Mercurial > repos > lecorguille > msnbase_readmsdata
comparison msnbase_readmsdata.r @ 13:cda005bc221c draft
"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit f1caf2a3bf23cf319a75dd12c86402555dd02617"
| author | workflow4metabolomics |
|---|---|
| date | Wed, 12 Feb 2020 13:24:24 +0000 |
| parents | 144392dd4a31 |
| children | cdebdb178031 |
comparison
equal
deleted
inserted
replaced
| 12:d1ec753f586f | 13:cda005bc221c |
|---|---|
| 36 cat("\tINFILE PROCESSING INFO\n") | 36 cat("\tINFILE PROCESSING INFO\n") |
| 37 | 37 |
| 38 # Handle infiles | 38 # Handle infiles |
| 39 if (!exists("singlefile")) singlefile <- NULL | 39 if (!exists("singlefile")) singlefile <- NULL |
| 40 if (!exists("zipfile")) zipfile <- NULL | 40 if (!exists("zipfile")) zipfile <- NULL |
| 41 rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args) | 41 rawFilePath <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile, args) |
| 42 zipfile <- rawFilePath$zipfile | 42 zipfile <- rawFilePath$zipfile |
| 43 singlefile <- rawFilePath$singlefile | 43 singlefile <- rawFilePath$singlefile |
| 44 directory <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile) | 44 files <- rawFilePath$files |
| 45 | 45 |
| 46 # Check some character issues | 46 md5sumList <- list("origin" = getMd5sum(files)) |
| 47 md5sumList <- list("origin" = getMd5sum(directory)) | |
| 48 checkXmlStructure(directory) | |
| 49 checkFilesCompatibilityWithXcms(directory) | |
| 50 | |
| 51 | 47 |
| 52 cat("\n\n") | 48 cat("\n\n") |
| 53 | 49 |
| 54 | 50 |
| 55 # ----- MAIN PROCESSING INFO ----- | 51 # ----- MAIN PROCESSING INFO ----- |
| 56 cat("\tMAIN PROCESSING INFO\n") | 52 cat("\tMAIN PROCESSING INFO\n") |
| 57 | 53 |
| 58 | 54 |
| 59 cat("\t\tCOMPUTE\n") | 55 cat("\t\tCOMPUTE\n") |
| 60 | |
| 61 ## Get the full path to the files | |
| 62 files <- getMSFiles(directory) | |
| 63 | 56 |
| 64 cat("\t\t\tCreate a phenodata data.frame\n") | 57 cat("\t\t\tCreate a phenodata data.frame\n") |
| 65 s_groups <- sapply(files, function(x) tail(unlist(strsplit(dirname(x),"/")), n=1)) | 58 s_groups <- sapply(files, function(x) tail(unlist(strsplit(dirname(x),"/")), n=1)) |
| 66 s_name <- tools::file_path_sans_ext(basename(files)) | 59 s_name <- tools::file_path_sans_ext(basename(files)) |
| 67 pd <- data.frame(sample_name=s_name, sample_group=s_groups, stringsAsFactors=FALSE) | 60 pd <- data.frame(sample_name=s_name, sample_group=s_groups, stringsAsFactors=FALSE) |
