Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit 49038d31 authored by joerg.buescher's avatar joerg.buescher
Browse files

separate scaling of 12C and 13C signals in plot_peaks.R

parent 3ce7e864
......@@ -35,6 +35,9 @@ plot_peaks <- function(metab, smpl, msd, prm) {
}
}
ylim12 <- c(0, max(c(100, 1.1 * msd[[im]][[id]]$height, 1.1 * msd[[im]][[id]]$height12),na.rm = TRUE) )
ylim13 <- c(0, max(c(120, 1.4 * msd[[im]][[id]]$height13)))
if (sum(nowgoody) < 2) {
nowgoodplot <- FALSE
plot(0)
......@@ -48,14 +51,14 @@ plot_peaks <- function(metab, smpl, msd, prm) {
plot(prm$unirt[nowgoody], nowy[nowgoody] ,
type = 'l',
main = msd[[im]][[id]]$label2, col.main = main_col,
ylim = msd[[im]][[id]]$ylim,
ylim = ylim12, # msd[[im]][[id]]$ylim,
xlab='', ylab='',
cex.main=0.7)
} else {
plot(prm$unirt[nowgoody], nowy[nowgoody] ,
type = 'l',
main = msd[[im]][[id]]$label1, col.main = main_col,
ylim = msd[[im]][[id]]$ylim,
ylim = ylim12, # msd[[im]][[id]]$ylim,
xlab='', ylab='',
cex.main=0.7)
}
......@@ -76,7 +79,7 @@ plot_peaks <- function(metab, smpl, msd, prm) {
col='#AAAAAA', border=NA)
# fill integration range with polygon
polygon(x=c(prm$unirt[nowxa[1]], prm$unirt[nowxa], prm$unirt[nowxa[length(nowxa)]]) ,
y=c(msd[[im]][[id]]$ylim[2] , nowya, msd[[im]][[id]]$ylim[2]) ,
y= c(ylim12[2], nowya, ylim12[2]), #y=c(msd[[im]][[id]]$ylim[2] , nowya, msd[[im]][[id]]$ylim[2]) ,
col='#DDDDDD', border=NA)
# draw quantifier line again because it looks nicer
......@@ -84,11 +87,13 @@ plot_peaks <- function(metab, smpl, msd, prm) {
}
# legend for quantifier
text(textxpos,0.95*msd[[im]][[id]]$ylim[2], metab[[im]]$quant$MRM , cex=0.5, pos=4)
# text(textxpos,0.95*msd[[im]][[id]]$ylim[2], metab[[im]]$quant$MRM , cex=0.5, pos=4)
text(textxpos,0.95*ylim12[2], metab[[im]]$quant$MRM , cex=0.5, pos=4)
# draw vertical line at peaktop
lines(prm$unirt[rep(msd[[im]][[id]]$peaktop,2)],
msd[[im]][[id]]$ylim,
ylim12, #msd[[im]][[id]]$ylim,
lty=3)
# draw vertical line at exp RT with shift
......@@ -114,7 +119,8 @@ plot_peaks <- function(metab, smpl, msd, prm) {
} else {
lines(prm$unirt[nowgoody], nowy[nowgoody], col = 'blue' , lty = 2)
}
text(textxpos,0.85*msd[[im]][[id]]$ylim[2], metab[[im]]$qual12c$MRM , col = 'blue', cex=0.5, pos=4)
# text(textxpos,0.85*msd[[im]][[id]]$ylim[2], metab[[im]]$qual12c$MRM , col = 'blue', cex=0.5, pos=4)
text(textxpos,0.85*ylim12[2], metab[[im]]$qual12c$MRM , col = 'blue', cex=0.5, pos=4)
}
# plot 13c qualifier
......@@ -124,11 +130,23 @@ plot_peaks <- function(metab, smpl, msd, prm) {
nowy <- compressplot(nd$x3)
nowgoody <- !is.na(nowy)
if (metab[[im]]$qual13c$use == 1 ) {
lines(prm$unirt[nowgoody], nowy[nowgoody], col = 'green')
# lines(prm$unirt[nowgoody], nowy[nowgoody], col = 'green')
par(new = TRUE)
plot(prm$unirt[nowgoody], nowy[nowgoody],
type = "l", axes = FALSE, bty = "n", xlab = "", ylab = "", col = 'green',
ylim = ylim13)
axis(side=4, at = pretty(ylim13), col = 'green', col.axis= 'green')
} else {
lines(prm$unirt[nowgoody], nowy[nowgoody], col = 'green' , lty = 2)
# lines(prm$unirt[nowgoody], nowy[nowgoody], col = 'green' , lty = 2)
par(new = TRUE)
plot(prm$unirt[nowgoody], nowy[nowgoody],
type = "l", axes = FALSE, bty = "n", xlab = "", ylab = "", col = 'green', lty = 2,
ylim = ylim13)
axis(side=4, at = pretty(ylim13), col = 'green', col.axis= 'green')
}
text(textxpos,0.75*msd[[im]][[id]]$ylim[2], metab[[im]]$qual13c$MRM , col = 'green', cex=0.5, pos=4)
# text(textxpos,0.75*msd[[im]][[id]]$ylim[2], metab[[im]]$qual13c$MRM , col = 'green', cex=0.5, pos=4)
text(textxpos,0.75*ylim13[2], metab[[im]]$qual13c$MRM , col = 'green', cex=0.5, pos=4)
}
}
......
##------ Thu Mar 18 14:15:40 2021 ------##
Now running QQQ_integrate.R
Gitlab repository for processing script: https://gitlab.gwdg.de/daniel.eilertz/ms-web
Commit hash: 5ef6043
Gitlab repository for helperfiles: https://gitlab.gwdg.de/joerg.buescher/helperfiles
Commit hash: 3b9df1c
Gitlab repository for automRm: https://gitlab.gwdg.de/joerg.buescher/automrm
Commit hash: f19f33e
Current user: rstudio
Reading additional sample info
Excelfile: /home/rstudio/data/helperfiles/metabolite_databases/metabdb_really_polar.xlsx
Size of excel table: 525 by 13
Now reading metabolites from excel file.
Counting metabolites... 1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26-27-28-29-30-31-32-33-34-35-36-37-38-39-40-41-42-43-44-45-46-47-48-49-50-51-52-53-54-55-56-57-58-59-60-61-62-63-64-65-66-67-68-69-70-71-72-73-74-75-76-77-78-79-80-81-82-83-84-85-86-87-88-89-90-91-92-93-94-95-96-97-98-99-100-101-102-103-104-105-106-107-108-109-110-111-112-113-114-115-116-117-118-119-120-121-122-123-124-125-126-127-128-129-130-131-132-133-134-135-136-137-138-139-140-141-142-143-144-145-146-147-148-149-150-151-152-153-154-155-156-157-158-159-160-161-162-163-164-165-166-167-168-169-170-171-172-173-174-175-176-177-178-179-180-181-182-183-184-185-186-replacing quant +666.1>136 with quant +666.1>514.1 for NADHNow integrating peaks in from all files.
Counting files...
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment