Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Mar 17, 2020
2 parents 8ab7511 + cb8b9bc commit 6a1da77
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# The short X.Y version.
version = '1.5'
# The full version, including alpha/beta/rc tags.
release = '1.5.6'
release = '1.5.7'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
10 changes: 4 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ New in release |release|

This is a hotfix release. It fixes the following issues:

- The ``pvacbind run`` command would previously error out if one of the input
sequences would contain a X stop codon. This update will remove the X amino
acid and the downstream sequence before further processing the remaining
protein sequence.
- A bug in the ``pvacfuse top_score_filter`` code would previsouly result
in an error when trying to run this command. This has now been fixed.
- The ``pvacbind run`` command would previously allow fasta input files with
duplicated headers. However, it would silently skip subsequent entries with
duplicated headers even if the fasta sequence was novel. With this release
pVACbind will now error out if a duplicate fasta header is encounterd.

New in version |version|
------------------------
Expand Down
12 changes: 12 additions & 0 deletions docs/releases/1_5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,21 @@ This is a hotfix release. It fixes the following issues:
1.5.6
-----

This is a hotfix release. It fixes the following issues:

- The ``pvacbind run`` command would previously error out if one of the input
sequences would contain a X stop codon. This update will remove the X amino
acid and the downstream sequence before further processing the remaining
protein sequence.
- A bug in the ``pvacfuse top_score_filter`` code would previsouly result
in an error when trying to run this command. This has now been fixed.

1.5.7
-----

This is a hotfix release. It fixes the following issues:

- The ``pvacbind run`` command would previously allow fasta input files with
duplicated headers. However, it would silently skip subsequent entries with
duplicated headers even if the fasta sequence was novel. With this release
pVACbind will now error out if a duplicate fasta header is encounterd.
4 changes: 4 additions & 0 deletions lib/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,12 @@ def split_fasta_basename(self, length):

def uniquify_records(self, records):
fasta_sequences = OrderedDict()
ids = []
for record in records:
if record.id in ids:
raise Exception("Duplicate fasta header {}. Please ensure that the input FASTA uses unique headers.".format(record.id))
fasta_sequences.setdefault(str(record.seq), []).append(record.id)
ids.append(record.id)
count = 1
uniq_records = []
keys = {}
Expand Down
4 changes: 2 additions & 2 deletions lib/top_score_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def execute(self):
filtered_lines.append(line_with_max_expression)
else:
line_with_lowest_transcript_id = lines[0]
lowest_transcript_id = re.compile('ENST(\d+)').match(line_with_lowest_transcript_id['Transcript']).group(1)
lowest_transcript_id = re.compile(r'ENST(\d+)').match(line_with_lowest_transcript_id['Transcript']).group(1)
for line in lines:
transcript_id = re.compile('ENST(\d+)').match(line['Transcript']).group(1)
transcript_id = re.compile(r'ENST(\d+)').match(line['Transcript']).group(1)
if transcript_id < lowest_transcript_id:
lowest_transcript_id = transcript_id
line_with_lowest_transcript_id = line
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

setup(
name="pvactools",
version="1.5.6",
version="1.5.7",
packages=[
"tools",
"tools.pvacbind",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_data/pvacbind/input.duplicate_header.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
>1
LPLPPPPLLPLLLLLLGASGG
>1
LPLPPPPLLPLLPLLLLLGASGG
32 changes: 24 additions & 8 deletions tests/test_pvacbind.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,23 +273,39 @@ def test_pvacbind_pipeline(self):

with self.assertRaises(SystemExit) as cm:
run.main([
os.path.join(self.test_data_directory, "input.vcf"),
os.path.join(self.test_data_directory, "input.fasta"),
'Test',
'H2-IAb',
'NNalign',
output_dir.name,
'--top-score-metric=lowest',
'--keep-tmp-files',
])
self.assertEqual(
cm.exception,
"Restart inputs are different from past inputs: \n" +
"Past input: downstream_sequence_length - None\n" +
"Current input: downstream_sequence_length - 1000"
)
self.assertEqual(
str(cm.exception),
"Restart inputs are different from past inputs: \n" +
"Past input: top_score_metric - lowest\n" +
"Current input: top_score_metric - median\nAborting."
)

output_dir.cleanup()

def test_duplicate_fasta_header(self):
with self.assertRaises(Exception) as cm:
output_dir = tempfile.TemporaryDirectory(dir = self.test_data_directory)
run.main([
os.path.join(self.test_data_directory, "input.duplicate_header.fasta"),
'Test',
'HLA-A*02:01',
'NetMHC',
output_dir.name,
'-e', '8'
])
self.assertEqual(
str(cm.exception),
"Duplicate fasta header 1. Please ensure that the input FASTA uses unique headers."
)
output_dir.cleanup()

def test_pvacbind_combine_and_condense_steps(self):
output_dir = tempfile.TemporaryDirectory(dir = self.test_data_directory)
for subdir in ['MHC_Class_I', 'MHC_Class_II']:
Expand Down
12 changes: 6 additions & 6 deletions tests/test_pvacseq.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,12 +422,12 @@ def test_pvacseq_pipeline(self):
'--top-score-metric=lowest',
'--keep-tmp-files',
])
self.assertEqual(
cm.exception,
"Restart inputs are different from past inputs: \n" +
"Past input: downstream_sequence_length - None\n" +
"Current input: downstream_sequence_length - 1000"
)
self.assertEqual(
str(cm.exception),
"Restart inputs are different from past inputs: \n" +
"Past input: downstream_sequence_length - None\n" +
"Current input: downstream_sequence_length - 1000\nAborting."
)

output_dir.cleanup()

Expand Down

0 comments on commit 6a1da77

Please sign in to comment.