Question: Question about using DESeq2 package to calculate FPKM
gravatar for lyrae
17 months ago by
lyrae0 wrote:

Dear  Michael Love:

I used fpkm(dds) form DESeq2 R package to calculate fpkm , the progress did not show any error.

The I summed all gene's fpkm value belong to 1 sample, and the sum is 400003.3, which is far from 1000000, I just want to check if i made some mistake during the calculation.

Here is the comand line I used :

raw_count<-read.csv(file.choose(),header = T,row.names = 1)# input raw_count
head(raw_count) # check

condition <- factor(c('A','A','A','B','B','B'))# treatment

dds <- DESeqDataSetFromMatrix(raw_count, DataFrame(condition), ~ condition)# dds
nrow(dds)# check

G_range<-read.csv(file.choose(),header = T,row.names = 1)# Grangelist were obtained form gff3 file, just like the table showed below.

gene_id CHR start end
UN1G000010 Chr1 2952 4284
UN1G000020 Chr1 5474 14089
UN1G000030 Chr1 18684 21806
UN1G000040 Chr1 22969 27457
UN1G000050 Chr1 30604 32551
UN1G000550 Chr1 37706 39576

G_range_list<-makeGRangesFromDataFrame(G_range)# get list
rowRanges(dds) <- G_range_list

#Cal fpkm
head(fpkm(dds))# check 

write.csv(fpkm(fkpm_deseq2_dds),'G:/fpkm.csv')#output FPKM


deseq2 fpkm() • 319 views
ADD COMMENTlink modified 17 months ago by Michael Love25k • written 17 months ago by lyrae0
Answer: Question about using DESeq2 package to calculate FPKM
gravatar for Michael Love
17 months ago by
Michael Love25k
United States
Michael Love25k wrote:

FPKM don’t sum to 1,000,000, the standard TPM and CPM/FPM do. But also we have a robust version of normalization such that even our “FPM” don’t sum to 1,000,000 (it is controlled by an argument which you can turn off, see the help). This makes them robust for comparison across samples for cases such as: one highly expressed gene changes its level across sample but none others do. Robust normalization can handle this while strict compositional measures will induce changes to all genes. You may want one or the other so we have an argument that controls it.

ADD COMMENTlink written 17 months ago by Michael Love25k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 389 users visited in the last hour