Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions tools/odgi/build.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<tool id="odgi_build" name="odgi build" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
<tool id="odgi_build" name="odgi build" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.1">
<description>construct a dynamic succinct variation graph</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
cp '$gfa' input.gfa &&

odgi build
-g input.gfa
-o '$odgi_output'
$sort
#if $to_gfa:
--to-gfa > '$gfa_output'
odgi build -g input.gfa -o '$odgi_output' $sort
#if $to_gfa
&& odgi view -i '$odgi_output' $to_gfa > '$gfa_output'
#end if
]]></command>
<inputs>
Expand All @@ -31,19 +27,29 @@ $sort
</data>
</outputs>
<tests>
<test>
<test expect_num_outputs="2">
<param name="gfa" value="t.gfa" />
<param name="sort" value="true" />
<param name="to_gfa" value="true" />
<output name="odgi_output" file="note5_out.og" />
<output name="gfa_output" file="note5.gfa" />
</test>
</tests>
<help><![CDATA[
optimized dynamic genome/graph implementation (odgi)
----------------------------------------------------
<help format="markdown"><![CDATA[
@HELP_HEADER@

`odgi build` converts a GFA file into an ODGI graph, optionally topologically sorting nodes and emitting a companion GFA view.

### Inputs

- **Construct the graph from this GFA input file**: Source GFA file to ingest.
- **Topological sort the graph**: Apply generalized topological sorting before writing the `.og`.
- **Output additional GFA file**: Re-export the resulting graph in GFA format.

### Outputs

Construct a dynamic succinct variation graph (build)
- **odgi**: The constructed graph in ODGI format.
- **GFA**: Optional GFA view of the constructed graph.
]]></help>
<expand macro="citations">
</expand>
Expand Down
63 changes: 63 additions & 0 deletions tools/odgi/cover.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<tool id="odgi_cover" name="odgi cover" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.1">
<description>generate path covers for graph components</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
odgi cover
--idx '$idx'
--out '$output'
#if str($hogwild_depth)
--hogwild-depth $hogwild_depth
#end if
#if str($num_paths_per_component)
--num-paths-per-component $num_paths_per_component
#end if
#if str($node_windows_size)
--node-windows-size $node_windows_size
#end if
#if str($min_node_coverage)
--min-node-coverage $min_node_coverage
#end if
$ignore_paths
#if str($save_coverages)
--write-node-coverages '$node_coverages'
#end if
@THREADS@
]]></command>
<inputs>
<expand macro="graph_input_param"/>
<param argument="--hogwild-depth" type="float" optional="true" min="0" label="Cover graph to this average depth" help="Randomly cover the graph until reaching the specified average depth."/>
<param argument="--num-paths-per-component" type="integer" optional="true" min="1" label="Number of paths to generate per component"/>
<param argument="--node-windows-size" type="integer" optional="true" min="2" label="Node window size when extending paths"/>
<param argument="--min-node-coverage" type="integer" optional="true" min="1" label="Minimum node coverage to reach"/>
<param argument="--ignore-paths" type="boolean" truevalue="--ignore-paths" falsevalue="" checked="false" label="Ignore embedded paths when initializing coverage"/>
<param argument="--save-coverages" type="boolean" truevalue="true" falsevalue="" checked="false" label="Write node coverages table" help="Generate a tabular file with per-node coverage statistics."/>
</inputs>
<outputs>
<data name="output" format="odgi" label="${tool.name} on ${on_string}"/>
<data name="node_coverages" format="tabular" label="${tool.name} on ${on_string}: node coverages">
<filter>save_coverages</filter>
</data>
</outputs>
<tests/>
<help format="markdown"><![CDATA[
@HELP_HEADER@

`odgi cover` generates path covers for each connected component of the graph.

### Inputs

- **Input odgi graph**: Graph to cover.
- **Average depth / Paths per component / Node window size / Minimum node coverage**: Control coverage generation heuristics.
- **Ignore embedded paths**: Start covering from scratch ignoring existing paths.
- **Write node coverages table**: Emit per-node coverage values.

### Outputs

- **odgi**: Graph augmented with generated cover paths.
- **node coverages**: Optional tabular coverage summary.
]]></help>
<expand macro="citations"/>
</tool>
88 changes: 88 additions & 0 deletions tools/odgi/depth.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<tool id="odgi_depth" name="odgi depth" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.1">
<description>compute path depth statistics</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
odgi depth
--input '$input'
#if str($subset_paths)
--subset-paths '$subset_paths'
#end if
#if str($path)
--path '$path'
#end if
#if str($paths)
--paths '$paths'
#end if
#if str($graph_pos)
--graph-pos '$graph_pos'
#end if
#if str($graph_pos_file)
--graph-pos-file '$graph_pos_file'
#end if
#if str($path_pos)
--path-pos '$path_pos'
#end if
#if str($path_pos_file)
--path-pos-file '$path_pos_file'
#end if
#if str($bed_input)
--bed-input '$bed_input'
#end if
$graph_depth_table
$graph_depth_vec
$path_depth
$self_depth
$summarize
#if str($windows_in)
--windows-in '$windows_in'
#end if
#if str($windows_out)
--windows-out '$windows_out'
#end if
@THREADS@
> '$output'
]]></command>
<inputs>
<expand macro="graph_input_param_input"/>
<param argument="--subset-paths" type="data" format="txt" optional="true" label="Subset of paths for depth calculation" help="Text file with one path name per line."/>
<param argument="--path" type="text" optional="true" label="Single path to analyze"/>
<param argument="--paths" type="data" format="txt" optional="true" label="Report depth for these paths" help="Text file with one path name per line."/>
<param argument="--graph-pos" type="text" optional="true" label="Graph position (node[,offset[,strand]])"/>
<param argument="--graph-pos-file" type="data" format="txt" optional="true" label="File of graph positions"/>
<param argument="--path-pos" type="text" optional="true" label="Path position (path[,offset[,strand]])"/>
<param argument="--path-pos-file" type="data" format="txt" optional="true" label="File of path positions"/>
<param argument="--bed-input" type="data" format="bed" optional="true" label="BED intervals to evaluate"/>
<param argument="--graph-depth-table" type="boolean" truevalue="--graph-depth-table" falsevalue="" checked="false" label="Write node depth/unique depth table"/>
<param argument="--graph-depth-vec" type="boolean" truevalue="--graph-depth-vec" falsevalue="" checked="false" label="Write graph depth vector"/>
<param argument="--path-depth" type="boolean" truevalue="--path-depth" falsevalue="" checked="false" label="Write per-base path depth"/>
<param argument="--self-depth" type="boolean" truevalue="--self-depth" falsevalue="" checked="false" label="Write self depth per base"/>
<param argument="--summarize" type="boolean" truevalue="--summarize" falsevalue="" checked="false" label="Summarize depth distribution"/>
<param argument="--windows-in" type="text" optional="true" label="Depth windows inside range (LEN:MIN:MAX)"/>
<param argument="--windows-out" type="text" optional="true" label="Depth windows outside range (LEN:MIN:MAX)"/>
</inputs>
<outputs>
<expand macro="standard_tabular_output"/>
</outputs>
<tests/>
<help format="markdown"><![CDATA[
@HELP_HEADER@

`odgi depth` reports depth metrics for selected paths, positions, or intervals.

### Inputs

- **Input odgi graph**: Graph to profile.
- **Subset/path/path lists**: Limit the analysis to specific paths.
- **Positions / BED intervals**: Query exact positions or ranges.
- **Depth summary toggles**: Emit tables or vectors describing depth per node or path.
- **Depth windows**: Report intervals within or outside depth ranges.

### Outputs

- **Tabular**: Depth metrics written in tab-separated form.
]]></help>
<expand macro="citations"/>
</tool>
114 changes: 114 additions & 0 deletions tools/odgi/layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<tool id="odgi_layout" name="odgi layout" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="24.1">
<description>compute 2D path-guided layouts</description>
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
odgi layout
--idx '$idx'
--out '$layout_output'
#if $tsv
$tsv '$layout_tsv'
#end if
#if str($path_index)
--path-index '$path_index'
#end if
#if str($path_sgd_use_paths)
--path-sgd-use-paths '$path_sgd_use_paths'
#end if
#if str($layout_initialization)
--layout-initialization '$layout_initialization'
#end if
#if str($path_sgd_min_term_updates_paths)
--path-sgd-min-term-updates-paths $path_sgd_min_term_updates_paths
#end if
#if str($path_sgd_min_term_updates_nodes)
--path-sgd-min-term-updates-nodes $path_sgd_min_term_updates_nodes
#end if
#if str($path_sgd_delta)
--path-sgd-delta $path_sgd_delta
#end if
#if str($path_sgd_eta)
--path-sgd-eta $path_sgd_eta
#end if
#if str($path_sgd_eta_max)
--path-sgd-eta-max $path_sgd_eta_max
#end if
#if str($path_sgd_iter_max)
--path-sgd-iter-max $path_sgd_iter_max
#end if
#if str($path_sgd_iteration_max_learning_rate)
--path-sgd-iteration-max-learning-rate $path_sgd_iteration_max_learning_rate
#end if
#if str($path_sgd_zipf_theta)
--path-sgd-zipf-theta $path_sgd_zipf_theta
#end if
#if str($path_sgd_zipf_space)
--path-sgd-zipf-space $path_sgd_zipf_space
#end if
#if str($path_sgd_zipf_space_max)
--path-sgd-zipf-space-max $path_sgd_zipf_space_max
#end if
#if str($path_sgd_zipf_space_quantization_step)
--path-sgd-zipf-space-quantization-step $path_sgd_zipf_space_quantization_step
#end if
#if str($path_sgd_snapshot)
--path-sgd-snapshot '$path_sgd_snapshot'
#end if
@THREADS@
]]></command>
<inputs>
<expand macro="graph_input_param"/>
<param argument="--tsv" type="boolean" truevalue="--tsv" falsevalue="" checked="false" label="Export TSV layout alongside binary layout"/>
<param argument="--path-index" type="data" format="txt" optional="true" label="Precomputed path index (.xp)"/>
<param argument="--path-sgd-use-paths" type="data" format="txt" optional="true" label="Paths to sample for PG-SGD"/>
<param argument="--layout-initialization" type="select" optional="true" label="Layout initialization mode">
<option value="d" selected="true">Node rank in X, Gaussian noise in Y (default)</option>
<option value="r">Uniform noise in X and Y</option>
<option value="u">Node rank in X, uniform noise in Y</option>
<option value="g">Gaussian noise in X and Y</option>
<option value="h">Hilbert curve initialization</option>
</param>
<param argument="--path-sgd-min-term-updates-paths" type="float" optional="true" min="0" label="Minimum term updates (paths multiple)"/>
<param argument="--path-sgd-min-term-updates-nodes" type="float" optional="true" min="0" label="Minimum term updates (nodes multiple)"/>
<param argument="--path-sgd-delta" type="float" optional="true" min="0" label="Maximum displacement threshold (bp)"/>
<param argument="--path-sgd-eta" type="float" optional="true" min="0" label="Final learning rate"/>
<param argument="--path-sgd-eta-max" type="float" optional="true" min="0" label="Initial learning rate"/>
<param argument="--path-sgd-iter-max" type="integer" optional="true" min="1" label="Maximum PG-SGD iterations"/>
<param argument="--path-sgd-iteration-max-learning-rate" type="integer" optional="true" min="0" label="Iteration where learning rate peaks"/>
<param argument="--path-sgd-zipf-theta" type="float" optional="true" label="Zipf theta"/>
<param argument="--path-sgd-zipf-space" type="integer" optional="true" min="1" label="Zipf space size"/>
<param argument="--path-sgd-zipf-space-max" type="integer" optional="true" min="1" label="Zipf space max before quantization"/>
<param argument="--path-sgd-zipf-space-quantization-step" type="integer" optional="true" min="1" label="Zipf quantization step size"/>
<param argument="--path-sgd-snapshot" type="text" optional="true" label="Snapshot prefix for intermediate layouts"/>
</inputs>
<outputs>
<data name="layout_output" format="binary" label="${tool.name} on ${on_string}"/>
<data name="layout_tsv" format="tabular" label="${tool.name} on ${on_string}: coordinates">
<filter>tsv</filter>
</data>
</outputs>
<tests/>
<help format="markdown"><![CDATA[
@HELP_HEADER@

`odgi layout` computes 2D coordinates for ODGI graphs using path-guided stochastic gradient descent (PG-SGD).
The binary `.lay` output can be fed into visualization or downstream statistics; optionally export a TSV table of node coordinates.

### Inputs

- **Input odgi graph**: Sorted, id-compacted graph to lay out.
- **Export TSV layout alongside binary layout**: Produce a human-readable coordinate table as well as the binary `.lay`.
- **Precomputed path index**: Reuse a `.xp` index to accelerate layout.
- **Layout initialization mode**: Choose how the initial coordinates are seeded.
- **PG-SGD parameters**: Min term updates, learning rates, iteration cap, and Zipf sampling controls fine-tune convergence.
- **Snapshot prefix**: Write intermediate layouts for debugging or animation.

### Outputs

- **Binary**: Primary `.lay` file containing node coordinates.
- **coordinates**: Optional TSV with node ID, X, Y triples.
]]></help>
<expand macro="citations"/>
</tool>
26 changes: 22 additions & 4 deletions tools/odgi/macros.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
<?xml version="1.0"?>
<macros>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">odgi</requirement>
</requirements>
</xml>
<token name="@TOOL_VERSION@">0.3</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@TOOL_VERSION@">0.9.3</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@HELP_HEADER@">optimized dynamic genome/graph implementation (odgi)
----------------------------------------------------</token>
<token name="@THREADS@">--threads=${GALAXY_SLOTS:-1}</token>
<xml name="graph_input_param">
<param argument="--idx" type="data" format="odgi" label="Input odgi graph"/>
</xml>
<xml name="graph_input_param_input">
<param argument="--input" type="data" format="odgi" label="Input odgi graph"/>
</xml>
<xml name="group_delim_params">
<param argument="--delim" type="text" optional="true" label="Delimiter to define path groups" help="Split path names at this character to group them before summarizing statistics or haplotypes."/>
<param argument="--delim-pos" type="integer" optional="true" min="1" label="Use the N-th occurrence of the delimiter" help="Specify which occurrence of the delimiter to use when extracting the group identifier."/>
</xml>
<xml name="standard_tabular_output">
<data name="output" format="tabular" label="${tool.name} on ${on_string}"/>
</xml>
<xml name="standard_text_output">
<data name="output" format="txt" label="${tool.name} on ${on_string}"/>
</xml>
<xml name="citations">
<citations>
<yield />
<citation type="doi">10.1093/bioinformatics/btac308</citation>
</citations>
</xml>
</macros>
Loading
Loading