Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
shinyscreen
Manage
Activity
Members
Labels
Plan
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Miroslav Kratochvil
shinyscreen
Commits
dc558d51
Unverified
Commit
dc558d51
authored
5 years ago
by
Todor Kondic
Browse files
Options
Downloads
Patches
Plain Diff
Fixes tag lossage in mzML table
parent
1dc1e2b5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/mix.R
+1
-32
1 addition, 32 deletions
R/mix.R
R/shinyUI.R
+8
-19
8 additions, 19 deletions
R/shinyUI.R
with
9 additions
and
51 deletions
R/mix.R
+
1
−
32
View file @
dc558d51
...
...
@@ -887,10 +887,8 @@ plot_id_msn <- function(ni,
## } else NULL
message
(
"PH L "
,
i
)
res
<-
if
(
!
is.null
(
plMS1
))
cowplot
::
plot_grid
(
plMS1
,
plStruc
,
plMS2
,
plEmpty
,
plSpecMS2
,
align
=
"hv"
,
axis
=
'l'
,
ncol
=
2
,
nrow
=
3
,
rel_widths
=
c
(
3
,
1
))
else
NULL
message
(
"PH M "
,
i
)
res
}
...
...
@@ -909,35 +907,6 @@ adornmzMLTab<-function(df,projDir=getwd()) {
df
}
## genSuprFileTblOld <- function(fileTbl,compTab) {
## genOneFileTbl <- function(id,fileTbl) {
## n <- nrow(fileTbl)
## K <- length(id)
## longid <- rep(id,n)
## cols <- lapply(names(fileTbl),function(cn) rep("",n*K))
## names(cols) <- names(fileTbl)
## bdf <- as.data.frame(cols,stringsAsFactors = F)
## rows <- lapply(1:n*K,function(x) NA)
## for (j in 1:n) {
## for (i in 1:K)
## rows[[(j-1)*K+i]] <- fileTbl[j,]
## }
## bdf <- as.data.frame(do.call(rbind,rows),stringsAsFactors = F)
## bdf <- cbind(bdf,data.frame(ID=longid))
## bdf
## }
## sets <- levels(factor(compTab$set))
## setTbl <- lapply(sets,function (s) {
## sl1<-compTab$set %in% s
## sl2<-fileTbl$set==s
## if (!any(sl2)) stop("Set",s,"does not select anything in the currently processed files.")
## genOneFileTbl(compTab[sl1,]$ID,fileTbl[sl2,])
## })
## allTbl <- do.call(rbind,setTbl)
## allTbl
## }
genSuprFileTab
<-
function
(
fileTab
,
compTab
)
{
genOne
<-
function
(
ids
,
fn
)
{
...
...
This diff is collapsed.
Click to expand it.
R/shinyUI.R
+
8
−
19
View file @
dc558d51
...
...
@@ -526,8 +526,10 @@ shinyScreenApp <- function(projDir=getwd()) {
if
(
is.null
(
df
))
df
<-
mk_mzML_work
()
if
(
length
(
tags
)
>
0
&&
!
is.na
(
tags
))
{
oldlvl
<-
levels
(
df
$
tag
)
exttag
<-
unique
(
c
(
unlist
(
tags
),
oldlvl
))
x
<-
as.character
(
df
$
tag
)
df
$
tag
<-
factor
(
x
,
levels
=
unlist
(
tag
s
)
)
df
$
tag
<-
factor
(
x
,
levels
=
ext
tag
)
ina
<-
which
(
is.na
(
df
$
tag
))
df
$
tag
[
ina
]
<-
TAG_DEF
}
...
...
@@ -757,6 +759,8 @@ shinyScreenApp <- function(projDir=getwd()) {
chset
<-
as.character
(
mzml
$
set
)
shiny
::
validate
(
need
(
chset
,
"Sets not properly specified for the mzML files."
))
mzml
$
set
<-
factor
(
chset
)
tag
<-
as.character
(
mzml
$
tag
)
mzml
$
tag
<-
factor
(
tag
)
mzml
})
...
...
@@ -890,11 +894,8 @@ shinyScreenApp <- function(projDir=getwd()) {
tgt
<-
getTgt
()
message
(
"Begin generation of comp table."
)
availSets
<-
get_sets
()
message
(
"comp tab 1"
)
idTgt
<-
tgt
$
ID
message
(
"comp tab 2"
)
idUnk
<-
unk
$
ID
message
(
"comp tab 3"
)
if
(
is.null
(
availSets
))
stop
(
"Sets have not been (properly) set on the mzML files. Please check."
)
if
(
length
(
intersect
(
idTgt
,
idUnk
))
>
0
)
stop
(
"There must not be unknowns and targets with the same IDs."
)
...
...
@@ -906,8 +907,6 @@ shinyScreenApp <- function(projDir=getwd()) {
setId
[
iTgt
,
"orig"
]
<-
"known"
setId
[
iUnk
,
"orig"
]
<-
"unknown"
rvTab
$
setId
<-
setId
## !!!
message
(
"comp tab 4"
)
## knowns
setIdTgt
<-
setId
[
setId
$
orig
==
"known"
,]
...
...
@@ -917,7 +916,6 @@ shinyScreenApp <- function(projDir=getwd()) {
#on the data files.
nRow
<
-0
message
(
"comp tab 5"
)
for
(
s
in
sets
)
{
sMode
<-
getSetMode
(
s
,
mzML
)
n
<-
length
(
sMode
)
...
...
@@ -936,8 +934,6 @@ shinyScreenApp <- function(projDir=getwd()) {
SMILES
=
rep
(
""
,
nRow
),
stringsAsFactors
=
F
)
message
(
"comp tab 6"
)
i
<
-1
for
(
s
in
sets
)
{
sMode
<-
getSetMode
(
s
,
mzML
)
...
...
@@ -959,7 +955,6 @@ shinyScreenApp <- function(projDir=getwd()) {
}
}
message
(
"comp tab 7"
)
message
(
"Generation of comp table: knowns done."
)
## unknows
setIdUnk
<-
setId
[
setId
$
orig
==
"unknown"
,]
...
...
@@ -967,7 +962,6 @@ shinyScreenApp <- function(projDir=getwd()) {
sets
<-
intersect
(
availSets
,
sets
)
nRow
<
-0
message
(
"comp tab 8"
)
for
(
s
in
sets
)
{
sMode
<-
getSetMode
(
s
,
mzML
)
n
<-
length
(
sMode
)
...
...
@@ -977,7 +971,6 @@ shinyScreenApp <- function(projDir=getwd()) {
}
message
(
"comp tab 9"
)
compUnk
<-
data.frame
(
ID
=
rep
(
0
,
nRow
),
mz
=
rep
(
0.0
,
nRow
),
...
...
@@ -990,7 +983,6 @@ shinyScreenApp <- function(projDir=getwd()) {
stringsAsFactors
=
F
)
message
(
"comp tab 10"
)
i
<
-1
for
(
s
in
sets
)
{
m
<-
getSetMode
(
s
,
mzML
)
...
...
@@ -1007,7 +999,6 @@ shinyScreenApp <- function(projDir=getwd()) {
}
}
message
(
"comp tab 11"
)
message
(
"Generation of comp table: unknowns done."
)
df
<-
rbind
(
compTgt
,
compUnk
,
stringsAsFactors
=
F
)
tab2file
(
df
,
rvConf
$
fnComp
)
...
...
@@ -1293,17 +1284,15 @@ shinyScreenApp <- function(projDir=getwd()) {
for
(
t
in
sdf
$
tag
)
{
sprop
<-
rvConf
$
spectProps
[[
t
]]
sdfSel
<-
sdf
[
sdf
$
tag
%in%
t
,
QANAMES
]
sel
<-
as.logical
(
sdfSel
)
sel
<-
as.logical
(
sdfSel
)
choices
<-
QANAMES
[
sel
]
names
(
choices
)
<-
QANAMES
[
sel
]
shiny
::
updateCheckboxGroupInput
(
session
=
session
,
inputId
=
sprop
,
selected
=
choices
)
}
}
}
})
...
...
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