Hi i have row counts from featurecounts I want to calculate tpm, and for that I want to calculate gene length correctly I'm not sure what is the right way doing it do I need Total genomic span of the gene or Sum of non-overlapping exonic regions
For example running this command on a gtf file is good? awk '$3 == "exon" { match($0, /gene_id "([^"]+)"/, gene); gene_id = gene[1]; length[gene_id] += $5 - $4 + 1 } END { for (id in length) print id, length[id] }' gencode.v34.chr_patch_hapl_scaff.annotation.gtf > gene_lengths_cleaned.tsv