extract sample header information in batch process
0
0
Entering edit mode
@trinhkcs85-11878
Last seen 4.9 years ago

Hi,

I would like help on writing a code in R to extract simple sample header information i.e. sample name, instrument type, date, user, etc from mzXML files and coerce the information into a data.frame of some sort and then use write.table to output it into a .txt or .csv file for easy viewing and cataloging. I am not an expert R user and this is what I have gathered so far. However, it can only return the partial information from one file. Is it possible to run in batch process from an entire directory of say, 1000 files? Please advise, thanks for your help.

library("mzR")
file<-list.files("C:/Users/sktrinh", pattern="\\.mzXML$",full.names=T,recursive=T)

mz<-openMSfile(file[4])
mz.1<-as.data.frame(instrumentInfo(mz))
mz.1 <- cbind(mz.1, path=file[4])[,c(6,1,2,3,4,5)]
write.csv(mz.1,"C:/Users/sktrinh/mzxml_output.csv")

 

mzR mzxml files • 514 views
ADD COMMENT

Login before adding your answer.

Traffic: 226 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6