Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def kegg():
k = KEGG()
k.organismIds
k.organism = "hsa"
return k
def __init__(self):
self.ch = bioservices.ChEBI()
self.kegg = bioservices.KEGG()
self.wOntologySelect = w.Dropdown(description='Ontology:', options=['ChEBI', 'KEGG.Reaction'])
self.wSearchTerm = w.Text(description='Search Term:', value="glucose")
self.wSearchTerm.on_submit(self.search)
self.wSearchButton = w.Button(description='Search')
self.wSearchButton.on_click(self.search)
self.wResultsSelect = w.Select(description='Results:', width='100%')
self.wResultsSelect.on_trait_change(self.selectedTerm)
self.wResultsURL = w.Textarea(description='URL:', width='100%')
self.wResults = w.VBox(children=[
self.wResultsSelect,
self.wResultsURL
], width='100%')
for ch in self.wResults.children:
ch.font_family = 'monospace'
def __init__(self, folder, organism, comparison=None, alpha=0.05, fc=0):
print("DRAFT in progress")
from bioservices import KEGG
self.kegg = KEGG(cache=True)
self.kegg.organism = organism
self.read_rnadiff(folder, alpha=alpha, fc=fc)
choices = list(self.rnadiff.dr_gene_lists.keys())
if comparison:
assert comparison in choices
self.comparison = comparison
elif len(choices) == 1:
logger.info("One comparison found and set automatically")
self.comparison = choices[0]
self.background = len(self.kegg.list(self.kegg.organism).split("\n"))
logger.info("Set number of genes to {}".format(self.background))
self._load_pathways()
"""
import io
import logging
import os.path as op
from collections import defaultdict
from bioservices import KEGG
from slugify import Slugify
import ssbio.utils
from ssbio.protein.sequence.seqprop import SeqProp
log = logging.getLogger(__name__)
custom_slugify = Slugify(safe_chars='-_')
bs_kegg = KEGG()
class KEGGProp(SeqProp):
def __init__(self, seq, id, name='', description='',
fasta_path=None, txt_path=None, gff_path=None):
SeqProp.__init__(self, id=id, seq=seq, name=name, description=description,
sequence_path=fasta_path, metadata_path=txt_path, feature_path=gff_path)
self.kegg = id
@SeqProp.metadata_path.setter
def metadata_path(self, m_path):
"""Provide pointers to the paths of the metadata file
Args:
m_path: Path to metadata file
from ssbio.databases.kegg import KEGGProp
from ssbio.databases.uniprot import UniProtProp
from ssbio.protein.sequence.properties.scratch import SCRATCH
if utils.is_ipynb():
from tqdm import tqdm_notebook as tqdm
else:
from tqdm import tqdm
custom_slugify = Slugify(safe_chars='-_.')
logging.getLogger("requests").setLevel(logging.ERROR)
logging.getLogger("urllib3").setLevel(logging.ERROR)
log = logging.getLogger(__name__)
date = utils.Date()
bs_unip = UniProt()
bs_kegg = KEGG()
class GEMPRO(Object):
"""Generic class to represent all information for a GEM-PRO project.
Initialize the GEM-PRO project with a genome-scale model, a list of genes, or a dict of genes and sequences.
Specify the name of your project, along with the root directory where a folder with that name will be created.
Main methods provided are:
#. Automated mapping of sequence IDs
* With KEGG mapper
* With UniProt mapper
* Allowing manual gene ID --> protein sequence entry