Skip to content
GitLab
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
471fd517
Commit
471fd517
authored
Mar 08, 2021
by
Sebastien Theil
Browse files
do not remove control samples when not used.
parent
b632de5d
Pipeline
#27740
passed with stage
in 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
R/decontam_fun.R
View file @
471fd517
...
...
@@ -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
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment