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 Feb 7, 2017
1 parent a5db59c commit dba636d
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 @@ -182,8 +182,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 @@ -343,7 +345,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 @@ -367,7 +369,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 @@ -435,7 +437,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 @@ -458,7 +460,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 dba636d

Please sign in to comment.