#!/usr/bin/env python # coding: utf-8 # # CellCollective Knowledge Base # # Models from [CellCollective.org](https://cellcollective.org) can be directly imported by CoLoMoTo tools (such as `bioLQM` or `Pint`) by giving their URL as the argument of the ``.load`` function, for instance, ``lqm = biolqm.load("https://cellcollective.org/#2329/apoptosis-network")``. # # In this notebook, we show how to use the API of the `cellcollective` python module to access metadata of network species, such as UnitProt and NCBI gene identifiers. # In[1]: import cellcollective # ### Model loading from cellcollective.org # # A CellCollective model can be imported using its URL on https://cellcollective.org. # Alternatively, you can also use "cellcollective://MODEL_ID" syntax. # In[2]: sbml = cellcollective.load("https://cellcollective.org/#2329/apoptosis-network") # The cellcollective python module supports basic access to the SBML-qual file, including the list of defined qualitative species: # In[3]: sbml.species # ### Access metadata # # In most models on CellCollective, authors attached to nodes several metadata, including identifiers of biological species: # In[4]: sbml.species_metadata("Cas3") # The link to UnitProt knowledge or NCBI gene database can be obtained as follows: # In[5]: sbml.species_uniprotkb("Cas3") # In[6]: sbml.species_ncbi_gene("Cas3") # There exists several python interfaces to programmatically query information from these databases: # - using NBCI Gene ID: https://github.com/biocommons/eutils # - using UniProt ID: https://github.com/jdrudolph/uniprot # ### Convert to bioLQM for model analysis # # Finally, a CellCollective model can be imported in the `bioLQM` tool, for further processing, such as dynamical analysis and simulations. # In[7]: lqm = cellcollective.to_biolqm(sbml) # In[8]: set([str(c) for c in lqm.getComponents()]) # In[ ]: