Exemple #1
0
    def test_add_identified_node(self):
        """Test what happens when a node with only an identifier is added to a graph."""
        graph = BELGraph()
        namespace, identifier = n(), n()
        node = protein(namespace=namespace, identifier=identifier)
        self.assertNotIn(NAME, node)

        t = graph.add_node_from_data(node)

        self.assertEqual(
            {
                FUNCTION: PROTEIN,
                NAMESPACE: namespace,
                IDENTIFIER: identifier,
            }, graph.node[t])
    def test_convert_activates(self):
        """Test the conversion of a bel statement like p(x) -> act(p(y))."""
        bel_graph = BELGraph()
        bel_graph.add_directly_activates(
            cdk5,
            casp8,
            evidence=n(),
            citation=n(),
        )

        expected_reified_graph = self.help_make_simple_expected_graph(
            cdk5, casp8, ACTIVATES, 0, self.help_causal_increases)

        reified_graph = reify_bel_graph(bel_graph)
        self.help_test_graphs_equal(expected_reified_graph, reified_graph)
Exemple #3
0
    def test_add_robust_node(self):
        """Test adding a node with both a name and identifier."""
        graph = BELGraph()
        namespace, name, identifier = n(), n(), n()
        node = protein(namespace=namespace, name=name, identifier=identifier)

        graph.add_node_from_data(node)

        self.assertEqual(
            {
                FUNCTION: PROTEIN,
                NAMESPACE: namespace,
                NAME: name,
                IDENTIFIER: identifier,
            }, graph.node[node.as_tuple()])
    def add_edge(self,
                 source_modifier=None,
                 target_modifier=None,
                 annotations=None):
        key = self.g.add_increases(
            self.u,
            self.v,
            evidence=n(),
            citation=n(),
            source_modifier=source_modifier,
            target_modifier=target_modifier,
            annotations=annotations,
        )

        return canonicalize_edge(self.get_data(key))
Exemple #5
0
    def setUp(self):
        self.name = n()
        self.version = n()
        self.created = datetime.datetime.utcnow()

        self.model = Network(
            name=self.name,
            version=self.version,
            created=self.created,
        )
        self.expected = {
            METADATA_NAME: self.name,
            METADATA_VERSION: self.version,
            'created': str(self.created),
        }
    def test_multiple_annotations(self):
        a1, v1, v2 = map(lambda _: n(), range(3))
        v1, v2 = sorted([v1, v2])

        self.graph.add_increases(Protein(namespace='HGNC', name='YFG1'),
                                 Protein(namespace='HGNC', name='YFG'),
                                 citation=self.citation,
                                 evidence=self.evidence,
                                 annotations={a1: {v1, v2}})

        self.assertEqual(2, self.graph.number_of_nodes())
        self.assertEqual(1, self.graph.number_of_edges())

        expected_lines = [
            'SET Citation = {{"PubMed", "{}"}}\n'.format(self.citation),
            'SET SupportingText = "{}"'.format(self.evidence),
            'SET {} = {{"{}", "{}"}}'.format(a1, v1, v2),
            'p(HGNC:YFG1) increases p(HGNC:YFG)',
            'UNSET {}'.format(a1),
            'UNSET SupportingText',
            'UNSET Citation\n',
            ('#' * 80),
        ]

        self._help_check_lines(expected_lines)
    def test_single_annotation(self):
        """Tests a scenario with a qualified edge, but no annotaitons"""
        a1, v1 = map(lambda _: n(), range(2))

        self.graph.add_increases(Protein(namespace='HGNC', name='YFG1'),
                                 Protein(namespace='HGNC', name='YFG'),
                                 citation=self.citation,
                                 evidence=self.evidence,
                                 annotations={a1: {v1}})

        self.assertEqual(2, self.graph.number_of_nodes())
        self.assertEqual(1, self.graph.number_of_edges())

        expected_lines = [
            'SET Citation = {{"PubMed", "{}"}}\n'.format(self.citation),
            'SET SupportingText = "{}"'.format(self.evidence),
            'SET {} = "{}"'.format(a1, v1),
            'p(HGNC:YFG1) increases p(HGNC:YFG)',
            'UNSET {}'.format(a1),
            'UNSET SupportingText',
            'UNSET Citation\n',
            '#' * 80,
        ]

        self._help_check_lines(expected_lines)
