Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Araformatics group
Araformatics project
Commits
7d689b4f
Commit
7d689b4f
authored
Dec 08, 2021
by
Patino Medina, Laura
Browse files
Replace GOenrichment_proj.R
parent
1feb0c33
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/GOenrichment_proj.R
View file @
7d689b4f
.libPaths
(
c
(
'/local/data/course/project/araformatics/pipeline/test_R'
,
.libPaths
()))
#!/usr/bin/env Rscript
#BIF30806 Project group: Araformatic
#(2021)
#GO enrichment
...
...
@@ -7,11 +7,11 @@
#expression analysis
# Scrip written based on:
# https://ucdavis-bioinformatics-training.github.io/2018-June-RNA-Seq-Workshop/friday/enrichment.html
# Documentation available of topGO usage
# https://www.r-bloggers.com/2015/09/passing-arguments-to-an-r-script-from-command-lines/
# Documentation available on topGO usage
#Usage: Rscript GOenrichment_proj.R input_file.txt
# input_file: txt file, genes as rows, leafs as columns and values
# are adjusted p value from DGE
#Output: txt file and a pdf GO graph for each leaf(sample) in the input file
#Take arguments from command line
args
=
commandArgs
(
trailingOnly
=
TRUE
)
...
...
@@ -26,10 +26,10 @@ if (length(args)==0) {
#Install packages from source.
source
(
"https://bioconductor.org/biocLite.R"
)
biocLite
(
c
(
"topGO"
,
"KEGGREST"
,
"org.At.tair.db"
,
"Rgraphviz"
))
if
(
!
requireNamespace
(
"BiocManager"
,
quietly
=
TRUE
))
install.packages
(
"BiocManager"
)
#
source("https://bioconductor.org/biocLite.R")
#
biocLite(c("topGO", "KEGGREST", "org.At.tair.db", "Rgraphviz"))
#
if (!requireNamespace("BiocManager", quietly = TRUE))
#
install.packages("BiocManager")
#BiocManager::install("topGO")
#BiocManager::install("AnnotationDbi")
...
...
@@ -44,9 +44,8 @@ library(Rgraphviz)
library
(
multtest
,
verbose
=
FALSE
)
####### ADJUSTED P-VALUE #http://rileylab.org/wp-content/uploads/2016/08/multtest.pdf
#useful info: #multiple_dexp[,c(1,which(colnames(multiple_dexp) == current_leaf))]
#GO enrichment on multiple lea
f
s(samples)
#GO enrichment on multiple lea
ve
s(samples)
#list with samples names
multiple_dexp
<-
read.delim
(
args
[
1
],
stringsAsFactors
=
F
)
...
...
@@ -74,7 +73,7 @@ for(leaf in sample_names[2:length(sample_names)]){
geneSelectionFun
=
function
(
x
)(
x
==
1
),
annot
=
annFUN.org
,
mapping
=
"org.At.tair.db"
)
#Run the Fishers exact Test (raw p-vals)
#Run the Fishers exact Test (raw p-vals)
fisher_sample
<-
runTest
(
GOdata_sample
,
algorithm
=
"elim"
,
statistic
=
"fisher"
)
sample_result
<-
GenTable
(
GOdata_sample
,
raw.p.value
=
fisher_sample
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment