Skip to content

Commit ad061ef

Browse files
committed
reports correct length for sequence in fasta file
1 parent d6c7e1d commit ad061ef

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

util/gff3_file_to_proteins.pl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@
124124
next;
125125
}
126126

127+
128+
my $seqlen = length($seq);
129+
if ($seq =~ /\*$/) {
130+
$seqlen -= 1; # dont count stop codon
131+
}
132+
133+
127134
$seq =~ s/(\S{60})/$1\n/g; # make fasta format
128135
chomp $seq;
129136

@@ -148,12 +155,7 @@
148155
#if ($seq_type eq 'prot' || $seq_type eq 'CDS') { # this was a bad idea, just use the original id.
149156
# $isoform_id = "cds.$isoform_id";
150157
#}
151-
152-
$seqlen = length($seq);
153-
if ($seq =~ /\*$/) {
154-
$seqlen -= 1; # dont count stop codon
155-
}
156-
158+
157159
print ">$isoform_id $gene_id $locus_string $com_name len:$seqlen $asmbl_id:$model_lend-$model_rend($orientation)\n$seq\n";
158160
}
159161
}

0 commit comments

Comments
 (0)