Exemple #8
0
 def help_test_convert(
     self,
     converter: Type[Converter],
     u: BaseEntity,
     v: BaseEntity,
     edge_data: EdgeData,
     triple: Tuple[str, str, str],
 ) -> None:
     """Test a converter class."""
     self.assertTrue(issubclass(converter, Converter),
                     msg='Not a Converter: {}'.format(converter.__name__))
     key = n()
     self.assertTrue(
         converter.predicate(u, v, key, edge_data),
         msg='Predicate failed: {}'.format(converter.__name__),
     )
     self.assertEqual(
         triple,
         converter.convert(u, v, key, edge_data),
         msg='Conversion failed: {}'.format(converter.__name__),
     )
     graph = BELGraph()
     graph.add_edge(u, v, key=key, **edge_data)
     self.assertEqual(
         triple,
         get_triple(graph, u, v, key),
         msg='get_triple failed: {}'.format(converter.__name__),
     )
    def test_object_degradation(self):
        self.graph.add_increases(
            Protein(name='YFG', namespace='HGNC'),
            Protein(name='YFG2', namespace='HGNC'),
            evidence=n(),
            citation=n(),
            object_modifier=degradation(),
        )
        make_dummy_namespaces(self.manager, self.graph)

        network = self.manager.insert_graph(self.graph)

        self.assertEqual(2, network.nodes.count())
        self.assertEqual(1, network.edges.count())

        edge = network.edges.first()
Exemple #10
0
    def test_add_node_with_variant(self):
        """Test that the identifier is carried through to the child."""
        graph = BELGraph()
        namespace, name, identifier, variant_name = n(), n(), n(), n()
        node = protein(namespace=namespace,
                       name=name,
                       identifier=identifier,
                       variants=hgvs(variant_name))
        parent = node.get_parent()

        graph.add_node_from_data(node)

        self.assertEqual(2, graph.number_of_nodes())

        self.assertIn(IDENTIFIER, graph.node[node.as_tuple()])
        self.assertIn(IDENTIFIER, graph.node[parent.as_tuple()])
Exemple #11
0
    def test_get_upstream_causal_subgraph(self):
        """Test get_upstream_causal_subgraph."""
        a, b, c, d, e, f = [protein(namespace='test', name=n()) for _ in range(6)]
        citation, evidence = '', ''

        universe = BELGraph()
        universe.namespace_pattern['test'] = 'test-url'
        universe.add_qualified_edge(a, b, INCREASES, citation, evidence)
        universe.add_qualified_edge(b, c, INCREASES, citation, evidence)
        universe.add_qualified_edge(d, a, ASSOCIATION, citation, evidence)
        universe.add_qualified_edge(e, a, INCREASES, citation, evidence)
        universe.add_qualified_edge(f, b, DECREASES, citation, evidence)

        subgraph = get_upstream_causal_subgraph(universe, [a.as_tuple(), b.as_tuple()])

        self.assertIn('test', subgraph.namespace_pattern)
        self.assertEqual('test-url', subgraph.namespace_pattern['test'])

        self.assert_in_graph(a, subgraph)
        self.assertIn(FUNCTION, subgraph.node[a.as_tuple()])
        self.assertEqual(PROTEIN, subgraph.node[a.as_tuple()][FUNCTION])
        self.assert_in_graph(b, subgraph)
        self.assert_not_in_graph(c, subgraph)
        self.assert_not_in_graph(d, subgraph)
        self.assert_in_graph(e, subgraph)
        self.assert_in_graph(f, subgraph)
        self.assertIn(FUNCTION, subgraph.node[f.as_tuple()])
        self.assertEqual(PROTEIN, subgraph.node[f.as_tuple()][FUNCTION])
        self.assertEqual(4, subgraph.number_of_nodes())

        self.assert_in_edge(e, a, subgraph)
        self.assert_in_edge(a, b, subgraph)
        self.assert_in_edge(f, b, subgraph)
        self.assertEqual(3, subgraph.number_of_edges())
Exemple #12
0
    def test_reset_citation(self):
        s1_identifier = str(randint(0, 1e7))
        s1 = 'SET Citation = {{"PubMed","Test Reference 1","{}"}}'.format(
            s1_identifier)
        s2 = 'SET Evidence = "d"'

        s3_identifier = str(randint(0, 1e7))
        s3 = 'SET Citation = {{"PubMed","Test Reference 2","{}"}}'.format(
            s3_identifier)
        _test_evidence = n()
        s4 = 'SET Evidence = "{}"'.format(_test_evidence)
        s5 = 'SET Custom1 = "Custom1_A"'
        s6 = 'SET Custom2 = "Custom2_A"'

        statements = [s1, s2, s3, s4, s5, s6]

        self.parser.parse_lines(statements)

        self.assertEqual(_test_evidence, self.parser.evidence)
        self.assertEqual(CITATION_TYPE_PUBMED, self.parser.citation_db)
        self.assertEqual(s3_identifier, self.parser.citation_db_id)

        self.parser.parseString('UNSET {Custom1,Evidence}')
        self.assertNotIn('Custom1', self.parser.annotations)
        self.assertIsNone(self.parser.evidence)
        self.assertIn('Custom2', self.parser.annotations)
        self.assertTrue(self.parser.citation_is_set)

        self.parser.parseString('UNSET ALL')
        self.assertEqual(0, len(self.parser.annotations))
        self.assertFalse(self.parser.citation_is_set)
    def test_different_key_and_namespace(self):
        key, namespace, value = map(lambda _: n(), range(3))

        self.graph.annotation_curie.add(key)
        self.graph.add_increases(Protein(namespace='HGNC', name='YFG1'),
                                 Protein(namespace='HGNC', name='YFG'),
                                 citation=self.citation,
                                 evidence=self.evidence,
                                 annotations={
                                     key:
                                     Entity(namespace=namespace,
                                            identifier=value),
                                 })

        self.assertEqual(2, self.graph.number_of_nodes())
        self.assertEqual(1, self.graph.number_of_edges())

        expected_lines = [
            f'SET Citation = {{"{CITATION_TYPE_PUBMED}", "{self.citation}"}}\n',
            f'SET SupportingText = "{self.evidence}"',
            f'SET {key} = "{namespace}:{value}"',
            'p(HGNC:YFG1) increases p(HGNC:YFG)',
            f'UNSET {key}',
            'UNSET SupportingText',
            'UNSET Citation\n',
            ('#' * 80),
        ]

        self._help_check_lines(expected_lines)
Exemple #14
0
    def test_get_node_properties(self):
        """Test looking up node properties."""
        test_name = n()
        test_identifier = n()

        node = protein(namespace='TEST',
                       name=test_name,
                       identifier=test_identifier)
        self.graph.add_node_from_data(node)

        self.assertIsNone(self.graph.get_node_description(node))

        test_description = n()
        self.graph.set_node_description(node, test_description)
        self.assertEqual(test_description,
                         self.graph.get_node_description(node))
