annotate flatten_mzIdentML.R @ 75:792056ff8ed5 draft

Uploaded
author bornea
date Fri, 02 Sep 2016 16:32:26 -0400
parents 47aa4f551c53
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
1 #! /usr/bin/Rscript
74
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
2 ins_check_run <- function() {
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
3 if ("mzID" %in% rownames(installed.packages())){}
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
4 else {
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
5 source("https://bioconductor.org/biocLite.R")
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
6 biocLite('mzID')
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
7 }
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
8 if ('dplyr' %in% rownames(installed.packages())){}
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
9 else {
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
10 install.packages('dplyr', repos='http://cran.us.r-project.org')
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
11 }
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
12 }
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
13
47aa4f551c53 Uploaded
bornea
parents: 66
diff changeset
14 ins_check_run()
66
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
15 args <- commandArgs(trailingOnly = TRUE)
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
16 #source("https://bioconductor.org/biocLite.R")
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
17 #biocLite("mzID")
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
18 library(mzID)
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
19 library(dplyr)
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
20 mzResults <- mzID(args[1])
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
21 flatresults <- flatten(mzResults)
d8cc862e6412 Uploaded
bornea
parents:
diff changeset
22 write.table(flatresults,"flat_mzIdentML.txt",sep="\t",quote=FALSE,row.names=FALSE)