我在fasta中有5000条蛋白质序列,其中有假想的蛋白质和功能蛋白,我怎样才能把假想的蛋白质和推测的蛋白质区分开来。假设的蛋白质在标题中有假设这个词,所以我希望我能用一些命令来区分它们。有谁知道python或linux命令来做到这一点吗?像这样的事情
KSADKKSNPTQ,2257-1421 ()蛋白质KSGRRATTRSVSGIDQDVKLNRALWTLAQELRGHLTTA,3593-2535 ()核酸en9 en8 11 en33#,4624-3506 ()
我希望有两个文件,其中一个包含
( PSPTOA )的假想蛋白和其他含有其他蛋白质序列的PSPTOA
发布于 2015-06-21 23:34:09
Biopython有一个FASTA解析器,应该能够执行您想做的事情。获取和使用它的说明在http://biopython.org/DIST/docs/tutorial/Tutorial.html#htoc11上。
在http://www.petercollingridge.co.uk/python-bioinformatics-tools/fasta-parser中,有一个简单的Python脚本,用于读取FASTA文件并将其转换为以头行(以>开头)作为键的字典。我在你们的例子中没有看到这些。您的文件中的标题与序列内容有何区别?
https://gamma2.wordpress.com/2014/01/03/reading-a-fasta-file-with-python/为编写上面提到的相同类型的脚本提供了逐步的指导。将包含“假设蛋白质”的头文件的筛选添加到任何一个文件中都很容易,跳过散列,只需将header+sequence输出写入两个不同的文件,取决于头文件是否匹配。
使用Ruby,bioruby类Bio::Sequence::Common和Bio::FastaFormat具有很好的功能。第一种是混合toFasta方法,用于以FASTA格式编写Bio::Sequence对象。第二个方法可以读取as::Sequence对象中的FASTA文件,并有7个与FASTA头(定义行)相关的方法和6个用于序列的方法。请参阅http://bioruby.open-bio.org/rdoc/Bio/Sequence/Common.html和http://bioruby.open-bio.org/rdoc/Bio/FastaFormat.html的示例程序,它们都是从format.3F开始的。
发布于 2022-05-22 17:32:02
@我希望这个amy帮助,提取没有假设蛋白质的序列,如果有任何建议,请回答,您可以从这些链接https://bioinformatics.stackexchange.com/questions/16378/remove-from-multi-fasta-by-sequence-id https://python.omics.wiki/biopython/examples/read-fasta https://bioinformatics.stackexchange.com/questions/3931/remove-delete-sequences-by-id-from-multifasta或搜索关键字删除/删除序列从https://answerbun.com/上的多快门。
from Bio import SeqIO
import re
import sys
sequences = SeqIO.parse('input.fasta', 'fasta')
filtered = [seq for seq in sequences if 'hypothetical protein' not in seq.description]
with open('output.fasta', 'wt') as output:
SeqIO.write(filtered, output, 'fasta')发布于 2022-05-22 17:50:57
为了只提取假设的蛋白质,请使用下面的代码
from Bio import SeqIO
import re #regular expression optional
import sys # command-line arguments to passed the script optional
sequences = SeqIO.parse('input.fasta', 'fasta')
filtered1 = [seq for seq in sequences if 'hypothetical protein' in seq.description]
with open('hypothetical.fasta', 'wt') as hypothetical:
SeqIO.write(filtered1, hypothetical, 'fasta')https://stackoverflow.com/questions/30970109
复制相似问题