Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from bioservices.services import REST
from bioservices import logger
logger.name = __name__
__all__ = ["PRIDE"]
@wrapt.decorator
def params_to_update(wrapped, instance, args, kwargs):
vars(wrapped)['actual_kwargs'] = kwargs
return wrapped(*args, **kwargs)
class PRIDE(REST):
"""Interface to the `PRIDE `_ service
"""
_url = "https://www.ebi.ac.uk/pride/ws/archive"
def __init__(self, verbose=False, cache=False):
"""**Constructor**
:param verbose: set to False to prevent informative messages
"""
super(PRIDE, self).__init__(name="PRIDE", url=PRIDE._url,
verbose=verbose, cache=cache)
def get_project(self, identifier):
from functools import reduce # python3 compat
except:
pass
from bioservices.services import REST, BioServicesError
import webbrowser
import copy
from bioservices import logger
logger.name = __name__
from easydev.logging_tools import Logging
__all__ = ["KEGG", "KEGGParser"]
class KEGG(REST):
"""Interface to the `KEGG `_ service
This class provides an interface to the KEGG REST API. The weblink tools
are partially accesible. All dbentries can be parsed into dictionaries using
the :class:`KEGGParser`
Here are some examples. In order to retrieve the entry of the
gene identifier 7535 of the **hsa** organism, type::
from bioservices import KEGG
s = KEGG()
print(s.get("hsa:7535"))
The output is the raw ouput sent by KEGG API. See :class:`KEGGParser` to
parse this output.
"OMA": "OMA_ID",
"OrthoDB": "ORTHODB_ID",
"ProtClustDB": "PROTCLUSTDB_ID",
"BioCyc": "BIOCYC_ID",
"Reactome": "REACTOME_ID",
"UniPathWay": "UNIPATHWAY_ID",
"CleanEx": "CLEANEX_ID",
"GermOnline": "GERMONLINE_ID",
"ChEMBL": "CHEMBL_ID",
"ChiTaRS": "CHITARS_ID",
"DrugBank": "DRUGBANK_ID",
"GenomeRNAi": "GENOMERNAI_ID",
"NextBio": "NEXTBIO_ID"}
class UniProt(REST):
"""Interface to the `UniProt `_ service
.. rubric:: Identifiers mapping between databases:
::
>>> from bioservices import UniProt
>>> u = UniProt(verbose=False)
>>> u.mapping("ACC", "KEGG_ID", query='P43403')
defaultdict(, {'P43403': ['hsa:7535']})
>>> res = u.search("P43403")
# Returns sequence on the ZAP70_HUMAN accession Id
>>> sequence = u.search("ZAP70_HUMAN", columns="sequence")
"""
##############################################################################
# About Clinvitae (http://clinvitae.invitae.com/)
# "CLINVITAE is a database of clinically-observed genetic variants aggregated
# from public sources, operated and made freely available by INVITAE." - CLINVITAE website
from bioservices.services import REST
from bioservices import logger
logger.name = __name__
__all__ = ["Clinvitae"]
class Clinvitae(REST):
"""
class for interfacing with the Clinvitae web service
Requests will return a list of json dicts. each dict has the following fields::
accessionId
gene
nucleotideChanges
description
classification
reportedClassification
url
region
proteinChange
lastUpdated
alias
using the interactive interface. "
-- From the PICR home page, Dec 2012
"""
from bioservices.services import REST
__all__ = ["PICR"]
#//the NEWT taxonomy ID to limit the mappings to
#//can be null or a number. Do not specify 0 for null.
#String taxonID = "9606"; //H. Sapiens
class PICR(REST):
"""Interface to the `PICR (Protein Identifier Cross reference) `_ service
.. doctest::
>>> from bioservices import PICR
>>> p = PICR()
>>> res = p.getMappedDatabaseNames() # get list of valid database
>>> results = p.getUPIForSequence(p._sequence_example, \
["IPI", "ENSEMBL", "SWISSPROT"])
"""
_sequence_example="MDSTNVRSGMKSRKKKPKTTVIDDDDDCMTCSACQSKLVKISDITKVSLDYINTMRGNTLACAACGSSLKLLNDFAS"
_blastfrag_example="MSVMYKKILYPTDFSETAEIALKHVKAFKTLKAEEVILLHVIDEREIKKRDIFSLLLGVAGLNKSVEEFENELKNKLTEEAKNKMENIKKELEDVGFKVKDIIVVGIPHEEIVKIAEDEGVDIIIMGSHGKTNLKEILLGSVTENVIKKSNKPVLVVKRKNS"
_accession_example = "P29375"
_url = "http://www.ebi.ac.uk/Tools/picr/rest"
-- from Rhea Home page, Dec 2012 (http://www.ebi.ac.uk/rhea/about.xhtml)
"""
from __future__ import print_function
from collections import defaultdict
from bioservices.services import REST
from bioservices import logger
logger.name = __name__
__all__ = ["Rhea"]
class Rhea(REST):
"""Interface to the `Rhea `_ service
You can search by compound name, ChEBI ID, reaction ID, cross reference
(e.g., EC number) or citation (author name, title, abstract text, publication ID).
You can use double quotes - to match an exact phrase - and the following
wildcards:
* ? (question mark = one character),
* `*` (asterisk = several characters).
Searching for caffe* will find reactions with participants such as caffeine,
trans-caffeic acid or caffeoyl-CoA::
from bioservices import Rhea
r = Rhea()
response = r.search("caffe*")
-- from NCBIblast web page
"""
import sys
import time
from bioservices.services import REST
from bioservices import logger
logger.name = __name__
__all__ = ["NCBIblast"]
class NCBIblast(REST):
"""Interface to the `NCBIblast `_ service.
::
>>> from bioservices import *
>>> s = NCBIblast(verbose=False)
>>> jobid = s.run(program="blastp", sequence=s._sequence_example,
stype="protein", database="uniprotkb", email="name@provider")
>>> s.getResult(jobid, "out")
.. warning:: It is very important to provide a real e-mail address as your
job otherwise very likely will be killed and your IP, Organisation or
entire domain black-listed.
When running a blast request, a program is required. You can obtain the
"""
import io
from bioservices.services import REST
from bioservices import logger
logger.name = __name__
try:
import pandas as pd
except:
pass
__all__ = ["BioDBNet"]
class BioDBNet(REST):
"""Interface to the `BioDBNet `_ service
::
>>> from bioservices import *
>>> s = BioDBNet()
Most of the BioDBNet WSDL are available. There are functions added to
the original interface such as :meth:`extra_getReactomeIds`.
Use :meth:`db2db` to convert from 1 database to some databases.
Use :meth:`dbReport` to get the convertion from one database to all
databases.
"""
_url = 'https://biodbnet-abcc.ncifcrf.gov/webServices/rest.php/biodbnetRestApi.json'
An Information Portal to Biological Macromolecular Structures
-- PDB home page, Feb 2013
:Status: in progress not for production
"""
from __future__ import print_function
from bioservices.services import REST
__all__ = ["PDB"]
class PDB(REST):
"""Interface to part of the `PDB `_ service
:Status: in progress not for production. You can get all ID and retrieve
uncompressed file in PDB/FASTA formats for now. New features will be
added on request.
.. doctest::
>>> from bioservices import PDB
>>> s = PDB()
>>> res = s.get_file("1FBV", "pdb")
"""
def __init__(self, verbose=False, cache=False):
""".. rubric:: Constructor
"""
import types
import io
from bioservices.services import REST
from bioservices import logger
logger.name = __name__
__all__ = ["EVA"]
class EVA(REST):
"""Interface to the `EVA `_ service
* version: indicates the version of the API, this defines the available
filters and JSON schema to be returned. Currently there is only
version 'v1'.
* category: this defines what objects we want to query. Currently there
are five different categories: variants, segments, genes, files and
studies.
* resource: specifies the resource to be returned, therefore the JSON
data model.
* filters: each specific endpoint allows different filters.
"""
_url = "http://wwwdev.ebi.ac.uk/eva/webservices/rest/"
def __init__(self, verbose=False, cache=False):