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 Dec 1, 2016
1 parent 82e771b commit 47a031d
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 @@ -156,9 +156,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 @@ -312,7 +315,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 @@ -335,7 +338,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 @@ -404,7 +407,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 @@ -427,7 +430,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 47a031d

Please sign in to comment.