Skip to content

Commit fc3deb5

Browse files
authored
Merge pull request #2961 from bgruening/vg
add initial version of vg
2 parents cd3b054 + a0ee9e8 commit fc3deb5

13 files changed

Lines changed: 788 additions & 3 deletions

File tree

.github/workflows/pr.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,8 @@ jobs:
318318
path: upload
319319
- name: Check status of combined status
320320
run: |
321-
stat=$(jq '.["tests"][]["data"]["status"]' upload/tool_test_output.json | grep -v "success" || true)
322-
if [[ "$(echo -n $stat | wc -l)" -gt "0" ]]; then
323-
echo "Unsuccessful tests found $(sort <<<$stat | uniq -c)"
321+
if jq '.["tests"][]["data"]["status"]' upload/tool_test_output.json | grep -v "success"; then
322+
echo "Unsuccessful tests found, inspect the 'All tool test results' artifact for details."
324323
exit 1
325324
fi
326325

tools/vg/.shed.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
owner: iuc
2+
long_description: |
3+
Variation graph data structures, interchange formats, alignment, genotyping, and variant calling methods
4+
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/master/tools/vg
5+
homepage_url: https://github.com/vgteam/vg
6+
type: unrestricted
7+
categories:
8+
- Sequence Analysis
9+
- Variant Analysis
10+
auto_tool_repositories:
11+
name_template: "{{ tool_id }}"
12+
description_template: "Wrapper for the vg tool: {{ tool_name }}"
13+
suite:
14+
name: "suite_vg"
15+
description: "variation graph data structures, interchange formats, alignment, genotyping, and variant calling methods"
16+
type: repository_suite_definition

tools/vg/convert.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<tool id="vg_convert" name="vg convert" version="@TOOL_VERSION@">
2+
<description></description>
3+
<macros>
4+
<import>macros.xml</import>
5+
</macros>
6+
<expand macro="requirements"/>
7+
<command detect_errors="exit_code"><![CDATA[
8+
ln -s '$infile' ./infile.${infile.ext} &&
9+
10+
vg convert
11+
$output_format
12+
./infile.${infile.ext}
13+
> '$output'
14+
]]></command>
15+
<inputs>
16+
<param name="infile" type="data" format="vg,xg" label="Input file in vg or xg format" />
17+
<param name="output_format" type="select" label="Choose your output format">
18+
<option value="--xg-out">XG format (--xg-out)</option>
19+
<!--option value="- -odgi-out">odgi format (- -odgi-out)</option-->
20+
</param>
21+
</inputs>
22+
<outputs>
23+
<data name="output" format="odgi">
24+
<change_format>
25+
<when input="output_format" value="--xg-out" format="xg"/>
26+
</change_format>
27+
</data>
28+
</outputs>
29+
<tests>
30+
<test>
31+
<param name="infile" value="hla.vg" ftype="vg" />
32+
<param name="output_format" value="--xg-out" />
33+
<output name="output" file="hla.xg" ftype="xg" compare="sim_size" />
34+
</test>
35+
<!--test>
36+
<param name="infile" value="x.vg" ftype="vg" />
37+
<param name="output_format" value="- -odgi-out" />
38+
<output name="output" file="x.odgi" ftype="odgi" compare="sim_size" />
39+
</test-->
40+
</tests>
41+
<help><![CDATA[
42+
43+
variation graph (vg) convert module
44+
-----------------------------------
45+
46+
This module is converting various variant graphs into each format.
47+
48+
]]></help>
49+
<expand macro="citations" />
50+
</tool>

