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
a67b11b4
Commit
a67b11b4
authored
Sep 12, 2016
by
svolant
Browse files
Correction bug Processing + modif merge table
parent
02d02eb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Rfunctions/Data_Management.R
View file @
a67b11b4
...
...
@@ -195,6 +195,7 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
CT
=
CT_int
}
else
CT
=
CT
[,
ind
]
save.image
(
"test.RData"
)
## Order CT according to the target
CT
=
OrderCounts
(
counts
=
CT
,
labels
=
labels
)
$
CountsOrder
CT_noNorm
=
CT
...
...
@@ -239,9 +240,10 @@ GetCountsMerge <- function(input,dataInput,taxoSelect,target,design)
## Keep normalized OTU table
CT_Norm
=
counts
(
dds
,
normalized
=
TRUE
)
save
(
CT_Norm
,
dds
,
CT
,
taxo
,
taxoSelect
,
file
=
"test.RData"
)
# Only interesting OTU
merged_table
=
merge
(
CT
,
taxo
[
order
(
rownames
(
CT
)),],
by
=
"row.names"
)
# merged_table = merge(CT, taxo[order(rownames(CT)),], by="row.names")
merged_table
=
merge
(
CT
,
taxo
,
by
=
"row.names"
)
CT
=
merged_table
[,
2
:
(
dim
(
CT
)[
2
]
+1
)]
taxo
=
merged_table
[,(
dim
(
CT
)[
2
]
+2
)
:
dim
(
merged_table
)[
2
]]
rownames
(
CT
)
=
merged_table
[,
1
]
...
...
server.R
View file @
a67b11b4
...
...
@@ -46,7 +46,7 @@ shinyServer(function(input, output,session) {
inFile
<-
input
$
fileTaxo
if
(
is.null
(
inFile
))
return
(
NULL
)
print
(
input
$
TypeTaxo
)
if
(
input
$
TypeTaxo
==
"Table"
)
{
data
=
read.csv
(
inFile
$
datapath
,
sep
=
"\t"
,
header
=
TRUE
)
...
...
@@ -315,7 +315,7 @@ shinyServer(function(input, output,session) {
output
$
DataCounts
<-
renderDataTable
(
dataInput
()
$
data
$
counts
,
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
## Counts Table
...
...
@@ -325,7 +325,7 @@ shinyServer(function(input, output,session) {
BaseContrast
=
read.table
(
namesfile
,
header
=
TRUE
)
GetData_venn
(
input
,
SelContrast
,
BaseContrast
,
resDiff
)
$
df.tot
},
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
...
...
@@ -362,7 +362,7 @@ shinyServer(function(input, output,session) {
if
(
!
is.null
(
data
$
counts
)
&&
!
is.null
(
data
$
taxo
)
&&
nrow
(
data
$
counts
)
>
0
&&
nrow
(
data
$
taxo
)
>
0
)
{
taxo
=
rbind
(
taxo
,
rep
(
NA
,
ncol
(
taxo
)))
tmpPercent
=
round
(
apply
(
is.na
(
taxo
),
2
,
table
)[
"FALSE"
,]
/
nrow
(
counts
)
*
100
,
2
)
tmpPercent
=
round
(
apply
(
is.na
(
taxo
),
2
,
table
)[
"FALSE"
,]
/
(
nrow
(
taxo
)
-1
)
*
100
,
2
)
#print(tmpPercent)
df
<-
data.frame
(
Label
=
colnames
(
taxo
),
Value
=
tmpPercent
)
...
...
@@ -531,14 +531,14 @@ shinyServer(function(input, output,session) {
output
$
DataTarget
<-
renderDataTable
(
dataInputTarget
()
$
target
,
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
## Counts table for the selected taxonomy level
output
$
CountsMerge
<-
renderDataTable
(
round
(
counts
(
ResDiffAnal
()
$
dds
,
normalized
=
TRUE
)),
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
...
...
@@ -1140,7 +1140,7 @@ shinyServer(function(input, output,session) {
output
$
SizeFactTable
<-
renderDataTable
(
SizeFactor_table
(),
options
=
list
(
scrollX
=
TRUE
,
searching
=
FALSE
options
=
list
(
scrollX
=
TRUE
,
searching
=
FALSE
,
processing
=
FALSE
))
...
...
@@ -1336,21 +1336,21 @@ shinyServer(function(input, output,session) {
output
$
DataDiffcomplete
<-
renderDataTable
(
datatable
(
dataDiff
()
$
complete
,
rownames
=
FALSE
),
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
## Up diff table
output
$
DataDiffup
<-
renderDataTable
(
datatable
(
dataDiff
()
$
up
,
rownames
=
FALSE
),
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
## Down diff table
output
$
DataDiffdown
<-
renderDataTable
(
datatable
(
dataDiff
()
$
down
,
rownames
=
FALSE
),
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
...
...
@@ -1496,14 +1496,14 @@ shinyServer(function(input, output,session) {
output
$
lmRegScatter
<-
renderDataTable
(
Plot_Visu_Scatterplot
(
input
,
ResDiffAnal
(),
lmEst
=
TRUE
)
$
regCoef
,
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
## Correlation coefficients Table
output
$
CorTable
<-
renderDataTable
(
Plot_Visu_Scatterplot
(
input
,
ResDiffAnal
(),
CorEst
=
TRUE
)
$
cor.est
,
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
output
$
lmEquation
<-
renderPrint
({
...
...
@@ -1550,7 +1550,7 @@ shinyServer(function(input, output,session) {
datatable
(
tmp
[,
c
(
4
,
5
,
1
,
2
,
3
)],
rownames
=
FALSE
)
},
options
=
list
(
lengthMenu
=
list
(
c
(
10
,
50
,
-1
),
c
(
'10'
,
'50'
,
'All'
)),
pageLength
=
10
,
scrollX
=
TRUE
pageLength
=
10
,
scrollX
=
TRUE
,
processing
=
FALSE
))
## Export Diversitytable in .csv
...
...
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