Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding HalfDeep #6592

Merged
merged 13 commits into from
Dec 5, 2024
Merged
10 changes: 10 additions & 0 deletions tools/halfdeep/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
categories:
- Sequence Analysis
description: "HalfDeep: Automated detection of intervals covered at half depth by sequenced reads."
homepage_url: https://github.com/makovalab-psu/HalfDeep
long_description: |
Automated detection of intervals covered at half depth by sequenced reads.
name: halfdeep
owner: iuc
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/main/tools/halfdeep
type: unrestricted
70 changes: 70 additions & 0 deletions tools/halfdeep/halfdeep.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<tool id="halfdeep" name="HalfDeep" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
<description>Automated detection of intervals covered at half depth by sequenced reads.</description>
richard-burhans marked this conversation as resolved.
Show resolved Hide resolved
<macros>
<import>macros.xml</import>
</macros>
<expand macro="requirements"/>
<command detect_errors="exit_code"><![CDATA[
#import os
##
## reference
##
reference_filename="ref.fasta" &&
if [ "\$(head -c 2 '$ref' | xxd -p)" = "1f8b" ]; then reference_filename="ref.fasta.gz"; fi &&
richard-burhans marked this conversation as resolved.
Show resolved Hide resolved
ln -s '$ref' "\$reference_filename" &&
richard-burhans marked this conversation as resolved.
Show resolved Hide resolved
touch ref.idx &&
richard-burhans marked this conversation as resolved.
Show resolved Hide resolved
##
## reads
##
#set $reads_dir = "reads"
#set $mapped_reads_dir = "halfdeep/ref/mapped_reads"
mkdir -p '$reads_dir' '$mapped_reads_dir' &&
#for $read in $reads
#set $seq_base = os.path.basename(str($read))
richard-burhans marked this conversation as resolved.
Show resolved Hide resolved
ln -s '$read' '$reads_dir/$seq_base' &&
echo '$reads_dir/$seq_base' >> input.fofn &&
##
## mapped reads
##
#for $mapped_read in $mapped_reads
ln -s '$mapped_read' "$mapped_reads_dir/${seq_base}.bam" &&
ln -s "${seq_base}.bam" "$mapped_reads_dir/${seq_base}.sort.bam" &&
ln -s '$mapped_read.metadata.bam_index' "$mapped_reads_dir/${seq_base}.sort.bam.bai" &&
#end for
#end for
##
## run bam_depth.sh
##
#for $line_number in range(1, len($reads) + 1)
bam_depth.sh "\$reference_filename" $line_number &&
#end for
##
## run halfdeep.sh
##
halfdeep.sh "\$reference_filename"
]]></command>
<inputs>
<param name="ref" type="data" format="fasta,fasta.gz" label="Genome Assembly" help="A Genome Assembly in FASTA format."/>
<param name="reads" type="data" format="fastqsanger,fastqsanger.gz" multiple="true" label="Sequencing Reads" help="Sequencing Reads for the Genome Assembly in FASTQ format."/>
<param name="mapped_reads" type="data" format="bam" multiple="true" label="Aligned Reads" help="Alignments of the Sequencing Reads to the Genome Assembly in BAM format."/>
richard-burhans marked this conversation as resolved.
Show resolved Hide resolved
</inputs>
<outputs>
<data name="scaffold_len" format="tabular" from_work_dir="halfdeep/ref/scaffold_lengths.dat" label="Scaffold lengths for ${on_string}"/>
<data name="depth_dat" format="tabular.gz" from_work_dir="halfdeep/ref/depth.dat.gz" label="Depth for ${on_string}"/>
<data name="pct_cmds" format="text" from_work_dir="halfdeep/ref/percentile_commands.sh" label="Percentile to value for ${on_string}"/>
<data name="halfdeep_dat" format="tabular" from_work_dir="halfdeep/ref/halfdeep.dat" label="HalfDeep on ${on_string}"/>
</outputs>
<tests>
<test expect_num_outputs="4">
<param name="ref" value="ref.fasta.gz" ftype="fasta.gz"/>
<param name="reads" value="reads.fasta.gz" ftype="fasta.gz"/>
<param name="mapped_reads" value="mapped_reads.bam" ftype="bam"/>
richard-burhans marked this conversation as resolved.
Show resolved Hide resolved
</test>
</tests>
<help><![CDATA[
Inputs are an assembly in FASTA format, reads in FASTQ format, and mapped reads in BAM format.

The final output is a halfdeep.dat file. This is a list of intervals (origin 1, closed) that the process has called as 'covered at half depth'.
]]></help>
<expand macro="citations"/>
</tool>
23 changes: 23 additions & 0 deletions tools/halfdeep/macros.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<macros>
<xml name="requirements">
<requirements>
<requirement type="package" version="@TOOL_VERSION@">halfdeep</requirement>
</requirements>
</xml>
<token name="@TOOL_VERSION@">0.1.0</token>
<token name="@VERSION_SUFFIX@">0</token>
<token name="@PROFILE@">21.05</token>
<xml name="citations">
<citations>
<citation type="bibtex">
@misc{github_halfdeep,
author = {Makova Lab PSU},
year = "2019",
title = {HalfDeep},
publisher = {GitHub},
journal = {GitHub repository},
url = {https://github.com/makovalab-psu/HalfDeep}
</citation>
</citations>
</xml>
</macros>
Binary file added tools/halfdeep/test-data/mapped_reads.bam
Binary file not shown.
Binary file added tools/halfdeep/test-data/reads.fasta.gz
Binary file not shown.
Binary file added tools/halfdeep/test-data/ref.fasta.gz
Binary file not shown.