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
Amine GHOZLANE
shaman
Commits
eef4fd9c
Commit
eef4fd9c
authored
Feb 24, 2016
by
svolant
Browse files
modif sum to mean
parent
fa70abe7
Changes
1
Hide whitespace changes
Inline
Side-by-side
internal.R
View file @
eef4fd9c
...
...
@@ -80,7 +80,7 @@ CheckCountsTable <- function(counts)
return
(
list
(
Error
=
Error
,
Warning
=
Warning
,
counts
=
counts
))
}
CheckTaxoTable
<-
function
(
taxo
)
CheckTaxoTable
<-
function
(
taxo
,
counts
)
{
Error
=
NULL
Warning
=
NULL
...
...
@@ -95,6 +95,9 @@ CheckCountsTable <- function(counts)
if
(
nb
==
1
&&
level
==
"NA"
){
Error
=
"At least one column contains only NA"
}
}
## Annotated features without counts
if
(
!
any
(
rownames
(
taxo
)
%in%
rownames
(
counts
))){
Error
=
"Some annotated features are not in the count table"
}
return
(
list
(
Error
=
Error
,
Warning
=
Warning
))
}
...
...
@@ -121,7 +124,7 @@ CheckCountsTable <- function(counts)
## Taxonomy table
taxo
=
as.data.frame
(
observation_metadata
(
dataBIOM
))
CheckTaxo
=
CheckTaxoTable
(
taxo
)
CheckTaxo
=
CheckTaxoTable
(
taxo
,
counts
)
## Pourcentage of annotation
tmp
=
PercentAnnot
(
counts
,
taxo
)
...
...
@@ -140,7 +143,7 @@ CheckCountsTable <- function(counts)
## Taxonomy table
taxo
=
as.data.frame
(
dataT
)
CheckTaxo
=
CheckTaxoTable
(
taxo
)
CheckTaxo
=
CheckTaxoTable
(
taxo
,
counts
)
## Pourcentage of annotation
tmp
=
PercentAnnot
(
counts
,
taxo
)
...
...
@@ -868,7 +871,7 @@ CheckCountsTable <- function(counts)
## Be careful transposition !
if
(
aggregate
&&
nrow
(
counts_tmp
)
>
0
&&
nrow
(
targetInt
)
>
0
)
{
counts_tmp_combined
=
aggregate
(
t
(
counts_tmp
),
by
=
list
(
targetInt
$
AllVar
),
sum
)
counts_tmp_combined
=
aggregate
(
t
(
counts_tmp
),
by
=
list
(
targetInt
$
AllVar
),
mean
)
rownames
(
counts_tmp_combined
)
=
counts_tmp_combined
$
Group.1
namesCounts
=
counts_tmp_combined
$
Group.1
counts_tmp_combined
=
as.matrix
(
counts_tmp_combined
[,
-1
])
...
...
Write
Preview
Supports
Markdown
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