Mercurial > repos > galaxyp > cardinal_preprocessing
comparison preprocessing.xml @ 18:83aac7741200 draft default tip
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit 91e77c139cb3b7c6d67727dc39140dd79355fa0c
author | galaxyp |
---|---|
date | Thu, 04 Jul 2024 13:38:14 +0000 |
parents | 611d80c0e29d |
children |
comparison
equal
deleted
inserted
replaced
17:611d80c0e29d | 18:83aac7741200 |
---|---|
1 <tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.1"> | 1 <tool id="cardinal_preprocessing" name="MSI preprocessing" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> |
2 <description> | 2 <description> |
3 mass spectrometry imaging preprocessing | 3 mass spectrometry imaging preprocessing |
4 </description> | 4 </description> |
5 <macros> | 5 <macros> |
6 <import>macros.xml</import> | 6 <import>macros.xml</import> |
7 </macros> | 7 </macros> |
8 <expand macro="requirements"> | 8 <expand macro="requirements"/> |
9 <requirement type="package" version="2.3">r-gridextra</requirement> | |
10 <requirement type="package" version="3.4.0">r-ggplot2</requirement> | |
11 <requirement type="package" version="3.40.0">bioconductor-sva</requirement> | |
12 <requirement type="package" version="1.1.0.1">r-randomcolor</requirement> | |
13 </expand> | |
14 <command detect_errors="exit_code"> | 9 <command detect_errors="exit_code"> |
15 <![CDATA[ | 10 <![CDATA[ |
16 | 11 |
17 @INPUT_LINKING@ | 12 @INPUT_LINKING@ |
18 cat '${cardinal_preprocessing}' && | 13 cat '${cardinal_preprocessing}' && |
369 #elif str( $method.methods_conditional.preprocessing_method) == 'Mass_binning': | 364 #elif str( $method.methods_conditional.preprocessing_method) == 'Mass_binning': |
370 print('mass binning') | 365 print('mass binning') |
371 | 366 |
372 #if str($method.methods_conditional.mz_range.features_filtering) == 'change_mz_range': | 367 #if str($method.methods_conditional.mz_range.features_filtering) == 'change_mz_range': |
373 | 368 |
374 msidata = mse_bin = mzBin(msidata,resolution=$method.methods_conditional.bin_width, from=$method.methods_conditional.mz_range.min_mz, to=$method.methods_conditional.mz_range.max_mz, units="$method.methods_conditional.bin_units", fun="$method.methods_conditional.bin_fun") | 369 msidata = mse_bin = mzBin(msidata, resolution=$method.methods_conditional.bin_width, from=$method.methods_conditional.mz_range.min_mz, to=$method.methods_conditional.mz_range.max_mz, units="$method.methods_conditional.bin_units", fun="$method.methods_conditional.bin_fun") |
375 | 370 |
376 | 371 |
377 #elif str($method.methods_conditional.mz_range.features_filtering) == 'none': | 372 #elif str($method.methods_conditional.mz_range.features_filtering) == 'none': |
378 | 373 |
379 msidata = mse_bin = mzBin(msidata,resolution=$method.methods_conditional.bin_width, units="$method.methods_conditional.bin_units", fun=$method.methods_conditional.bin_fun) | 374 msidata = mse_bin = mzBin(msidata, resolution=$method.methods_conditional.bin_width, units="$method.methods_conditional.bin_units", fun="$method.methods_conditional.bin_fun") |
380 | 375 |
381 #elif str($method.methods_conditional.mz_range.features_filtering) == 'bin_to_reference': | 376 #elif str($method.methods_conditional.mz_range.features_filtering) == 'bin_to_reference': |
382 | 377 |
383 bin_reference_mz = read.delim("$method.methods_conditional.mz_range.mz_tabular", header = $method.methods_conditional.mz_range.feature_header, stringsAsFactors = FALSE) | 378 bin_reference_mz = read.delim("$method.methods_conditional.mz_range.mz_tabular", header = $method.methods_conditional.mz_range.feature_header, stringsAsFactors = FALSE) |
384 bin_reference_mz = bin_reference_mz[,$method.methods_conditional.mz_range.feature_column] | 379 bin_reference_mz = bin_reference_mz[,$method.methods_conditional.mz_range.feature_column] |
385 | 380 |
386 msidata = mse_bin = mzBin(msidata,resolution=$method.methods_conditional.bin_width, units="$method.methods_conditional.bin_units", fun=$method.methods_conditional.bin_fun, | 381 msidata = mse_bin = mzBin(msidata, resolution=$method.methods_conditional.bin_width, units="$method.methods_conditional.bin_units", fun="$method.methods_conditional.bin_fun", |
387 ref=bin_reference_mz) | 382 ref=bin_reference_mz) |
388 | 383 |
389 #end if | 384 #end if |
390 | 385 |
391 msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu)) | 386 msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu)) |
477 } | 472 } |
478 }, | 473 }, |
479 error=function(cond) { | 474 error=function(cond) { |
480 ## in case user provided an annotation tabular with less than two batches | 475 ## in case user provided an annotation tabular with less than two batches |
481 message("Error in annotation tabular") | 476 message("Error in annotation tabular") |
482 message("Possible problems: Annotation tabular file has not enough batch levels - to perform ComBat at least 2 batches and 2 pixels per batch are necessary)") | 477 message("Possible problems: Annotation tabular file has not enough batch levels - to perform ComBat at least 2 batches and 2 pixels per batch are necessary") |
483 stop(call.=FALSE) | 478 stop(call.=FALSE) |
484 } | 479 } |
485 ) | 480 ) |
486 | 481 |
487 ## get intensity matrix from imzml file | 482 ## get intensity matrix from imzml file |
810 </conditional> | 805 </conditional> |
811 </when> | 806 </when> |
812 <when value="ComBat_batch_correction"> | 807 <when value="ComBat_batch_correction"> |
813 <param name="annotation_file" type="data" format="tabular" label="Annotation file that contains the pixel x and y coordinates, the batch identifier, and the condition annotation for each spectrum." help="Annotation tabular file that contains the batch identifier for each spectrum in one column."/> | 808 <param name="annotation_file" type="data" format="tabular" label="Annotation file that contains the pixel x and y coordinates, the batch identifier, and the condition annotation for each spectrum." help="Annotation tabular file that contains the batch identifier for each spectrum in one column."/> |
814 <param name="x_column" type="data_column" data_ref="annotation_file" label="X coordinates" help="Column with x coordinates of pixels."/> | 809 <param name="x_column" type="data_column" data_ref="annotation_file" label="X coordinates" help="Column with x coordinates of pixels."/> |
815 <param name="y_column" type="data_column" data_ref="annotation_file" label="Y coordinates" help="Column with y ccordinates of pixels."/> | 810 <param name="y_column" type="data_column" data_ref="annotation_file" label="Y coordinates" help="Column with y coordinates of pixels."/> |
816 <param name="batch_column" type="data_column" data_ref="annotation_file" label="Batch column" help="The column that contains the batch identifier for each spectrum."/> | 811 <param name="batch_column" type="data_column" data_ref="annotation_file" label="Batch column" help="The column that contains the batch identifier for each spectrum."/> |
817 <param name="condition_column" type="data_column" data_ref="annotation_file" label="Condition column" help="The column that contains the condition annotation for each spectrum. Typically these are the groups you want to compare. If not applicable, the batch column can be selected again as this information is only used for the QC plot."/> | 812 <param name="condition_column" type="data_column" data_ref="annotation_file" label="Condition column" help="The column that contains the condition annotation for each spectrum. Typically these are the groups you want to compare. If not applicable, the batch column can be selected again as this information is only used for the QC plot."/> |
818 <param name="feature_header" type="boolean" label="Tabular file contains a header line" truevalue="TRUE" falsevalue="FALSE"/> | 813 <param name="feature_header" type="boolean" label="Tabular file contains a header line" truevalue="TRUE" falsevalue="FALSE"/> |
819 </when> | 814 </when> |
820 </conditional> | 815 </conditional> |
953 <param name="preprocessing_method" value="mz_recalibration"/> | 948 <param name="preprocessing_method" value="mz_recalibration"/> |
954 <param name="alignment_tol" value="2"/> | 949 <param name="alignment_tol" value="2"/> |
955 <param name="alignment_units" value="ppm"/> | 950 <param name="alignment_units" value="ppm"/> |
956 <param name="mz_tabular" value="inputcalibrantfile2.txt" ftype="tabular"/> | 951 <param name="mz_tabular" value="inputcalibrantfile2.txt" ftype="tabular"/> |
957 <param name="feature_column" value="1"/> | 952 <param name="feature_column" value="1"/> |
958 <param name="feature_header" value="TRUE"/> | 953 <param name="feature_header" value="FALSE"/> |
959 </conditional> | 954 </conditional> |
960 </repeat> | 955 </repeat> |
961 <repeat name="methods"> | 956 <repeat name="methods"> |
962 <conditional name="methods_conditional"> | 957 <conditional name="methods_conditional"> |
963 <param name="preprocessing_method" value="Mass_binning"/> | 958 <param name="preprocessing_method" value="Mass_binning"/> |
1021 </test> | 1016 </test> |
1022 <test> | 1017 <test> |
1023 <expand macro="processed_infile_imzml"/> | 1018 <expand macro="processed_infile_imzml"/> |
1024 <conditional name="processed_cond"> | 1019 <conditional name="processed_cond"> |
1025 <param name="processed_file" value="processed"/> | 1020 <param name="processed_file" value="processed"/> |
1026 <param name="accuracy" value="50"/> | 1021 <param name="accuracy" value="200"/> |
1027 <param name="units" value="ppm"/> | 1022 <param name="units" value="ppm"/> |
1028 </conditional> | 1023 </conditional> |
1029 <repeat name="methods"> | 1024 <repeat name="methods"> |
1030 <conditional name="methods_conditional"> | 1025 <conditional name="methods_conditional"> |
1031 <param name="preprocessing_method" value="ComBat_batch_correction"/> | 1026 <param name="preprocessing_method" value="ComBat_batch_correction"/> |
1035 <param name="y_column" value="3"/> | 1030 <param name="y_column" value="3"/> |
1036 <param name="batch_column" value="4"/> | 1031 <param name="batch_column" value="4"/> |
1037 <param name="condition_column" value="5"/> | 1032 <param name="condition_column" value="5"/> |
1038 </conditional> | 1033 </conditional> |
1039 </repeat> | 1034 </repeat> |
1040 <output name="QC_overview" file="ComBat_results_Example_processed_file_preprocessing.pdf" compare="sim_size"/> | 1035 <output name="QC_overview" file="ComBat_results_Example_processed_file.pdf" compare="sim_size"/> |
1041 <output name="outfile_imzml" ftype="imzml" file="ComBat_results_Example_processed_file.imzml.txt" compare="sim_size"> | 1036 <output name="outfile_imzml" ftype="imzml" file="ComBat_results_Example_processed_file.imzml.txt" compare="sim_size"> |
1042 <extra_files type="file" file="ComBat_results_Example_processed_file.imzml" name="imzml" lines_diff="6"/> | 1037 <extra_files type="file" file="ComBat_results_Example_processed_file.imzml" name="imzml" lines_diff="6"/> |
1043 <extra_files type="file" file="ComBat_results_Example_processed_file.ibd" name="ibd" compare="sim_size"/> | 1038 <extra_files type="file" file="ComBat_results_Example_processed_file.ibd" name="ibd" compare="sim_size"/> |
1044 </output> | 1039 </output> |
1045 </test> | 1040 </test> |
1067 - Peak alignment: only possible after peak picking, m/z inaccuracies are removed by alignment of same peaks to a common m/z value; if no reference is given the peaks are aligned to the local maxima of the mean spectrum of the current dataset; external reference data can be used from another MSI data file or a tabular file with m/z values, but then only the m/z from the reference will be kept | 1062 - Peak alignment: only possible after peak picking, m/z inaccuracies are removed by alignment of same peaks to a common m/z value; if no reference is given the peaks are aligned to the local maxima of the mean spectrum of the current dataset; external reference data can be used from another MSI data file or a tabular file with m/z values, but then only the m/z from the reference will be kept |
1068 - Peak filtering: removes peaks that occur only in a small proportion of pixels. If not sure which cut off to choose run quality control tool first and decide according to the number of peaks per m/z plot | 1063 - Peak filtering: removes peaks that occur only in a small proportion of pixels. If not sure which cut off to choose run quality control tool first and decide according to the number of peaks per m/z plot |
1069 - Peak binning: extracts peaks intensities, either peak height or area under curve (from a profile dataset) for a list of m/z (reference) values | 1064 - Peak binning: extracts peaks intensities, either peak height or area under curve (from a profile dataset) for a list of m/z (reference) values |
1070 - m/z binning: generates new m/z bins | 1065 - m/z binning: generates new m/z bins |
1071 - Transformation: log2 or squareroot transformation of all intensities; when using log2 transformation zero intensities will become NA, this can lead to compatibility problems. | 1066 - Transformation: log2 or squareroot transformation of all intensities; when using log2 transformation zero intensities will become NA, this can lead to compatibility problems. |
1072 - ComBat batch correction: corrects the intensity values of picked m/z features according to batches given in an annotation table. For now, it can only be applied to m/z features after peak picking (=centroided data). The annotation table needs to contain the x and y coordinates for each pixel and a batch identifier (e.g. TMA_1, TMA_2, TMA_3). Additionally a condition column can be provided, which is only used for the PCA plots in the pdf file. Example of annotation file for ComBat batch correction: | 1067 - ComBat batch correction: corrects the intensity values of picked m/z features according to batches given in an annotation table. For now, it can only be applied to m/z features after peak picking (=centroided data). The annotation table needs to contain the x and y coordinates for each pixel and a batch identifier (e.g. TMA_1, TMA_2, TMA_3). Additionally, a condition column can be provided, which is only used for the PCA plots in the pdf file. Example of annotation file for ComBat batch correction: |
1073 | 1068 |
1074 :: | 1069 :: |
1075 | 1070 |
1076 x_coord y_coord batch_identifier condition | 1071 x_coord y_coord batch_identifier condition |
1077 10 29 TMA_1 A | 1072 10 29 TMA_1 A |