0

我有一个 perl 脚本,它从输入文本文件中获取一些字段并将它们转换为生成更有用的(对我而言)文本文件。

当我在我的 Mac 上运行它时(由真实文件中的几行组成的一个非常小的文件),它会产生正确的输出。它会产生一些警告,粘贴在下面,但是,输出没问题。

当我在我机构的服务器上运行这个完全相同的脚本时,它会返回更多“使用未初始化值”警告,尽管它确实创建了一个输出文件,但它的内容与输入文件逐行完全相同. 我也在用我在我的电脑上测试过的小文件进行尝试。

我感觉这与 perl 的版本有关?我不是管理员,所以我该如何解决这个问题?

服务器上返回的警告:

Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 1.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 1.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 1.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 1.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 1.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 1.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 1.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 1.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 1.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 1.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 1.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 1.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 1.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 1.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 1.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 1.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 1.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 1.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 2.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 2.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 2.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 2.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 2.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 2.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 2.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 2.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 2.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 2.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 2.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 2.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 2.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 2.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 2.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 2.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 2.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 2.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 3.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 3.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 3.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 3.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 3.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 3.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 3.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 3.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 3.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 3.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 3.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 3.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 3.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 3.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 3.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 3.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 3.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 3.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 4.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 4.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 4.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 4.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 4.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 4.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 4.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 4.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 4.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 4.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 4.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 4.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 4.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 4.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 4.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 4.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 4.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 4.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 5.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 5.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 5.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 5.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 5.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 5.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 5.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 5.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 5.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 5.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 5.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 5.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 5.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 5.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 5.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 5.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 5.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 5.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 6.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 6.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 6.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 6.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 6.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 6.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 6.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 6.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 6.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 6.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 6.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 6.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 6.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 6.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 6.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 6.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 6.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 6.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 7.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 7.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 7.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 7.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 7.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 7.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 7.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 7.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 7.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 7.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 7.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 7.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 7.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 7.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 7.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 7.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 7.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 7.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 8.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 8.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 8.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 8.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 8.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 8.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 8.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 8.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 8.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 8.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 8.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 8.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 8.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 8.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 8.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 8.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 8.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 8.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 48, <R2_FILE> line 9.
Use of uninitialized value $Clipped in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 9.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 53, <R2_FILE> line 9.
Use of uninitialized value $Read_Cigar in pattern match (m//) at ../perl/R2_Warrior.pl line 59, <R2_FILE> line 9.
Use of uninitialized value $Matched in negation (-) at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 9.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 64, <R2_FILE> line 9.
Use of uninitialized value $Read_Info in pattern match (m//) at ../perl/R2_Warrior.pl line 73, <R2_FILE> line 9.
Use of uninitialized value $X2 in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 9.
Use of uninitialized value $Read_Seq in substr at ../perl/R2_Warrior.pl line 91, <R2_FILE> line 9.
Use of uninitialized value $X2 in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 9.
Use of uninitialized value $Matched in addition (+) at ../perl/R2_Warrior.pl line 97, <R2_FILE> line 9.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 9.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 9.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 9.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 9.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 9.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 9.
Use of uninitialized value in concatenation (.) or string at ../perl/R2_Warrior.pl line 104, <R2_FILE> line 9.

脚本:

use strict;
use warnings;


my ($Line) = "";
my (@Split_Line) = ();
my (%All_read_and_info_HASH) = ();


open(R2_FILE,"R2_Sample.txt") || die "Sorry I couldn't open the INPUT file: $!\n";
open(OUTPUT, ">R2_Output.txt") || die "Sorry I couldnt create the OUTPUT file: $!\n";

while(<R2_FILE>){

    ### Elimina los \n
    ### Parte cada linea por tabuladores
    chomp;
    $Line = $_;
    @Split_Line = split(/\t+/, $Line);


    ### Guarda los campos de donde se obtiene el resto de la informacion
    my $Read_Name = $Split_Line[0];
    my $Read_ID = $Split_Line[3];
    my $Read_Cigar = $Split_Line[5];
    my $Read_Seq = $Split_Line[9];
    my $Read_Info = $Split_Line[14];


    #print "$Read_Name\t$Read_Cigar\t$Read_Seq\t$Read_Info\n";
    #<STDIN>;


    ##########################################################
    ### Llena el hash de hashes                            ###
    ### Key = $Read_Name                                   ###
    ### La segunda llave, i.e. 'Sequence' son cada uno de  ###
    ### los campos del 0 al 8 del PDF                      ###
    ##########################################################

    my($Clipped, $Matched, $X1, $X2, $Temporal_Seq);

    ### [0]: Guarda la secuencia del read 
    $All_read_and_info_HASH{$Read_Name}{'Sequence'} = $Read_Seq;


    ### [1]: Guarda el numero de nt 'clipeados'
    if ($Read_Cigar =~ /(\d+)S\d+M/){ $Clipped = $1; }
    $All_read_and_info_HASH{$Read_Name}{'Clipped_Nt'} = $Clipped;


    ### [2]: Guarda los primeros N nt de la secuencia completa del read
    $Temporal_Seq = substr($Read_Seq, 0, $Clipped);
    $All_read_and_info_HASH{$Read_Name}{'Non_R2_Sequence'} = $Temporal_Seq;
    $Temporal_Seq = "";


    ### [3]: Guarda el numero de nt matcheados a R2
    if ($Read_Cigar =~ /\d+S(\d+)M/){ $Matched = $1; }
    $All_read_and_info_HASH{$Read_Name}{'R2_Matched_Nt'} = $Matched;


    ### [4]: Guarda los ultimos N nt de la secuencia completa del read (Las bases matcheadas a R2)
    $Temporal_Seq = substr($Read_Seq, -$Matched);
    $All_read_and_info_HASH{$Read_Name}{'R2_Matched_Sequence'} = $Temporal_Seq;
    $Temporal_Seq = "";


    ### [5]: Guarda el CIGAR string
    $All_read_and_info_HASH{$Read_Name}{'CIGAR'} = $Read_Cigar;


    if ($Read_Info =~ /\+(\d+),(\d+)M/){ 
    $X1 = $1; 
    $X2 = $2;

    #print "$X1\t$X2\n";
    #<STDIN>;
    }


    ### [6]: Guarda el numero X1
    $All_read_and_info_HASH{$Read_Name}{'28s_Start'} = $X1;


    ### [7]: Guarda el numero X2
    $All_read_and_info_HASH{$Read_Name}{'28s_Matched_NT'} = $X2;


    ### [8]: Guarda los primeros X2 nt de la secuencia completa del read
    $Temporal_Seq = substr($Read_Seq, 0, $X2);
    $All_read_and_info_HASH{$Read_Name}{'28s_Matched_Sequence'} = $Temporal_Seq;
    $Temporal_Seq = "";


    ### [9]: Calcula 144-([3] + [7])
    $All_read_and_info_HASH{$Read_Name}{'Result'} = (144 - ($Matched + $X2));


    ### [10]: Guarda el sitio de R2 Truncation
    $All_read_and_info_HASH{$Read_Name}{'R2_Truncation'} = $Read_ID;


    print OUTPUT $Read_Name."\t".$All_read_and_info_HASH{$Read_Name}{'Sequence'}."\t".$All_read_and_info_HASH{$Read_Name}{'Clipped_Nt'}."\t".$All_read_and_info_HASH{$Read_Name}{'Non_R2_Sequence'}."\t".$All_read_and_info_HASH{$Read_Name}{'R2_Matched_Nt'}."\t".$All_read_and_info_HASH{$Read_Name}{'R2_Matched_Sequence'}."\t".$All_read_and_info_HASH{$Read_Name}{'CIGAR'}."\t".$All_read_and_info_HASH{$Read_Name}{'28s_Start'}."\t".$All_read_and_info_HASH{$Read_Name}{'28s_Matched_NT'}."\t".$All_read_and_info_HASH{$Read_Name}{'28s_Matched_Sequence'}."\t".$All_read_and_info_HASH{$Read_Name}{'Result'}."\t".$All_read_and_info_HASH{$Read_Name}{'R2_Truncation'}."\n";


    #print $Read_Name."\n".$All_read_and_info_HASH{$Read_Name}{'Sequence'}."\n".$All_read_and_info_HASH{$Read_Name}{'First_N'}."\n".$All_read_and_info_HASH{$Read_Name}{'Sequence'}."\n".$All_read_and_info_HASH{$Read_Name}{'Last_N'}."\n";

    #<STDIN>;
}
close(R2_FILE);
close(OUTPUT);
4

1 回答 1

2

尝试使用

my @Split_Line = split(/\t+/, $Line); 

因为您将其设置在循环块之外。

您也可以像这样设置变量...

 my( $Read_Name,   $Read_ID ,$Read_Cigar , $Read_Seq , $Read_Info ) =  
      split(/\t+/, $Line);
于 2013-05-01T19:43:38.487 回答