mkatari-bioinformatics-august-2013-deseq
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
mkatari-bioinformatics-august-2013-deseq [2013/08/23 15:53] – mkatari | mkatari-bioinformatics-august-2013-deseq [2013/08/23 16:28] – mkatari | ||
---|---|---|---|
Line 1: | Line 1: | ||
[[mkatari-bioinformatics-august-2013|Back to Manny' | [[mkatari-bioinformatics-august-2013|Back to Manny' | ||
- | Here we will discuss how to create an R script (DESeq.R) that can be executed on HPC. Majority of the script | + | Here we will discuss how to create an R script (DESeq.R) that can be executed on HPC. This script |
If you are going to run DESeq in R on your desktop you will have to make sure DESeq is already installed. | If you are going to run DESeq in R on your desktop you will have to make sure DESeq is already installed. | ||
Line 11: | Line 11: | ||
</ | </ | ||
- | However to make the script | + | Once we have installed |
< | < | ||
- | mannyLibPaths = '/ | ||
.libPaths(new='/ | .libPaths(new='/ | ||
</ | </ | ||
Line 24: | Line 23: | ||
</ | </ | ||
- | Now in our script we will use a function (commandArgs) that will allow us to read in arguments from command line automatically. | + | Now in our script we will use a function (commandArgs) that will allow us to read in arguments from command line automatically. |
< | < | ||
Line 33: | Line 32: | ||
</ | </ | ||
- | This will save all the words as a character vector | + | Here we are saving |
An example of the count data file is provided [[https:// | An example of the count data file is provided [[https:// | ||
Line 95: | Line 94: | ||
< | < | ||
- | pdf(" | + | maFile = paste(pathToOutputDir, |
+ | pdf(maFile) | ||
plotMA(res) | plotMA(res) | ||
dev.off() | dev.off() | ||
</ | </ | ||
- | #To get the genes that have FDR of 10% | + | #To get the genes that have FDR of 10% and save it in the output directory. |
+ | < | ||
+ | resSig = res[ which(res$padj < 0.1), ] | ||
+ | |||
+ | outfile = paste(pathToOutputDir," | ||
write.table(resSig, | write.table(resSig, | ||
- | | + | |
sep=" | sep=" | ||
col.names=T, | col.names=T, | ||
row.names=F, | row.names=F, | ||
quote=F) | quote=F) | ||
+ | </ | ||
- | #DESeq manual: http://www.bioconductor.org/packages/release/bioc/vignettes/DESeq/inst/doc/DESeq.pdf | + | Now the beauty of the script is that a user does not need to start R or even know how to use R to run the script. Simply call the script as any command and the results will be saved in an output directory. This is also great way to build a workflow of several R functions. The command to run the script is shown below. Feel free to put it in your sbatch file. |
+ | |||
+ | < | ||
+ | /export/apps/R/3.0.0/bin/Rscript | ||
+ | </ |
mkatari-bioinformatics-august-2013-deseq.txt · Last modified: 2015/08/21 14:13 by mkatari