This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fwhm <- function(spectrum, peaks) { | |
| ## work horse | |
| .fwhm <- function(spectrum, i) { | |
| n <- length(spectrum) | |
| left <- ifelse(i <= 1, 1, i) | |
| right <- ifelse(i >= n, n, i) | |
| hm <- spectrum@intensity[i]/2 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## code to import peaks from Bruker xml files | |
| importBrukerXml <- function(file) { | |
| require("MALDIquant") | |
| ## read file | |
| r <- readLines(file) | |
| ## remove useless stuff | |
| r <- gsub(pattern="^.*<ms_peaks>|</ms_peaks>.*$", replacement="", x=r) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("shiny") | |
| library("MALDIquant") | |
| data("fiedler2009subset") | |
| shinyServer(function(input, output) { | |
| output$plotBaseline <- renderPlot({ | |
| plot(fiedler2009subset[[1]]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("shiny") | |
| library("MALDIquant") | |
| library("MALDIquantForeign") | |
| options(shiny.maxRequestSize=200*1024^2) | |
| data("fiedler2009subset") | |
| convertYlim <- function(lim, fun) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("MALDIquant") | |
| data("fiedler2009subset") | |
| ## preprocessing | |
| spectra <- transformIntensity(fiedler2009subset, sqrt) | |
| spectra <- transformIntensity(spectra, savitzkyGolay) | |
| spectra <- removeBaseline(spectra) | |
| peaks <- detectPeaks(spectra) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("MALDIquant") | |
| #' create toy example | |
| p <- c(p1=createMassPeaks(mass=c(1, 1.5, 10), intensity=c(1, 2, 1), | |
| metaData=list(name="p1")), | |
| p2=createMassPeaks(mass=c(0.9, 10.1), intensity=c(1, 1), | |
| metaData=list(name="p2")), | |
| p3=createMassPeaks(mass=c(1.1, 9.9), intensity=c(1, 1), | |
| metaData=list(name="p3"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \NeedsTeXFormat{LaTeX2e} | |
| \ProvidesPackage{Bioconductor}[2013/07/01 Bioconductor vignette style] | |
| %% -I would wish to know how to make this work- | |
| %% \DeclareOption{pdftitle}{\PassOptionsToPackage{pdftitle}{hyperref}} | |
| %% \DeclareOption{pdfauthor}{\PassOptionsToPackage{pdfauthor}{hyperref}} | |
| %% \ExecuteOptions{pdftitle,pdfauthor} | |
| %% \ProcessOptions | |
| \PassOptionsToPackage{usenames,dvipsnames}{color} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| convertFile <- function(inputFile, outputFile, | |
| fromEncoding="UTF-8", toEncoding="ASCII") { | |
| stopifnot(file.exists(inputFile)) | |
| input <- readLines(inputFile, encoding=fromEncoding) | |
| output <- iconv(input, from=fromEncoding, to=toEncoding) | |
| return(writeLines(output, outputFile)) | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("RNetCDF") | |
| nc <- create.nc("tiny.cdf") | |
| dim.def.nc(nc, "scan_number", 2) | |
| dim.def.nc(nc, "point_number", 10, unlim=TRUE) | |
| var.def.nc(nc, "scan_index", "NC_INT", "scan_number") | |
| var.def.nc(nc, "point_count", "NC_INT", "scan_number") | |
| var.def.nc(nc, "scan_acquisition_time", "NC_DOUBLE", "scan_number") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library("synapter") | |
| library("synapterdata") | |
| ## map some private functions to global NAMESPACE | |
| doHDMSePredictions <- synapter:::doHDMSePredictions | |
| error.ppm <- synapter:::error.ppm | |
| findMSeEMRTs <- synapter:::findMSeEMRTs | |
| ########################################################################### | |
| ## some boring stuff to prepare the Synapter object |
OlderNewer