Skip to content

Commit

Permalink
Merge branch 'master' into wordcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
bgruening authored Dec 12, 2024
2 parents 32c37cf + 5ab6f94 commit 6fabfd2
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 69 deletions.
80 changes: 57 additions & 23 deletions tools/diff/diff.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<tool id="diff" name="diff" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@">
<tool id="diff" name="diff" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="23.0">
<description>analyzes two files and generates an unidiff text file with information about the differences and an optional Html report</description>
<macros>
<token name="@TOOL_VERSION@">3.7</token>
<token name="@TOOL_VERSION@">3.10</token>
<token name="@GALAXY_VERSION@">0</token>
</macros>
<requirements>
Expand All @@ -13,10 +13,18 @@
<regex match="diff: memory exhausted" source="stdout" level="fatal_oom" description="Out of memory error occurred"/>
</stdio>
<command><![CDATA[
diff -u '$input1' '$input2' > '$diff_file';
#if $generate_report:
diff
#if $report_format.report_format_select == 'txt_lines' or $report_format.report_format_select == 'html'
## the -u option is needed to convert the output later to HTML
--unified=$report_format.unified
#else if $report_format.report_format_select == 'txt_columns'
-y
#end if
## If the compared input files differ the diff command returns exit-code 1
'$input1' '$input2' > '$diff_file' || [ \$? -eq 1 ];
#if $report_format.report_format_select == 'html'
sed -e 's/@@title@@/Diff report for "$input1.element_identifier" and "$input2.element_identifier"/g'
-e 's/@@outputformat@@/'$output_format'/g'
-e 's/@@outputformat@@/'$report_format.output_format'/g'
-e '/@@diffoutput@@/{r'$diff_file'' -e ';d}'
'$__tool_directory__/template.html' > '$html_file'
#end if
Expand All @@ -25,33 +33,50 @@
<inputs>
<param name="input1" type="data" format="txt" label="First input file"/>
<param name="input2" type="data" format="txt" label="Second input file"/>
<param name="generate_report" type="boolean" checked="true" truevalue="true" falsevalue="false" label="Generate HTML report" help="Generates an HTML report to visualize the differences"/>
<param name="output_format" type="select" label="Choose report output format" help="Displays the differences in the report using the selected format. Either line by line or side by side.">
<option value="side-by-side">Side by side</option>
<option value="line-by-line">Line by line</option>
</param>
<conditional name="report_format">
<param name="report_format_select" type="select" label="Choose a report format">
<option value="txt_lines">Text file, line-by-line (-u)</option>
<option value="txt_columns">Text file, side-by-side (-y)</option>
<option value="html">Generates an HTML report to visualize the differences</option>
</param>
<when value="txt_lines">
<param argument="--unified" type="integer" min="0" value="3" label="Output this amount of lines of unified context"/>
</when>
<when value="txt_columns"/>
<when value="html">
<param argument="--unified" type="integer" min="0" value="3" label="Output this amount of lines of unified context"/>
<param name="output_format" type="select" label="Choose report output format" help="Displays the differences in the report using the selected format. Either line by line or side by side.">
<option value="side-by-side">Side by side</option>
<option value="line-by-line">Line by line</option>
</param>
</when>
</conditional>
</inputs>
<outputs>
<data format="txt" name="diff_file" from_work_dir="output.txt" label="${tool.name} on ${on_string}: Raw Output"/>
<data format="html" name="html_file" from_work_dir="output.html" label="${tool.name} on ${on_string}: Html Report">
<filter>generate_report is True</filter>
<filter>report_format['report_format_select'] == 'html'</filter>
</data>
</outputs>
<tests>
<test expect_exit_code="0" expect_failure="false" expect_num_outputs="1">
<param name="input1" value="file1.txt"/>
<param name="input2" value="file1.txt"/>
<param name="generate_report" value="false"/>
<conditional name="report_format">
<param name="report_format_select" value="txt_lines"/>
</conditional>
<output name="diff_file">
<assert_contents>
<has_n_lines n="0"/>
</assert_contents>
</output>
</test>
<test expect_exit_code="1" expect_failure="false" expect_num_outputs="1">
<test expect_exit_code="0" expect_failure="false" expect_num_outputs="1">
<param name="input1" value="file1.txt"/>
<param name="input2" value="file2.txt"/>
<param name="generate_report" value="false"/>
<conditional name="report_format">
<param name="report_format_select" value="txt_lines"/>
</conditional>
<output name="diff_file">
<assert_contents>
<has_n_lines n="5"/>
Expand All @@ -63,7 +88,9 @@
<test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
<param name="input1" value="file1.txt"/>
<param name="input2" value="file2.txt"/>
<param name="generate_report" value="true"/>
<conditional name="report_format">
<param name="report_format_select" value="html"/>
</conditional>
<output name="html_file">
<assert_contents>
<has_text text="!DOCTYPE html"/>
Expand All @@ -73,8 +100,10 @@
<test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
<param name="input1" value="file1.txt"/>
<param name="input2" value="file2.txt"/>
<param name="generate_report" value="true"/>
<param name="output_format" value="side-by-side"/>
<conditional name="report_format">
<param name="report_format_select" value="html"/>
<param name="output_format" value="side-by-side"/>
</conditional>
<output name="html_file">
<assert_contents>
<has_text text="!DOCTYPE html"/>
Expand All @@ -85,8 +114,10 @@
<test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
<param name="input1" value="file1.txt"/>
<param name="input2" value="file2.txt"/>
<param name="generate_report" value="true"/>
<param name="output_format" value="line-by-line"/>
<conditional name="report_format">
<param name="report_format_select" value="html"/>
<param name="output_format" value="line-by-line"/>
</conditional>
<output name="html_file">
<assert_contents>
<has_text text="!DOCTYPE html"/>
Expand All @@ -95,9 +126,12 @@
</output>
</test>
<test expect_exit_code="0" expect_failure="false" expect_num_outputs="2">
<param name="input1" value="file 3.txt"/>
<param name="input2" value="file 3.txt"/>
<param name="generate_report" value="true"/>
<param name="input1" value="file3.txt"/>
<param name="input2" value="file3.txt"/>
<conditional name="report_format">
<param name="report_format_select" value="html"/>
<param name="output_format" value="side-by-side"/>
</conditional>
<output name="diff_file">
<assert_contents>
<has_n_lines n="0"/>
Expand Down Expand Up @@ -169,4 +203,4 @@ An **optional** *HTML report* with a friendlier visual representation of the dif
}
</citation>
</citations>
</tool>
</tool>
File renamed without changes.
2 changes: 2 additions & 0 deletions tools/diff/test-data/output_test4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a a
> b
1 change: 1 addition & 0 deletions tools/flux/flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
prompt = f.read().strip()
elif prompt_type == "text":
prompt = sys.argv[3]
print(f"Creating image from prompt: {prompt}")

if "dev" in model_path:
num_inference_steps = 20
Expand Down
19 changes: 5 additions & 14 deletions tools/flux/flux.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,21 @@
<description>text-to-image model</description>
<macros>
<token name="@TOOL_VERSION@">2024</token>
<token name="@VERSION_SUFFIX@">2</token>
<token name="@VERSION_SUFFIX@">4</token>
</macros>
<requirements>
<requirement type="package" version="3.12">python</requirement>
<requirement type="package" version="2.4.1">pytorch</requirement>
<requirement type="package" version="0.19.1">torchvision</requirement>
<requirement type="package" version="12.4">pytorch-cuda</requirement>
<requirement type="package" version="0.30.2">diffusers</requirement>
<requirement type="package" version="4.44.2">transformers</requirement>
<requirement type="package" version="0.34.0">accelerate</requirement>
<requirement type="package" version="0.2.0">sentencepiece</requirement>
<requirement type="package" version="4.25.3">protobuf</requirement>
<requirement type="package" version="0.24.6">huggingface_hub</requirement>
<container type="docker">quay.io/galaxy/black_forest_labs_flux:2024-0</container>
</requirements>
<command detect_errors="exit_code"><![CDATA[
python '$__tool_directory__/flux.py'
python3 '$__tool_directory__/flux.py'
'$flux_models.fields.path'
'$input_type_selector'
'$prompt'
]]></command>
<configfiles>
</configfiles>
<inputs>
<param name="flux_models" label="Model data" type="select" help="contact the administrator of this Galaxy instance if you miss model data">
<param name="flux_models" label="Model data" type="select" help="Contact the administrator of our Galaxy instance if you miss model data">
<options from_data_table="huggingface">
<filter type="static_value" column="4" value="flux"/>
<filter type="static_value" column="5" value="1"/>
Expand All @@ -48,7 +39,7 @@ python '$__tool_directory__/flux.py'
</conditional>
</inputs>
<outputs>
<data name="output" format="png" label="${tool.name} on ${on_string}" from_work_dir="./output.png"/>
<data name="output" format="png" label="${tool.name} on ${on_string if $input_type_selector=='file' else 'text prompt'}" from_work_dir="./output.png"/>
</outputs>
<tests>
<test expect_exit_code="1" expect_failure="true">
Expand Down
41 changes: 24 additions & 17 deletions tools/flye/flye.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
<outputs>
<data name="consensus" format="fasta" from_work_dir="out_dir/assembly.fasta" label="${tool.name} on ${on_string}: consensus"/>
<data name="assembly_graph" format="graph_dot" from_work_dir="out_dir/assembly_graph.gv" label="${tool.name} on ${on_string}: assembly graph"/>
<data name="assembly_gfa" format="gfa" from_work_dir="out_dir/assembly_graph.gfa" label="${tool.name} on ${on_string}: graphical fragment assembly"/>
<data name="assembly_gfa" format="gfa1" from_work_dir="out_dir/assembly_graph.gfa" label="${tool.name} on ${on_string}: graphical fragment assembly"/>
<data name="assembly_info" format="tabular" from_work_dir="out_dir/assembly_info.txt" label="${tool.name} on ${on_string}: assembly info"/>
<data name="flye_log" format="txt" from_work_dir="out_dir/flye.log" label="${tool.name} on ${on_string}: log">
<filter>generate_log</filter>
Expand All @@ -115,12 +115,14 @@
<!--Test 01: pacbio-raw-->
<test expect_num_outputs="5">
<param name="inputs" ftype="fastq.gz" value="ecoli_01.fastq.gz,ecoli_02.fastq.gz,ecoli_03.fastq.gz,ecoli_04.fastq.gz,ecoli_05.fastq.gz,ecoli_06.fastq.gz,ecoli_07.fastq.gz"/>
<param name="mode" value="--pacbio-raw"/>
<conditional name="mode_conditional">
<param name="mode" value="--pacbio-raw"/>
</conditional>
<param name="iterations" value="0"/>
<param name="generate_log" value="true"/>
<output name="assembly_info" file="result1_assembly_info.txt" ftype="tabular" compare="sim_size"/>
<output name="assembly_graph" file="result1_assembly_graph.dot" ftype="graph_dot" compare="sim_size"/>
<output name="assembly_gfa" file="result1_assembly_graph.gfa" ftype="gfa" compare="diff" lines_diff="10"/>
<output name="assembly_gfa" file="result1_assembly_graph.gfa" ftype="gfa1" compare="diff" lines_diff="10"/>
<output name="consensus" ftype="fasta">
<assert_contents>
<has_line line=">contig_1"/>
Expand All @@ -131,7 +133,9 @@
<!--Test 02: nano raw-->
<test expect_num_outputs="4">
<param name="inputs" ftype="fasta.gz" value="nanopore.fasta.gz"/>
<param name="mode" value="--nano-raw"/>
<conditional name="mode_conditional">
<param name="mode" value="--nano-raw"/>
</conditional>
<param name="iterations" value="0"/>
<output name="assembly_info" ftype="tabular">
<assert_contents>
Expand All @@ -143,7 +147,7 @@
<has_size value="803" delta="100"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="35047" delta="100"/>
</assert_contents>
Expand All @@ -162,7 +166,7 @@
</conditional>
<conditional name="asm">
<param name="asm_select" value="true" />
<param name="asm" value="30"/>
<param name="asm_coverage" value="30"/>
<param name="genome_size" value="3980000"/>
</conditional>
<output name="assembly_info" ftype="tabular">
Expand All @@ -175,7 +179,7 @@
<has_size value="1840" delta="100"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="420752" delta="100"/>
</assert_contents>
Expand Down Expand Up @@ -203,7 +207,7 @@
<has_size value="367" delta="100"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="418729" delta="100"/>
</assert_contents>
Expand Down Expand Up @@ -231,7 +235,7 @@
<has_size value="1248" delta="100"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="419414" delta="1000"/>
</assert_contents>
Expand Down Expand Up @@ -260,7 +264,7 @@
<has_size value="1248" delta="500"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="420254" delta="2000"/>
</assert_contents>
Expand All @@ -276,10 +280,9 @@
<param name="inputs" ftype="fastq.gz" value="ecoli_hifi_01.fastq.gz,ecoli_hifi_02.fastq.gz,ecoli_hifi_03.fastq.gz,ecoli_hifi_04.fastq.gz,ecoli_hifi_05.fastq.gz,ecoli_hifi_06.fastq.gz,ecoli_hifi_07.fastq.gz,ecoli_hifi_08.fastq.gz,ecoli_hifi_09.fastq.gz"/>
<conditional name="mode_conditional">
<param name="mode" value="--pacbio-corr"/>
<param name="hifi_error" value="0.21"/>
</conditional>
<param name="min_overlap" value="1000"/>
<param name="keep-haplotypes" value="true"/>
<param name="keep_haplotypes" value="true"/>
<output name="assembly_info" ftype="tabular">
<assert_contents>
<has_size value="286" delta="200"/>
Expand All @@ -290,7 +293,7 @@
<has_size value="1273" delta="500"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="420254" delta="3000"/>
</assert_contents>
Expand All @@ -304,7 +307,9 @@
<!--Test 08: scaffolding mode-->
<test expect_num_outputs="4">
<param name="inputs" ftype="fastq.gz" value="ecoli_hifi_01.fastq.gz,ecoli_hifi_02.fastq.gz,ecoli_hifi_03.fastq.gz,ecoli_hifi_04.fastq.gz,ecoli_hifi_05.fastq.gz,ecoli_hifi_06.fastq.gz,ecoli_hifi_07.fastq.gz,ecoli_hifi_08.fastq.gz,ecoli_hifi_09.fastq.gz"/>
<param name="mode" value="--nano-hq"/>
<conditional name="mode_conditional">
<param name="mode" value="--nano-hq"/>
</conditional>
<param name="min_overlap" value="1000"/>
<param name="scaffold" value="true"/>
<output name="assembly_info" ftype="tabular">
Expand All @@ -317,7 +322,7 @@
<has_size value="1248" delta="100"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="419414" delta="2000"/>
</assert_contents>
Expand All @@ -331,7 +336,9 @@
<!--Test 09: test not-alt-contigs parameter w-->
<test expect_num_outputs="4">
<param name="inputs" ftype="fasta.gz" value="nanopore.fasta.gz"/>
<param name="mode" value="--nano-raw"/>
<conditional name="mode_conditional">
<param name="mode" value="--nano-raw"/>
</conditional>
<param name="iterations" value="0"/>
<param name="no_alt_contigs" value="true"/>
<output name="assembly_info" ftype="tabular">
Expand All @@ -344,7 +351,7 @@
<has_size value="217" delta="100"/>
</assert_contents>
</output>
<output name="assembly_gfa" ftype="gfa">
<output name="assembly_gfa" ftype="gfa1">
<assert_contents>
<has_size value="5110" delta="100"/>
</assert_contents>
Expand Down
2 changes: 1 addition & 1 deletion tools/flye/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">2.9.5</token>
<token name="@SUFFIX_VERSION@">0</token>
<token name="@SUFFIX_VERSION@">1</token>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">flye</requirement>
Expand Down
4 changes: 2 additions & 2 deletions tools/gfastats/gfastats.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
</param>
<when value="manipulation">
<param argument="--swiss-army-knife" type="data"
format="text" label="SAK input file" optional="true"
format="txt" label="SAK input file" optional="true"
help="Set of instructions provided as an ordered list"/>
<conditional name="output_condition">
<param argument="--out-format" type="select"
Expand Down Expand Up @@ -201,7 +201,7 @@
<data name="stats" format="tabular" label="${tool.name} on ${on_string}: stats">
<filter>mode_condition['selector'] == 'statistics'</filter>
<change_format>
<when input="tabular" value="false" format="text"/>
<when input="tabular" value="false" format="txt"/>
</change_format>
</data>
<data name="output" format="fastq" from_work_dir="output_dataset" label="${tool.name} on ${on_string}: edited sequences">
Expand Down
Loading

0 comments on commit 6fabfd2

Please sign in to comment.