diff --git a/pvacseq/lib/pipeline.py b/pvacseq/lib/pipeline.py index 6a2b4ee..0c6c0a6 100644 --- a/pvacseq/lib/pipeline.py +++ b/pvacseq/lib/pipeline.py @@ -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 @@ -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): @@ -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) @@ -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): @@ -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 = []