Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MCQR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PAPPSO
MCQR
Commits
97491a26
Commit
97491a26
authored
4 years ago
by
Thierry Balliau
Browse files
Options
Downloads
Patches
Plain Diff
modification nom de fonction mcq.plot.area.triplex.effect vers mcq.plot.area.multiplex.effect
parent
bcaef1ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MCQR/NAMESPACE
+1
-1
1 addition, 1 deletion
MCQR/NAMESPACE
MCQR/R/mcq_plot_aera_multiplex_effect.R
+77
-0
77 additions, 0 deletions
MCQR/R/mcq_plot_aera_multiplex_effect.R
with
78 additions
and
1 deletion
MCQR/NAMESPACE
+
1
−
1
View file @
97491a26
...
...
@@ -70,7 +70,7 @@
export("mcq.get.protlist")
# Functions mcq.plot
export("mcq.plot.aera.t
r
iplex.effect")
export("mcq.plot.aera.
mul
tiplex.effect")
export("mcq.plot.cluster")
export("mcq.plot.counts.per.injection")
export("mcq.plot.global.intensity")
...
...
This diff is collapsed.
Click to expand it.
MCQR/R/mcq_plot_aera_multiplex_effect.R
0 → 100644
+
77
−
0
View file @
97491a26
### method to plot area in log by triplex to show if there is a specifique effect for each triplex
mcq.plot.aera.multiplex.effect
<-
function
(
object
,
file
=
NULL
,
binwidth
=
0.25
,
type
=
"histogram"
)
{
error_messages
<-
list
()
j
=
1
# if (!is.numeric(class)&!is.null(class)){
# error_messages[[j]] <- "class argument must be numeric"
# j=j+1
# }
if
(
!
is.numeric
(
binwidth
)){
error_messages
[[
j
]]
<-
"binwidth argument must be numeric"
j
=
j
+1
}
if
(
!
is.character
(
file
)
&!
is.null
(
file
)){
error_messages
[[
j
]]
<-
"file argument must be characters"
j
=
j
+1
}
if
(
!
(
type
%in%
c
(
"histogram"
,
"density"
,
"experimental"
))){
error_messages
[[
j
]]
<-
"file argument must be characters"
j
=
j
+1
}
if
(
length
(
error_messages
)
!=
0
){
stop
(
paste
(
"Error on argument format:\n"
,
paste
(
error_messages
,
collapse
=
"\n"
),
sep
=
""
))
}
# if(class(object) == "cmcq.pepq.sds"){
# if(class(object[[1]]) %in% c("cmcq.pepq.masschroq.labeling","cmcq.pepq.masschroq")){
# ## preparing data
# data <- mcq.union.fraction.sds.corrected(object, verbose=FALSE)[[1]]
# inj <- data@metadata@injections
# meta <- data@metadata@metadata
# ### workaround because meta contains fraction column if generated with mcq.union.fraction.sds
# if("fraction" %in% colnames(meta)){
# meta <- meta[,-which(colnames(meta) %in% "fraction")]
# }
# inj$msrun_label <- paste(inj$msrun, inj$label, sep="_")
# meta <- cbind(inj, meta)
# pep <- as.data.table(data@peptides)
# meta <- as.data.table(meta)
# pep <- merge(pep, meta)
# }
# }else
if
(
class
(
object
)
==
"cmcq.pepq.masschroq.labeling"
){
inj
<-
object
@
metadata
@
injections
meta
<-
object
@
metadata
@
metadata
### workaround because meta contains fraction column if generated with mcq.union.fraction.sds
if
(
"fraction"
%in%
colnames
(
meta
)){
meta
<-
meta
[,
-
which
(
colnames
(
meta
)
%in%
"fraction"
)]
}
inj
$
msrun_label
<-
paste
(
inj
$
msrun
,
inj
$
label
,
sep
=
"_"
)
meta
<-
cbind
(
inj
,
meta
)
pep
<-
as.data.table
(
object
@
peptides
)
meta
<-
as.data.table
(
meta
)
pep
<-
merge
(
pep
,
meta
)
}
else
{
stop
(
paste
(
"the class \""
,
class
(
object
),
"\" is not taken into account by mcq.plot.aera.triplex.effect"
,
sep
=
""
))
}
p
<-
list
()
if
(
type
==
"histogram"
){
temp
<-
ggplot
(
pep
,
aes
(
x
=
logarea
,
fill
=
track
))
+
geom_histogram
(
position
=
position_dodge2
(
padding
=
0.1
),
binwidth
=
binwidth
)
+
xlab
(
"log10(area)"
)
temp
<-
temp
+
ggtitle
(
"Distribution of log10(area) by triplex"
)
p
[[
1
]]
<-
temp
}
else
if
(
type
==
"density"
){
temp
<-
ggplot
(
pep
,
aes
(
x
=
logarea
,
fill
=
track
,
color
=
track
))
+
geom_density
(
alpha
=
0.1
)
temp
<-
temp
+
ggtitle
(
"Distribution of log10(area) by triplex"
)
p
[[
1
]]
<-
temp
}
else
if
(
type
==
"experimental"
){
toplot
<-
priv.mcq.compute.hist
(
as.data.frame
(
pep
),
class
=
20
,
by
=
"track"
,
value
=
"logarea"
)
temp
<-
ggplot
(
toplot
,
aes
(
x
=
mids
,
y
=
count
,
fill
=
track
))
+
geom_bar
(
stat
=
"identity"
,
position
=
position_dodge2
(
padding
=
0.2
))
+
theme
(
axis.text.x
=
element_text
(
angle
=
90
,
hjust
=
1
))
+
xlab
(
"log10(area)"
)
+
ylab
(
"count"
)
temp
<-
temp
+
ggtitle
(
"Distribution of log10(area) by triplex"
)
p
[[
1
]]
<-
temp
}
priv.mcq.visualisation.graph
(
p
,
file
)
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment