Skip to content

Commit

Permalink
Function now specifies full split FASTA filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmooney committed Dec 1, 2016
1 parent fd3380b commit 82e771b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pvacseq/lib/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,10 @@ def split_tsv_file(self, total_row_count):
def generate_fasta(self):
pass

def split_fasta_basename(self):
return os.path.join(self.tmp_dir, self.sample_name + "_" + str(self.peptide_sequence_length) + ".fa.split")
def split_fasta_file_path(self, split_start, split_end):
basename = os.path.join(self.tmp_dir, self.sample_name + "_" + str(self.peptide_sequence_length) + ".fa.split")
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
return "%s_%s" % (basename, fasta_chunk)

@abstractmethod
def call_iedb_and_parse_outputs(self, chunks):
Expand Down Expand Up @@ -312,7 +314,7 @@ def generate_fasta(self, chunks):
for (split_start, split_end) in chunks:
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
split_tsv_file_path = self.split_tsv_file_path(split_start, split_end)
split_fasta_file_path = "%s_%s" % (self.split_fasta_basename(), fasta_chunk)
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
if os.path.exists(split_fasta_file_path):
status_message("Split FASTA file for Entries %s already exists. Skipping." % (fasta_chunk))
continue
Expand All @@ -336,7 +338,7 @@ def call_iedb_and_parse_outputs(self, chunks):
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
for a in self.alleles:
for epl in self.epitope_lengths:
split_fasta_file_path = "%s_%s"%(self.split_fasta_basename(), fasta_chunk)
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
split_iedb_output_files = []
status_message("Processing entries for Allele %s and Epitope Length %s - Entries %s" % (a, epl, fasta_chunk))
for method in self.prediction_algorithms:
Expand Down Expand Up @@ -404,7 +406,7 @@ def generate_fasta(self, chunks):
for (split_start, split_end) in chunks:
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
split_tsv_file_path = self.split_tsv_file_path(split_start, split_end)
split_fasta_file_path = "%s_%s" % (self.split_fasta_basename(), fasta_chunk)
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
if os.path.exists(split_fasta_file_path):
status_message("Split FASTA file for Entries %s already exists. Skipping." % (fasta_chunk))
continue
Expand All @@ -427,7 +429,7 @@ def call_iedb_and_parse_outputs(self, chunks):
for (split_start, split_end) in chunks:
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
for a in self.alleles:
split_fasta_file_path = "%s_%s"%(self.split_fasta_basename(), fasta_chunk)
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
split_iedb_output_files = []
status_message("Processing entries for Allele %s - Entries %s" % (a, fasta_chunk))
for method in self.prediction_algorithms:
Expand Down

0 comments on commit 82e771b

Please sign in to comment.