-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #763 from MarenStillger/Update_test
Update Cardinal Version 3.4.3
- Loading branch information
Showing
104 changed files
with
18,418 additions
and
44,853 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
<tool id="cardinal_colocalization" name="MSI colocalization" version="@[email protected]"> | ||
<tool id="cardinal_colocalization" name="MSI colocalization" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> | ||
<description>mass spectrometry imaging colocalization</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"> | ||
<requirement type="package" version="2.3">r-gridextra</requirement> | ||
</expand> | ||
<expand macro="requirements"/> | ||
<command detect_errors="exit_code"> | ||
<![CDATA[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
<tool id="cardinal_combine" name="MSI combine" version="@[email protected]"> | ||
<tool id="cardinal_combine" name="MSI combine" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> | ||
<description> | ||
combine several mass spectrometry imaging datasets into one | ||
</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"> | ||
<requirement type="package" version="3.3.5">r-ggplot2</requirement> | ||
<requirement type="package" version="0.12">r-maldiquantforeign</requirement> | ||
<requirement type="package" version="1.20">r-maldiquant</requirement> | ||
</expand> | ||
<expand macro="requirements"/> | ||
<command detect_errors="exit_code"> | ||
<![CDATA[ | ||
#for $i, $infile in enumerate($infiles): | ||
#if $infile.ext == 'imzml' | ||
ln -s '${infile.extra_files_path}/imzml' infile_${i}.imzML && | ||
ln -s '${infile.extra_files_path}/ibd' infile_${i}.ibd && | ||
cp '${infile.extra_files_path}/imzml' infile_${i}.imzML && | ||
cp '${infile.extra_files_path}/ibd' infile_${i}.ibd && | ||
#elif $infile.ext == 'analyze75' | ||
ln -s '${infile.extra_files_path}/hdr' infile_${i}.hdr && | ||
ln -s '${infile.extra_files_path}/img' infile_${i}.img && | ||
ln -s '${infile.extra_files_path}/t2m' infile_${i}.t2m && | ||
cp '${infile.extra_files_path}/hdr' infile_${i}.hdr && | ||
cp '${infile.extra_files_path}/img' infile_${i}.img && | ||
cp '${infile.extra_files_path}/t2m' infile_${i}.t2m && | ||
#else | ||
ln -s '$infile' infile_${i}.RData && | ||
#end if | ||
|
@@ -103,14 +99,8 @@ all_files = $num_infiles | |
get(ls()[ls() != "fileName"]) | ||
} | ||
msidata_$i = loadRData('infile_${i}.RData') | ||
## keep compatibility with old .RData files: | ||
msidata_$i\$column1 = NULL | ||
msidata_$i\$column2 = NULL | ||
msidata_$i\$column3 = NULL | ||
msidata_$i\$column4 = NULL | ||
msidata_$i\$column5 = NULL | ||
msidata_$i\$combined_sample = NULL | ||
msidata_$i <- as(msidata_$i, "MSImagingExperiment") | ||
#end if | ||
## remove duplicated coordinates, otherwise combine will fail | ||
|
@@ -128,7 +118,6 @@ all_files = $num_infiles | |
############ 3) Read and process annotation tabular files ###################### | ||
#if str($annotation_cond.annotation_tabular) == 'annotation' | ||
print("annotations") | ||
## read annotation tabular, set first two columns as x and y, merge with coordinates dataframe and order according to pixelorder in msidata | ||
input_annotation = read.delim("annotation_file_${i}.tabular", header = $annotation_cond.tabular_header, stringsAsFactors = FALSE) | ||
|
@@ -138,7 +127,7 @@ all_files = $num_infiles | |
colnames(msidata_coordinates)[3] = "pixel_index" | ||
annotation_df = merge(msidata_coordinates, input_annotation, by=c("x", "y"), all.x=TRUE) | ||
annotation_df_sorted = annotation_df[order(annotation_df\$pixel_index),]## orders pixel according to msidata | ||
annotation_df_sorted = annotation_df[order(annotation_df\$pixel_index),] | ||
annotation_df_sorted\$pixel_index = NULL | ||
## extract columnnames from (last) annotation tabular (for QC plot names) | ||
|
@@ -171,7 +160,7 @@ all_files = $num_infiles | |
#elif str( $combine_conditional.combine_method ) == 'automatic_combine': | ||
## use name of Galaxy inputfile as sample annotation | ||
## use name of Galaxy input file as sample annotation | ||
sample_name = character() | ||
#set escaped_element_identifier = re.sub('[^\w\-\s\[/]]', '_', str($infile.element_identifier)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<tool id="cardinal_data_exporter" name="MSI data exporter" version="@[email protected]"> | ||
<tool id="cardinal_data_exporter" name="MSI data exporter" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> | ||
<description> | ||
exports imzML and Analyze7.5 to tabular files | ||
</description> | ||
|
@@ -102,7 +102,7 @@ if (class(msidata) == "MSImageSet"){ | |
count = 1 | ||
for (subsample in levels(msidata\$annotation)){ | ||
subsample_pixels = msidata[,msidata\$annotation == subsample] | ||
subsample_calc = rowMeans(spectra(subsample_pixels), na.rm=TRUE) | ||
subsample_calc = rowMeans(as.matrix(spectra(subsample_pixels)), na.rm=TRUE) | ||
sample_matrix = cbind(sample_matrix, subsample_calc) | ||
count = count+1} | ||
sample_matrix_mean = cbind(mz_names,sample_matrix) | ||
|
@@ -117,7 +117,7 @@ if (class(msidata) == "MSImageSet"){ | |
count = 1 | ||
for (subsample in levels(msidata\$annotation)){ | ||
subsample_pixels = msidata[,msidata\$annotation == subsample] | ||
subsample_calc = apply(spectra(subsample_pixels),1,median, na.rm=TRUE) | ||
subsample_calc = apply(as.matrix(spectra(subsample_pixels)),1,median, na.rm=TRUE) | ||
sample_matrix = cbind(sample_matrix, subsample_calc) | ||
count = count+1} | ||
sample_matrix_median = cbind(mz_names,sample_matrix) | ||
|
@@ -190,13 +190,13 @@ if (class(msidata) == "MSImageSet"){ | |
for (mass in 1:length(inputcalibrantmasses)){ | ||
filtered_data = msidata[mz(msidata) >= inputcalibrantmasses[mass]-plusminusvalues[mass] & mz(msidata) <= inputcalibrantmasses[mass]+plusminusvalues[mass],] | ||
if (nrow(filtered_data) > 1 & sum(spectra(filtered_data),na.rm=TRUE) > 0){ | ||
if (nrow(filtered_data) > 1 & sum(as.matrix(spectra(filtered_data)), na.rm=TRUE) > 0){ | ||
## intensity of all m/z > 0 | ||
intensity_sum = colSums(spectra(filtered_data), na.rm=TRUE) > 0 | ||
intensity_sum = colSums(as.matrix(spectra(filtered_data)), na.rm=TRUE) > 0 | ||
}else if(nrow(filtered_data) == 1 & sum(spectra(filtered_data), na.rm=TRUE) > 0){ | ||
}else if(nrow(filtered_data) == 1 & sum(as.matrix(spectra(filtered_data)), na.rm=TRUE) > 0){ | ||
## intensity of only m/z > 0 | ||
intensity_sum = spectra(filtered_data) > 0 | ||
intensity_sum = as.matrix(spectra(filtered_data)) > 0 | ||
}else{ | ||
intensity_sum = rep(FALSE, ncol(filtered_data))} | ||
## for each pixel add sum of intensities > 0 in the given m/z range | ||
|
@@ -343,7 +343,11 @@ if (class(msidata) == "MSImageSet"){ | |
<param name="feature_header" value="False"/> | ||
<param name="plusminus_ppm" value="200"/> | ||
</conditional> | ||
<output name="feature_output" file="features_out4.tabular"/> | ||
<output name="feature_output"> | ||
<assert_contents> | ||
<has_text text="100.120072029209"/> | ||
</assert_contents> | ||
</output> | ||
<output name="pixel_output" file="pixel_out4.tabular"/> | ||
</test> | ||
</tests> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
<tool id="cardinal_filtering" name="MSI filtering" version="@[email protected]"> | ||
<tool id="cardinal_filtering" name="MSI filtering" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> | ||
<description>tool for filtering mass spectrometry imaging data</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"> | ||
<requirement type="package" version="2.3">r-gridextra</requirement> | ||
<requirement type="package" version="3.3.5">r-ggplot2</requirement> | ||
</expand> | ||
<expand macro="requirements"/> | ||
<expand macro="print_version"/> | ||
<command detect_errors="exit_code"> | ||
<![CDATA[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
<tool id="cardinal_mz_images" name="MSI mz images" version="@[email protected]"> | ||
<tool id="cardinal_mz_images" name="MSI mz images" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> | ||
<description> | ||
mass spectrometry imaging m/z heatmaps | ||
</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
</macros> | ||
<expand macro="requirements"> | ||
<requirement type="package" version="2.3">r-gridextra</requirement> | ||
</expand> | ||
<expand macro="requirements"/> | ||
<command detect_errors="aggressive"> | ||
<![CDATA[ | ||
@INPUT_LINKING@ | ||
|
@@ -83,8 +81,8 @@ if (ncol(msidata)>0 & nrow(msidata) >0){ | |
print("svg pixel image") | ||
## reverse y axis for svg output = correct order and nice svg image | ||
coord(msidata)\$y <- max(coord(msidata)\$y) - coord(msidata)\$y + 1 | ||
## works only with MSImageSet as expected | ||
msidata = as(msidata, "MSImageSet") | ||
msidata = as(msidata,"MSImagingExperiment") | ||
svg(file="svg_pixel_output.svg", width=maximumx, height=maximumy) | ||
par(mar=c(0,0,0,0), oma=c(0,0,0,0))## no margin for svg | ||
|
@@ -132,7 +130,7 @@ dev.off() | |
<expand macro="pdf_filename"/> | ||
<expand macro="reading_2_column_mz_tabular"/> | ||
|
||
<param name="plusminus_dalton" value="0.25" type="float" label="plusminus m/" help="m/z range to add on either side of the given m/z to create a window in which the mean of all intensities will be computed"/> | ||
<param name="plusminus_dalton" value="0.25" type="float" label="plusminus m/z" help="m/z range to add on either side of the given m/z to create a window in which the mean of all intensities will be computed"/> | ||
<param name="image_contrast" type="select" label="Contrast enhancement" help="The 'histogram' equalization method flatterns the distribution of intensities. The hotspot 'suppression' method uses thresholding to reduce the intensities of hotspots"> | ||
<option value="none" selected="True">none</option> | ||
<option value="suppression">suppression</option> | ||
|
@@ -193,7 +191,7 @@ dev.off() | |
</data> | ||
</outputs> | ||
<tests> | ||
<test> | ||
<test expect_num_outputs="1"> | ||
<expand macro="infile_imzml"/> | ||
<param name="calibrant_file" value="inputpeptides.tabular" ftype="tabular"/> | ||
<param name="mz_column" value="1"/> | ||
|
@@ -204,7 +202,7 @@ dev.off() | |
<param name="colorkey" value="True"/> | ||
<output name="plots" file="Heatmaps_imzml.pdf" ftype="pdf" compare="sim_size"/> | ||
</test> | ||
<test> | ||
<test expect_num_outputs="2"> | ||
<expand macro="infile_analyze75"/> | ||
<param name="calibrant_file" value="inputpeptides2.tabular" ftype="tabular"/> | ||
<param name="mz_column" value="1"/> | ||
|
@@ -218,7 +216,7 @@ dev.off() | |
<output name="plots" file="Heatmaps_analyze75.pdf" ftype="pdf" compare="sim_size"/> | ||
<output name="svg_output" file="analyze75.svg" ftype="svg" compare="sim_size"/> | ||
</test> | ||
<test> | ||
<test expect_num_outputs="1"> | ||
<param name="infile" value="preprocessed.RData" ftype="rdata"/> | ||
<param name="calibrant_file" value="inputpeptides.tabular" ftype="tabular"/> | ||
<param name="mz_column" value="1"/> | ||
|
@@ -228,7 +226,7 @@ dev.off() | |
<param name="filename" value="Testfile_rdata"/> | ||
<output name="plots" file="Heatmaps_rdata.pdf" ftype="pdf" compare="sim_size"/> | ||
</test> | ||
<test> | ||
<test expect_num_outputs="1"> | ||
<param name="infile" value="empty_spectra.rdata" ftype="rdata"/> | ||
<param name="calibrant_file" value="inputpeptides2.tabular" ftype="tabular"/> | ||
<param name="mz_column" value="1"/> | ||
|
@@ -239,7 +237,7 @@ dev.off() | |
<param name="filename" value="Testfile_rdata"/> | ||
<output name="plots" file="Heatmaps_LM8_file16.pdf" ftype="pdf" compare="sim_size"/> | ||
</test> | ||
<test> | ||
<test expect_num_outputs="1"> | ||
<expand macro="processed_infile_imzml"/> | ||
<conditional name="processed_cond"> | ||
<param name="processed_file" value="processed"/> | ||
|
Oops, something went wrong.