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
7c338e31
Commit
7c338e31
authored
Mar 09, 2021
by
Etienne Rifa
Browse files
Merge branch 'master' of forgemia.inra.fr:umrf/ranomaly
parents
817f2479
471fd517
Pipeline
#27820
passed with stage
in 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
R/ASVenn_fun.R
View file @
7c338e31
...
...
@@ -66,6 +66,21 @@ ASVenn_fun <- function(data = data, output = "./ASVenn/", rank = "ASV",
}
if
(
length
(
lvls
)
==
0
){
flog.error
(
'You must provide levels...'
)
stop
()
}
else
if
(
length
(
lvls
)
>
5
){
flog.error
(
'Venn diagram is limited to 5 levels'
)
stop
()
}
else
{
if
(
!
all
(
lvls
%in%
na.omit
(
levels
(
as.factor
(
sample_data
(
data
)[,
column1
]
@
.Data
[[
1
]]))
))){
flog.error
(
'Your levels are not present in metadata...'
)
stop
()
}
}
#Nombre d'espèce par matrice
flog.info
(
'Parsing factor ...'
)
level1
<-
na.omit
(
levels
(
as.factor
(
sample_data
(
data
)[,
column1
]
@
.Data
[[
1
]]))
)
...
...
R/decontam_fun.R
View file @
7c338e31
...
...
@@ -189,6 +189,7 @@ decontam_fun <- function(data = data, domain = "Bacteria", output = "./decontam_
}
else
{
flog.info
(
'Decontam step skipped or too few control samples (less than 3)...'
)
taxToDump0
=
NULL
skip
=
TRUE
}
}
else
{
taxToDump0
=
NULL
}
#-k skip all decontam
...
...
@@ -285,7 +286,7 @@ decontam_fun <- function(data = data, domain = "Bacteria", output = "./decontam_
}
data
<-
prune_samples
(
sample_sums
(
data
)
>
number
,
data
)
flog.info
(
'Done.'
)
flog.info
(
paste
(
"AFTER FILTERING: "
,
nsamples
(
data
),
"samples and"
,
ntaxa
(
data
),
"ASVs in otu table"
)
)
##TAXA to remove manually
...
...
@@ -305,12 +306,13 @@ decontam_fun <- function(data = data, domain = "Bacteria", output = "./decontam_
}
##Remove Control samples for next analysis
if
(
column
!=
""
){
if
(
column
!=
""
&&
skip
==
FALSE
){
flog.info
(
'Subsetting controls samples.'
)
fun
<-
paste
(
"data <- subset_samples(data, "
,
column
,
" %in% '"
,
spl_identifier
,
"')"
,
sep
=
""
)
eval
(
parse
(
text
=
fun
))
}
flog.info
(
paste
(
"AFTER FILTERING: "
,
nsamples
(
data
),
"samples and"
,
ntaxa
(
data
),
"ASVs in otu table"
)
)
flog.info
(
'Writing raw tables.'
)
write.table
(
cbind
(
otu_table
(
data
),
"Consensus Lineage"
=
apply
(
tax_table
(
data
),
1
,
paste
,
collapse
=
";"
),
"sequences"
=
as.data.frame
(
refseq
(
data
))
),
paste
(
output
,
"/raw_otu-table.csv"
,
sep
=
''
),
sep
=
"\t"
,
row.names
=
TRUE
,
col.names
=
NA
,
quote
=
FALSE
)
...
...
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