Exemple #15
0
    def test_get_upstream_causal_subgraph(self):
        """Test get_upstream_causal_subgraph."""
        a, b, c, d, e, f = [
            protein(namespace='test', name=n()) for _ in range(6)
        ]
        citation, evidence = '', ''

        universe = BELGraph()
        universe.namespace_pattern['test'] = 'test-url'
        universe.add_qualified_edge(a, b, INCREASES, citation, evidence)
        universe.add_qualified_edge(b, c, INCREASES, citation, evidence)
        universe.add_qualified_edge(d, a, ASSOCIATION, citation, evidence)
        universe.add_qualified_edge(e, a, INCREASES, citation, evidence)
        universe.add_qualified_edge(f, b, DECREASES, citation, evidence)

        subgraph = get_upstream_causal_subgraph(universe, [a, b])

        self.assertIsInstance(subgraph, BELGraph)
        self.assert_all_nodes_are_base_entities(subgraph)

        self.assertIn('test', subgraph.namespace_pattern)
        self.assertEqual('test-url', subgraph.namespace_pattern['test'])

        self.assertIn(a, subgraph)
        self.assertIn(b, subgraph)
        self.assertNotIn(c, subgraph)
        self.assertNotIn(d, subgraph)
        self.assertIn(e, subgraph)
        self.assertIn(f, subgraph)
        self.assertEqual(4, subgraph.number_of_nodes())

        self.assert_in_edge(e, a, subgraph)
        self.assert_in_edge(a, b, subgraph)
        self.assert_in_edge(f, b, subgraph)
        self.assertEqual(3, subgraph.number_of_edges())
    def test_multiple_annotations(self):
        a1, v1, v2 = map(lambda _: n(), range(3))
        v1, v2 = sorted([v1, v2])

        self.graph.annotation_list[a1] = {v1, v2}
        self.graph.add_increases(Protein(namespace='HGNC', name='YFG1'),
                                 Protein(namespace='HGNC', name='YFG'),
                                 citation=self.citation,
                                 evidence=self.evidence,
                                 annotations={
                                     a1: {v1, v2},
                                 })

        self.assertEqual(2, self.graph.number_of_nodes())
        self.assertEqual(1, self.graph.number_of_edges())

        expected_lines = [
            f'SET Citation = {{"{CITATION_TYPE_PUBMED}", "{self.citation}"}}\n',
            f'SET SupportingText = "{self.evidence}"',
            f'SET {a1} = {{"{v1}", "{v2}"}}',
            'p(HGNC:YFG1) increases p(HGNC:YFG)',
            f'UNSET {a1}',
            'UNSET SupportingText',
            'UNSET Citation\n',
            ('#' * 80),
        ]

        self._help_check_lines(expected_lines)
    def test_single_annotation(self):
        """Test a scenario with a qualified edge, but no annotations."""
        a1, v1 = map(lambda _: n(), range(2))
        self.graph.annotation_list[a1] = {v1}
        self.graph.add_increases(Protein(namespace='HGNC', name='YFG1'),
                                 Protein(namespace='HGNC', name='YFG'),
                                 citation=self.citation,
                                 evidence=self.evidence,
                                 annotations={
                                     a1: {v1},
                                 })

        self.assertEqual(2, self.graph.number_of_nodes())
        self.assertEqual(1, self.graph.number_of_edges())

        # Means that only the identifier needs to be written out
        self.assertNotIn(a1, self.graph.annotation_curie)

        expected_lines = [
            f'SET Citation = {{"{CITATION_TYPE_PUBMED}", "{self.citation}"}}\n',
            f'SET SupportingText = "{self.evidence}"',
            f'SET {a1} = "{v1}"',
            'p(HGNC:YFG1) increases p(HGNC:YFG)',
            f'UNSET {a1}',
            'UNSET SupportingText',
            'UNSET Citation\n',
            '#' * 80,
        ]

        self._help_check_lines(expected_lines)
Exemple #18
0
 def test_get_node_identifier(self):
     """Test looking up the node identifier from the graph."""
     test_name = n()
     node = protein(namespace='TEST', name=test_name)
     self.graph.add_node_from_data(node)
     self.assertIsNotNone(self.graph.get_node_name(node.as_tuple()))
     self.assertIsNone(self.graph.get_node_identifier(node.as_tuple()))
Exemple #19
0
    def test_no_infer_rna_fusion(self):
        """Test that no RNA nor gene is inferred from a protein fusion node."""
        partner5p = rna(n(), n())
        partner3p = rna(n(), n())

        p = rna_fusion(partner_3p=partner3p, partner_5p=partner5p)

        graph = BELGraph()
        graph.add_node_from_data(p)

        self.assertEqual(1, graph.number_of_nodes())
        self.assertEqual(0, graph.number_of_edges())

        enrich_protein_and_rna_origins(graph)

        self.assertEqual(1, graph.number_of_nodes())
        self.assertEqual(0, graph.number_of_edges())
    def test_convert_phosphorylates(self):
        """Test the conversion of a BEL statement like ``act(p(X)) -> p(Y, pmod(Ph))."""
        bel_graph = BELGraph()
        bel_graph.add_directly_increases(
            cdk5,
            p_tau,
            evidence=n(),
            citation=n(),
            subject_modifier=activity('kin'),
        )

        r_edge = 0
        expected_reified_graph = self.help_make_simple_expected_graph(
            cdk5, p_tau, PHOSPHORYLATES, r_edge, self.help_causal_increases)

        reified_graph = reify_bel_graph(bel_graph)
        self.help_test_graphs_equal(expected_reified_graph, reified_graph)
    def test_subject_location(self):
        self.graph.add_increases(Protein(name='YFG', namespace='HGNC'),
                                 Protein(name='YFG2', namespace='HGNC'),
                                 evidence=n(),
                                 citation=n(),
                                 subject_modifier=location(
                                     Entity(namespace='GO',
                                            name='nucleus',
                                            identifier='GO:0005634')))
        make_dummy_namespaces(self.manager, self.graph)

        network = self.manager.insert_graph(self.graph)

        self.assertEqual(2, network.nodes.count())
        self.assertEqual(1, network.edges.count())

        edge = network.edges.first()
Exemple #22
0
    def test_get_subgraphs_by_annotation_with_sentinel(self):
        sentinel = n()
        subgraphs = get_subgraphs_by_annotation(self.graph, annotation='subgraph', sentinel=sentinel)

        self.assertEqual(3, len(subgraphs))
        self.assertIn(Entity(namespace='subgraph', identifier='1'), subgraphs)
        self.assertIn(Entity(namespace='subgraph', identifier='2'), subgraphs)
        self.assertIn(sentinel, subgraphs)
Exemple #23
0
    def test_get_subgraph_by_annotation_value(self):
        """Test getting a subgraph by a single annotation value."""
        graph = BELGraph()
        a, b, c, d = [protein(namespace='test', name=n()) for _ in range(4)]

        k1 = graph.add_increases(a,
                                 b,
                                 citation=n(),
                                 evidence=n(),
                                 annotations={'Subgraph': {'A'}})

        k2 = graph.add_increases(a,
                                 b,
                                 citation=n(),
                                 evidence=n(),
                                 annotations={'Subgraph': {'B'}})

        k3 = graph.add_increases(a,
                                 b,
                                 citation=n(),
                                 evidence=n(),
                                 annotations={'Subgraph': {'A', 'C', 'D'}})

        subgraph = get_subgraph_by_annotation_value(graph, 'Subgraph', 'A')
        self.assertIsInstance(subgraph, BELGraph)

        self.assertIn(a, subgraph)
        self.assertIn(b, subgraph)
        self.assertIn(b, subgraph[a])
        self.assertIn(k1, subgraph[a][b])
        self.assertNotIn(k2, subgraph[a][b])
        self.assertIn(k3, subgraph[a][b])
Exemple #24
0
    def test_collapse_all_variants(self):
        """Test collapsing all variants to their reference nodes."""
        graph = BELGraph()
        graph.add_node_from_data(p1_phosphorylated)

        graph.add_increases(p1_phosphorylated, p2, n(), n())

        self.assertEqual(3, graph.number_of_nodes())
        self.assertEqual(2, graph.number_of_edges())

        collapse_all_variants(graph)

        self.assertEqual(2, graph.number_of_nodes())
        self.assertEqual(1, graph.number_of_edges())

        self.assertIn(p1, graph)
        self.assertNotIn(p1_phosphorylated, graph)
        self.assertIn(p2, graph)
Exemple #25
0
    def test_get_qualified_edge(self):
        """Test adding an edge to a graph."""
        test_source = protein(namespace='TEST', name='YFG')
        test_target = protein(namespace='TEST', name='YFG2')

        self.graph.add_node_from_data(test_source)
        self.graph.add_node_from_data(test_target)

        test_evidence = n()
        test_pmid = n()

        test_key = self.graph.add_increases(
            test_source,
            test_target,
            citation=test_pmid,
            evidence=test_evidence,
            annotations={
                'Species': '9606',
                'Confidence': 'Very High'
            },
        )

        citation = self.graph.get_edge_citation(test_source, test_target, test_key)

        self.assertIsNotNone(citation)
        self.assertIsInstance(citation, dict)
        self.assertIn(NAMESPACE, citation)
        self.assertEqual(CITATION_TYPE_PUBMED, citation[NAMESPACE])
        self.assertIn(IDENTIFIER, citation)
        self.assertEqual(test_pmid, citation[IDENTIFIER])

        evidence = self.graph.get_edge_evidence(test_source, test_target, test_key)

        self.assertIsNotNone(evidence)
        self.assertIsInstance(evidence, str)
        self.assertEqual(test_evidence, evidence)

        annotations = self.graph.get_edge_annotations(test_source, test_target, test_key)
        self.assertIsNotNone(annotations)
        self.assertIsInstance(annotations, dict)
        self.assertIn('Species', annotations)
        self.assertIn(Entity(namespace='Species', identifier='9606'), annotations['Species'])
        self.assertIn('Confidence', annotations)
        self.assertIn(Entity(namespace='Confidence', identifier='Very High'), annotations['Confidence'])
