Mercurial > repos > tomnl > track_rt_raw
comparison frag4feature.R @ 4:a8d243fcf676 draft
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 9ea2ca0892fa55c21491c93afba790e8d9427e01-dirty
| author | tomnl |
|---|---|
| date | Wed, 04 Apr 2018 16:34:45 -0400 |
| parents | 31c68f2d97b5 |
| children | deea5e9205d9 |
comparison
equal
deleted
inserted
replaced
| 3:31c68f2d97b5 | 4:a8d243fcf676 |
|---|---|
| 63 opt<- parse_args(OptionParser(option_list=option_list)) | 63 opt<- parse_args(OptionParser(option_list=option_list)) |
| 64 | 64 |
| 65 loadRData <- function(rdata_path, name){ | 65 loadRData <- function(rdata_path, name){ |
| 66 #loads an RData file, and returns the named xset object if it is there | 66 #loads an RData file, and returns the named xset object if it is there |
| 67 load(rdata_path) | 67 load(rdata_path) |
| 68 return(get(ls()[ls() == name])) | 68 return(get(ls()[ls() %in% name])) |
| 69 } | |
| 70 | |
| 71 # This function retrieve a xset like object | |
| 72 #@author Gildas Le Corguille lecorguille@sb-roscoff.fr | |
| 73 getxcmsSetObject <- function(xobject) { | |
| 74 # XCMS 1.x | |
| 75 if (class(xobject) == "xcmsSet") | |
| 76 return (xobject) | |
| 77 # XCMS 3.x | |
| 78 if (class(xobject) == "XCMSnExp") { | |
| 79 # Get the legacy xcmsSet object | |
| 80 suppressWarnings(xset <- as(xobject, 'xcmsSet')) | |
| 81 sampclass(xset) <- xset@phenoData$sample_group | |
| 82 return (xset) | |
| 83 } | |
| 69 } | 84 } |
| 70 | 85 |
| 71 # Requires | 86 # Requires |
| 72 pa <- loadRData(opt$pa, 'pa') | 87 pa <- loadRData(opt$pa, 'pa') |
| 73 xset <- loadRData(opt$xset, 'xset') | 88 xset <- loadRData(opt$xset, c('xset','xdata')) |
| 89 xset <- getxcmsSetObject(xset) | |
| 74 | 90 |
| 75 pa@cores <- opt$cores | 91 pa@cores <- opt$cores |
| 76 | 92 |
| 77 print(pa@fileList) | 93 print(pa@fileList) |
| 78 print(xset@filepaths) | 94 print(xset@filepaths) |
| 100 pa <- fix[[1]] | 116 pa <- fix[[1]] |
| 101 xset <- fix[[2]] | 117 xset <- fix[[2]] |
| 102 | 118 |
| 103 if(is.null(opt$grp_peaklist)){ | 119 if(is.null(opt$grp_peaklist)){ |
| 104 grp_peaklist = NA | 120 grp_peaklist = NA |
| 105 | |
| 106 | |
| 107 }else{ | 121 }else{ |
| 108 grp_peaklist = opt$grp_peaklist | 122 grp_peaklist = opt$grp_peaklist |
| 109 } | 123 } |
| 110 | 124 |
| 111 print('heck') | 125 print('heck') |
