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
# Cross Matching Example | |
```{r setup, include=FALSE} | |
library(knitr) | |
opts_chunk$set(fig.height=10, fig.width=14, fig.path="figure/crossmatching/", cache=TRUE, autodep=TRUE, tidy=FALSE) | |
``` | |
## Default Synapter Preprocessing | |
(same as in `synergise`) |
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
importSIMS <- function(path) { | |
stopifnot(file.exists(path) && file.info(path)$isdir) | |
## find all txt files | |
files <- list.files(path, pattern="^.*\\.txt$", full.names=TRUE, recursive=TRUE) | |
files <- normalizePath(files) | |
## read metadata (first 8 lines) of the SIMS file | |
ll <- lapply(files, function(f)readLines(f, n=8)) |
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") | |
########################################################################### | |
## some boring stuff to prepare the Synapter object | |
########################################################################### | |
fasfile <- synapterdata::getFasta() | |
mstrfile <- synapterdata::getMaster() | |
pepfile <- synapterdata::getMSeFinalPeptide()[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
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 |
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
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
\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
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
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("shiny") | |
library("MALDIquant") | |
library("MALDIquantForeign") | |
options(shiny.maxRequestSize=200*1024^2) | |
data("fiedler2009subset") | |
convertYlim <- function(lim, fun) { |