Mercurial > repos > galaxyp > cardinal_spectra_plots
comparison spectra_plots.xml @ 3:58c4aef16eb0 draft
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 2c4a1a862900b4efbc30824cbcb798f835b168b2
author | galaxyp |
---|---|
date | Thu, 28 Feb 2019 09:27:53 -0500 |
parents | 3642ed221eb2 |
children | 9b6b86e771c2 |
comparison
equal
deleted
inserted
replaced
2:3642ed221eb2 | 3:58c4aef16eb0 |
---|---|
54 ## set NA to 0 otherwise plot function will not work | 54 ## set NA to 0 otherwise plot function will not work |
55 | 55 |
56 #if str($processed_cond.processed_file) == "processed": | 56 #if str($processed_cond.processed_file) == "processed": |
57 ##processed file needs to be converted into matrix to be able to replace NAs | 57 ##processed file needs to be converted into matrix to be able to replace NAs |
58 iData(msidata) <- iData(msidata)[] | 58 iData(msidata) <- iData(msidata)[] |
59 spectra(msidata)[][is.na(spectra(msidata)[])] = 0 | 59 spectra(msidata)[is.na(spectra(msidata))] = 0 |
60 #else | 60 #else |
61 spectra(msidata)[is.na(spectra(msidata))] = 0 | 61 spectra(msidata)[is.na(spectra(msidata))] = 0 |
62 #end if | 62 #end if |
63 | 63 |
64 ## run only if mz and pixels are > 0 | 64 ## run only if mz and pixels are > 0 |
99 abline(v=$chosenpixel.inputx, col ="$chosenpixel.inputcolour", lty="$chosenpixel.inputtype", lwd=$chosenpixel.inputwidth) | 99 abline(v=$chosenpixel.inputx, col ="$chosenpixel.inputcolour", lty="$chosenpixel.inputtype", lwd=$chosenpixel.inputwidth) |
100 abline(h=$chosenpixel.inputy, col ="$chosenpixel.inputcolour", lty="$chosenpixel.inputtype", lwd=$chosenpixel.inputwidth) | 100 abline(h=$chosenpixel.inputy, col ="$chosenpixel.inputcolour", lty="$chosenpixel.inputtype", lwd=$chosenpixel.inputwidth) |
101 | 101 |
102 ##################### III) plot full mass spectrum ################# | 102 ##################### III) plot full mass spectrum ################# |
103 | 103 |
104 plot(msidata, coord=list(x=$chosenpixel.inputx, y=$chosenpixel.inputy)) | 104 plot(msidata, coord=list(x=$chosenpixel.inputx, y=$chosenpixel.inputy), main="Mass spectrum of full m/z range") |
105 | 105 |
106 ##################### IV) plot zoom-in mass spectrum ############### | 106 ##################### IV) plot zoom-in mass spectrum ############### |
107 | 107 |
108 #if $chosenpixel.zoomedplot: | 108 #if $chosenpixel.zoomedplot: |
109 | 109 |
197 ## print legend only for less than 10 samples | 197 ## print legend only for less than 10 samples |
198 if (length(levels(msidata\$annotation)) < 10){ | 198 if (length(levels(msidata\$annotation)) < 10){ |
199 key_legend = TRUE | 199 key_legend = TRUE |
200 }else{key_legend = FALSE} | 200 }else{key_legend = FALSE} |
201 | 201 |
202 plot(msidata, pixel=1:ncol(msidata), pixel.groups=msidata\$annotation, key=key_legend, col=hue_pal()(length(levels(msidata\$annotation))),superpose=TRUE) | 202 plot(msidata, pixel=1:ncol(msidata), pixel.groups=msidata\$annotation, key=key_legend, col=hue_pal()(length(levels(msidata\$annotation))),superpose=TRUE, main="Average mass spectrum of full m/z range") |
203 }else{ | 203 }else{ |
204 plot(msidata, pixel=1:ncol(msidata), key=TRUE)} | 204 plot(msidata, pixel=1:ncol(msidata), key=TRUE, main="Average mass spectrum of full m/z range")} |
205 | 205 |
206 ##################### II) Sample: plot zoom-in mass spectrum ########## | 206 ##################### II) Sample: plot zoom-in mass spectrum ########## |
207 | 207 |
208 #if $pixel_conditional.zoomed_sample: | 208 #if $pixel_conditional.zoomed_sample: |
209 #for $token in $pixel_conditional.zoomed_sample: | 209 #for $token in $pixel_conditional.zoomed_sample: |