Mercurial > repos > galaxyp > maldi_quant_peak_detection
comparison maldi_quant_peakdetection.xml @ 5:e66f552a3c47 draft
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/MALDIquant commit 218c44b9ba1b5f0f47edb743ed70075fb661386e"
author | galaxyp |
---|---|
date | Thu, 19 Mar 2020 18:09:47 -0400 |
parents | e9300ef37403 |
children | d286ff4600dd |
comparison
equal
deleted
inserted
replaced
4:e9300ef37403 | 5:e66f552a3c47 |
---|---|
1 <tool id="maldi_quant_peak_detection" name="MALDIquant peak detection" version="@VERSION@.4"> | 1 <tool id="maldi_quant_peak_detection" name="MALDIquant peak detection" version="@VERSION@.5"> |
2 <description> | 2 <description> |
3 Peak detection, binning and filtering for mass-spectrometry imaging data | 3 Peak detection, binning and filtering for mass-spectrometry imaging data |
4 </description> | 4 </description> |
5 <macros> | 5 <macros> |
6 <import>maldi_macros.xml</import> | 6 <import>maldi_macros.xml</import> |
14 #elif $infile.ext == 'analyze75' | 14 #elif $infile.ext == 'analyze75' |
15 cp '${infile.extra_files_path}/hdr' infile.hdr && | 15 cp '${infile.extra_files_path}/hdr' infile.hdr && |
16 cp '${infile.extra_files_path}/img' infile.img && | 16 cp '${infile.extra_files_path}/img' infile.img && |
17 cp '${infile.extra_files_path}/t2m' infile.t2m && | 17 cp '${infile.extra_files_path}/t2m' infile.t2m && |
18 #else | 18 #else |
19 ln -s $infile infile.RData && | 19 ln -s '$infile' infile.RData && |
20 #end if | 20 #end if |
21 Rscript '${maldi_quant_peak_detection}'&& | 21 cat '${maldi_quant_peak_detection}' && |
22 Rscript '${maldi_quant_peak_detection}' && | |
22 mkdir $outfile_imzml.files_path && | 23 mkdir $outfile_imzml.files_path && |
23 mv ./out.imzMl "${os.path.join($outfile_imzml.files_path, 'imzml')}" | true && | 24 mv ./out.imzMl "${os.path.join($outfile_imzml.files_path, 'imzml')}" | true && |
24 mv ./out.ibd "${os.path.join($outfile_imzml.files_path, 'ibd')}" | true && | 25 mv ./out.ibd "${os.path.join($outfile_imzml.files_path, 'ibd')}" | true && |
25 echo "imzML file:" > $outfile_imzml && | 26 echo "imzML file:" > $outfile_imzml && |
26 ls -l "$outfile_imzml.files_path" >> $outfile_imzml | 27 ls -l "$outfile_imzml.files_path" >> $outfile_imzml |
357 tolerance=$method.methods_conditional.tolerance, method="$method.methods_conditional.warping_method", | 358 tolerance=$method.methods_conditional.tolerance, method="$method.methods_conditional.warping_method", |
358 allowNoMatches=$method.methods_conditional.allow_nomatch, reference = mass_list) | 359 allowNoMatches=$method.methods_conditional.allow_nomatch, reference = mass_list) |
359 ## 2) warp spectra: | 360 ## 2) warp spectra: |
360 peaks_new_list = warpMassPeaks(list(peaks[[pixelnb]]), warping_function, emptyNoMatches=$method.methods_conditional.empty_nomatch) | 361 peaks_new_list = warpMassPeaks(list(peaks[[pixelnb]]), warping_function, emptyNoMatches=$method.methods_conditional.empty_nomatch) |
361 } | 362 } |
362 peaks_new = peaks_new_list | 363 peaks = peaks_new_list |
363 | 364 |
364 #end if | 365 #end if |
365 | 366 |
367 #end if | |
368 | |
369 #if $method.methods_conditional.remove_empty: | |
370 print(paste(length(findEmptyMassObjects(peaks)), " empty spectra were removed", sep=" ")) | |
371 | |
372 ## only if there are empty spectra to remove | |
373 | |
374 if (length(findEmptyMassObjects(peaks))>0) | |
375 | |
376 { | |
377 #if $infile.ext == 'rdata' | |
378 cardinal_coordinates = cardinal_coordinates[-findEmptyMassObjects(peaks),,drop=FALSE] ## remove coordinates of empty spectra for Cardinal RData input | |
379 #end if | |
380 | |
381 peaks = removeEmptyMassObjects(peaks) | |
382 } | |
366 #end if | 383 #end if |
367 | 384 |
368 ## QC plot and numbers | 385 ## QC plot and numbers |
369 par(mfrow = c(2, 2), oma=c(0,0,2,0)) | 386 par(mfrow = c(2, 2), oma=c(0,0,2,0)) |
387 | |
370 for (random_sample in random_spectra){ | 388 for (random_sample in random_spectra){ |
371 plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))} | 389 |
390 | |
391 tryCatch( | |
392 { | |
393 plot(peaks[[random_sample]], sub="", main=paste0("spectrum ", pixelnames[random_sample]))}, | |
394 error=function(cond) { | |
395 plot(NULL, xlim=c(0,0), ylim=c(0,0), ylab="intensity", xlab="m/z") | |
396 } | |
397 ) | |
398 } | |
399 | |
372 title("Aligned spectra", outer=TRUE, line=0) | 400 title("Aligned spectra", outer=TRUE, line=0) |
373 minmz = round(min(unlist(lapply(peaks,mass))), digits=4) | 401 minmz = round(min(unlist(lapply(peaks,mass))), digits=4) |
374 maxmz = round(max(unlist(lapply(peaks,mass))), digits=4) | 402 maxmz = round(max(unlist(lapply(peaks,mass))), digits=4) |
375 mean_features = round(length(unlist(lapply(peaks,mass)))/length(peaks), digits=2) | 403 mean_features = round(length(unlist(lapply(peaks,mass)))/length(peaks), digits=2) |
376 medint = round(median(unlist(lapply(peaks,intensity))), digits=2) | 404 medint = round(median(unlist(lapply(peaks,intensity))), digits=2) |