Hi!! I need to try fpkm and fpm on my data for compare with other experiments
I import my data using HTseqcount not txtimport so I have this error:
fpkm(dds1)
Error in fpkm(dds1) : rowRanges(object) has all ranges of zero width.
the user should instead supply a column, mcols(object)$basepairs,
which will be used to produce FPKM values
You can use just fpm() which does not require that you supply a column with the number of basepairs of each gene.
Or, if you're not able to come up with the bp length of each gene as it says in the message above, it may be easier for you to just run software like Salmon, Sailfish or kallisto to produce TPM values (for a sample this is scalar equivalent to FPKM). It takes a few minutes per sample. These software are run from the command line, and can be imported to R with the Bioconductor package tximport.