コード例 #1
0
 def add_connection(self, element, score, query_id):
     connection = Connection(
         source_element_id=query_id,
         type=self.info.knowledge_map.predicates[0].predicate,
         attributes=[
             Attribute(name='CMAP similarity score',
                       value=str(score),
                       type='CMAP similarity score',
                       source='CMAP',
                       provided_by=self.info.name),
             Attribute(name='reference',
                       value='PMID:29195078',
                       type='reference',
                       source='CMAP',
                       provided_by=self.info.name),
             Attribute(name='about CMAP',
                       value='https://clue.io/cmap',
                       type='about CMAP',
                       source='CMAP',
                       url='https://clue.io/cmap',
                       provided_by=self.info.name),
             Attribute(name='CMAP touchstone data version',
                       value=self.get_version(),
                       type='CMAP touchstone data version',
                       source='CMAP',
                       url='https://api.clue.io/api/touchstone-version',
                       provided_by=self.info.name)
         ])
     element.connections.append(connection)
コード例 #2
0
 def add_connection(self, id, assay, row):
     connection = Connection(
         source_element_id=CHEMBL+id,
         attributes=[],
         type=self.info.knowledge_map.predicates[0].predicate
     )
     add_attribute(self,connection,row,'standard_type')
     add_attribute(self,connection,row,'standard_relation')
     add_attribute(self,connection,row,'standard_value')
     add_attribute(self,connection,row,'standard_units')
     add_attribute(self,connection,row,'pchembl_value')
     add_attribute(self,connection,row,'activity_comment')
     reference=add_attribute(self,connection,row,'document_chembl_id')
     if reference is not None:
         reference.name = 'publication'
         reference.url = DOC_URL + reference.value
         reference.value = CHEMBL + reference.value
         reference.type = 'publication'
     add_attribute(self,connection,row,'source_description')
     add_attribute(self,connection,row,'data_validity_comment')
     add_attribute(self,connection,row,'uo_units')
     add_attribute(self,connection,row,'ligand_efficiency_BEI')
     add_attribute(self,connection,row,'ligand_efficiency_LE')
     add_attribute(self,connection,row,'ligand_efficiency_LLE')
     add_attribute(self,connection,row,'ligand_efficiency_SEI')
     add_attribute(self,connection,row,'journal')
     add_attribute(self,connection,row,'year')
     assay.connections.append(connection)
コード例 #3
0
    def find_drug(self, rxcui, source_element_id):

        substance_list = []

        query = """
        SELECT
            RXNREL.RXCUI1,
            RXNREL.RXCUI2
        from RXNREL

        where RXNREL.RXCUI1 = ?
        """
        cur = connection.execute(query, (rxcui, ))

        for row in cur.fetchall():
            substance_rxcui2 = row['RXCUI2']

            if substance_rxcui2 is not None:

                substance = Element(
                    id='RXCUI:' + str(substance_rxcui2),
                    biolink_class='related_to',
                    identifiers={'rxnorm': 'RXCUI:' + str(substance_rxcui2)},
                    connections=[],
                    source=self.info.name)
                substance_list.append(substance)

                connect = Connection(
                    source_element_id=source_element_id,
                    type=self.info.knowledge_map.predicates[0].predicate,
                    attributes=self.connection_attributes(
                        rxcui, substance_rxcui2))
                substance.connections.append(connect)

        return substance_list
コード例 #4
0
 def create_connection(self, compound, mechanism):
     connection = Connection(
         source_element_id=compound.id,
         type=self.info.knowledge_map.predicates[0].predicate,
         attributes=[])
     action = mechanism['action_type']
     if action is not None:
         connection.attributes.append(
             Attribute(name='action_type',
                       value=action,
                       type=ACTION,
                       source=SOURCE,
                       url=None,
                       provided_by=self.info.name))
     moa = mechanism['mechanism_of_action']
     if moa is not None:
         connection.attributes.append(
             Attribute(name='mechanism_of_action',
                       value=moa,
                       type=MOA,
                       source=SOURCE,
                       url=None,
                       provided_by=self.info.name))
     for reference in mechanism['mechanism_refs']:
         connection.attributes.append(
             Attribute(name=reference['ref_type'],
                       value=reference['ref_id'],
                       type=REFERENCE,
                       source=SOURCE,
                       url=reference['ref_url'],
                       provided_by=self.info.name))
     return connection
コード例 #5
0
    def add_connections(self, row, protein, compound):
        connection1 = Connection(
            source_element_id=compound.id,
            type=self.info.knowledge_map.predicates[0].predicate,
            attributes=[]
        )

        self.get_connections_attributes(row, connection1)
        protein.connections.append(connection1)
コード例 #6
0
    def add_connections (self, row, gene, compound):
        connection= Connection(
            source_element_id= gene.id,
            type= self.info.knowledge_map.predicates[0].predicate,
            attributes= []
        )

        self.get_connections_attributes(row,connection)
        compound.connections.append(connection)
コード例 #7
0
 def create_connection(self, compound, target):
     connection = Connection(
         source_element_id=compound.id,
         type = self.info.knowledge_map.predicates[0].predicate,
         attributes=[]
     )
     add_attribute(self, connection, target, 'action_type')
     add_attribute(self, connection, target,'mechanism_of_action')
     add_references(self, connection, 'mechanism_refs', 'mec_id', target['mec_id'])
     return connection
コード例 #8
0
def create_connection(connection):  # noqa: E501
    """Create connection entry

     # noqa: E501

    :param connection: 
    :type connection: dict | bytes

    :rtype: Connection
    """
    if connexion.request.is_json:
        connection = Connection.from_dict(
            connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
コード例 #9
0
 def add_connection(self, chembl_id, indication, row):
     curie = CHEMBL+chembl_id
     connection = None
     for c in indication.connections:
         if c.source_element_id == curie:
             connection = c
     if connection is None:
         connection = Connection(source_element_id=curie, attributes=[])
         connection.type = self.info.knowledge_map.predicates[0].predicate
         indication.connections.append(connection)
     max_phase = row['max_phase_for_ind']
     max_phase_attr = None
     for attr in connection.attributes:
         if attr.name == 'max phase for indication':
             max_phase_attr = attr
             break
     if max_phase_attr is None:
         max_phase_attr = Attribute(
             name='max phase for indication',
             value=max_phase,
             type='OPMI:0000367',# clinical trial phase
             source=SOURCE,
             url=None,
             provided_by=self.info.name
         )
         connection.attributes.append(max_phase_attr)
     elif max_phase > max_phase_attr.value:
         max_phase_attr.value = max_phase
     connection.attributes.append(Attribute(
         name=row['ref_type'],
         value=row['ref_id'],
         type='reference',
         source=SOURCE,
         url=row['ref_url'],
         provided_by=self.info.name
     ))
コード例 #10
0
 def Connection(self,
                source_element_id,
                predicate,
                inv_predicate,
                relation=None,
                inv_relation=None,
                attributes=None):
     return Connection(
         source_element_id=source_element_id,
         biolink_predicate=predicate,
         inverse_predicate=inv_predicate,
         relation=relation,
         inverse_relation=inv_relation,
         source=self.SOURCE,
         provided_by=self.PROVIDED_BY,
         attributes=attributes if attributes is not None else [])
コード例 #11
0
 def create_connection(self, source_element_id, beacon_statement_id):
     connection = Connection(
         source_element_id=source_element_id,
         type=self.info.knowledge_map.predicates[0].predicate,
         relation=self.info.knowledge_map.predicates[0].predicate,
         source=self.info.label,
         provided_by=self.info.name,
         attributes=[])
     for reference in get_references(beacon_statement_id):
         connection.attributes.append(
             Attribute(name='reference',
                       value=reference['PMID'] if
                       reference['PMID'] != 'PMID:' else reference['NAME'],
                       type='reference',
                       source=self.info.label,
                       provided_by=self.info.name))
     return connection
コード例 #12
0
 def create_connection(self, source_element_id, hit):
     connection = Connection(
         source_element_id = source_element_id,
         type = self.info.knowledge_map.predicates[0].predicate,
         relation=self.info.knowledge_map.predicates[0].predicate,
         source=self.info.label,
         provided_by = self.info.name,
         attributes = []
     )
     self.add_attribute(connection, 'correlation', hit['CORRELATION_VALUE'])
     self.add_attribute(connection, 'z-score', hit['FISHER_Z'])
     self.add_attribute(connection, 'FDR', hit['FDR'])
     self.add_attribute(connection, 'sample size', hit['N_SAMPLES'])
     self.add_reference(connection,'26656090')
     self.add_reference(connection,'26482930')
     self.add_reference(connection,'23993102')
     return connection
コード例 #13
0
 def add_connection(self, id, metabolite, row):
     connection = Connection(
         source_element_id=CHEMBL+id,
         attributes=[],
         type=self.info.knowledge_map.predicates[0].predicate
     )
     add_attribute(self,connection,row,'enzyme_name')
     add_attribute(self,connection,row,'met_conversion')
     add_attribute(self,connection,row,'met_comment')
     add_attribute(self,connection,row,'organism')
     add_attribute(self,connection,row,'tax_id')
     add_attribute(self,connection,row,'enzyme_type')
     enzyme_chembl_id = add_attribute(self,connection,row,'enzyme_chembl_id')
     if enzyme_chembl_id is not None:
         enzyme_chembl_id.value = CHEMBL+row['enzyme_chembl_id']
     add_references(self, connection, 'metabolism_refs','met_id', row['met_id'])
     metabolite.connections.append(connection)
コード例 #14
0
    def create_connection(self, source_element_id, target):
        connection = Connection(
            source_element_id=source_element_id,
            type=self.info.knowledge_map.predicates[0].predicate,
            relation=self.info.knowledge_map.predicates[0].predicate,
            source=self.info.label,
            provided_by=self.info.name,
            attributes=[])

        beacon_statement_id = target['BEACON_STATEMENT_ID']
        for reference in get_references(beacon_statement_id):
            connection.attributes.append(
                Attribute(name='reference',
                          value=reference['PMID'],
                          type='reference',
                          source=self.info.label,
                          provided_by=self.info.name))
        return connection
コード例 #15
0
 def connection(self, source_element_id, row):
     connection = Connection(
         source_element_id = source_element_id,
         type = self.biolinkClass_dict[row['TAG']],
         relation = '',
         source = self.SOURCE,
         provided_by = self.PROVIDED_BY,
         attributes = [
                 self.Attribute(
                     name= 'known action',
                     value= row['KNOWN_ACTION'],
                     type= 'known action'
                 )
         ]
     )
     get_connection_properties(self, self.PROVIDED_BY, row['CONNECTION_ID'], connection)   # add attributes from CONNECTION_PROPERTY table
     get_connection_references(self, self.PROVIDED_BY, row['CONNECTION_ID'], connection)   # add attributes from REFERENCE table
                       
     return connection
コード例 #16
0
    def get_connection_data(entity, info_name, interaction_id, id, type):
        """
            Gather all the information about the drug-gene interaction (i.e., connection)
        """
        drug_gene_interaction = Connection(
            source_element_id=id,
            type=type,
            evidence_type="",
            attributes=[],
        )

        #   Connections publications SQL query:
        query8 = """ 
                SELECT 
                    publications.pmid,
                    publications.citation
                FROM interactions
                JOIN interactions_publications on interactions_publications.interaction_id = interactions.id
                JOIN publications ON publications.id = interactions_publications.publication_id
                WHERE interactions.id =?;
                """
        global connection
        connection = DGIdbDataSupply.get_db()
        cur8 = connection.execute(query8, (interaction_id, ))

        for row in cur8.fetchall():  # loop for each PubMed citation
            drug_gene_interaction.attributes.append(
                Attribute(name="publication",
                          value="PMID:" + str(row['pmid']),
                          type="IAO:0000311",
                          source=SOURCE,
                          url="https://pubmed.ncbi.nlm.nih.gov/" +
                          str(row['pmid']),
                          provided_by=info_name))

    #   append Interaction Attributes from interaction_attributes table
        DGIdbDataSupply.get_interaction_attributes(info_name,
                                                   drug_gene_interaction,
                                                   interaction_id)

        #   append the completed Interaction to the drug's or gene's connections array
        entity.connections.append(drug_gene_interaction)
コード例 #17
0
def update_connection(connection_id,
                      connection,
                      update_mask=None):  # noqa: E501
    """Update a connection entry

     # noqa: E501

    :param connection_id: The Connection ID.
    :type connection_id: int
    :param connection: 
    :type connection: dict | bytes
    :param update_mask: The fields to update on the connection (connection, pool etc). If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. 
    :type update_mask: List[str]

    :rtype: Connection
    """
    if connexion.request.is_json:
        connection = Connection.from_dict(
            connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
コード例 #18
0
 def add_connection(self, id, mechanism, row):
     connection = Connection(
         source_element_id=CHEMBL+id,
         attributes=[],
         type=self.info.knowledge_map.predicates[0].predicate
     )
     add_attribute(self,connection,row,'action_type')
     add_attribute(self,connection,row,'mechanism_of_action')
     add_attribute(self,connection,row,'mechanism_comment')
     add_attribute(self,connection,row,'selectivity_comment')
     add_attribute(self,connection,row,'target_chembl_id')
     add_attribute(self,connection,row,'site_name')
     add_attribute(self,connection,row,'binding_site_comment')
     add_attribute(self,connection,row,'source_description')
     reference=add_attribute(self,connection,row,'document_chembl_id')
     if reference is not None:
         reference.name = 'publication'
         reference.url = DOC_URL + reference.value
         reference.value = CHEMBL + reference.value
         reference.type = 'publication'
     add_references(self, connection, 'mechanism_refs', 'mec_id', row['mec_id'])
     self.add_atc_classification(connection,row['molregno'])
     mechanism.connections.append(connection)
    def get_mixtures(self, relationship_list, substance):
        substance_unii = substance.identifiers['unii'].split(":", 1)[1].strip()
        source_element_id = substance.identifiers['unii']
        """
            Get mixtures that "has part" that includes the substance as a component,
            so append any mixtures to the relationship_list
            and annotate their Connection per biolink: 
            (https://biolink.github.io/biolink-model/docs/has_part.html)
        """
        query14 = """
            SELECT 
                substances._name AS substance_name,
                mixture_substances.uuid AS mixture_uuid,
                mixture_substances._name AS mixture_substance,
                mixture_substances.UNII AS mixture_substance_unii,
                mixture_substances.substanceClass,
                unii_lookup.RXCUI AS mixture_RXCUI,
                unii_lookup.PUBCHEM AS mixture_PUBCHEM,
                unii_lookup.INCHIKEY AS mixture_InChiKey,
                unii_lookup.NCBI AS mixture_NCBI
            FROM substances
            JOIN components ON substances.uuid = components.refuuid
            JOIN mixtures ON components.mixture_id = mixtures.uuid
            JOIN substances AS mixture_substances ON mixtures.uuid = mixture_substances.mixture
            LEFT JOIN unii_lookup ON mixture_substances.UNII = unii_lookup.UNII 
            WHERE substances.UNII = ?   ;
            """
        connection = Inxight_Drugs_DataSupply.get_db()
        cur14 = connection.execute(query14, (substance_unii, ))
        for row in cur14.fetchall():  # loop for each mixture substance found
            id = "UNII:" + str(row['mixture_substance_unii'])
            name = row['mixture_substance']
            #   Create identifiers by annotating ids with appropriate CURIE prefix
            identifiers = {'unii': id}
            if (row['mixture_InChiKey']):
                identifiers["inchikey"] = row['mixture_InChiKey']
            if (row['mixture_PUBCHEM']):
                identifiers["pubchem"] = "CID:" + row['mixture_PUBCHEM']

            biolink_class = Inxight_Drugs_DataSupply.get_biolink_class(
                row['substanceClass'], row['mixture_InChiKey'])
            if row['mixture_RXCUI'] and biolink_class == 'Drug':
                identifiers["rxnorm"] = "RXCUI:" + row['mixture_RXCUI']

            connection = Connection(source_element_id=source_element_id,
                                    type='has_part',
                                    relation='has_part',
                                    evidence_type="",
                                    attributes=[])
            mixture = Element(
                id=id,
                biolink_class=biolink_class,
                identifiers=identifiers,
                names_synonyms=[
                    Names(name=name, synonyms=[], source=SOURCE)
                ],  # add name & later synonyms from the database
                attributes=[],
                connections=[connection],
                source=self.info.name)
            if biolink_class != 'ignore':
                relationship_list.append(mixture)
    def get_active_ingredients(self, related_list, drug):
        drug_rxcui = drug.identifiers['rxnorm'].split(":", 1)[1].strip()
        source_element_id = drug.id.strip()
        query7 = """
            SELECT DISTINCT
                unii_lookup.PT,
                unii_lookup.RXCUI,
                unii_lookup.PUBCHEM,
                unii_lookup.NCBI,
                substances._name,
                relatedSubstances._name AS related_substance,
                relatedSubstances.uuid AS related_substance_uuid,
                relatedSubstances.UNII AS related_substance_unii,
                relatedSubstances.substanceClass AS related_substance_class,
                relationships.type AS relationships_type,
                relationships.qualification,
                relationships.amount_average AS average,
                relationships.amount_high AS high,
                relationships.amount_low AS low,
                relationships.amount_units,
                unii_lookup.INCHIKEY AS InChiKey,
                unii_lookup.INGREDIENT_TYPE
            FROM unii_lookup
            JOIN substances ON unii_lookup.UNII = substances.UNII
            LEFT JOIN relationships ON substances.uuid = relationships.substance_id
            JOIN substances AS relatedSubstances ON relationships.relatedSubstance_id = relatedSubstances.uuid
            WHERE
                relationships.type LIKE ("%ACTIVE%") 
                AND NOT relationships.type LIKE ("%INACTIVE%")
                AND NOT relationships.type LIKE ("%PARENT->%")
                AND NOT relationships.type LIKE ("%PRODRUG->%")
                AND NOT relationships.type LIKE ("%RACEMATE->%")
                AND NOT relationships.type LIKE ("%SUBSTANCE->%")  
                AND NOT relationships.type LIKE ("%METABOLITE ACTIVE%") 
                AND NOT relationships.type LIKE ("%METABOLITE LESS ACTIVE%") 
                AND NOT relationships.type LIKE ("%ACTIVE CONSTITUENT ALWAYS PRESENT%")
                AND RXCUI = ?; 
        """
        connection = Inxight_Drugs_DataSupply.get_db()
        cur7 = connection.execute(query7, (drug_rxcui, ))

        for row in cur7.fetchall():  # loop for each related substance found
            id = "UNII:" + str(row['related_substance_unii'])
            uuid = row['related_substance_uuid']
            identifiers = {'unii': id}
            if row['InChiKey']:
                identifiers['inchikey'] = row['InChiKey']
            if (row['PUBCHEM']):
                identifiers["pubchem"] = "CID:" + row['PUBCHEM']
            name = row['related_substance']
            biolink_class = Inxight_Drugs_DataSupply.get_biolink_class(
                row['related_substance_class'], row['InChiKey'])
            relationships_type = row['relationships_type']
            if row['RXCUI'] and biolink_class == 'Drug':
                identifiers["rxnorm"] = "RXCUI:" + row['RXCUI']
            substance = Element(
                id=id,
                biolink_class=biolink_class,
                identifiers=identifiers,
                names_synonyms=[
                    Names(name=name, synonyms=[], source=SOURCE)
                ],  # add name & later synonyms from the database
                attributes=[],
                connections=[],
                source=self.info.name)
            # Append synonyms to the substance
            Inxight_Drugs_DataSupply.get_names_synonyms(uuid, substance)
            relationship = Connection(source_element_id=source_element_id,
                                      type=relationships_type,
                                      relation="has_active_ingredient",
                                      evidence_type="",
                                      attributes=[])
            if (row['qualification']):
                #   active ingredients attributes
                attributes_list = ['average', 'high', 'low']
                for attribute in attributes_list:
                    if row[attribute] is not None and len(
                            row[attribute].strip()) > 0:
                        name = attribute + ' ' + str(
                            row['qualification']) + ' (' + str(
                                row['amount_units']) + ')'
                        value = str(row[attribute])
                        relationship.attributes.append(
                            Attribute(provided_by=self.info.name,
                                      name=name,
                                      value=value,
                                      source=SOURCE,
                                      type=name))
            substance.connections.append(relationship)
            if biolink_class != 'ignore':  # the ingredient is not a "concept"
                related_list.append(substance)
    def get_relationships(self, relationship_list, substance):
        #   substance is a mixture that must have components
        Inxight_Drugs_DataSupply.get_components(self, relationship_list,
                                                substance)
        # also check if it is a component
        Inxight_Drugs_DataSupply.get_mixtures(self, relationship_list,
                                              substance)

        substance_unii = substance.identifiers['unii'].split(":", 1)[1].strip()
        source_element_id = substance.identifiers['unii']
        """
            Find relationships to other substances by a substance UNII
            """
        query5 = """
            SELECT 
                substances._name AS substance_name,
                substances.mixture,
                relationships.type AS relationships_type,
                relationships.mediatorSubstance_id,
                relationships.interactionType AS interaction_type,
                relationships.qualification,
                relationships.amount_average AS average,
                relationships.amount_high AS high,
                relationships.amount_low AS low,
                relationships.amount_units,
                relationships.comments,
                related.uuid AS related_uuid,
                related._name AS related_substance,
                related.UNII AS related_substance_unii,
                related.substanceClass,
                unii_lookup.RXCUI AS relatedRXCUI,
                unii_lookup.PUBCHEM AS relatedPUBCHEM,
                unii_lookup.INCHIKEY AS InChiKey,
                unii_lookup.NCBI
            FROM substances
            JOIN relationships ON substances.uuid = relationships.substance_id
            JOIN substances AS related ON relationships.relatedSubstance_id = related.uuid
            LEFT JOIN unii_lookup ON related.UNII = unii_lookup.UNII
            WHERE substances.UNII = ?; 
        """
        connection = Inxight_Drugs_DataSupply.get_db()
        cur5 = connection.execute(query5, (substance_unii, ))

        for row in cur5.fetchall():  # loop for each related substance found
            id = "UNII:" + str(row['related_substance_unii'])
            name = row['related_substance']
            #   Create identifiers by annotating ids with appropriate CURIE prefix
            identifiers = {'unii': id}
            if (row['InChiKey']):
                identifiers["inchikey"] = row['InChiKey']
            if (row['relatedPUBCHEM']):
                identifiers["pubchem"] = "CID:" + row['relatedPUBCHEM']
            biolink_class = Inxight_Drugs_DataSupply.get_biolink_class(
                row['substanceClass'], row['InChiKey'])
            if row['relatedRXCUI'] and biolink_class == 'Drug':
                identifiers["rxnorm"] = "RXCUI:" + row['relatedRXCUI']

            related_substances = Element(
                id=id,
                biolink_class=biolink_class,
                identifiers=identifiers,
                names_synonyms=[
                    Names(name=name, synonyms=[], source=SOURCE)
                ],  # add name & later synonyms from the database
                attributes=[],
                connections=[],
                source=self.info.name)
            #   Append additional attributes collected from Inxight:Drugs substances & unii tables
            attributes_list = ['substanceClass', 'NCBI']
            for attribute in attributes_list:
                if row[attribute] is not None and len(
                        row[attribute].strip()) > 0:
                    if attribute != 'NCBI':
                        related_substances.attributes.append(
                            Attribute(provided_by=self.info.name,
                                      name=attribute,
                                      value=str(row[attribute]),
                                      source=SOURCE,
                                      type=attribute))
                    else:  # NCBI id
                        related_substances.attributes.append(
                            Attribute(provided_by=self.info.name,
                                      name='OrganismTaxon',
                                      value='NCBITaxon:' + row[attribute],
                                      source=SOURCE,
                                      type='biolink:OrganismTaxon'))
            relationship = Connection(source_element_id=source_element_id,
                                      type=row['relationships_type'],
                                      relation=row['relationships_type'],
                                      evidence_type="",
                                      attributes=[])
            #   Append additional attributes collected from Inxight:Drugs relationships table
            attributes_list = ['interaction_type', 'comments']
            for attribute in attributes_list:
                if row[attribute] is not None and len(
                        row[attribute].strip()) > 0:
                    relationship.attributes.append(
                        Attribute(provided_by=self.info.name,
                                  name=attribute,
                                  value=str(row[attribute]),
                                  source=SOURCE,
                                  type=attribute))
            if (row['qualification']):
                attributes_list = ['average', 'high', 'low']
                for attribute in attributes_list:
                    if row[attribute] is not None and len(
                            row[attribute].strip()) > 0:
                        # e.g., attribute.name: average IC50 (NANOMOLAR), attribute.value: 2.7
                        name = attribute + ' ' + str(
                            row['qualification']) + ' (' + str(
                                row['amount_units']) + ')'
                        value = str(row[attribute])
                        relationship.attributes.append(
                            Attribute(provided_by=self.info.name,
                                      name=name,
                                      value=value,
                                      source=SOURCE,
                                      type=name))

            related_substances.connections.append(relationship)
            if biolink_class != 'ignore':
                relationship_list.append(related_substances)