Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_muscle():
m = MUSCLE(verbose=False)
m.parameters
m.getParametersDetails("format")
u = uniprot.UniProt(verbose=False)
f1 = u.get_fasta("P18812")
f2 = u.get_fasta("P18813")
jobid = m.run(frmt="fasta", sequence=f1+f2, email="cokelaer@ebi.ac.uk")
m.getStatus(jobid)
m.wait(jobid)
m.getResultTypes(jobid)
m.getResult(jobid, 'phylotree')
def uniprot():
u = UniProt(verbose=False, cache=False)
u.logging.level = "ERROR"
return u
from bioservices.uniprot import UniProt
import requests
from collections import defaultdict
import libsbml
reader = libsbml.SBMLReader()
bsup = UniProt()
def kegg_mapper(kegg_organism, map_db='uniprot'):
'''
Generates a dictionary that maps KEGG gene IDs to NCBI Entrez gene IDs ('ncbi-geneid') or UniProt ('uniprot').
Input: kegg_organism - the KEGG organism name which you can determine from http://www.genome.jp/kegg/catalog/org_list.html
map_db - ncbi-geneid OR uniprot (default): the database you want to map to
Output: id_mapper - a dictionary of {KEGG_ID: mapped_ID}
'''
id_mapper = {}
r = requests.post('http://rest.kegg.jp/conv/%s/%s' % (map_db,kegg_organism))
for line in r.content.split('\n'):
if not line: continue
from collections import defaultdict
from dateutil.parser import parse as dateparse
import ssbio.utils
from BCBio import GFF
from ssbio.protein.sequence.seqprop import SeqProp
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from six.moves.urllib.request import urlretrieve
from Bio import SeqIO
import logging
log = logging.getLogger(__name__)
bsup = bioservices.uniprot.UniProt()
# See the UniProt XML specification for these http://www.uniprot.org/docs/uniprot.xsd
# Also see http://www.uniprot.org/help/sequence_annotation for categories
longname_all_features = ["active site", "binding site", "calcium-binding region", "chain", "coiled-coil region",
"compositionally biased region", "cross-link", "disulfide bond", "DNA-binding region",
"domain", "glycosylation site", "helix", "initiator methionine", "lipid moiety-binding region",
"metal ion-binding site", "modified residue", "mutagenesis site", "non-consecutive residues",
"non-terminal residue", "nucleotide phosphate-binding region", "peptide", "propeptide",
"region of interest", "repeat", "non-standard amino acid", "sequence conflict",
"sequence variant", "short sequence motif", "signal peptide", "site", "splice variant",
"strand", "topological domain", "transit peptide", "transmembrane region", "turn",
"unsure residue", "zinc finger region", "intramembrane region"]
longname_molecule_processing = ["initiator methionine", "signal peptide", "transit peptide", "propeptide", "chain",
"peptide"]
longname_regions = ['repeat','calcium-binding region','compositionally biased region','nucleotide phosphate-binding region',
import math
import warnings
import cachetools
from tqdm import tqdm
import ssbio.databases.uniprot
import ssbio.sequence.properties.aggregation_propensity as agg
import ssbio.sequence.properties.kinetic_folding_rate as kfr
import ssbio.sequence.properties.thermostability as ts
from bioservices.uniprot import UniProt
bsup = UniProt()
def convert_bnumber_to_uniprot(bnumber):
"""Map an E. coli locus id (ie. b0003) to its reviewed UniProt ID
Args:
bnumber: E. coli locus ID
Returns:
UniProt ID (reviewed only) - in most cases there should only be one
"""
genes_to_uniprots = dict(bsup.mapping(fr='ENSEMBLGENOME_ID', to='ACC', query=bnumber))
reviewed_uniprots = [x for x in genes_to_uniprots[bnumber] if ssbio.databases.uniprot.uniprot_reviewed_checker(x)]
if len(reviewed_uniprots) > 1:
warnings.warn('{}: more than one reviewed UniProt entry. Returning first mapped ID.'.format(bnumber))
return reviewed_uniprots[0]
import json
import requests
import tempfile
import ssbio.databases.pdb
import ssbio.utils
import os.path as op
from bioservices.uniprot import UniProt
import ssbio.databases.uniprot
bs_unip = UniProt()
def get_pdbs_for_gene(bigg_model, bigg_gene, cache_dir=tempfile.gettempdir(), force_rerun=False):
"""Attempt to get a rank-ordered list of available PDB structures for a BiGG Model and its gene.
Args:
bigg_model: BiGG Model ID
bigg_gene: BiGG Gene ID
Returns:
list: rank-ordered list of tuples of (pdb_id, chain_id)
"""
my_structures = []
# Download gene info