Skip to content

Commit

Permalink
Merge branch 'main' into mite_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
afrubin committed Jul 30, 2021
2 parents 315b355 + d44e159 commit eef0dd1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018-2020, Alan F Rubin and Daniel Esposito
Copyright (c) 2018-2021, Alan F Rubin and Daniel Esposito
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -19,7 +19,7 @@
# -- Project information -----------------------------------------------------

project = "MAVE-HGVS"
copyright = "2018-2020, Alan F Rubin and Daniel Esposito"
copyright = "2018-2021, Alan F Rubin and Daniel Esposito"
author = "Alan F Rubin and Daniel Esposito"


Expand Down
2 changes: 1 addition & 1 deletion mavehgvs/variant.py
Expand Up @@ -184,7 +184,7 @@ def sort_key(x):
else: # pragma: no cover
raise ValueError("invalid variant count")

if targetseq is not None:
if targetseq is not None and not self.is_target_identical():
for vtype, pos, seq in self.variant_tuples():
if vtype == "sub":
if self._prefix == "p":
Expand Down
17 changes: 17 additions & 0 deletions tests/test_variant.py
Expand Up @@ -624,6 +624,23 @@ def test_create_multivariant(self):


class TestTargetSequenceValidation(unittest.TestCase):
def test_target_identity(self):
variant_tuples = [
("ACGT", "g.="),
("ACGT", "m.="),
("ACGT", "o.="),
("ACGT", "c.="),
("ACGT", "n.="),
("ACGU", "r.="),
("RCQY", "p.="),
("RCQY", "p.(=)"),
]

for target, s in variant_tuples:
with self.subTest(target=target, s=s):
v = Variant(s, targetseq=target)
self.assertEqual(s, str(v))

def test_matching_dna_substitution(self):
variant_tuples = [
("ACGT", "c.1A>T"),
Expand Down

0 comments on commit eef0dd1

Please sign in to comment.