Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Gene('HGNC', 'AKT1', variants=Hgvs('c.308G>A')),
tmprss2_erg_gene_fusion,
Gene('HGNC', 'AKT1', variants=[Hgvs('c.1521_1523delCTT'), Hgvs('c.308G>A'), Hgvs('p.Phe508del')]),
MicroRna('HGNC', 'MIR21'),
bcr_jak2_gene_fusion,
Gene('HGNC', 'CFTR', variants=Hgvs('c.1521_1523delCTT')),
Gene('HGNC', 'CFTR'),
Gene('HGNC', 'CFTR', variants=Hgvs('g.117199646_117199648delCTT')),
Gene('HGNC', 'CFTR', variants=Hgvs('c.1521_1523delCTT')),
Protein('HGNC', 'AKT1', variants=ProteinModification('Ph', 'Ser', 473)),
MicroRna('HGNC', 'MIR21', variants=Hgvs('p.Phe508del')),
Protein('HGNC', 'AKT1', variants=Hgvs('p.C40*')),
Protein('HGNC', 'AKT1', variants=[Hgvs('p.Ala127Tyr'), ProteinModification('Ph', 'Ser')]),
chchd4_aifm1_gene_fusion,
tmprss2_erg_protein_fusion,
Protein('HGNC', 'AKT1', variants=Hgvs('p.Arg1851*')),
bcr_jak2_protein_fusion,
Protein('HGNC', 'AKT1', variants=Hgvs('p.40*')),
chchd4_aifm1_protein_fusion,
Protein('HGNC', 'CFTR', variants=HgvsReference()),
cftr,
egfr,
cftr_protein_unspecified_variant,
adenocarcinoma,
cftr_protein_phe_508_del,
Protein('HGNC', 'MIA', variants=Fragment(5, 20)),
mia,
interleukin_23_complex,
Protein('HGNC', 'MIA', variants=Fragment(1, '?')),
Protein('HGNC', 'MIA', variants=Fragment()),
Protein('HGNC', 'MIA', variants=Fragment(description='55kD')),
Protein('HGNC', 'CFTR', variants=Hgvs('p.Gly576Ala')),
def test_multiple_variants(self):
node_data = Gene('HGNC', 'AKT1', variants=[
Hgvs('p.Phe508del'), Hgvs('p.Phe509del')
])
node_parent_data = node_data.get_parent()
node_parent_tuple = node_parent_data
self.graph.add_node_from_data(node_data)
self.assertIn(node_data, self.graph)
self.assertIn(node_parent_tuple, self.graph)
self.assertEqual(2, self.graph.number_of_nodes())
self.assertEqual(1, self.graph.number_of_edges())
def test_psub_2(self):
statement = 'sub(Ala, 127, Tyr)'
result = self.parser.parseString(statement)
expected_list = Hgvs('p.Ala127Tyr')
self.assertEqual(expected_list, result.asDict())
CITATION: citation_1,
RELATION: INCREASES,
}),
(Protein('HGNC', 'CFTR', variants=HgvsReference()), egfr, {
EVIDENCE: dummy_evidence,
CITATION: citation_1,
RELATION: INCREASES,
OBJECT: translocation(INTRACELLULAR, CELL_SURFACE),
}),
(cftr, Protein('HGNC', 'CFTR', variants=Hgvs('=')), {
RELATION: HAS_VARIANT,
}),
(cftr, Protein('HGNC', 'CFTR', variants=Hgvs('?')), {
RELATION: HAS_VARIANT,
}),
(cftr, Protein('HGNC', 'CFTR', variants=Hgvs('p.Phe508del')), {
RELATION: HAS_VARIANT,
}),
(cftr, Protein('HGNC', 'CFTR', variants=Hgvs('p.Gly576Ala')), {
RELATION: HAS_VARIANT,
}),
(mia, Protein('HGNC', 'MIA', variants=Fragment(5, 20)), {
RELATION: HAS_VARIANT,
}),
(mia, Protein('HGNC', 'MIA', variants=Fragment(1, '?')), {
RELATION: HAS_VARIANT,
}),
(mia, Protein('HGNC', 'MIA', variants=Fragment()), {
RELATION: HAS_VARIANT,
}),
(mia, Protein('HGNC', 'MIA', variants=Fragment(description='55kD')), {
RELATION: HAS_VARIANT,
def test_single_variant(self):
node_data = Gene('HGNC', 'AKT1', variants=Hgvs('p.Phe508del'))
node_parent_data = node_data.get_parent()
self.graph.add_node_from_data(node_data)
self.assertIn(node_data, self.graph)
self.assertIn(node_parent_data, self.graph)
self.assertEqual(2, self.graph.number_of_nodes())
self.assertEqual(1, self.graph.number_of_edges())
def test_gsub(self):
statement = 'sub(G,308,A)'
result = self.parser.parseString(statement)
expected_dict = Hgvs('c.308G>A')
self.assertEqual(expected_dict, result.asDict())
bcr_jak2_protein_fusion,
Protein('HGNC', 'AKT1', variants=Hgvs('p.40*')),
chchd4_aifm1_protein_fusion,
Protein('HGNC', 'CFTR', variants=HgvsReference()),
cftr,
egfr,
cftr_protein_unspecified_variant,
adenocarcinoma,
cftr_protein_phe_508_del,
Protein('HGNC', 'MIA', variants=Fragment(5, 20)),
mia,
interleukin_23_complex,
Protein('HGNC', 'MIA', variants=Fragment(1, '?')),
Protein('HGNC', 'MIA', variants=Fragment()),
Protein('HGNC', 'MIA', variants=Fragment(description='55kD')),
Protein('HGNC', 'CFTR', variants=Hgvs('p.Gly576Ala')),
akt1_rna,
Rna('HGNC', 'AKT1', variants=[Hgvs('c.1521_1523delCTT'), Hgvs('p.Phe508del')]),
Gene('HGNC', 'NCF1'),
ComplexAbundance([
Gene('HGNC', 'NCF1'),
Protein('HGNC', 'HBP1')
]),
Protein('HGNC', 'HBP1'),
ComplexAbundance([Protein('HGNC', 'FOS'), Protein('HGNC', 'JUN')]),
Protein('HGNC', 'FOS'),
Protein('HGNC', 'JUN'),
Rna('HGNC', 'CFTR', variants=Hgvs('r.1521_1523delcuu')),
Rna('HGNC', 'CFTR'),
Rna('HGNC', 'CFTR', variants=Hgvs('r.1653_1655delcuu')),
CompositeAbundance([
interleukin_23_complex,
def test_protein_del(self):
statement = 'variant(p.Phe508del)'
expected = Hgvs('p.Phe508del')
result = self.parser.parseString(statement)
self.assertEqual(expected, result.asDict())
def test_snp(self):
statement = 'var(c.1521_1523delCTT)'
expected = Hgvs('c.1521_1523delCTT')
result = self.parser.parseString(statement)
self.assertEqual(expected, result.asDict())
def test_psub_1(self):
statement = 'sub(A, 127, Y)'
result = self.parser.parseString(statement)
expected_list = Hgvs('p.Ala127Tyr')
self.assertEqual(expected_list, result.asDict())