Commit 040a160c by icaoberg

Updated tools

parent 149a3308
#!/bin/bash
echo "Downloading "$1
echo wget --quiet -O download -nc $1
wget --quiet -O download -nc $1 2>/dev/null
echo "Checking file"
find . -type f -empty -exec rm -fv {} \;
ls
if [ ! -f download ]; then
echo "File does not exist"
exit 1
fi
cp -v download ./image.ome.tif
echo "Validating file"
xmlvalid ./image.ome.tif | grep -q "No validation errors found."
if (($? == 0)); then
echo "File is a valid OMETIFF"
exit 0
else
echo "File is not a valid OMETIFF"
rm -f ./download
exit -1
fi
<tool id="import_image" name="Imports image" version="1.0.0">
<!--
Copyright (C) 2007-2017 Murphy Lab
Lane Center for Computational Biology
School of Computer Science
Carnegie Mellon University
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
For additional information visit http://murphylab.web.cmu.edu or
send email to murphy@cmu.edu
-->
<description>from a URL.</description>
<command interpreter="bash">
import_image.sh ${URL}
</command>
<inputs>
<param name="URL" type="text" value="http://www.cellorganizer.org/demos/demo3D34/img/cell1/cell1.ome.tif" label="Provide the image URL"/>
</inputs>
<outputs>
<data format="tiff" name="output" from_work_dir="download" label="Imported OME.TIFF image" />
</outputs>
<help>
**Description**
Downloads an image from the URL provided, if the image is considered a valid input.
-----
**Input**
A link to an image. The image must be a valid OME.TIFF_.
OME.TIFF's provided are validated using the BioFormats_ command line tools_.
-----
**Output**
The file is placed in the workspace of the current history if it is deemed valid.
.. _OME.TIFF: https://docs.openmicroscopy.org/ome-model/5.6.3/ome-tiff/index.html
.. _BioFormats: http://www.openmicroscopy.org/site/products/bio-formats
.. _tools: http://www.openmicroscopy.org/site/support/bio-formats5.5/users/comlinetools
</help>
</tool>
#!/bin/bash
echo "Downloading "$1
echo wget --quiet -O download -nc $1
wget --quiet -O download -nc $1 2>/dev/null
echo "Checking file"
find . -type f -empty -exec rm -fv {} \;
ls
if [ ! -f download ]; then
echo "File does not exist"
exit 1
fi
#verification?
echo "Downloaded generative model"
<tool id="import_model" name="Imports generative model" version="1.0.0">
<!--
Copyright (C) 2007-2017 Murphy Lab
Lane Center for Computational Biology
School of Computer Science
Carnegie Mellon University
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
For additional information visit http://murphylab.web.cmu.edu or
send email to murphy@cmu.edu
-->
<description>from a URL.</description>
<command interpreter="bash">
import_model.sh ${URL}
</command>
<inputs>
<param name="URL" type="text" value="http://www.cellorganizer.org/downloads/models/nuc.mat" label="Provide the model URL"/>
</inputs>
<outputs>
<data format="mat" name="output" from_work_dir="download" label="Imported generative model"/>
</outputs>
<help>
**Description**
Downloads a generative model from the URL provided, if the model is considered a valid input.
-----
**Input**
A link to a generative model. The model must be a valid MAT-file_.
-----
**Output**
The file is placed in the workspace of the current history if it is deemed valid.
.. _MAT-file: https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html
</help>
</tool>
#!/bin/bash
ln -s $1 ./file.dat
file ./file.dat
rm ./file.dat
<tool id="show_file_information" name="Show" version="0.0.1">
<!--
Copyright (C) 2007-2018 Murphy Lab
Lane Center for Computational Biology
School of Computer Science
Carnegie Mellon University
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
For additional information visit http://murphylab.web.cmu.edu or
send email to murphy@cmu.edu
-->
<description> file information </description>
<command>
bash $__tool_directory__/show_file_information.sh $dataset
</command>
<inputs>
<param name="dataset" type="data" label="Choose a file" multiple="false" optional="false" />
</inputs>
<outputs>
</outputs>
<help>
**Description**
Shows information about a given file.
-----
**Input**
Information.
-----
**Output**
A valid html file.
</help>
</tool>
#!/bin/bash
# @icaoberg inherit script filename
SCRIPT=$1
#2>/dev/null
cat $SCRIPT | matlab -nodesktop -nosplash
rm -fv $SCRIPT
# @icaoberg check if file exists on disk. if it does not, then exit with error code
if [ ! -f model.mat ]; then
echo "File does not exist."
exit -1
fi
<tool id="slml2slml" name="Combine " version="0.0.1">
<!--
Copyright (C) 2007-2017 Murphy Lab
Lane Center for Computational Biology
School of Computer Science
Carnegie Mellon University
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
For additional information visit http://murphylab.web.cmu.edu or
send email to murphy@cmu.edu
-->
<description> multiple generative model files into a single file.</description>
<command>
echo -e "tic;
current_directory = pwd;
cellorganizer_directory = getenv('CELLORGANIZER');
cd( cellorganizer_directory );
setup();
cd( current_directory );
disp( current_directory );
#for $field in $generative_models.files
check_if_files_exist_on_disk_and_link_them_mat('$field.dataset');
#end for
files = dir( [ pwd filesep '*.mat']);
filenames = {};
options.documentation.date = datestr(now);
for i=1:length(files) filenames{length(filenames)+1}=[pwd filesep files(i).name]; end;
#for $field in $doc.documentation
options.documentation.${field.docname}='${field.docvalues}';
#end for
diary diary.txt;
answer = slml2slml(filenames, options);
diary off;
toc;
exit;" > script.m;
cat script.m;
if [ ! -d $output.extra_files_path ]; then mkdir $output.extra_files_path; fi;
cp script.m $output.extra_files_path;
bash $__tool_directory__/slml2slml.sh "$output.extra_files_path/script.m";
</command>
<inputs>
<!-- select datasets -->
<section name="generative_models" title="Generative models" expanded="true">
<repeat name="files" title="Models">
<param name="dataset" format="mat" type="data" label="Select model"/>
</repeat>
</section>
<section name="doc" title="Documentation" expanded="true">
<repeat name="documentation" title="Documentation">
<param name="docname" type="text" label="Name"> </param>
<param name="docvalues" type="text" label="Values"></param>
</repeat>
</section>
</inputs>
<outputs>
<data format="mat" name="output" from_work_dir="model.mat" label="New generative model"/>
</outputs>
<help>
**Description**
Combine multiple generative models of the same dimensionality into a single model file.
-----
**Input**
* Up to three generative models
* Documentation structure
-----
**Output**
* A single generative model file
</help>
</tool>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment