comparison anticipated_purity_dims.R @ 1:3f1f2d545f3a draft

planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 0aa10df0ec1ed71601f932cfb11d7d4d4f620d80-dirty
author tomnl
date Wed, 02 May 2018 14:08:21 -0400
parents 4b417094bf71
children ac8738f96e53
comparison
equal deleted inserted replaced
0:4b417094bf71 1:3f1f2d545f3a
30 df <- read.table(opt$peaks_file, header = TRUE, sep='\t') 30 df <- read.table(opt$peaks_file, header = TRUE, sep='\t')
31 filename = NA 31 filename = NA
32 }else{ 32 }else{
33 indf <- read.table(opt$peaks_file, 33 indf <- read.table(opt$peaks_file,
34 header = TRUE, sep='\t', stringsAsFactors = FALSE) 34 header = TRUE, sep='\t', stringsAsFactors = FALSE)
35 35
36 filename = colnames(indf)[8:ncol(indf)][opt$file_num_dimspy] 36 filename = colnames(indf)[8:ncol(indf)][opt$file_num_dimspy]
37 print(filename)
37 # check if the data file is mzML or RAW (can only use mzML currently) so 38 # check if the data file is mzML or RAW (can only use mzML currently) so
38 # we expect an mzML file of the same name in the same folder 39 # we expect an mzML file of the same name in the same folder
39 indf$i <- indf[,colnames(indf)==filename] 40 indf$i <- indf[,colnames(indf)==filename]
40 indf[,colnames(indf)==filename] <- as.numeric(indf[,colnames(indf)==filename]) 41 indf[,colnames(indf)==filename] <- as.numeric(indf[,colnames(indf)==filename])
41 42
42 filename = sub("raw", "mzML", filename, ignore.case = TRUE) 43 filename = sub("raw", "mzML", filename, ignore.case = TRUE)
43 44 print(filename)
44 df <- indf[4:nrow(indf),] 45 df <- indf[4:nrow(indf),]
45 if ('blank_flag' %in% colnames(df)){ 46 if ('blank_flag' %in% colnames(df)){
46 df <- df[df$blank_flag==1,] 47 df <- df[df$blank_flag==1,]
47 } 48 }
48 49