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
umrf
ranomaly
Commits
57aae0a6
Commit
57aae0a6
authored
Jul 02, 2021
by
Etienne Rifa
Browse files
resolve metagenomeq bug (thx Philippe Ruiz)
closes
#14
comment plotArrow bug
#15
parent
06ee0652
Pipeline
#36696
passed with stage
in 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
R/metagenomeseq_fun.R
View file @
57aae0a6
...
...
@@ -31,11 +31,11 @@ metagenomeseq_fun <- function(data = data, output = "./metagenomeseq/", column1
}
if
(
!
dir.exists
(
output
)){
dir.create
(
output
)
dir.create
(
output
,
recursive
=
TRUE
)
}
ranks
<-
c
(
"Domain"
,
"Phylum"
,
"Class"
,
"Order"
,
"Family"
,
"Genus"
,
"Species"
)
if
(
comp
==
''
){
fun
<-
paste
(
'combinaisons <- combn(na.omit(unique(sample_data(data
.glom
)$'
,
column1
,
')),2) '
,
sep
=
''
)
fun
<-
paste
(
'combinaisons <- combn(na.omit(unique(sample_data(data)$'
,
column1
,
')),2) '
,
sep
=
''
)
eval
(
parse
(
text
=
fun
))
}
else
{
comp_list
<-
unlist
(
strsplit
(
comp
,
","
))
...
...
R/plsda_fun.r
View file @
57aae0a6
...
...
@@ -133,7 +133,7 @@ plsda_fun <- function(data = data, output = "./plsda/", column1 = "",
flog.info
(
paste
(
'keepX: '
,
select.keepX
,
sep
=
''
))
flog.info
(
'SPLSDA...'
)
fun
<-
paste
(
'splsda.res <- splsda(t(otable+1), mdata$'
,
column1
,
', ncomp = ncomp, keepX = select.keepX)'
,
sep
=
''
)
fun
<-
paste
(
'splsda.res <- splsda(t(otable+1), mdata$'
,
column1
,
', ncomp = ncomp, keepX = select.keepX
, logratio= "CLR"
)'
,
sep
=
''
)
eval
(
parse
(
text
=
fun
))
flog.info
(
'Done.'
)
flog.info
(
'Plot Individuals...'
)
...
...
@@ -151,7 +151,7 @@ plsda_fun <- function(data = data, output = "./plsda/", column1 = "",
png
(
paste
(
output
,
'/splsda_perf_'
,
column1
,
'_'
,
rank
,
'.png'
,
sep
=
''
))
plot
(
perf.splsda
,
col
=
color.mixo
(
5
))
dev.off
()
flog.info
(
'Done.'
)
outF
[[
"loadings"
]]
=
list
()
for
(
comp
in
1
:
ncomp
){
...
...
@@ -164,16 +164,17 @@ plsda_fun <- function(data = data, output = "./plsda/", column1 = "",
dev.off
()
}
plotArrow
(
splsda.res
,
legend
=
T
)
outF
$
splsda.plotArrow
<-
recordPlot
()
invisible
(
dev.off
())
png
(
paste
(
output
,
'/splsda_arrow_'
,
column1
,
'_'
,
rank
,
'.png'
,
sep
=
''
))
replayPlot
(
outF
$
splsda.plotArrow
)
dev.off
()
#
plotArrow(splsda.res, legend=T)
#
outF$splsda.plotArrow <- recordPlot()
#
invisible(dev.off())
#
#
png(paste(output,'/splsda_arrow_',column1,'_',rank,'.png',sep=''))
#
replayPlot(outF$splsda.plotArrow)
#
dev.off()
outF
$
splsda.loadings_table
=
splsda.res
$
loadings
$
X
write.table
(
splsda.res
$
loadings
$
X
,
paste
(
output
,
'/splsda_table_'
,
column1
,
'_'
,
rank
,
'.csv'
,
sep
=
''
),
quote
=
FALSE
,
sep
=
"\t"
,
col.names
=
NA
)
flog.info
(
'Done.'
)
return
(
outF
)
...
...
Write
Preview
Markdown
is supported
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