Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print item.organism, item.distance, item.domains, \
item.statistics.get('Charge', '').strip()
class EnsemblComparaTranscript:
"""Hold comparative information retrieved from Ensembl on a transcript.
"""
def __init__(self, organism, g_id, t_id, p_id):
self.organism = organism
self.g_id = g_id
self.t_id = t_id
self.p_id = p_id
self.distance = None
self.domains = []
self.statistics = {}
class DistanceVisitor(newick.tree.TreeVisitor):
def __init__(self):
self.graph = networkx.Graph()
def pre_visit_edge(self, src, b, l, dest):
self.graph.add_edge(repr(src), repr(dest), l)
class EnsemblComparaRest:
"""Provide a REST-like API interface to Ensembl.
"""
def __init__(self, cache_dir):
self._base_url = "http://www.ensembl.org"
self._cache_dir = cache_dir
if not(os.path.exists(cache_dir)):
os.makedirs(cache_dir)
def protein_stats(self, organism, gene_id, tx_id):