Skip to content

Commit

Permalink
Merge branch 'hotfix' of github.com:griffithlab/pVAC-Seq into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Aug 31, 2017
2 parents a874380 + abae8e2 commit 16f73aa
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
1 change: 0 additions & 1 deletion pvacseq/lib/binding_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def main(args_input = sys.argv[1:]):
writer.writeheader()

for entry in reader:
name = entry['Gene Name']
if args.top_score_metric == 'median':
score = float(entry['Median MT Score'])
fold_change = sys.maxsize if entry['Median Fold Change'] == 'NA' else float(entry['Median Fold Change'])
Expand Down
7 changes: 6 additions & 1 deletion pvacseq/lib/fasta_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def execute(self):
variant_type = line['variant_type']
full_wildtype_sequence = line['wildtype_amino_acid_sequence']
if variant_type == 'FS':
position = int(line['protein_position'].split('-', 1)[0]) - 1
if line['amino_acid_change'] is not None and line['amino_acid_change'].split('/')[0] == '-':
position = int(line['protein_position'].split('-', 1)[0])
else:
position = int(line['protein_position'].split('-', 1)[0]) - 1
elif variant_type == 'missense' or variant_type == 'inframe_ins':
wildtype_amino_acid, mutant_amino_acid = line['amino_acid_change'].split('/')
if wildtype_amino_acid == '-':
Expand Down Expand Up @@ -130,6 +133,8 @@ def execute(self):
else:
mutation_start_position, wildtype_subsequence = self.get_wildtype_subsequence(position, full_wildtype_sequence, wildtype_amino_acid_length, peptide_sequence_length, line)
mutation_end_position = mutation_start_position + wildtype_amino_acid_length
if wildtype_amino_acid != '-' and wildtype_amino_acid != wildtype_subsequence[mutation_start_position:mutation_end_position]:
sys.exit("ERROR: There was a mismatch between the actual wildtype amino acid and the expected amino acid. Did you use the same reference build version for VEP that you used for creating the VCF?\n%s" % line)
mutant_subsequence = wildtype_subsequence[:mutation_start_position] + mutant_amino_acid + wildtype_subsequence[mutation_end_position:]

if '*' in wildtype_subsequence or '*' in mutant_subsequence:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chromosome_name start stop reference variant gene_name transcript_name amino_acid_change ensembl_gene_id wildtype_amino_acid_sequence downstream_amino_acid_sequence variant_type protein_position transcript_expression gene_expression normal_depth normal_vaf tdna_depth tdna_vaf trna_depth trna_vaf index
12 62381609 62381609 G GT USP15 ENST00000280377 -/X ENSG00000135655 MAEGGAADLDTQRSDIATLLKTSLRKGDTWYLVDSRWFKQWKKYVGFDSWDKYQMGDQNVYPGPIDNSGLLKDGDAQSLKEHLIDELDYILLPTEGWNKLVSWYTLMEGQEPIARKVVEQGMFVKHCKVEVYLTELKLCENGNMNNVVTRRFSKADTIDTIEKEIRKIFSIPDEKETRLWNKYMSNTFEPLNKPDSTIQDAGLYQGQVLVIEQKNEDGTWPRGPSTPKSPGASNFSTLPKISPSSLSNNYNNMNNRNVKNSNYCLPSYTAYKNYDYSEPGRNNEQPGLCGLSNLGNTCFMNSAIQCLSNTPPLTEYFLNDKYQEELNFDNPLGMRGEIAKSYAELIKQMWSGKFSYVTPRAFKTQVGRFAPQFSGYQQQDCQELLAFLLDGLHEDLNRIRKKPYIQLKDADGRPDKVVAEEAWENHLKRNDSIIVDIFHGLFKSTLVCPECAKISVTFDPFCYLTLPLPMKKERTLEVYLVRMDPLTKPMQYKVVVPKIGNILDLCTALSALSGIPADKMIVTDIYNHRFHRIFAMDENLSSIMERDDIYVFEININRTEDTEHVIIPVCLREKFRHSSYTHHTGSSLFGQPFLMAVPRNNTEDKLYNLLLLRMCRYVKISTETEETEGSLHCCKDQNINGNGPNGIHEEGSPSEMETDEPDDESSQDQELPSENENSQSEDSVGGDNDSENGLCTEDTCKGQLTGHKKRLFTFQFNNLGNTDINYIKDDTRHIRFDDRQLRLDERSFLALDWDPDLKKRYFDENAAEDFEKHESVEYKPPKKPFVKLKDCIELFTTKEKLGAEDPWYCPNCKEHQQATKKLDLWSLPPVLVVHLKRFSYSRYMRDKLDTLVDFPINDLDMSEFLINPNAGPCRYNLIAVSNHYGGMGGGHYTAFAKNKDDGKWYYFDDSSVSTASEDQIVSKAAYVLFYQRQDTFSGTGFFPLDRETKGASAATGIPLESDEDSNDNDNDIENENCMHTN YQANVVWKV FS 345-346 NA NA NA NA NA NA NA NA USP15_ENST00000280377_1.FS.345-346
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
>1
GEIAKSYAELIKQMWSGKFS
>2
GEIAKSYAELYQANVVWKV
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1:
- WT.USP15_ENST00000280377_1.FS.345-346
2:
- MT.USP15_ENST00000280377_1.FS.345-346
21 changes: 21 additions & 0 deletions tests/test_fasta_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,27 @@ def test_input_file_with_frameshift_variant_range_generates_expected_file(self):
expected_key_output_file = os.path.join(self.test_data_dir, 'output_frameshift_variant_range.key')
self.assertTrue(cmp(generate_fasta_key_output_file.name, expected_key_output_file))

def test_input_file_with_frameshift_variant_position_shift_generates_expected_file(self):
generate_fasta_input_file = os.path.join(self.test_data_dir, 'input_frameshift_variant_position_shift.tsv')
generate_fasta_output_file = tempfile.NamedTemporaryFile()
generate_fasta_key_output_file = tempfile.NamedTemporaryFile()

generate_fasta_params = {
'input_file': generate_fasta_input_file,
'peptide_sequence_length': self.peptide_sequence_length,
'epitope_length': self.epitope_length,
'output_file': generate_fasta_output_file.name,
'output_key_file': generate_fasta_key_output_file.name,
'downstream_sequence_length': None,
}
generator = FastaGenerator(**generate_fasta_params)

self.assertFalse(generator.execute())
expected_output_file = os.path.join(self.test_data_dir, 'output_frameshift_variant_position_shift.fasta')
self.assertTrue(cmp(generate_fasta_output_file.name, expected_output_file))
expected_key_output_file = os.path.join(self.test_data_dir, 'output_frameshift_variant_position_shift.key')
self.assertTrue(cmp(generate_fasta_key_output_file.name, expected_key_output_file))

def test_input_file_with_sequence_containing_asterisk(self):
generate_fasta_input_file = os.path.join(self.test_data_dir, 'input_asterisk_sequence.tsv')
generate_fasta_output_file = tempfile.NamedTemporaryFile()
Expand Down

0 comments on commit 16f73aa

Please sign in to comment.