-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
aa7f3c5
change description
MarenStillger b44dfc6
change description
MarenStillger f841786
Initial commit
MarenStillger 4c10440
Change description
MarenStillger 4fb6609
Fix tests
MarenStillger efeb016
Fix test
MarenStillger db40ec0
Fix version token in requirements
MarenStillger 308bd65
Fix tests and requirements
MarenStillger e3e7d8d
Fix tests
MarenStillger a1f3bd7
Fix tests
MarenStillger 16c814a
Merge branch 'master' into Update_test
bgruening 6732b02
Fix input linking
MarenStillger 4f54d86
Merge remote-tracking branch 'origin/Update_test' into Update_test
MarenStillger a402082
Fix tests
MarenStillger 6e1eb51
Fix tests
MarenStillger 8bef62c
Fix tests
MarenStillger 371f840
Fix profile and requirements
MarenStillger 523c7c8
Merge branch 'master' into Update_test
bgruening File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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