diff --git a/scripts/get_fasta_lengths.pl b/scripts/get_fasta_lengths.pl index b45ce78..740d84b 100644 --- a/scripts/get_fasta_lengths.pl +++ b/scripts/get_fasta_lengths.pl @@ -21,17 +21,19 @@ open (OUT, ">$result_file") or die "Cannot open file!!!!: $!"; $_ = ; -if (/>(.*)/) { - print OUT $1,"\t"; +if (/>(.*)/) { + my @line_splits = split /\s+/, $1; + print OUT $line_splits[0],"\t"; } my $length = 0; while () { chomp; - if (/>(.*)/) { + if (/>(.*)/) { + my @line_splits = split /\s+/, $1; print OUT $length,"\n"; $length = 0; - print OUT $1,"\t"; + print OUT $line_splits[0],"\t"; } else { $length += length($_);