Using CummeRbund:
diff_genes=subset(diffData(genes(diff_data)),(significant=='yes'))
where diffdata is the initial diffout folder generated after running cuffdiff and read in R using readCufflinks
Now, write out the diff_genes(list of significant DE genes)
write.table(diff_genes,'diff_genes.txt',sep='\t',quote=FALSE,row.names=FALSE,col.names=TRUE)
Using awk in terminal (In case you just need the list freshly out from cuff_diff without any R manipulation)
awk '$14=="yes"' diff_out/gene_exp.diff > diff_genes.txt
where diffout is again the output folder containing results of cuffdiff and geneexp.diff contains the list of genes tested for DE. In most cases the 14th column is the column which says the gene is significantly expressed or not, if you have some other column replace the number 14 by that.
If just interested in number of DE genes, then
awk '$14=="yes"' diff_out/gene_exp.diff | wc -l
Cheers
Sukhdeep..
Thanks for a wonderful script. It worked for me but the output file include non-significant genes.. What am I doing wrong.. I want the sig genes only.
Please include in your answer how to replace the XLOC thingy with the real gene id. Thanks.
Fahim
Hi Fahim,
Either you should as a new question or add a new comment, don't put these as answers unless what you are writing is a real answer.
You have to use
-gwith an appropriate GTF file to be used to with cufflinks to get gene id's.XLOC are the cufflinks locus id's which are mapped to the locus information in the provided gtf file to fetch the geneids
http://seqanswers.com/forums/showthread.php?t=19079
Cheers