Previously i asked, this question deseq2 and dexseq for multiple tissue from wildtype only
Based on the response and some reading i used this design,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sample7 |
tissue7 |
sample7 |
tissue7 |
#design dds <- DESeqDataSetFromMatrix(countData = data, colData =colData, design = ~tissue) dds <- estimateSizeFactors(dds) #filter low counts idx <-rowSums(counts(dds, normalize=TRUE) >= 19 ) >= 2 deseq2.dds <- dds[idx,] dds <- DESeq(dds)
what i am trying to do next is compare tissue1 with every other tissue and compare tissue1 with tissue 2 , tissue 2 with 3 so on and so forth, using contrast function,
#comparison 1 comp1 <- results(dds, contrast = c("tissue", "tissue1", "tissue2")) #similarly for others and write it to a text file.
I read each file again
comp1.DE <-read.table("tissue1Vstissue2") #similarly for other comparsions
#create a matrix DE.mat<-cbind(comp1.DE[,c(1,2)],comp2.DE[,2],comp3.DE[,2], comp4.DE[,2],comp5.DE[,2],comp6.DE[,2]) #column 2 logfc rownames(DE.mat)<-DE.mat$V1 #rownamesgeneid colnames(DE.mat)<-c("Comp1", "Comp2", "Comp3", "Comp4", "Comp5", "Comp6") DE.mat<-DE.mat[,-1] pheatmap(DE.mat,fontsize_col=20, show_rownames=F)
This gives me all the the rows from each comparison
what i would like help is when i filter each comparison on only significant genes after reading the files,
comp1.DE <-read.table("tissue1Vstissue2.txt") comp1.DE.f <- filter(comp1.DE, comp1.DE$padj < 0.01)#similarly for other comparisons
I end up with diffrent number of each for each comparison, and hence cannot plot heatmap.
Is this a reasonable approach or is there an better approach, if yes could someone please help me with plotting heatmaps with different number of rows.
many thanks.
Thought so, was trying to push my luck here thank you