Chase Clark June 11, 2018
Examples of both MALDI MS1 and LC-MS/MS files
First few lines of mzXML file:
| #Read in data | |
| party_ready <- read_csv("Data/party_ready.csv") | |
| #Copy data | |
| party_time <- party_ready | |
| #Get columns with percents | |
| columns_with_pct <- grep("pct",colnames(party_time)) | |
| #Convert percents as strings to percents as double |
| # cols is a vector of named colors | |
| # First we convert the named colors to rgb, and store the values in a list | |
| rgbVals<-lapply(cols,col2rgb) | |
| # Then convert the list to a data frame and flip it | |
| rgbVals<-t(as.data.frame(rgbVals,col.names = seq(1,length(rgbVals),by=1))) | |
| # Then we convert the rgb values to HEX | |
| hexVal<-sapply(1:length(rgbVal[,1]),function(x){ rgb(rgbVal[x,"red"],rgbVal[x,"green"],rgbVal[x,"blue"],maxColorValue = 255) }) |
| #define IncludeRtools true | |
| #-------------------------------------- | |
| #if IncludeRtools | |
| Source: "Rtools34.exe"; DestDir: "{tmp}"; Check: RtoolsNeeded | |
| #endif |
| # | |
| # output$pcaplot3d <- renderRglwidget({ | |
| # | |
| # e<-pcaCalculation() | |
| # | |
| # if(!any(names(e) == 'd')){ | |
| # e<-cbind(e,d=rep("black",length(e[,1]))) | |
| # } | |
| # |
| # e<-pcaCalculation() | |
| # | |
| # if(any(names(e) == 'd')){ | |
| # | |
| # p<-ggplot(e,aes(Dim.1,Dim.2,label=nam,col=factor(e$d)))+ | |
| # geom_text()+ | |
| # xlab("Dimension 1")+ | |
| # ylab("Dimension 2")+ | |
| # ggtitle("Zoomable PCA of Protein MALDI Spectra")+ |
| if(!length(grep("mzR",row.names(installed.packages())))){ | |
| if(!length(grep("BiocInstaller",row.names(installed.packages())))){ | |
| source("https://bioconductor.org/biocLite.R") | |
| biocLite("BiocInstaller",suppressUpdates = T) | |
| } | |
| source("https://bioconductor.org/biocLite.R") | |
| biocLite("mzR",ask=F) | |
| } |
| # capture the current working directory | |
| # set the package search path to the app specific library | |
| appwd <- getwd() | |
| applibpath <- file.path(appwd, "library") | |
| # Load functions to ensure software dependencies and check the internet | |
| source("utils/ensure.R") | |
| # Create app/library if it doesn't exist (e.g. first run) | |
| # Initialize RInno |
| 4 | |
| MENVMSWFNIDFEIKSDNNIDKTLL | |
| 3017.418 | |
| 3.918049 | |
| 5 | |
| MKFYTIKLPKFLGGIVRAMLGSFRKD | |
| 3017.730 | |
| 11.254379 |
| spongeSmallIn <- readRDS("data/spongeSmall.rds") | |
| spongeSmall <- MALDIquant::intensityMatrix(spongeSmallIn) | |
| spongeSmall[is.na(spongeSmall)] <- 0.000000001 | |
| spongeSmall <- prcomp(log10(spongeSmall)) | |
| spongeSmall <- spongeSmall$x[,1:50] | |
| z <- sapply(spongeSmallIn, function(x) x@metaData$Strain ) | |
| q <- as.data.frame(spongeSmall) | |
| rownames(q) <- z | |