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
fkpm_deseq2_dds<-DESeq(dds)
fpkm(fkpm_deseq2_dds)
head(fpkm(dds))# check
write.csv(fpkm(fkpm_deseq2_dds),'G:/fpkm.csv')#output FPKM