Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ViSEAGO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
A compter du 1er avril, attention à vos pipelines :
Nouvelles limitations de Docker Hub
Show more breadcrumbs
UMR-BOA
ViSEAGO
Commits
0c6a1ed8
Commit
0c6a1ed8
authored
4 years ago
by
Aurelien Brionne
Browse files
Options
Downloads
Patches
Plain Diff
merge_enrich_terms_upgrade
parent
bddff533
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
DESCRIPTION
+1
-1
1 addition, 1 deletion
DESCRIPTION
NEWS
+1
-0
1 addition, 0 deletions
NEWS
R/merge_enrich_terms.R
+36
-81
36 additions, 81 deletions
R/merge_enrich_terms.R
README.md
+1
-1
1 addition, 1 deletion
README.md
vignettes/mouse_bionconductor.Rmd
+2
-3
2 additions, 3 deletions
vignettes/mouse_bionconductor.Rmd
with
41 additions
and
86 deletions
DESCRIPTION
+
1
−
1
View file @
0c6a1ed8
Package: ViSEAGO
Version: 1.3.
6
Version: 1.3.
7
Title: ViSEAGO: a Bioconductor package for clustering biological functions using Gene Ontology and semantic similarity
Author: Aurelien Brionne [aut, cre],
Amelie Juanchich [aut],
...
...
This diff is collapsed.
Click to expand it.
NEWS
+
1
−
0
View file @
0c6a1ed8
...
...
@@ -72,4 +72,5 @@ CHANGES IN VERSION 1.3
o show_heatmap() upgrade
o upset print update
o merge_enrich_terms upgrade pvalue cutoff
o merge_enrich_terms globale upgrade
This diff is collapsed.
Click to expand it.
R/merge_enrich_terms.R
+
36
−
81
View file @
0c6a1ed8
...
...
@@ -151,7 +151,7 @@ setMethod(
unlist
(
lapply
(
seq_along
(
Input
),
function
(
x
){
# extract
quering objects names
# extract quering objects names
x
=
Input
[[
x
]]
# check existence
...
...
@@ -160,7 +160,7 @@ setMethod(
# check if available
available
<-
x
%in%
values
# stop if not
# stop if not
found
if
(
!
all
(
available
)){
stop
(
paste
(
"objects not found:"
,
paste
(
x
[
!
available
],
collapse
=
", "
),
sep
=
"\n"
))
}
...
...
@@ -193,7 +193,7 @@ setMethod(
# check ontology
if
(
length
(
check.onto
)
>
1
){
# stop if more than one
go
data by list
# stop if more than one
topGO
data by list
stop
(
"Only one ontology supported"
)
}
...
...
@@ -312,34 +312,25 @@ setMethod(
}
# objects type
if
(
sum
(
obj.type
%in%
"topGOresult"
)
<
1
){
if
(
sum
(
obj.type
%in%
"topGOresult"
)
>
1
){
# stop if more than one godata by list
stop
(
"
At least
one topGOresult object
need
ed by list"
)
stop
(
"
Only
one topGOresult object
is support
ed by list"
)
}
## find and extract pvalues
#
load GOdata
#
find topGOresult
pos
=
which
(
obj.type
==
"topGOresult"
)
# tested algorithm
algorithms
<-
Data
[
pos
]
# extract significant pvalues results
unlist
(
lapply
(
algorithms
,
function
(
y
){
# extract scores
pvalues
<-
topGO
::
score
(
y
)
# extract names of enrich terms
as.vector
(
names
(
pvalues
[
pvalues
<
as.numeric
(
sub
(
"^.+[[:space:]]"
,
""
,
slot
(
y
,
"testName"
)))]
)
)
})
# extract scores
pvalues
<-
topGO
::
score
(
Data
[[
pos
]])
# extract names of enrich terms
as.vector
(
names
(
pvalues
[
pvalues
<
as.numeric
(
sub
(
"^.+[[:space:]]"
,
""
,
slot
(
Data
[[
pos
]],
"testName"
)))]
)
)
})
...
...
@@ -400,7 +391,7 @@ setMethod(
GOdata
=
Data
[[
pos
]]
# tested algorithm
algorithm
s
<-
Data
[
-
pos
]
algorithm
<-
Data
[
-
pos
]
## extract some statistics from initial GOdata object (before enrichment test)
...
...
@@ -680,47 +671,21 @@ setMethod(
## extract pvalue according the algorithm results
# extract pvalues results
pvalues
<-
lapply
(
seq_along
(
algorithms
),
function
(
y
){
# extract all pvalues from topGOresult
pvalue
<-
topGO
::
score
(
algorithms
[[
y
]])
# select pvalues from topGOresult
pvalue
<-
pvalue
[
GOs
]
# extract pvalue in data.table
pvalue
<-
data.table
(
GO.ID
=
names
(
pvalue
),
pvalue
=
as.numeric
(
format
(
pvalue
,
scientific
=
T
)),
round
(
-
log10
(
pvalue
),
digits
=
2
)
)
# ordering pvalue by go term
names
(
pvalue
)[
ncol
(
pvalue
)]
=
"-log10_pvalue"
if
(
y
>
1
){
# remove GO.ID
pvalue
[,
"GO.ID"
:=
NULL
]
}
# return
pvalue
})
# convert to data.table
pvalues
=
data.table
(
do.call
(
"cbind"
,
pvalues
))
# algoritms
algo
=
vapply
(
algorithms
,
function
(
x
){
slot
(
x
,
"algorithm"
)},
""
)
# if use of different algorithms
if
(
length
(
algo
)
>
1
){
# extract all pvalues from topGOresult
pvalue
<-
topGO
::
score
(
algorithm
[[
1
]])
# select pvalues from topGOresult
pvalue
<-
pvalue
[
GOs
]
# extract pvalue in data.table
pvalues
<-
data.table
(
GO.ID
=
names
(
pvalue
),
pvalue
=
as.numeric
(
format
(
pvalue
,
scientific
=
T
)),
`-log10_pvalue`
=
round
(
-
log10
(
pvalue
),
digits
=
2
)
)
# add names
names
(
pvalues
)[
-1
]
<-
paste
(
rep
(
algo
,
each
=
2
),
names
(
pvalues
)[
-1
],
sep
=
"."
)
}
# algorithm
algo
=
slot
(
algorithm
[[
1
]],
"algorithm"
)
# return input params
assign
(
...
...
@@ -756,29 +721,19 @@ setMethod(
Results
<-
Results
[
!
is.na
(
Results
$
GO.ID
)]
# extract pvalue threshold
p
<-
unique
(
vapply
(
algorithms
,
function
(
x
){
as.numeric
(
sub
(
"^.+[[:space:]]"
,
""
,
slot
(
x
,
"testName"
)))},
0
))
# stop if more than one pvalue threshold among comparison
if
(
length
(
p
)
>
1
){
stop
(
"Only one pvalue theshold is allowed by list element."
)}
p
<-
as.numeric
(
sub
(
"^.+[[:space:]]"
,
""
,
slot
(
algorithm
[[
1
]],
"testName"
)))
# Remove gene ID and symbol if GO term not significant
Results
[
Results
$
pvalue
>=
p
,
`:=`
(
Significant_genes
=
NA
,
Significant_genes_symbol
=
NA
)]
if
(
!
is.null
(
names
(
Input
))){
# add GOdata name
if
(
x
==
1
){
# add GOdata name in the header
names
(
Results
)[
-1
]
<-
paste
(
names
(
Input
)[
x
],
names
(
Results
)[
-1
],
sep
=
"."
)
}
else
{
# add GOdata name in the header
names
(
Results
)[
-1
]
<-
paste
(
names
(
Input
)[
x
],
names
(
Results
)[
-1
],
sep
=
"."
)
}
# add GOdata name in the header
names
(
Results
)[
-1
]
<-
paste
(
names
(
Input
)[
x
],
names
(
Results
)[
-1
],
sep
=
"."
)
}
# return Results
...
...
This diff is collapsed.
Click to expand it.
README.md
+
1
−
1
View file @
0c6a1ed8
...
...
@@ -27,7 +27,7 @@ remotes::install_gitlab(
devtools
::
build
(
"ViSEAGO"
)
# install package (from R console)
install.packages
(
"ViSEAGO_1.3.
6
.tar.gz"
,
repos
=
NULL
,
type
=
"source"
)
install.packages
(
"ViSEAGO_1.3.
7
.tar.gz"
,
repos
=
NULL
,
type
=
"source"
)
```
## Citation
...
...
This diff is collapsed.
Click to expand it.
vignettes/mouse_bionconductor.Rmd
+
2
−
3
View file @
0c6a1ed8
...
...
@@ -174,7 +174,7 @@ BP_VirginvsPregnant<-ViSEAGO::create_topGOdata(
)
```
Now, we perform the GO enrichment tests for BP category with Fisher's exact test and *elim* algorithm using `topGO::runTest` method.
Now, we perform the GO enrichment tests for BP category with Fisher's exact test and *elim* algorithm using `topGO::runTest` method.
<u>NB</u>: p-values of enriched GO terms are not adjusted and considered significant if below 0.01.
...
...
@@ -209,8 +209,7 @@ The printed table contains for each enriched GO terms, additional columns includ
```{r Enrichment_merge}
# merge topGO results
ViSEAGO::
BP_sResults<-merge_enrich_terms(
BP_sResults<-ViSEAGO::merge_enrich_terms(
Input=list(
PregnantvsLactate=c(
"BP_PregnantvsLactate",
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment