Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/usegalaxy-au/tools-au
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed May 31, 2023
2 parents 6cd8c5d + b677161 commit 2e1eba8
Show file tree
Hide file tree
Showing 25 changed files with 234,105 additions and 47 deletions.
2 changes: 2 additions & 0 deletions tools/cactus/.shed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ exclude:
- README.md
- tool_test_output.html
- tool_test_output.json
- extras/*
- venv
homepage_url: https://github.com/ComparativeGenomicsToolkit/cactus
long_description: >
Cactus is a reference-free whole-genome multiple alignment program
Expand Down
56 changes: 11 additions & 45 deletions tools/cactus/cactus_cactus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,60 +23,26 @@
## Run cactus
#if $aln_mode.aln_mode_select == 'intraspecies':
## If we're doing a pangenome, we need to run the steps manually
cactus-minigraph
--binariesMode local
--mapCores \${GALAXY_SLOTS:-4}
--maxMemory \${GALAXY_MEMORY_MB:-8192}M
--reference $aln_mode.ref_level
--workDir ./
./jobStore
./seqfile.txt
pangenome.gfa
&&
cactus-graphmap
--binariesMode local
--maxCores \${GALAXY_SLOTS:-4}
--maxMemory \${GALAXY_MEMORY_MB:-8192}M
--outputFasta pangenome.gfa.fa
--reference $aln_mode.ref_level
--workDir ./
./jobStore
./seqfile.txt
pangenome.gfa
pangenome.paf
&&
cactus-align
## Run cactus-pangenome
cactus-pangenome
--binariesMode local
--maxCores \${GALAXY_SLOTS:-4}
--maxMemory \${GALAXY_MEMORY_MB:-8192}M
--outVG
--pangenome
--reference $aln_mode.ref_level
--workDir ./
./jobStore
./seqfile.txt
pangenome.paf
alignment.hal
&&
cactus-graphmap-join
--binariesMode local
--giraffe
--maxCores \${GALAXY_SLOTS:-4}
--maxMemory \${GALAXY_MEMORY_MB:-8192}M
--maxMemory \${GALAXY_MEMORY_MB:-8192}M
--outDir ./
--outName alignment
--reference $aln_mode.ref_level
--vg alignment.vg
--outDir ./
./jobStore
seqfile.txt
#else if $aln_mode.aln_mode_select == 'interspecies':
## Run cactus normally
cactus
--binariesMode local
--maxCores \${GALAXY_SLOTS:-4}
--maxMemory \${GALAXY_MEMORY_MB:-8192}M
--workDir ./
jobStore seqfile.txt alignment.hal
jobStore
seqfile.txt
alignment.full.hal
#end if
]]></command>
Expand Down Expand Up @@ -111,12 +77,12 @@
</param>
<param name="fasta" type="data" format="fasta,fasta.gz" label="Genome Sequence" help="Input genome"/>
</repeat>

<!-- add an option for root -->
<!-- root mr -->
</inputs>
<outputs>
<data name="out_hal" format="h5" from_work_dir="alignment.hal" label="${tool.name} on ${on_string} (HAL file)" />
<data name="out_hal" format="h5" from_work_dir="alignment.full.hal" label="${tool.name} on ${on_string} (HAL file)">
</data>
<data name="out_gfa" format="gfa2.gz" from_work_dir="alignment.gfa.gz" label="${tool.name} on ${on_string} (GFA file)" >
<filter>aln_mode['aln_mode_select'] == 'intraspecies'</filter>
</data>
Expand Down Expand Up @@ -182,7 +148,7 @@
</repeat>
<output name="out_hal">
<assert_contents>
<has_size value="2088959" delta="200000" />
<has_size value="565214" delta="65214" />
</assert_contents>
</output>
<output name="out_gfa">
Expand Down
2 changes: 2 additions & 0 deletions tools/cactus/extras/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The Snakefile is for testing the cactus interface.
Run the workflow with `snakemake --use-singularity` and inspect the output in `test_output`.
102 changes: 102 additions & 0 deletions tools/cactus/extras/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
#!/usr/bin/env python3

from pathlib import Path
import tempfile

cactus = 'docker://quay.io/comparative-genomics-toolkit/cactus:v2.5.1'

data_dir = Path(Path().resolve().parent, 'test-data')
outdir = Path('test_output')
logdir = Path(outdir, 'logs')

in_seqs = [Path(outdir, 'fastas', x) for x in [
'simCow_chr6.fasta',
'simDog_chr6.fasta',
'simHuman_chr6.fasta',
'simMouse_chr6.fasta',
'simRat_chr6.fasta']]

rule target:
input:
Path(outdir, 'cactus_pangenome', 'alignment.full.hal'),
Path(outdir, 'cactus', 'alignment.hal'),


with tempfile.TemporaryDirectory() as jobstore:
rule cactus_pangenome:
input:
fastas = in_seqs,
seqfile = Path(outdir, 'seqfile.txt')
output:
Path(outdir, 'cactus_pangenome', 'alignment.full.hal'),
params:
ref_level = 'simCow_chr6',
wd = Path(outdir, 'cactus_pangenome')
log:
Path(logdir, 'cactus_pangenome.log')
threads:
workflow.cores
container:
cactus
shell:
'cactus-pangenome '
'--binariesMode local '
'--maxCores {threads} '
'--outDir {params.wd} '
'--outName alignment '
'--reference {params.ref_level} '
'{jobstore} '
'{input.seqfile} '
'&> {log}'

with tempfile.TemporaryDirectory() as jobstore:
rule cactus:
input:
fastas = in_seqs,
seqfile = Path(outdir, 'seqfile.txt')
output:
Path(outdir, 'cactus', 'alignment.hal'),
params:
wd = Path(outdir, 'cactus'),
seqfile = lambda wildcards, input: Path(input.seqfile).resolve()
log:
Path(logdir, 'cactus.log').resolve()
threads:
workflow.cores
container:
cactus
shell:
'mkdir -p {params.wd} || exit 1 '
'&& '
'cd {params.wd} || exit 1 '
'&& '
'cactus '
'--binariesMode local '
'--maxCores {threads} '
'{jobstore} '
'{params.seqfile} '
'alignment.hal '
'&> {log}'

rule seqfile:
input:
in_seqs
output:
Path(outdir, 'seqfile.txt')
run:
with open(output[0], 'wt') as f:
for seq in input:
label = Path(seq).with_suffix('').name
filename = Path(seq).resolve()
f.write(f'{label} {filename}\n')

rule fastas:
input:
lambda wildcards:
Path(data_dir, wildcards.filename)
output:
Path(outdir, 'fastas', '{filename}')
shell:
'cp {input} {output}'


4 changes: 2 additions & 2 deletions tools/cactus/macros.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<macros>
<token name="@TOOL_VERSION@">2.4.4</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@TOOL_VERSION@">2.5.1</token>
<token name="@VERSION_SUFFIX@">1</token>
<token name="@PROFILE@">20.09</token>
<xml name="requirements">
<requirements>
Expand Down
11 changes: 11 additions & 0 deletions tools/cellranger/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This is the Galaxy Wrapper of CellRanger. Only three pipelines are wrappered: count, mkref and mkgtf.

[See more information](https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/what-is-cell-ranger)

Setup Cellranger via command line

[See more information](https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/installation)

Build Notes for Reference Packages

[See more information](https://support.10xgenomics.com/single-cell-gene-expression/software/release-notes/build)
Loading

0 comments on commit 2e1eba8

Please sign in to comment.