Exemple #26
0
    def test_protein_interaction_2(self):
        graph = BELGraph()

        graph.add_node_from_data(p1)
        graph.add_node_from_data(p2)
        graph.add_node_from_data(a5)
        graph.add_node_from_data(p5)

        graph.add_qualified_edge(p1, p2, relation=POSITIVE_CORRELATION, citation=n(), evidence=n())
        graph.add_qualified_edge(p1, p2, relation=ASSOCIATION, citation=n(), evidence=n())
        graph.add_qualified_edge(a5, p5, relation=DIRECTLY_INCREASES, citation=n(), evidence=n())
        graph.add_qualified_edge(p1, a5, relation=DECREASES, citation=n(), evidence=n())

        collapsed_graph = collapse_to_protein_interactions(graph)

        self.assertEqual(2, collapsed_graph.number_of_nodes())
        self.assertEqual(1, collapsed_graph.number_of_edges())
        self.assertIn(g1, collapsed_graph)
        self.assertIn(g2, collapsed_graph)
Exemple #27
0
    def test_get_subgraphs_by_annotation_with_sentinel(self):
        sentinel = n()
        subgraphs = get_subgraphs_by_annotation(self.graph,
                                                annotation='subgraph',
                                                sentinel=sentinel)

        self.assertEqual(3, len(subgraphs))
        self.assertIn('1', subgraphs)
        self.assertIn('2', subgraphs)
        self.assertIn(sentinel, subgraphs)
Exemple #28
0
    def test_data_missing_key_builder(self):
        """Test the data_missing_key_builder function."""
        graph = BELGraph()
        p1 = protein('HGNC', n())
        p2 = protein('HGNC', n())
        graph.add_node_from_data(p1)
        graph.add_node_from_data(p2)

        key, other_key = 'k1', 'k2'

        data_missing_key = data_missing_key_builder(key)

        graph.nodes[p1][key] = n()
        graph.nodes[p2][other_key] = n()

        nodes = set(filter_nodes(graph, data_missing_key))

        self.assertNotIn(p1, nodes)
        self.assertIn(p2, nodes)
Exemple #29
0
    def test_simple(self):
        """Test converting a simple dictionary."""
        namespace, name, identifier = n(), n(), n()

        self.assertEqual(
            Abundance(namespace=namespace, name=name),
            _simple_po_to_dict({
                FUNCTION: ABUNDANCE,
                CONCEPT: {
                    NAMESPACE: namespace,
                    NAME: name,
                },
            }))

        self.assertEqual(
            Abundance(namespace=namespace, name=name, identifier=identifier),
            _simple_po_to_dict({
                FUNCTION: ABUNDANCE,
                CONCEPT: {
                    NAMESPACE: namespace,
                    NAME: name,
                    IDENTIFIER: identifier,
                },
            }))

        self.assertEqual(
            Abundance(namespace=namespace, identifier=identifier),
            _simple_po_to_dict({
                FUNCTION: ABUNDANCE,
                CONCEPT: {
                    NAMESPACE: namespace,
                    IDENTIFIER: identifier,
                },
            }))

        with self.assertRaises(ValueError):
            _simple_po_to_dict({
                FUNCTION: ABUNDANCE,
                CONCEPT: {
                    NAMESPACE: namespace,
                },
            })
Exemple #30
0
    def test_get_naked_names(self):
        """Retrieve the naked names from a graph."""
        graph = BELGraph()

        n_names = 5

        line_number = 30
        position = 4
        line = n()

        names = {n() for _ in range(n_names)}

        exceptions = [
            NakedNameWarning(
                line_number=line_number,
                line=line,
                position=position,
                name=name,
            ) for name in names
        ]

        for exception in exceptions:
            graph.add_warning(
                line_number=line_number,
                line=line,
                exception=exception,
            )

        graph.add_warning(
            line_number=line_number,
            line=line,
            exception=exceptions[0],
        )

        self.assertEqual(6, len(graph.warnings))

        naked_names = get_naked_names(graph)
        self.assertEqual(names, naked_names)

        naked_name_counter = count_naked_names(graph)
        self.assertEqual(n_names, len(naked_name_counter))
        self.assertEqual(2, naked_name_counter[exceptions[0].name])