Patch the extract.obiclean function
This commit is contained in:
@@ -35,4 +35,4 @@ Collate:
|
|||||||
'taxoDBtree.R'
|
'taxoDBtree.R'
|
||||||
'taxonomic.resolution.R'
|
'taxonomic.resolution.R'
|
||||||
'taxonomy_classic_table.R'
|
'taxonomy_classic_table.R'
|
||||||
RoxygenNote: 6.0.1
|
RoxygenNote: 6.1.1
|
||||||
|
42
R/obiclean.R
42
R/obiclean.R
@@ -56,9 +56,8 @@ setMethod("extracts.obiclean", "metabarcoding.data", function(obj) {
|
|||||||
cols = colnames(obj@motus)
|
cols = colnames(obj@motus)
|
||||||
cleancols = grep(pat,cols)
|
cleancols = grep(pat,cols)
|
||||||
clean.names=cols[cleancols]
|
clean.names=cols[cleancols]
|
||||||
p = grep(pat,cols)
|
d = t(as.factor.or.matrix(obj@motus[,cleancols]))
|
||||||
d = t(as.factor.or.matrix(obj@motus[,p]))
|
n = sapply(strsplit(cols[cleancols],':'),function(y) y[[2]])
|
||||||
n = sapply(strsplit(cols[p],':'),function(y) y[[2]])
|
|
||||||
rownames(d)=n
|
rownames(d)=n
|
||||||
d = d[rownames(obj@reads),]
|
d = d[rownames(obj@reads),]
|
||||||
obj[["obiclean_status"]]=d
|
obj[["obiclean_status"]]=d
|
||||||
@@ -68,28 +67,31 @@ setMethod("extracts.obiclean", "metabarcoding.data", function(obj) {
|
|||||||
pat = "^obiclean_count:.*$"
|
pat = "^obiclean_count:.*$"
|
||||||
cols = colnames(newmotus)
|
cols = colnames(newmotus)
|
||||||
cleancols = grep(pat,cols)
|
cleancols = grep(pat,cols)
|
||||||
clean.names=cols[cleancols]
|
if (length(cleancols) > 0) {
|
||||||
p = grep(pat,cols)
|
clean.names=cols[cleancols]
|
||||||
d = t(as.factor.or.matrix(newmotus[,p]))
|
d = t(as.factor.or.matrix(newmotus[,cleancols]))
|
||||||
n = sapply(strsplit(cols[p],':'),function(y) y[[2]])
|
n = sapply(strsplit(cols[cleancols],':'),function(y) y[[2]])
|
||||||
rownames(d)=n
|
rownames(d)=n
|
||||||
d = d[rownames(obj@reads),]
|
d = d[rownames(obj@reads),]
|
||||||
obj[["obiclean_count"]]=d
|
obj[["obiclean_count"]]=d
|
||||||
|
|
||||||
newmotus = newmotus[-cleancols]
|
newmotus = newmotus[-cleancols]
|
||||||
|
}
|
||||||
|
|
||||||
pat = "^obiclean_cluster:.*$"
|
pat = "^obiclean_cluster:.*$"
|
||||||
cols = colnames(newmotus)
|
cols = colnames(newmotus)
|
||||||
cleancols = grep(pat,cols)
|
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)
|
newdata = copy.metabarcoding.data(obj,motus=newmotus)
|
||||||
|
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
\alias{extrapol.freq}
|
\alias{extrapol.freq}
|
||||||
\title{Read frequencies krigging}
|
\title{Read frequencies krigging}
|
||||||
\usage{
|
\usage{
|
||||||
extrapol.freq(x, min.coord, max.coord, grid.grain = 100, coords, otus.table,
|
extrapol.freq(x, min.coord, max.coord, grid.grain = 100, coords,
|
||||||
cutoff = 0.001, return.metabarcoding.data = FALSE)
|
otus.table, cutoff = 0.001, return.metabarcoding.data = FALSE)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{x}{a vector or matrix from a row-normalized read table
|
\item{x}{a vector or matrix from a row-normalized read table
|
||||||
|
@@ -7,7 +7,8 @@
|
|||||||
\title{metabarcoding.data constructor}
|
\title{metabarcoding.data constructor}
|
||||||
\usage{
|
\usage{
|
||||||
\S4method{initialize}{metabarcoding.data}(.Object, reads, samples, motus,
|
\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{
|
\description{
|
||||||
metabarcoding.data constructor
|
metabarcoding.data constructor
|
||||||
|
@@ -4,7 +4,8 @@
|
|||||||
\alias{m.univariate.test}
|
\alias{m.univariate.test}
|
||||||
\title{Test the significance of the M statistics by Monte-Carlo}
|
\title{Test the significance of the M statistics by Monte-Carlo}
|
||||||
\usage{
|
\usage{
|
||||||
m.univariate.test(w, groups, resampling = 100, alternative = "two.sided")
|
m.univariate.test(w, groups, resampling = 100,
|
||||||
|
alternative = "two.sided")
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{w}{the weigth matrix indicating the presence probability of each motu
|
\item{w}{the weigth matrix indicating the presence probability of each motu
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
\alias{map.extrapol.freq}
|
\alias{map.extrapol.freq}
|
||||||
\title{Maps of krigged log10-transformed frequencies}
|
\title{Maps of krigged log10-transformed frequencies}
|
||||||
\usage{
|
\usage{
|
||||||
map.extrapol.freq(x, path = NULL, col.name = NULL, index, cutoff = 0.001,
|
map.extrapol.freq(x, path = NULL, col.name = NULL, index,
|
||||||
add.points = NULL, adj = 4)
|
cutoff = 0.001, add.points = NULL, adj = 4)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{x}{an extrapol.freq output}
|
\item{x}{an extrapol.freq output}
|
||||||
|
@@ -4,8 +4,8 @@
|
|||||||
\alias{plot.PCRplate}
|
\alias{plot.PCRplate}
|
||||||
\title{Plot PCR plates}
|
\title{Plot PCR plates}
|
||||||
\usage{
|
\usage{
|
||||||
\method{plot}{PCRplate}(x, samples = NULL, col = "cyan2", different = T,
|
\method{plot}{PCRplate}(x, samples = NULL, col = "cyan2",
|
||||||
...)
|
different = T, ...)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{x}{a \code{\link{metabarcoding.data}} object}
|
\item{x}{a \code{\link{metabarcoding.data}} object}
|
||||||
|
@@ -6,8 +6,8 @@
|
|||||||
\alias{threshold.mask-methods,metabarcoding.data}
|
\alias{threshold.mask-methods,metabarcoding.data}
|
||||||
\title{Computes a cumulatif thresold mask for filtering read aboundancies.}
|
\title{Computes a cumulatif thresold mask for filtering read aboundancies.}
|
||||||
\usage{
|
\usage{
|
||||||
\S4method{threshold.mask}{metabarcoding.data}(data, MARGIN, threshold = 0.97,
|
\S4method{threshold.mask}{metabarcoding.data}(data, MARGIN,
|
||||||
operator = "<")
|
threshold = 0.97, operator = "<")
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{data}{The \code{\linkS4class{metabarcoding.data}} instance
|
\item{data}{The \code{\linkS4class{metabarcoding.data}} instance
|
||||||
|
Reference in New Issue
Block a user