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
Amine GHOZLANE
shaman
Commits
02d02eb6
Commit
02d02eb6
authored
Sep 09, 2016
by
svolant
Browse files
Couleur barplot pca/pcoa + correction bug correlation
parent
1b2e73dc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Rfunctions/DiagPlot.R
View file @
02d02eb6
...
@@ -402,7 +402,11 @@ PCoAPlot_meta <-function (input, dds, group_init, col = c("SpringGreen","dodgerb
...
@@ -402,7 +402,11 @@ PCoAPlot_meta <-function (input, dds, group_init, col = c("SpringGreen","dodgerb
s.class
(
dfxy
=
pco.counts.norm
$
li
,
fac
=
group
,
col
=
col
,
label
=
levels
(
group
),
add.plot
=
TRUE
,
cpoint
=
0
,
clabel
=
0
,
cstar
=
input
$
cexstar
,
cell
=
input
$
cexcircle
)
s.class
(
dfxy
=
pco.counts.norm
$
li
,
fac
=
group
,
col
=
col
,
label
=
levels
(
group
),
add.plot
=
TRUE
,
cpoint
=
0
,
clabel
=
0
,
cstar
=
input
$
cexstar
,
cell
=
input
$
cexcircle
)
}
}
}
else
{
}
else
{
barplot
(
eigen
[
1
:
7
],
xlab
=
"Dimensions"
,
ylab
=
"Eigenvalues (%)"
,
names.arg
=
1
:
7
,
col
=
c
(
rep
(
"black"
,
2
),
rep
(
"grey"
,
5
)),
ylim
=
c
(
0
,
max
(
eigen
)
+5
),
cex.axis
=
1.2
,
cex.lab
=
1.4
,
cex.names
=
1.2
)
v_axes
=
c
(
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe1
)),
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe2
)))
nbBar
=
max
(
7
,
max
(
v_axes
))
col
=
rep
(
"grey"
,
nbBar
)
col
[
v_axes
]
=
"black"
barplot
(
eigen
[
1
:
nbBar
],
xlab
=
"Dimensions"
,
ylab
=
"Eigenvalues (%)"
,
names.arg
=
1
:
nbBar
,
col
=
col
,
ylim
=
c
(
0
,
max
(
eigen
)
+5
),
cex.axis
=
1.2
,
cex.lab
=
1.4
,
cex.names
=
1.2
)
}
}
}
}
...
@@ -474,7 +478,12 @@ PCAPlot_meta <-function(input,dds, group_init, n = min(500, nrow(counts(dds))),
...
@@ -474,7 +478,12 @@ PCAPlot_meta <-function(input,dds, group_init, n = min(500, nrow(counts(dds))),
text
(
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe1
))]
-
ifelse
(
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe1
))]
>
0
,
abs
,
-
abs
),
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe2
))]
-
ifelse
(
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe2
))]
>
0
,
ord
,
-
ord
),
colnames
(
counts.trans
),
col
=
col
[
indgrp
],
cex
=
input
$
cexLabelDiag
)
text
(
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe1
))]
-
ifelse
(
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe1
))]
>
0
,
abs
,
-
abs
),
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe2
))]
-
ifelse
(
pca
$
x
[,
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe2
))]
>
0
,
ord
,
-
ord
),
colnames
(
counts.trans
),
col
=
col
[
indgrp
],
cex
=
input
$
cexLabelDiag
)
}
}
if
(
plot
==
"eigen"
){
eigen
=
pca
$
sdev
[
1
:
min
(
7
,
ncol
(
counts.trans
))]
^
2
;
barplot
(
eigen
,
xlab
=
"Dimensions"
,
ylab
=
"Eigenvalues (%)"
,
names.arg
=
1
:
min
(
7
,
ncol
(
counts.trans
)),
col
=
c
(
rep
(
"black"
,
3
),
rep
(
"grey"
,
4
)),
ylim
=
c
(
0
,
max
(
eigen
)
+5
),
cex.axis
=
1.2
,
cex.lab
=
1.4
,
cex.names
=
1.2
)}
if
(
plot
==
"eigen"
){
nbBar
=
max
(
7
,
max
(
c
(
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe1
)),
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe2
)))))
col
=
rep
(
"grey"
,
nbBar
)
eigen
=
pca
$
sdev
[
1
:
nbBar
]
^
2
col
[
c
(
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe1
)),
as.numeric
(
gsub
(
"PC"
,
""
,
input
$
PCaxe2
)))]
=
"black"
barplot
(
eigen
,
xlab
=
"Dimensions"
,
ylab
=
"Eigenvalues (%)"
,
names.arg
=
1
:
nbBar
,
col
=
col
,
ylim
=
c
(
0
,
max
(
eigen
)
+5
),
cex.axis
=
1.2
,
cex.lab
=
1.4
,
cex.names
=
1.2
)}
}
}
}
}
...
...
Rfunctions/VisuPlot.R
View file @
02d02eb6
...
@@ -292,7 +292,7 @@ Plot_Visu_Scatterplot<- function(input,resDiff,export=FALSE,lmEst = FALSE,CorEst
...
@@ -292,7 +292,7 @@ Plot_Visu_Scatterplot<- function(input,resDiff,export=FALSE,lmEst = FALSE,CorEst
if
(
any
(
numInd
))
data
=
cbind
(
target
[,
numInd
],
log2
(
t
(
counts
)
+1
),
div
)
if
(
any
(
numInd
))
data
=
cbind
(
target
[,
numInd
],
log2
(
t
(
counts
)
+1
),
div
)
if
(
!
any
(
numInd
))
data
=
cbind
(
log2
(
t
(
counts
)
+1
),
div
)
if
(
!
any
(
numInd
))
data
=
cbind
(
log2
(
t
(
counts
)
+1
),
div
)
cor.est
=
cor
(
as.matrix
(
data
),
method
=
input
$
CorMeth
,
na.rm
=
TRUE
)
cor.est
=
round
(
cor
(
as.matrix
(
data
),
method
=
input
$
CorMeth
),
3
)
#cor.pvalue = cor.test(data,method = input$CorMeth)
#cor.pvalue = cor.test(data,method = input$CorMeth)
return
(
list
(
cor.est
=
cor.est
))
return
(
list
(
cor.est
=
cor.est
))
}
}
...
...
server.R
View file @
02d02eb6
...
@@ -24,7 +24,7 @@ shinyServer(function(input, output,session) {
...
@@ -24,7 +24,7 @@ shinyServer(function(input, output,session) {
## Counts file
## Counts file
dataInputCounts
<-
reactive
({
dataInputCounts
<-
reactive
({
print
(
input
$
TypeTaxo
)
inFile
<-
input
$
fileCounts
inFile
<-
input
$
fileCounts
if
(
is.null
(
inFile
))
return
(
NULL
)
if
(
is.null
(
inFile
))
return
(
NULL
)
...
...
ui.R
View file @
02d02eb6
...
@@ -346,7 +346,7 @@ body <- dashboardBody(
...
@@ -346,7 +346,7 @@ body <- dashboardBody(
conditionalPanel
(
condition
=
"input.DiagPlot=='pcoaPlot' || input.DiagPlot=='SERE' || input.DiagPlot=='clustPlot' "
,
conditionalPanel
(
condition
=
"input.DiagPlot=='pcoaPlot' || input.DiagPlot=='SERE' || input.DiagPlot=='clustPlot' "
,
selectInput
(
"DistClust"
,
"Distance"
,
c
(
"euclidean"
,
"SERE"
=
"sere"
,
"canberra"
,
"bray"
,
"kulczynski"
,
"jaccard"
,
selectInput
(
"DistClust"
,
"Distance"
,
c
(
"euclidean"
,
"SERE"
=
"sere"
,
"canberra"
,
"bray"
,
"kulczynski"
,
"jaccard"
,
"gower"
,
"altGower"
,
"morisita"
,
"horn"
,
"mountford"
,
"raup"
,
"binomial"
,
"gower"
,
"altGower"
,
"morisita"
,
"horn"
,
"mountford"
,
"raup"
,
"binomial"
,
"chao"
,
"cao"
,
"mahalanobis"
),
selected
=
"
jaccard
"
)
"chao"
,
"cao"
,
"mahalanobis"
),
selected
=
"
canberra
"
)
)
)
...
...
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