Hello,
I used the command which is in the README.md file to get the transcript_length from a gtf file like the following:
cat gtf-file | awk -F'\t' '{if($3=="transcript") {split($9,a,";"); print a[1]"\t"$5-$4};}' | sed 's/[transcript_id |"|]//g' > transcript_length.txt
For Eg: Let's say I have the transcript transcript_002 with start and end positions (42939 49164) with the above command, I got the following output:
transcript_id length
transcript_002 6225
But when I used another command which is from here https://gist.github.com/sp00nman/10372555
awk -F"\t" '$3=="transcript" {ID=substr($9, length($9)-16, 15); L[ID]+=$5-$4+1}END{for(i in L){print i"\t"L[i]}}' gtf-file
I got another output:
transcript_id length
transcript_002 6226
Which is the right one?