生物主题包
子包
子模块
- 生物。图案。收件箱模块
- 生物。图案。集群破坏模块
- 生物。图案。桅杆模块
- 生物。图案。矩阵模块
GenericPositionMatrix
GenericPositionMatrix.__init__()
GenericPositionMatrix.__str__()
GenericPositionMatrix.__getitem__()
GenericPositionMatrix.consensus
GenericPositionMatrix.anticonsensus
GenericPositionMatrix.degenerate_consensus
GenericPositionMatrix.calculate_consensus()
GenericPositionMatrix.gc_content
GenericPositionMatrix.reverse_complement()
GenericPositionMatrix.__firstlineno__
GenericPositionMatrix.__static_attributes__
FrequencyPositionMatrix
PositionWeightMatrix
PositionSpecificScoringMatrix
PositionSpecificScoringMatrix.calculate()
PositionSpecificScoringMatrix.search()
PositionSpecificScoringMatrix.max
PositionSpecificScoringMatrix.min
PositionSpecificScoringMatrix.gc_content
PositionSpecificScoringMatrix.mean()
PositionSpecificScoringMatrix.std()
PositionSpecificScoringMatrix.dist_pearson()
PositionSpecificScoringMatrix.dist_pearson_at()
PositionSpecificScoringMatrix.__annotations__
PositionSpecificScoringMatrix.__firstlineno__
PositionSpecificScoringMatrix.__static_attributes__
PositionSpecificScoringMatrix.distribution()
- Bio.motifs.meme模块
- 生物。图案。最小模块
- 生物基序pfm模块
- 生物.图案.阈值模块
- Bio.motifs.transfac模块
- Bio.motifs.xms模块
模块内容
序列基序分析工具。
Bio.motifs包含核心Motif类别,其中包含各种I/O方法以及序列中的基序比较和基序搜索方法。它还包括解析AlignACE、MEME和MAST程序以及TRANSAC格式文件的输出的功能。
- Bio.motifs.create(instances, alphabet='ACGT')
创建Motif对象。
- Bio.motifs.parse(handle, fmt, strict=True)
解析主题查找程序的输出文件。
- 当前支持的格式(忽略案例):
AlignAce: AlignAce输出文件格式
间谍克星: 集群破坏者位置频率矩阵格式
XMS: XMS矩阵格式
MEME: MEME输出文件主题
最小: MINIMAL MEME输出文件主题
桅杆: MAST输出文件主题
转移: TRANSFAC数据库文件格式
pfm-four-lines:具有四列的通用位置频率矩阵格式。(CIS-BP、HOMER、HOCOMOCO、Neph、Tiffany)
pfm-four-rows: 四行通用位置-频率矩阵格式。(ScerTF、YeTFaSCo、hDPI、iDMMPMM、FlyFactorSurvey、Cys 2 His 2锌指蛋白PWM预测器)
pfm: JASPARs式位置频率矩阵
贾斯帕: JASPARs风格的多重PLM格式
地点: JASPARs风格的网站文件
由于pfm和sites格式的文件只包含一个主题,因此使用Bio.motifs.read()而不是Bio.motifs.parse()更容易。
例如:
>>> from Bio import motifs >>> with open("motifs/alignace.out") as handle: ... for m in motifs.parse(handle, "AlignAce"): ... print(m.consensus) ... TCTACGATTGAG CTGCACCTAGCTACGAGTGAG GTGCCCTAAGCATACTAGGCG GCCACTAGCAGAGCAGGGGGC CGACTCAGAGGTT CCACGCTAAGAGAAGTGCCGGAG GCACGTCCCTGAGCA GTCCATCGCAAAGCGTGGGGC GAGATCAGAGGGCCG TGGACGCGGGG GACCAGAGCCTCGCATGGGGG AGCGCGCGTG GCCGGTTGCTGTTCATTAGG ACCGACGGCAGCTAAAAGGG GACGCCGGGGAT CGACTCGCGCTTACAAGG
如果strict为True(默认值),则如果文件内容不严格符合指定的文件格式,解析器将引发ValueError。
- Bio.motifs.read(handle, fmt, strict=True)
使用指定的文件格式从句柄中读取主题。
它支持与Bio.motifs.parse()相同的格式,但仅适用于包含一个主题的文件。 例如,读取JASPAR风格的pfm文件:
>>> from Bio import motifs >>> with open("motifs/SRF.pfm") as handle: ... m = motifs.read(handle, "pfm") >>> m.consensus Seq('GCCCATATATGG')
或者单一主题的MEME文件,
>>> from Bio import motifs >>> with open("motifs/meme.psp_test.classic.zoops.xml") as handle: ... m = motifs.read(handle, "meme") >>> m.consensus Seq('GCTTATGTAA')
如果手柄不包含记录或包含多个记录,则会引发异常:
>>> from Bio import motifs >>> with open("motifs/alignace.out") as handle: ... motif = motifs.read(handle, "AlignAce") Traceback (most recent call last): ... ValueError: More than one motif found in handle
但是,如果你想从一个包含多个motif的文件中获取第一个motif,这个函数将引发一个异常(如上面的例子所示)。 相反用途:
>>> from Bio import motifs >>> with open("motifs/alignace.out") as handle: ... record = motifs.parse(handle, "alignace") >>> motif = record[0] >>> motif.consensus Seq('TCTACGATTGAG')
如果您想从手柄读取多个记录,请使用Bio.motifs.parse(handle,fdt)函数。
如果strict为True(默认值),则如果文件内容不严格符合指定的文件格式,解析器将引发ValueError。
- class Bio.motifs.Instances(instances=None, alphabet='ACGT')
基类:
list
包含构成主题的序列列表的类。
- __init__(instances=None, alphabet='ACGT')
初始化课程。
- __str__()
返回包含主题序列的字符串。
- count()
计算一个位置的核苷酸数。
- search(sequence)
找到给定序列中图案的位置。
这是一个生成器函数,返回给定序列中motif实例的位置。
- reverse_complement()
计算序列的反向补数。
- __firstlineno__ = 190
- __static_attributes__ = ('alphabet', 'length')
- class Bio.motifs.Motif(alphabet='ACGT', alignment=None, counts=None, instances=None)
基类:
object
代表序列基元的类。
- __init__(alphabet='ACGT', alignment=None, counts=None, instances=None)
初始化课程。
- property mask
- property pseudocounts
- property background
- __getitem__(key)
为key中包含的位置返回新的Motif对象。
>>> from Bio import motifs >>> motif = motifs.create(["AACGCCA", "ACCGCCC", "AACTCCG"]) >>> print(motif) AACGCCA ACCGCCC AACTCCG >>> print(motif[:-1]) AACGCC ACCGCC AACTCC
- property pwm
计算并返回此主题的位置权重矩阵。
- property pssm
计算并返回此主题的特定位置评分矩阵。
- property instances
返回构建主题的序列。
- __str__(masked=False)
返回主题的字符串表示。
- __len__()
返回主题的长度。
请使用此方法(即调用len(m)),而不是直接引用m. size。
- reverse_complement()
将主题的反向补语作为新主题返回。
- __firstlineno__ = 311
- __static_attributes__ = ('__mask', '_background', '_pseudocounts', 'alignment', 'alphabet', 'background', 'counts', 'length', 'mask', 'name', 'pseudocounts')
- property consensus
返回共识序列。
- property anticonsensus
返回从该主题生成的最不可能的模式。
- property degenerate_consensus
返回简并共有序列。
根据D. R. Cavener:“果蝇和脊椎动物中翻译起始位点侧翼的共有序列的比较。核酸研究15(4):1353-1361。(1987)。
TRANSFAC使用相同的规则。
- property relative_entropy
返回一个包含主题每列的相对熵的数组。
- weblogo(fname, fmt='PNG', version=None, **kwds)
使用Berkeley weblogo服务下载并保存weblogo。
需要互联网连接。
版本参数已被弃用并且没有任何作用。
中的参数
**kwds
直接传递给web徽标服务器。目前,该方法使用WebLogo版本3.3。这些是传递给WebLogo 3.3的参数及其默认值;请参阅其网站http://weblogo.threeplusone.com了解更多信息::
'stack_width' : 'medium', 'stacks_per_line' : '40', 'alphabet' : 'alphabet_dna', 'ignore_lower_case' : True, 'unit_name' : "bits", 'first_index' : '1', 'logo_start' : '1', 'logo_end': str(self.length), 'composition' : "comp_auto", 'percentCG' : '', 'scale_width' : True, 'show_errorbars' : True, 'logo_title' : '', 'logo_label' : '', 'show_xaxis': True, 'xaxis_label': '', 'show_yaxis': True, 'yaxis_label': '', 'yaxis_scale': 'auto', 'yaxis_tic_interval' : '1.0', 'show_ends' : True, 'show_fineprint' : True, 'color_scheme': 'color_auto', 'symbols0': '', 'symbols1': '', 'symbols2': '', 'symbols3': '', 'symbols4': '', 'color0': '', 'color1': '', 'color2': '', 'color3': '', 'color4': '',
- __format__(format_spec, **kwargs)
以给定格式返回Motif的字符串表示形式。
- 当前支持的格式:
集群破坏者:集群破坏者位置频率矩阵格式
pfm:JASVAR单位置频率矩阵
jaspar:JASVAR多位置频率矩阵
transfac:TRANSAC类似文件
- format(format_spec)
以给定格式返回Motif的字符串表示形式。
- 当前支持的格式:
集群破坏者:集群破坏者位置频率矩阵格式
pfm:JASVAR单位置频率矩阵
jaspar:JASVAR多位置频率矩阵
transfac:TRANSAC类似文件
- Bio.motifs.write(motifs, fmt, **kwargs)
返回给定格式的主题的字符串表示形式。
- 当前支持的格式(忽略案例):
集群破坏者:集群破坏者位置频率矩阵格式
pfm:JASVAR简单的单位置频率矩阵
jaspar:JASPAR多重PLM格式
transfac:TRANSAC类似文件