Mercurial > repos > yguitton > metams_rungc
comparison lib_metams.r @ 8:d1ce2634135f draft
planemo upload for repository https://github.com/workflow4metabolomics/metaMS commit 88163f9ba0e3e95f00e18247c67b95cf7791fa98-dirty
author | workflow4metabolomics |
---|---|
date | Mon, 06 Jul 2020 03:04:16 -0400 |
parents | b8d4129dd2a6 |
children |
comparison
equal
deleted
inserted
replaced
7:89af36e05548 | 8:d1ce2634135f |
---|---|
431 peaktable <- resGC$PeakTable | 431 peaktable <- resGC$PeakTable |
432 | 432 |
433 par (mar=c(5, 4, 4, 2) + 0.1) | 433 par (mar=c(5, 4, 4, 2) + 0.1) |
434 #For each unknown | 434 #For each unknown |
435 for (l in 1:length(unkn)){ | 435 for (l in 1:length(unkn)){ |
436 #recordPlot | 436 print("la") |
437 #recordPlot | |
437 perpage=3 #if change change layout also! | 438 perpage=3 #if change change layout also! |
438 dev.new(width=21/2.54, height=29.7/2.54, file=paste("Unknown_",unkn[l],".pdf", sep="")) #A4 pdf | 439 dev.new(width=21/2.54, height=29.7/2.54, file=paste("Unknown_",unkn[l],".pdf", sep="")) #A4 pdf |
439 # par(mfrow=c(perpage,2)) | 440 # par(mfrow=c(perpage,2)) |
440 layout(matrix(c(1,1,2,3,4,4,5,6,7,7,8,9), 6, 2, byrow = TRUE), widths=rep(c(1,1),perpage), heights=rep(c(1,5),perpage)) | 441 layout(matrix(c(1,1,2,3,4,4,5,6,7,7,8,9), 6, 2, byrow = TRUE), widths=rep(c(1,1),perpage), heights=rep(c(1,5),perpage)) |
441 # layout.show(6) | 442 # layout.show(6) |
444 par(oma = oma.saved) | 445 par(oma = oma.saved) |
445 o.par <- par(mar = rep.int(0, 4)) | 446 o.par <- par(mar = rep.int(0, 4)) |
446 on.exit(par(o.par)) | 447 on.exit(par(o.par)) |
447 #For each sample | 448 #For each sample |
448 for (c in 1:length(resGC$xset)) { | 449 for (c in 1:length(resGC$xset)) { |
449 #get sample name | 450 #get sample name |
450 sampname<-basename(resGC$xset[[c]]@xcmsSet@filepaths) | 451 sampname<-basename(resGC$xset[[c]]@xcmsSet@filepaths) |
451 #remove .cdf, .mzXML filepattern | 452 #remove .cdf, .mzXML filepattern |
452 filepattern <- c("[Cc][Dd][Ff]", "[Nn][Cc]", "([Mm][Zz])?[Xx][Mm][Ll]", | 453 filepattern <- c("[Cc][Dd][Ff]", "[Nn][Cc]", "([Mm][Zz])?[Xx][Mm][Ll]", |
453 "[Mm][Zz][Dd][Aa][Tt][Aa]", "[Mm][Zz][Mm][Ll]") | 454 "[Mm][Zz][Dd][Aa][Tt][Aa]", "[Mm][Zz][Mm][Ll]") |
454 filepattern <- paste(paste("\\.", filepattern, "$", sep = ""), collapse = "|") | 455 filepattern <- paste(paste("\\.", filepattern, "$", sep = ""), collapse = "|") |
470 if(helpannotation[[a]][r,"annotation"] == peaktable[unkn[l],1]){ | 471 if(helpannotation[[a]][r,"annotation"] == peaktable[unkn[l],1]){ |
471 findunkn <- TRUE | 472 findunkn <- TRUE |
472 pcgrp <- helpannotation[[a]][r,"pspvector"] | 473 pcgrp <- helpannotation[[a]][r,"pspvector"] |
473 par (mar=c(0, 0, 0, 0) + 0.1) | 474 par (mar=c(0, 0, 0, 0) + 0.1) |
474 #Write title | 475 #Write title |
476 print("on plot le new") | |
475 plot.new() | 477 plot.new() |
476 box() | 478 box() |
477 text(0.5, 0.5, title1, cex=2) | 479 text(0.5, 0.5, title1, cex=2) |
478 par (mar=c(3, 2.5, 3, 1.5) + 0.1) | 480 par (mar=c(3, 2.5, 3, 1.5) + 0.1) |
479 #Window for EIC | 481 #Window for EIC |
482 print("plot eic") | |
483 print(an) | |
484 print(pcgrp) | |
480 plotEICs(an, pspec=pcgrp, maxlabel=2) | 485 plotEICs(an, pspec=pcgrp, maxlabel=2) |
481 #Window for pseudospectra | 486 #Window for pseudospectra |
487 print("plotPsSpectrum") | |
482 plotPsSpectrum(an, pspec=pcgrp, maxlabel=2) | 488 plotPsSpectrum(an, pspec=pcgrp, maxlabel=2) |
483 } | 489 } |
484 } | 490 } |
485 if(!findunkn) { | 491 if(!findunkn) { |
486 par (mar=c(0, 0, 0, 0) + 0.1) | 492 par (mar=c(0, 0, 0, 0) + 0.1) |
500 break | 506 break |
501 } | 507 } |
502 } | 508 } |
503 } | 509 } |
504 graphics.off() | 510 graphics.off() |
511 print("graph off") | |
505 }#end for unkn[l] | 512 }#end for unkn[l] |
513 print("fin unkn") | |
506 }#end function | 514 }#end function |