Mercurial > repos > mvdbeek > bam_readtagger
changeset 0:a38447a59412 draft
planemo upload for repository https://github.com/bardin-lab/readtagger/tree/master/galaxy commit d63500891dc173a7657bb9a9aabbeb6cf2ddb9e3-dirty
author | mvdbeek |
---|---|
date | Fri, 17 Feb 2017 10:54:47 -0500 |
parents | |
children | f69131f584e8 |
files | allow_dovetailing.xml bam_readtagger.xml deploy.sh macros.xml test-data/a_pasteurianus_tagged_with_dm6.bam test-data/a_pasteurianus_tagged_with_dm6_discarded.bam test-data/a_pasteurianus_tagged_with_dm6_verified.bam test-data/dm6.bam test-data/dm6_tagged_with_a_pasteurianus.bam test-data/dm6_tagged_with_a_pasteurianus_discarded.bam test-data/dm6_tagged_with_a_pasteurianus_verified.bam test-data/not_a_proper_pair.bam test-data/pasteurianus.bam test-data/proper_pair.bam test.sh |
diffstat | 15 files changed, 179 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/allow_dovetailing.xml Fri Feb 17 10:54:47 2017 -0500 @@ -0,0 +1,34 @@ +<tool id="allow_dovetailing" name="Allow dovetailing" version="0.1.8"> + <description>modifies proper_pair flag in bam files</description> + <requirements> + <requirement type="package" version="0.1.8">readtagger</requirement> + </requirements> + <command detect_errors="aggressive"><![CDATA[ + allow_dovetailing -i '$input' -o '$output' + ]]></command> + <inputs> + <param name="input" argument="--input_path" type="data" format="bam"/> + </inputs> + <outputs> + <data name="output" format="bam"/> + </outputs> + <tests> + <test> + <param name="input" value="not_a_proper_pair.bam" ftype="bam"/> + <output name="output" file="proper_pair.bam" ftype="bam" lines_diff="2"/> + </test> + </tests> + <help><![CDATA[ +:: +usage: allow_dovetailing [-h] -i INPUT_PATH -o OUTPUT_PATH + +Allow dovetailing. + +optional arguments: + -h, --help show this help message and exit + -i INPUT_PATH, --input_path INPUT_PATH + Input alignment file to manipulate + -o OUTPUT_PATH, --output_path OUTPUT_PATH + Output alignment file + ]]></help> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bam_readtagger.xml Fri Feb 17 10:54:47 2017 -0500 @@ -0,0 +1,92 @@ +<tool id="bam_readtagger" name="Tag alignment files" version="0.1.8"> + <description>from multiple bam files</description> + <macros> + <import>macros.xml</import> + </macros> + <requirements> + <requirement type="package" version="0.1.8">readtagger</requirement> + </requirements> + <command detect_errors="aggressive"><![CDATA[ + readtagger -t '$tag_file' -a + #for $element in $alignment_series + '$element.annotate_with':$element.r_tag:$element.m_tag + #end for + $allow_dovetailing + $keep_suboptimal + $discarded + $verified + -o '$tagged_file' + ]]></command> + <inputs> + <param name="tag_file" argument="--tag_file" type="data" format="bam"/> + <repeat name="alignment_series" title="Alignments"> + <param name="annotate_with" argument="--annotate_with" type="data" format="bam"/> + <param type="select" name="r_tag" label="First letter to use for read tag" value="A"> + <expand macro="tag_options"/> + </param> + <param type="select" name="m_tag" label="First letter to use for mate tag" value="B"> + <expand macro="tag_options"/> + </param> + </repeat> + <param argument="--allow_dovetailing" type="boolean" truevalue="-d" falsevalue="" label="Allow dovetailing" help="Check this to label reads as proper_pair even if the mates of a pair overlap each other"/> + <param argument="-k" name="keep_suboptimal" type="boolean" truevalue="-k" falsevalue="" label="Keep suboptimal alternative tags" help="Check this to also keep alternative tags that cannot explain the current read cigar"/> + <param argument="-wd" name="discarded" type="boolean" truevalue="-wd discarded.bam" falsevalue="" label="Check this to produce an output file containing only the reads with tags that failed validation"/> + <param argument="-wv" name="verified" type="boolean" truevalue="-wv verified.bam" falsevalue="" label="Check this to produce an output file containing only the reads with tags that pass validation"/> + </inputs> + <outputs> + <data name="tagged_file" format="bam" label="Tagged reads on $on_string"/> + <data name="verified_file" format="bam" from_work_dir="verified.bam" label="Verified reads/tags on $on_string"> + <filter>verified is True</filter> + </data> + <data name="discarded_file" format="bam" from_work_dir="discarded.bam" label="Discarded reads/tags $on_string"> + <filter>verified is True</filter> + </data> + </outputs> + <tests> + <test> <!-- test that a single read originating from a pasteurianus is properly annotated in a dm6 alignment (should end in verified bam file) --> + <param name="tag_file" value="dm6.bam" ftype="bam"/> + <repeat name="alignment_series"> + <param name="annotate_with" value="pasteurianus.bam" ftype="bam"/> + <param name="r_tag" value="A"/> + <param name="m_tag" value="B"/> + </repeat> + <param name="discarded" value="True"/> + <param name="verified" value="True"/> + <output name="tagged_file" file="dm6_tagged_with_a_pasteurianus.bam" ftype="bam" lines_diff="5"/> + <output name="verified_file" file="dm6_tagged_with_a_pasteurianus_verified.bam" ftype="bam" lines_diff="5"/> + <output name="discarded_file" file="dm6_tagged_with_a_pasteurianus_discarded.bam" ftype="bam" lines_diff="5"/> + </test> + <test> <!-- test that a single read originating from a pasteurianus is annotated in pasteurianus.bam as having homology with dm6, but marked as discarded (should end in discarded bam file) --> + <param name="tag_file" value="pasteurianus.bam" ftype="bam"/> + <repeat name="alignment_series"> + <param name="annotate_with" value="dm6.bam" ftype="bam"/> + <param name="r_tag" value="A"/> + <param name="m_tag" value="B"/> + </repeat> + <param name="discarded" value="True"/> + <param name="verified" value="True"/> + <output name="tagged_file" file="a_pasteurianus_tagged_with_dm6.bam" ftype="bam" lines_diff="5" /> + <output name="verified_file" file="a_pasteurianus_tagged_with_dm6_verified.bam" ftype="bam" lines_diff="5"/> + <output name="discarded_file" file="a_pasteurianus_tagged_with_dm6_discarded.bam" ftype="bam" lines_diff="5"/> + </test> + </tests> + <help><![CDATA[ + usage: readtagger [-h] -t TAG_FILE -a ANNOTATE_WITH [ANNOTATE_WITH ...] -o + OUTPUT_FILE + +Tag reads in an alignment file based on other alignment files + +optional arguments: + -h, --help show this help message and exit + -t TAG_FILE, --tag_file TAG_FILE + Tag reads in this file. (default: None) + -a ANNOTATE_WITH [ANNOTATE_WITH ...], --annotate_with ANNOTATE_WITH [ANNOTATE_WITH ...] + Tag reads in readfile if reads are aligned in these + files.Append `:A:B` to tag first letter of tag + describing read as A, and first letter of tag + describing the mate as B (default: None) + -o OUTPUT_FILE, --output_file OUTPUT_FILE + Write bam file to this path (default: None) + + ]]></help> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/deploy.sh Fri Feb 17 10:54:47 2017 -0500 @@ -0,0 +1,14 @@ +#!/bin/bash +# this script uploads galaxy tools in the current directory to the galaxy toolsheds +set -e + +CURRENT_DIR=$(dirname $0) + +echo "Deploying to Testtoolshed ..." +planemo shed_update -r --force_repository_creation -t testtoolshed --shed_key_from_env TTS_KEY "$CURRENT_DIR" + +echo "Deploying to Toolshed ..." +planemo shed_update -r --force_repository_creation -t toolshed --shed_key_from_env TS_KEY $CURRENT_DIR + +echo "Successfully deployed to toolsheds" +exit 0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Fri Feb 17 10:54:47 2017 -0500 @@ -0,0 +1,29 @@ +<macros> + <xml name="tag_options"> + <option value="A">A</option> + <option value="B">B</option> + <option value="C">C</option> + <option value="D">D</option> + <option value="E">E</option> + <option value="F">F</option> + <option value="G">G</option> + <option value="H">H</option> + <option value="I">I</option> + <option value="J">J</option> + <option value="K">K</option> + <option value="L">L</option> + <option value="M">M</option> + <option value="N">N</option> + <option value="O">O</option> + <option value="P">P</option> + <option value="Q">Q</option> + <option value="R">R</option> + <option value="S">S</option> + <option value="T">T</option> + <option value="U">U</option> + <option value="V">V</option> + <option value="W">W</option> + <option value="X">X</option> + <option value="Y">Y</option> + </xml> +</macros>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test.sh Fri Feb 17 10:54:47 2017 -0500 @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +if grep -v 'python tag_reads.py' bam_tag_reads.xml +then + sed -i.bak 's/tag_reads -t/python \$__tool_directory__\/tag_reads.py -t/g' bam_tag_reads.xml +fi +cp ../tag_reads/tag_reads.py . +planemo test --conda_prefix ~/miniconda3