Mercurial > repos > galaxyp > cardinal_classification
changeset 3:585ef27873c9 draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 2c4a1a862900b4efbc30824cbcb798f835b168b2
line wrap: on
line diff
--- a/classification.xml Fri Feb 15 10:18:51 2019 -0500 +++ b/classification.xml Thu Feb 28 09:24:53 2019 -0500 @@ -33,6 +33,10 @@ ## to make sure that processed files work as well: iData(msidata) = iData(msidata)[] +## remove duplicated coordinates +print(paste0(sum(duplicated(coord(msidata))), " duplicated coordinates were removed")) +msidata <- msidata[,!duplicated(coord(msidata))] + @DATA_PROPERTIES_INRAM@ @@ -231,10 +235,13 @@ ### m/z and pixel information output pls_classes = data.frame(msidata.pls\$classes[[1]]) - pixel_names = gsub(", y = ", "_", names(pixels(msidata))) - pixel_names = gsub(" = ", "y_", pixel_names) - x_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,2] - y_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,3] + ## pixel names and coordinates + ## to remove potential sample names and z dimension, split at comma and take only x and y + x_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 1)) + y_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 2)) + x_coordinates = gsub("x = ","",x_coords) + y_coordinates = gsub(" y = ","",y_coords) + pixel_names = paste0("xy_", x_coordinates, "_", y_coordinates) ## remove msidata to clean up RAM space rm(msidata) @@ -373,12 +380,15 @@ maximumy = max(coord(msidata)[,2]) print(image(msidata, mz = topLabels(msidata.opls)[1,1], normalize.image = "linear", contrast.enhance = "histogram",smooth.image="gaussian", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), main="best m/z heatmap")) - ## m/z and pixel information output opls_classes = data.frame(msidata.opls\$classes[[1]]) - pixel_names = gsub(", y = ", "_", names(pixels(msidata))) - pixel_names = gsub(" = ", "y_", pixel_names) - x_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,2] - y_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,3] + ## pixel names and coordinates + ## to remove potential sample names and z dimension, split at comma and take only x and y + x_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 1)) + y_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 2)) + x_coordinates = gsub("x = ","",x_coords) + y_coordinates = gsub(" y = ","",y_coords) + pixel_names = paste0("xy_", x_coordinates, "_", y_coordinates) + opls_classes2 = data.frame(pixel_names, x_coordinates, y_coordinates, opls_classes) colnames(opls_classes2) = c("pixel names", "x", "y","predicted condition") @@ -520,10 +530,15 @@ ## m/z and pixel information output ssc_classes = data.frame(msidata.ssc\$classes[[1]]) - pixel_names = gsub(", y = ", "_", names(pixels(msidata))) - pixel_names = gsub(" = ", "y_", pixel_names) - x_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,2] - y_coordinates = matrix(unlist(strsplit(pixel_names, "_")), ncol=3, byrow=TRUE)[,3] + + ## pixel names and coordinates + ## to remove potential sample names and z dimension, split at comma and take only x and y + x_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 1)) + y_coords = unlist(lapply(strsplit(names(pixels(msidata)), ","), `[[`, 2)) + x_coordinates = gsub("x = ","",x_coords) + y_coordinates = gsub(" y = ","",y_coords) + pixel_names = paste0("xy_", x_coordinates, "_", y_coordinates) + ## remove msidata to clean up RAM space rm(msidata)
--- a/test-data/preprocessing_results1.imzml Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results1.imzml Thu Feb 28 09:24:53 2019 -0500 @@ -9,8 +9,8 @@ <fileContent> <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" /> <cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" /> - <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{002DF5BA-0549-44DF-A8BB-27DA3E197EB7}" /> - <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="0379019A6F9D0B55F9217420030633F7163AF9D3" /> + <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{728FBFFE-E6FC-4283-8068-393A66F6BD5C}" /> + <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="375094460F3B80674CB2F541DCD9928B3D61B2FF" /> <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" /> </fileContent> </fileDescription>
--- a/test-data/preprocessing_results1.imzml.txt Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results1.imzml.txt Thu Feb 28 09:24:53 2019 -0500 @@ -1,4 +1,4 @@ imzML file: total 24 --rw-r--r-- 1 meli meli 96 Feb 12 21:24 ibd --rw-r--r-- 1 meli meli 16714 Feb 12 21:24 imzml +-rw-r--r-- 1 meli meli 96 Feb 24 14:11 ibd +-rw-r--r-- 1 meli meli 16714 Feb 24 14:11 imzml
--- a/test-data/preprocessing_results2.imzml Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results2.imzml Thu Feb 28 09:24:53 2019 -0500 @@ -9,8 +9,8 @@ <fileContent> <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" /> <cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" /> - <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{84BEACDD-B841-4730-81A0-A19A28C7B48A}" /> - <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="1BC49DCCC566E7A6938CE3DE62090650C2A04798" /> + <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{40F230A1-1893-4A8C-BAE2-A8BBEF24DB20}" /> + <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="417ADF38FBC4D0304A9B75B4C85799137846DD2F" /> <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" /> </fileContent> </fileDescription>
--- a/test-data/preprocessing_results2.imzml.txt Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results2.imzml.txt Thu Feb 28 09:24:53 2019 -0500 @@ -1,4 +1,4 @@ imzML file: total 80 --rw-r--r-- 1 meli meli 54720 Feb 12 21:25 ibd --rw-r--r-- 1 meli meli 21132 Feb 12 21:25 imzml +-rw-r--r-- 1 meli meli 54720 Feb 24 14:12 ibd +-rw-r--r-- 1 meli meli 21132 Feb 24 14:12 imzml
--- a/test-data/preprocessing_results3.imzml Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results3.imzml Thu Feb 28 09:24:53 2019 -0500 @@ -9,8 +9,8 @@ <fileContent> <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" /> <cvParam cvRef="MS" accession="MS:1000127" name="centroid spectrum" value="" /> - <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{4C387879-DE12-49A4-878F-6980D6F7C6F0}" /> - <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="94ED775BCF16644D23DACFCA1E62D28D5C755178" /> + <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{D767424F-5E74-45AB-AF1B-0D25244B435B}" /> + <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="445E32981D0B3D08ED2BA74E11500A3A08CDB9B7" /> <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" /> </fileContent> </fileDescription>
--- a/test-data/preprocessing_results3.imzml.txt Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results3.imzml.txt Thu Feb 28 09:24:53 2019 -0500 @@ -1,4 +1,4 @@ imzML file: total 36 --rw-r--r-- 1 meli meli 14216 Feb 12 21:26 ibd --rw-r--r-- 1 meli meli 16824 Feb 12 21:26 imzml +-rw-r--r-- 1 meli meli 14216 Feb 24 14:12 ibd +-rw-r--r-- 1 meli meli 16824 Feb 24 14:12 imzml
--- a/test-data/preprocessing_results4.imzml Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results4.imzml Thu Feb 28 09:24:53 2019 -0500 @@ -9,8 +9,8 @@ <fileContent> <cvParam cvRef="MS" accession="MS:1000579" name="MS1 spectrum" value="" /> <cvParam cvRef="MS" accession="MS:1000128" name="profile spectrum" value="" /> - <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{26018306-9D72-49F5-89CB-68E4DDE0527C}" /> - <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="BA6411EC5A5A59ABE5BD7005F4ED8FCEBA775A8E" /> + <cvParam cvRef="IMS" accession="IMS:1000080" name="universally unique identifier" value="{FE932E04-42E4-4D89-B721-2A6CE83250B6}" /> + <cvParam cvRef="IMS" accession="IMS:1000091" name="ibd SHA-1" value="36C7C916C176DD85CBBF4B7FA969C92B9403768D" /> <cvParam cvRef="IMS" accession="IMS:1000030" name="continuous" value="" /> </fileContent> </fileDescription>
--- a/test-data/preprocessing_results4.imzml.txt Fri Feb 15 10:18:51 2019 -0500 +++ b/test-data/preprocessing_results4.imzml.txt Thu Feb 28 09:24:53 2019 -0500 @@ -1,4 +1,4 @@ imzML file: total 28 --rw-r--r-- 1 meli meli 6376 Feb 12 21:29 ibd --rw-r--r-- 1 meli meli 16801 Feb 12 21:29 imzml +-rw-r--r-- 1 meli meli 6376 Feb 24 14:13 ibd +-rw-r--r-- 1 meli meli 16801 Feb 24 14:13 imzml