-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Cardinal Version 3.4.3 #763
Changes from 16 commits
aa7f3c5
b44dfc6
f841786
4c10440
4fb6609
efeb016
db40ec0
308bd65
e3e7d8d
a1f3bd7
16c814a
6732b02
4f54d86
a402082
6e1eb51
8bef62c
371f840
523c7c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<tool id="cardinal_colocalization" name="MSI colocalization" version="@[email protected]"> | ||
<tool id="cardinal_colocalization" name="MSI colocalization" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> | ||
<description>mass spectrometry imaging colocalization</description> | ||
<macros> | ||
<import>macros.xml</import> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
<tool id="cardinal_combine" name="MSI combine" version="@[email protected]"> | ||
<tool id="cardinal_combine" name="MSI combine" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> | ||
<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="3.3.5">r-ggplot2</requirement> | ||
<requirement type="package" version="0.12">r-maldiquantforeign</requirement> | ||
<requirement type="package" version="1.20">r-maldiquant</requirement> | ||
<requirement type="package" version="1.20">r-maldiquant</requirement--> | ||
</expand> | ||
<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 +103,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 +122,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 +131,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 +164,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)) | ||
|
||
|
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@"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add also a profile="22.05" to each tool There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks, added the profile to all tools 👍 |
||
<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> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<tool id="cardinal_filtering" name="MSI filtering" version="@[email protected]"> | ||
<tool id="cardinal_filtering" name="MSI filtering" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@"> | ||
<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> | ||
<!--requirement type="package" version="2.3">r-gridextra</requirement> | ||
<requirement type="package" version="3.3.5">r-ggplot2</requirement--> | ||
</expand> | ||
<expand macro="print_version"/> | ||
<command detect_errors="exit_code"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<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@"> | ||
<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> | ||
<!--requirement type="package" version="2.3">r-gridextra</requirement--> | ||
</expand> | ||
<command detect_errors="aggressive"> | ||
<![CDATA[ | ||
|
@@ -83,8 +83,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 +132,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 +193,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 +204,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 +218,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 +228,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 +239,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"/> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is copying really necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately yes, otherwise neither imzml nor analyze75 files will be loaded