【问题标题】:Emboss Cons for getting consensus sequence for many files, not just oneEmboss Cons 用于获得许多文件的一致序列,而不仅仅是一个文件
【发布时间】:2016-06-11 11:11:41
【问题描述】:

我安装并配置了 emboss,并且可以运行简单的命令行参数来获得一个先前对齐的 multifasta 文件的一致性:

% 缺点

从多重比对中创建一致序列

输入(对齐)序列集:dna.msf

输出序列[dna.fasta]:aligned.cons

这非常适合一次处理一个文件,但我要处理数百个文件。 我已经开始编写一个带有 foreach 循环的 perl 脚本来尝试为每个文件处理它,但我想我需要在脚本之外运行这些命令。关于如何运行命令行友好程序以从先前对齐的 multifasta 文件中连续获取多个文件的 fasta 格式的单个一致序列的任何线索?我不必使用浮雕——我可以使用另一个程序。 到目前为止,这是我的代码:

   #!/usr/bin/perl 
   use warnings; 
   use strict; 

   my $dir = ("/Users/roblogan/Documents/Clustered_Barcodes_Aligned");

    my @ArrayofFiles = glob "$dir/*"; #put all files in the directory into an array

    #print join("\n", @ArrayofFiles), "\n";  #diagnostic print

    foreach my $file (@ArrayofFiles){
            print 'cons', "\n";
            print "/Users/roblogan/Documents/Clustered_Barcodes_Aligned/Clustered_Barcode_Number_*.*.Sequences.txt.out", "\n";
            print "*.*.Consensus.txt", "\n"; 
    } 

【问题讨论】:

  • 您的print 语句——这是命令的外观吗?换句话说,你手动运行的命令到底是什么?
  • 请问您要使用哪种 EMBOSS 工具?
  • 嗨 Arijit-我正在使用 EMBOSS CONS,如问题标题所示。嗨zdim,我手动成功运行的确切命令是:1)缺点2)命名对齐的文件输入3)命名共识文件输出,如问题中给出的示例(粗体)。名称可以更改,提示“缺点”不能。我想放入工作流程的文件因数字而异,在我的打印声明中用 * 表示。
  • 哦,我明白了——这是一个交互式工具。您启动它,然后在它的提示下输入内容。对不起,我错过了,谢谢。这有点不同。该工具是否具有某种“批处理”模式?

标签: perl bioinformatics fasta consensus emboss


【解决方案1】:

EMBOSS cons 有两个强制限定符:

  1. -序列(提供输入序列)

  2. - outseq(用于输出)。

因此您需要将上述内容提供给字段。

现在稍微改变你的代码来运行多个程序:

my $count=1;
foreach my $file (@ArrayofFiles){
            $output_path= "/Users/roblogan/Documents/Clustered_Barcodes_Aligned/";
            my $output_file = $output_path. "out$count";# please change here to get your desired output filename 
            my $command = "cons -sequence '$file' -outseq '$output_file' "; 
            system($command);
            $count ++;
} 

希望上面的代码对你有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-12-29
    • 2014-08-27
    • 1970-01-01
    • 2020-12-13
    • 2023-03-23
    • 1970-01-01
    • 2011-12-18
    相关资源
    最近更新 更多