Mercurial > repos > pieterlukasse > prims_metabolomics
comparison metaMS_cmd_annotate.r @ 53:70574a6381ea
small fixes
author | pieter.lukasse@wur.nl |
---|---|
date | Thu, 11 Dec 2014 14:09:27 +0100 |
parents | f772a5caa86a |
children |
comparison
equal
deleted
inserted
replaced
52:5b1adc49700d | 53:70574a6381ea |
---|---|
8 args.settings <- args[3] | 8 args.settings <- args[3] |
9 | 9 |
10 ## output file names, e.g. "E:/Rworkspace/metaMS/data/out.txt" | 10 ## output file names, e.g. "E:/Rworkspace/metaMS/data/out.txt" |
11 args.outAnnotationTable <- args[4] | 11 args.outAnnotationTable <- args[4] |
12 | 12 |
13 args.mass_error_function <- args[5] | |
14 if (args.mass_error_function == "0") | |
15 args.mass_error_function <- NULL | |
13 ## report files | 16 ## report files |
14 args.htmlReportFile <- args[5] | 17 args.htmlReportFile <- args[6] |
15 args.htmlReportFile.files_path <- args[6] | 18 args.htmlReportFile.files_path <- args[7] |
16 | 19 |
17 if (length(args) == 7) | 20 if (length(args) == 8) |
18 { | 21 { |
19 args.outLogFile <- args[7] | 22 args.outLogFile <- args[8] |
20 # suppress messages: | 23 # suppress messages: |
21 # Send all STDERR to STDOUT using sink() see http://mazamascience.com/WorkingWithData/?p=888 | 24 # Send all STDERR to STDOUT using sink() see http://mazamascience.com/WorkingWithData/?p=888 |
22 msg <- file(args.outLogFile, open="wt") | 25 msg <- file(args.outLogFile, open="wt") |
23 sink(msg, type="message") | 26 sink(msg, type="message") |
24 sink(msg, type="output") | 27 sink(msg, type="output") |
41 source(args.settings, local=tempEnv) | 44 source(args.settings, local=tempEnv) |
42 message(paste(" loaded : ", args.settings)) | 45 message(paste(" loaded : ", args.settings)) |
43 | 46 |
44 # Just to highlight: if you want to use more than one | 47 # Just to highlight: if you want to use more than one |
45 # trigger runLC: | 48 # trigger runLC: |
46 LC <- runLC(xset=xsetData, settings = tempEnv[["customMetaMSsettings"]], DB = tempEnv[[testDB[1]]]$DB, nSlaves=20, returnXset = TRUE) | 49 LC <- runLC(xset=xsetData, settings = tempEnv[["customMetaMSsettings"]], DB = tempEnv[[testDB[1]]]$DB, errf=args.mass_error_function, nSlaves=20, returnXset = TRUE) |
47 | 50 |
48 # write out runLC annotation results: | 51 # write out runLC annotation results: |
49 write.table(LC$PeakTable, args.outAnnotationTable, sep="\t", row.names=FALSE) | 52 write.table(LC$PeakTable, args.outAnnotationTable, sep="\t", row.names=FALSE) |
50 | 53 |
51 # the used constructed DB (write to log): | 54 # the used constructed DB (write to log): |
52 cat("\nConstructed DB info===============:\n") | 55 cat("\nConstructed DB info===============:\n") |
53 str(tempEnv[[testDB[1]]]$Info) | 56 str(tempEnv[[testDB[1]]]$Info) |
54 cat("\nConstructed DB table===============:\n") | 57 cat("\nConstructed DB table===============:\n") |
55 if (length(args) == 7) | 58 if (length(args) == 8) |
56 { | 59 { |
57 write.table(tempEnv[[testDB[1]]]$DB, args.outLogFile, append=TRUE, row.names=FALSE) | 60 write.table(tempEnv[[testDB[1]]]$DB, args.outLogFile, append=TRUE, row.names=FALSE) |
58 write.table(tempEnv[[testDB[1]]]$Reftable, args.outLogFile, sep="\t", append=TRUE, row.names=FALSE) | 61 write.table(tempEnv[[testDB[1]]]$Reftable, args.outLogFile, sep="\t", append=TRUE, row.names=FALSE) |
59 } | 62 } |
60 | 63 |