changeset 0:d2e46adc199e draft

planemo upload commit 35b743e6492923c0e2b1e5e434eaf4e56d268108
author nick
date Mon, 23 Nov 2015 22:06:21 -0500
parents
children b63d6673f883
files align_families.xml duplex.xml make_families.xml tool_dependencies.xml
diffstat 4 files changed, 230 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/align_families.xml	Mon Nov 23 22:06:21 2015 -0500
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<tool id="align_families" name="Align families" version="0.1">
+  <description>from duplex sequencing data</description>
+  <requirements>
+    <requirement type="package" version="7.221">mafft</requirement>
+    <requirement type="package" version="0.1">duplex</requirement>
+    <requirement type="set_environment">DUPLEX_DIR</requirement>
+  </requirements>
+  <command detect_errors="exit_code">python \$DUPLEX_DIR/align_families.py $input &gt; $output
+  </command>
+  <inputs>
+    <param name="input" type="data" format="tabular" label="Input reads" help="with barcodes, grouped by family"/>
+  </inputs>
+  <outputs>
+    <data name="output" format="tabular"/>
+  </outputs>
+  <tests>
+    <test>
+      <param name="input" value="smoke.families.tsv"/>
+      <output name="output" file="smoke.families.aligned.tsv"/>
+    </test>
+    <test>
+      <param name="input" value="families.in.tsv"/>
+      <output name="output" file="families.sort.tsv"/>
+    </test>
+  </tests>
+  <help>
+
+**What it does**
+
+This is for processing duplex sequencing data. It does a multiple sequence alignment on each (single-stranded) family of reads.
+
+-----
+
+**Input**
+
+This expects the output format of the "Make families" tool.
+
+-----
+
+**Output**
+
+The output is a tabular file where each line corresponds to a (single) read.
+
+The columns are::
+
+  1: barcode (both tags)
+  2: tag order in barcode ("ab" or "ba")
+  3: read mate ("1" or "2")
+  4: read name
+  5: read sequence, aligned ("-" for gaps)
+  6: read quality scores, aligned (" " for gaps)
+
+-----
+
+**Alignments**
+
+The alignments are done using MAFFT, specifically the command
+::
+
+  $ mafft --nuc --quiet family.fa &gt; family.aligned.fa
+
+    </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/duplex.xml	Mon Nov 23 22:06:21 2015 -0500
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<tool id="duplex" name="Make consensus reads" version="0.1">
+  <description>from duplex sequencing data</description>
+  <requirements>
+    <requirement type="package" version="0.1">duplex</requirement>
+    <requirement type="set_environment">DUPLEX_DIR</requirement>
+  </requirements>
+  <command detect_errors="exit_code"><![CDATA[
+    python \$DUPLEX_DIR/duplex.py -r $min_reads -q $qual_thres -F $qual_format $input
+    #if $keep_sscs:
+      --sscs-file $sscs
+    #end if
+    > duplex.fa
+    && awk -f \$DUPLEX_DIR/utils/outconv.awk -v target=1 duplex.fa > $output1
+    && awk -f \$DUPLEX_DIR/utils/outconv.awk -v target=2 duplex.fa > $output2
+  ]]>
+  </command>
+  <inputs>
+    <param name="input" type="data" format="tabular" label="Aligned input reads" />
+    <param name="min_reads" type="integer" value="3" min="1" label="Minimum reads per family" help="Single-strand families with fewer than this many reads will be skipped."/>
+    <param name="qual_thres" type="integer" value="25" min="1" label="Minimum base quality" help="Bases with a PHRED score less than this will not be counted in the consensus making."/>
+    <param name="qual_format" type="select" label="FASTQ format" help="Solexa should also work for Illumina 1.3+ and 1.5+, and Sanger should work for Illumina 1.8+">
+      <option value="sanger" selected="true">Sanger (PHRED 0 = &quot;!&quot;)</option>
+      <option value="solexa">Solexa (PHRED 0 = &quot;@&quot;)</option>
+    </param>
+    <param name="keep_sscs" type="boolean" truevalue="true" falsevalue="" label="Output single-strand consensus sequences" />
+  </inputs>
+  <outputs>
+    <data name="output1" format="fasta" label="$tool.name on $on_string (mate 1)"/>
+    <data name="output2" format="fasta" label="$tool.name on $on_string (mate 2)"/>
+    <data name="sscs" format="fasta" label="$tool.name on $on_string (SSCS)">
+      <filter>keep_sscs</filter>
+    </data>
+  </outputs>
+  <tests>
+    <test>
+      <param name="input" value="families.msa.tsv"/>
+      <output name="output1" file="families.cons_1.fa"/>
+      <output name="output2" file="families.cons_2.fa"/>
+    </test>
+  </tests>
+  <help>
+
+**What it does**
+
+This is for processing duplex sequencing data. It creates single-strand and duplex consensus reads from aligned read families.
+
+-----
+
+**Input**
+
+This expects the output format of the "Align families" tool.
+
+-----
+
+**Output**
+
+This will output final, duplex consensus reads in two FASTA files (first and second reads in the pairs). Optionally, you can save the single-strand reads too, in a separate FASTA file.
+
+    </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make_families.xml	Mon Nov 23 22:06:21 2015 -0500
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<tool id="make_families" name="Make families" version="0.1">
+  <description>from duplex sequencing data</description>
+  <requirements>
+    <requirement type="package" version="0.1">duplex</requirement>
+    <requirement type="set_environment">DUPLEX_DIR</requirement>
+  </requirements>
+  <command>paste $fastq1 $fastq2
+    | paste - - - -
+    | awk -f \$DUPLEX_DIR/make-barcodes.awk -v TAG_LEN=$taglen -v INVARIANT=$invariant
+    | sort
+    &gt; $output
+  </command>
+  <inputs>
+    <param name="fastq1" type="data" format="fastq" label="Sequencing reads, mate 1"/>
+    <param name="fastq2" type="data" format="fastq" label="Sequencing reads, mate 2"/>
+    <param name="taglen" type="integer" value="12" min="0" label="Tag length" help="length of each random barcode on the ends of the fragments"/>
+    <param name="invariant" type="integer" value="5" min="0" label="Invariant sequence length" help="length of the sequence between the tag and actual sample sequence (the restriction site, normally)"/>
+  </inputs>
+  <outputs>
+    <data name="output" format="tabular"/>
+  </outputs>
+  <tests>
+    <test>
+      <param name="fastq1" value="smoke_1.fq"/>
+      <param name="fastq2" value="smoke_2.fq"/>
+      <param name="taglen" value="5"/>
+      <param name="invariant" value="1"/>
+      <output name="output" file="smoke.families.tsv"/>
+    </test>
+    <test>
+      <param name="fastq1" value="smoke_1.fq"/>
+      <param name="fastq2" value="smoke_2.fq"/>
+      <param name="taglen" value="5"/>
+      <param name="invariant" value="0"/>
+      <output name="output" file="smoke.families.i0.tsv"/>
+    </test>
+  </tests>
+  <help>
+
+**What it does**
+
+This tool is for processing raw duplex sequencing data, removing the barcodes and grouping by them into families of reads from the same fragment.
+
+-----
+
+**Output**
+
+The output will be a tabular file where each line corresponds to a pair of input reads.
+
+The columns are::
+
+  1: barcode (both tags joined and ordered)
+  2: tag order in barcode ("ab" or "ba")
+  3: read1 name
+  4: read1 sequence (minus the tag and invariant sequences)
+  5: read1 quality scores (minus the same tag and invariant)
+  6: read2 name
+  7: read2 sequence (minus the tag and invariant sequences)
+  8: read2 quality scores (minus the same tag and invariant)
+
+-----
+
+**Barcode creation**
+
+For each pair, the tool will remove the tag at the beginning of each read and create a barcode by concatenating the two tags. The order of the tags is determined by a string comparison so that it will make an identical barcode from pairs of either order. The original tag order will be noted in the second column.
+
+Since pairs from opposite strands will have the same tags, but in the reverse order, this produces the same barcode for reads from the same fragment, regardless of strand. Then a simple sort will group all reads from the same strand together, separated into strands by the different "order" values.
+
+Examples::
+
+  +---------------+-----------------+
+  |  input tags   |     output      |
+  +-------+-------+-------+---------+
+  | read1 | read2 | order | barcode |
+  +-------+-------+-------+---------+
+  |  ATG  |  CCT  |  ab   | ATGCCT  |
+  +-------+-------+-------+---------+
+  |  CCT  |  ATG  |  ba   | ATGCCT  |
+  +-------+-------+-------+---------+
+
+    </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Mon Nov 23 22:06:21 2015 -0500
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<tool_dependency>
+  <package name="mafft" version="7.221">
+    <repository changeset_revision="d71e007323d4" name="mafft" owner="rnateam" toolshed="https://toolshed.g2.bx.psu.edu" />
+  </package>
+  <package name="duplex" version="0.1">
+    <install version="1.0">
+      <actions>
+        <action type="download_by_url">https://github.com/makrutenko/duplex/archive/master.tar.gz</action>
+        <action type="shell_command">make</action>
+        <action type="move_directory_files">
+          <source_directory>.</source_directory>
+          <destination_directory>$INSTALL_DIR</destination_directory>
+        </action>
+        <action type="set_environment">
+          <environment_variable action="set_to" name="DUPLEX_DIR">$INSTALL_DIR</environment_variable>
+          <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR</environment_variable>
+        </action>
+      </actions>
+    </install>
+  </package>
+</tool_dependency>