text
stringlengths
0
828
motifs = [x for x in self.rabf_motifs if x[1] >= beg and x[2] <= end]
if motifs:
matches = int(pairwise2.align.globalxx('12345', ''.join(str(x[0]) for x in motifs))[0][2])
if matches >= self.motif_number:
return True
return False"
4926,"def summarize(self):
"""""" G protein annotation summary in a text format
:return: A string summary of the annotation
:rtype: str
""""""
data = [
['Sequence ID', self.seqrecord.id],
['G domain', ' '.join(self.gdomain_regions) if self.gdomain_regions else None],
['E-value vs rab db', self.evalue_bh_rabs],
['E-value vs non-rab db', self.evalue_bh_non_rabs],
['RabF motifs', ' '.join(map(str, self.rabf_motifs)) if self.rabf_motifs else None],
['Is Rab?', self.is_rab()]
]
summary = ''
for name, value in data:
summary += '{:25s}{}\n'.format(name, value)
if self.is_rab():
summary += '{:25s}{}\n'.format('Top 5 subfamilies',
', '.join('{:s} ({:.2g})'.format(name, score) for name, score
in self.rab_subfamily_top5))
return summary"
4927,"def write(self):
""""""Write sequences predicted to be Rabs as a fasta file.
:return: Number of written sequences
:rtype: int
""""""
rabs = [x.seqrecord for x in self.gproteins.values() if x.is_rab()]
return SeqIO.write(rabs, self.tmpfname + '.phase2', 'fasta')"
4928,"def check(self):
"""""" Check if data and third party tools, necessary to run the classification, are available
:raises: RuntimeError
""""""
pathfinder = Pathfinder(True)
if pathfinder.add_path(pathfinder['superfamily']) is None:
raise RuntimeError(""'superfamily' data directory is missing"")
for tool in ('hmmscan', 'phmmer', 'mast', 'blastp', 'ass3.pl', 'hmmscan.pl'):
if not pathfinder.exists(tool):
raise RuntimeError('Dependency {} is missing'.format(tool))"
4929,"def create_brand(cls, brand, **kwargs):
""""""Create Brand
Create a new Brand
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.create_brand(brand, async=True)
>>> result = thread.get()
:param async bool
:param Brand brand: Attributes of brand to create (required)
:return: Brand
If the method is called asynchronously,
returns the request thread.
""""""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return cls._create_brand_with_http_info(brand, **kwargs)
else:
(data) = cls._create_brand_with_http_info(brand, **kwargs)
return data"
4930,"def delete_brand_by_id(cls, brand_id, **kwargs):
""""""Delete Brand
Delete an instance of Brand by its ID.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.delete_brand_by_id(brand_id, async=True)
>>> result = thread.get()
:param async bool
:param str brand_id: ID of brand to delete. (required)
:return: None
If the method is called asynchronously,
returns the request thread.
""""""
kwargs['_return_http_data_only'] = True
if kwargs.get('async'):
return cls._delete_brand_by_id_with_http_info(brand_id, **kwargs)
else:
(data) = cls._delete_brand_by_id_with_http_info(brand_id, **kwargs)
return data"
4931,"def get_brand_by_id(cls, brand_id, **kwargs):
""""""Find Brand
Return single instance of Brand by its ID.
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=True
>>> thread = api.get_brand_by_id(brand_id, async=True)
>>> result = thread.get()