Skip to content

Commit

Permalink
Extract function to get fasta chunk name.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmooney committed Nov 15, 2016
1 parent a639088 commit fc2dd34
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pvacseq/lib/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,12 @@ def generate_fasta(self):

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)
fasta_chunk = self.split_fasta_chunk(split_start, split_end)
return "%s_%s" % (basename, fasta_chunk)

def split_fasta_chunk(self, split_start, split_end):
return "%d-%d" % (split_start*2-1, split_end*2)

@abstractmethod
def call_iedb_and_parse_outputs(self, chunks):
pass
Expand Down Expand Up @@ -310,7 +313,7 @@ def __init__(self, **kwargs):
def generate_fasta(self, chunks):
status_message("Generating Variant Peptide FASTA and Key Files")
for (split_start, split_end) in chunks:
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
fasta_chunk = self.split_fasta_chunk(split_start, split_end)
split_tsv_file_path = self.split_tsv_file_path(split_start, split_end)
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
if os.path.exists(split_fasta_file_path):
Expand All @@ -333,7 +336,7 @@ def generate_fasta(self, chunks):
def call_iedb_and_parse_outputs(self, chunks):
split_parsed_output_files = []
for (split_start, split_end) in chunks:
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
fasta_chunk = self.split_fasta_chunk(split_start, split_end)
for a in self.alleles:
for epl in self.epitope_lengths:
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
Expand Down Expand Up @@ -402,7 +405,7 @@ def __init__(self, **kwargs):
def generate_fasta(self, chunks):
status_message("Generating Variant Peptide FASTA and Key Files")
for (split_start, split_end) in chunks:
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
fasta_chunk = self.split_fasta_chunk(split_start, split_end)
split_tsv_file_path = self.split_tsv_file_path(split_start, split_end)
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
if os.path.exists(split_fasta_file_path):
Expand All @@ -425,7 +428,7 @@ def generate_fasta(self, chunks):
def call_iedb_and_parse_outputs(self, chunks):
split_parsed_output_files = []
for (split_start, split_end) in chunks:
fasta_chunk = "%d-%d" % (split_start*2-1, split_end*2)
fasta_chunk = self.split_fasta_chunk(split_start, split_end)
for a in self.alleles:
split_fasta_file_path = self.split_fasta_file_path(split_start, split_end)
split_iedb_output_files = []
Expand Down

0 comments on commit fc2dd34

Please sign in to comment.