tools/vg/deconstruct.xml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<tool id="vg_deconstruct" name="vg deconstruct" version="@TOOL_VERSION@">
2+
<description>construct a dynamic succinct variation graph</description>
3+
<macros>
4+
<import>macros.xml</import>
5+
</macros>
6+
<expand macro="requirements"/>
7+
<command detect_errors="exit_code"><![CDATA[
8+
ln -s '$infile' ./infile.${infile.ext} &&
9+
10+
vg deconstruct
11+
#if $path:
12+
--path '${','.join([$p for $p in $path])}'
13+
#end if
14+
#if $path_prefix
15+
--path-prefix '${','.join([$p for $p in $path_prefix])}'
16+
#end if
17+
#if $alt_prefix
18+
--alt-prefix '${','.join([$p for $p in $alt_prefix])}'
19+
#end if
20+
#if $snarls:
21+
--snarls '$snarls'
22+
#end if
23+
$path_traversals ## -e
24+
--threads=\${GALAXY_SLOTS:-1}
25+
./infile.${infile.ext}
26+
27+
> '$output'
28+
29+
]]></command>
30+
<inputs>
31+
<param name="infile" type="data" format="xg,odgi" label="Graph files" />
32+
<param argument="--path" type="text" value="" label="A reference path to deconstruct against"
33+
help="comma-separated list accepted">
34+
<sanitizer>
35+
<valid initial="string.printable">
36+
<remove value="&apos;"/>
37+
</valid>
38+
</sanitizer>
39+
</param>
40+
<param argument="--path-prefix" type="text" value="" label="All paths beginning with this value used as reference"
41+
help="comma-separated list accepted">
42+
<sanitizer>
43+
<valid initial="string.printable">
44+
<remove value="&apos;"/>
45+
</valid>
46+
</sanitizer>
47+
</param>
48+
<param argument="--alt-prefix" type="text" value="" label="Non-reference paths beginning with with this value get lumped together to same sample in VCF"
49+
help="comma-separated list accepted">
50+
<sanitizer>
51+
<valid initial="string.printable">
52+
<remove value="&apos;"/>
53+
</valid>
54+
</sanitizer>
55+
</param>
56+
<param argument="--snarls" type="data" format="xg,odgi" label="Snarls files" optional="true"
57+
help="from `vg snarls` to avoid recomputing" />
58+
59+
<param argument="--path-traversals" type="boolean" truevalue="--path-traversals" falsevalue="" checked="false"
60+
label="Only consider traversals that correspond to paths in the grpah" />
61+
</inputs>
62+
<outputs>
63+
<data name="output" format="vcf" />
64+
</outputs>
65+
<tests>
66+
<test>
67+
<param name="infile" value="hla.xg" />
68+
<param name="path" value="gi|568815592:29791752-29792749" />
69+
<param name="path_traversals" value="true" />
70+
<output name="output" file="hla_variants.vcf" />
71+
</test>
72+
</tests>
73+
<help><![CDATA[
74+
variation graph (vg) deconstruct module
75+
-----------------------------------
76+
77+
Creates VCF records for Snarls present in a graph (relative to a chosen reference path).
78+
79+
]]></help>
80+
<expand macro="citations">
81+
</expand>
82+
</tool>

tools/vg/macros.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<macros>
3+
<xml name="requirements">
4+
<requirements>
5+
<requirement type="package" version="@TOOL_VERSION@">vg</requirement>
6+
</requirements>
7+
</xml>
8+
<token name="@TOOL_VERSION@">1.23.0</token>
9+
<xml name="citations">
10+
<citations>
11+
<yield />
12+
</citations>
13+
</xml>
14+
</macros>

tools/vg/test-data/hla.vg

6.82 KB
Binary file not shown.

tools/vg/test-data/hla.xg

16.1 KB
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
##fileformat=VCFv4.2
2+
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
3+
##contig=<ID=gi|568815592:29791752-29792749,length=998>
4+
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT gi|157734152:29563108-29564082 gi|528476637:29761569-29762543 gi|568815454:1057585-1058559 gi|568815529:1275535-1276509 gi|568815551:1054737-1055734 gi|568815561:1054328-1055325 gi|568815564:1054403-1055400 gi|568815567:1054737-1055711 gi|568815569:1097903-1098900
5+
gi|568815592:29791752-29792749 92 . G A 23 . . GT 1 1 1 1 0 0 0 1 0
6+
gi|568815592:29791752-29792749 105 . C T 23 . . GT 1 1 1 1 0 0 0 1 0
7+
gi|568815592:29791752-29792749 151 . CAG C 23 . . GT 1 1 1 1 0 0 0 1 0
8+
gi|568815592:29791752-29792749 160 . A G 23 . . GT 1 1 1 1 0 0 0 1 0
9+
gi|568815592:29791752-29792749 222 . G A 23 . . GT 1 1 1 1 0 0 0 1 0
10+
gi|568815592:29791752-29792749 283 . C G 23 . . GT 1 1 1 1 0 0 0 1 0
11+
gi|568815592:29791752-29792749 295 . TT CC 23 . . GT 1 1 1 1 0 0 0 1 0
12+
gi|568815592:29791752-29792749 348 . G A 23 . . GT 1 1 1 1 0 0 0 1 0
13+
gi|568815592:29791752-29792749 357 . G A 23 . . GT 1 1 1 1 0 0 0 1 0
14+
gi|568815592:29791752-29792749 395 . T C 23 . . GT 1 1 1 1 0 0 0 1 0
15+
gi|568815592:29791752-29792749 468 . T C 23 . . GT 1 1 1 1 0 0 0 1 0
16+
gi|568815592:29791752-29792749 583 . G C 23 . . GT 1 1 1 1 0 0 0 1 0
17+
gi|568815592:29791752-29792749 621 . G T 23 . . GT 0 1 0 0 0 0 0 1 0
18+
gi|568815592:29791752-29792749 660 . G A 23 . . GT 1 1 1 1 0 0 0 1 0
19+
gi|568815592:29791752-29792749 824 . CGCGGGCGCCGTGGATGGAGCA C 23 . . GT 1 1 1 1 0 0 0 1 0
20+
gi|568815592:29791752-29792749 982 . G A 23 . . GT 1 1 1 1 0 0 0 1 0
21+
gi|568815592:29791752-29792749 995 . C T 23 . . GT 1 1 1 1 0 0 0 1 0

tools/vg/test-data/snarls.pb

178 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)