Commit 7a750efa by Eric Coissac

Patch the extract.obiclean function

parent c09e222c
......@@ -35,4 +35,4 @@ Collate:
'taxoDBtree.R'
'taxonomic.resolution.R'
'taxonomy_classic_table.R'
RoxygenNote: 6.0.1
RoxygenNote: 6.1.1
......@@ -56,9 +56,8 @@ setMethod("extracts.obiclean", "metabarcoding.data", function(obj) {
cols = colnames(obj@motus)
cleancols = grep(pat,cols)
clean.names=cols[cleancols]
p = grep(pat,cols)
d = t(as.factor.or.matrix(obj@motus[,p]))
n = sapply(strsplit(cols[p],':'),function(y) y[[2]])
d = t(as.factor.or.matrix(obj@motus[,cleancols]))
n = sapply(strsplit(cols[cleancols],':'),function(y) y[[2]])
rownames(d)=n
d = d[rownames(obj@reads),]
obj[["obiclean_status"]]=d
......@@ -68,28 +67,31 @@ setMethod("extracts.obiclean", "metabarcoding.data", function(obj) {
pat = "^obiclean_count:.*$"
cols = colnames(newmotus)
cleancols = grep(pat,cols)
clean.names=cols[cleancols]
p = grep(pat,cols)
d = t(as.factor.or.matrix(newmotus[,p]))
n = sapply(strsplit(cols[p],':'),function(y) y[[2]])
rownames(d)=n
d = d[rownames(obj@reads),]
obj[["obiclean_count"]]=d
newmotus = newmotus[-cleancols]
if (length(cleancols) > 0) {
clean.names=cols[cleancols]
d = t(as.factor.or.matrix(newmotus[,cleancols]))
n = sapply(strsplit(cols[cleancols],':'),function(y) y[[2]])
rownames(d)=n
d = d[rownames(obj@reads),]
obj[["obiclean_count"]]=d
newmotus = newmotus[-cleancols]
}
pat = "^obiclean_cluster:.*$"
cols = colnames(newmotus)
cleancols = grep(pat,cols)
clean.names=cols[cleancols]
p = grep(pat,cols)
d = t(as.factor.or.matrix(newmotus[,p]))
n = sapply(strsplit(cols[p],':'),function(y) y[[2]])
rownames(d)=n
d = d[rownames(obj@reads),]
obj[["obiclean_cluster"]]=d
newmotus = newmotus[-cleancols]
if (length(cleancols) > 0) {
clean.names=cols[cleancols]
d = t(as.factor.or.matrix(newmotus[,cleancols]))
n = sapply(strsplit(cols[cleancols],':'),function(y) y[[2]])
rownames(d)=n
d = d[rownames(obj@reads),]
obj[["obiclean_cluster"]]=d
newmotus = newmotus[-cleancols]
}
newdata = copy.metabarcoding.data(obj,motus=newmotus)
......
......@@ -4,8 +4,8 @@
\alias{extrapol.freq}
\title{Read frequencies krigging}
\usage{
extrapol.freq(x, min.coord, max.coord, grid.grain = 100, coords, otus.table,
cutoff = 0.001, return.metabarcoding.data = FALSE)
extrapol.freq(x, min.coord, max.coord, grid.grain = 100, coords,
otus.table, cutoff = 0.001, return.metabarcoding.data = FALSE)
}
\arguments{
\item{x}{a vector or matrix from a row-normalized read table
......
......@@ -7,7 +7,8 @@
\title{metabarcoding.data constructor}
\usage{
\S4method{initialize}{metabarcoding.data}(.Object, reads, samples, motus,
taxonomy = NULL, taxid = NULL, sample.margin = NA, layers = list())
taxonomy = NULL, taxid = NULL, sample.margin = NA,
layers = list())
}
\description{
metabarcoding.data constructor
......
......@@ -4,7 +4,8 @@
\alias{m.univariate.test}
\title{Test the significance of the M statistics by Monte-Carlo}
\usage{
m.univariate.test(w, groups, resampling = 100, alternative = "two.sided")
m.univariate.test(w, groups, resampling = 100,
alternative = "two.sided")
}
\arguments{
\item{w}{the weigth matrix indicating the presence probability of each motu
......
......@@ -4,8 +4,8 @@
\alias{map.extrapol.freq}
\title{Maps of krigged log10-transformed frequencies}
\usage{
map.extrapol.freq(x, path = NULL, col.name = NULL, index, cutoff = 0.001,
add.points = NULL, adj = 4)
map.extrapol.freq(x, path = NULL, col.name = NULL, index,
cutoff = 0.001, add.points = NULL, adj = 4)
}
\arguments{
\item{x}{an extrapol.freq output}
......
......@@ -4,8 +4,8 @@
\alias{plot.PCRplate}
\title{Plot PCR plates}
\usage{
\method{plot}{PCRplate}(x, samples = NULL, col = "cyan2", different = T,
...)
\method{plot}{PCRplate}(x, samples = NULL, col = "cyan2",
different = T, ...)
}
\arguments{
\item{x}{a \code{\link{metabarcoding.data}} object}
......
......@@ -6,8 +6,8 @@
\alias{threshold.mask-methods,metabarcoding.data}
\title{Computes a cumulatif thresold mask for filtering read aboundancies.}
\usage{
\S4method{threshold.mask}{metabarcoding.data}(data, MARGIN, threshold = 0.97,
operator = "<")
\S4method{threshold.mask}{metabarcoding.data}(data, MARGIN,
threshold = 0.97, operator = "<")
}
\arguments{
\item{data}{The \code{\linkS4class{metabarcoding.data}} instance
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment