Grep 如何确定比特定尺寸更高的重叠数

Grep 如何确定比特定尺寸更高的重叠数,grep,bioinformatics,Grep,Bioinformatics,我希望你做得很好 请给我一个fasta文件,比如 >contig1 sequence >contig2 sequence >contig3 >sequence 每个序列都有它的长度 我想确定大于9000的重叠数(因此序列长度大于9000) 谢谢你你已经标记了grep,所以grep-c.{9000\}你的\u fasta.fa可能是最简单的方法 一种更为“生物信息学”的方法是使用seqkit():seqkit seq-m 9000您的_fasta.fa>newfile.t

我希望你做得很好

请给我一个fasta文件,比如

>contig1
sequence
>contig2
sequence
>contig3
>sequence
每个序列都有它的长度 我想确定大于9000的重叠数(因此序列长度大于9000)


谢谢你

你已经标记了grep,所以
grep-c.{9000\}你的\u fasta.fa
可能是最简单的方法

一种更为“生物信息学”的方法是使用seqkit():
seqkit seq-m 9000您的_fasta.fa>newfile.txt
将超过9000个碱基的序列提取到“newfile.txt”,并使用
grep-c“>”newfile.txt
计算长度>9000的序列数


此外,这里还有一系列您可以调整的awk/perl/BioWork解决方案:

如果您安装了,您可以执行此任务。然后,您可以将下面的脚本作为count_contigs.pl保存在名为“contigs.fasta”的contigs文件所在的目录中,并使用
perl count_contigs.pl
运行脚本。它将从输入文件中计算长度超过9000 bp的重叠并打印结果

#!/usr/bin/perl
use strict;
use warnings;    
use Bio::SeqIO;

# Setting minimum length to be more than 9000
my $min_len = 9000;

# Reading the input fasta file
my $seqio_in = Bio::SeqIO->new(-file => "contigs.fasta", 
                                     -format => "fasta" );
# Setting the counter
my $counter = 0; 

# Counting sequences if length > min_len     
while ( my $seq = $seqio_in->next_seq ) {
    if ( $seq->length  >  $min_len ) {
        $counter++;
    }
}

# Print the result
print "There are '$counter' sequences that are longer than $min_len\n"; 

会让你开始。是的,但是序列不止一行,你必须提供一个。不要以为我们可以看到你的数据,只有你有权访问它。我们鼓励通过研究、尝试提出问题,并在需要时(如您的案例)提供清晰、最少的输入文件和预期输出。我在标签中看到了grep,这是您问题的要求吗?或者任何基于Linux的系统都能做到?啊,塞德?有python语言吗?