Skip to content

Commit

Permalink
Added additional options to Abyss
Browse files Browse the repository at this point in the history
  • Loading branch information
jkokosar authored and dblenkus committed Feb 17, 2016
1 parent 874b090 commit f5c39b6
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 15 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ Added
* Import expressions from tranSMART.
* Limma differential expression (tranSMART)
* Added VC filtering tool (Chemical mutagenesis)
* Added aditional analysis options to Abyss assembler
63 changes: 50 additions & 13 deletions resolwe_bio/processes/assembly/abyss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,39 @@
---

- name: assembler:abyss
version: 1.0.1
version: 1.0.2
label: Assembler ABySS (1.9.0)
type: data:abyss
category: analyses
persistence: CACHED
description: >
ABySS assembler
input:
- name: reads
label: Reads
- name: paired_end
label: Paired-end reads
type: data:reads:fastq:paired
required: false
description: >
Paired-end library
- name: se
label: Reads without mates
label: Single-end reads
type: data:reads:fastq:single
required: false
description: >
Reads without mates should be placed in a file specified by the parameter se (single-end). Reads without mates in the paired-end files will slow down the paired-end assembler considerably during the abyss-fixmate stage.
- name: use_unmapped
label: Use unmapped reads
type: basic:boolean
default: false
description: >
Use unmapped reads from the reads alignment job (compatible with Bowtie and BWA output files). This selection will override the selection of single-end reads on the input.
- name: unmapped
label: Unmapped Reads
type: data:alignment:bam
required: false
description: >
Use unmapped reads from the reads alignment job (compatible with Bowtie and BWA output files). This selection will override the selection of single-end reads on the input.
hidden: "use_unmapped === false"
- name: options
label: Options
group:
Expand All @@ -43,6 +57,12 @@
The seed length should be at least twice the value of k. If more
sequence is assembled than the expected genome size, try
increasing s.
- name: n
label: Minimum number of pairs
type: basic:integer
default: 10
description: >
Minimum number of pairs required for building contigs.
output:
- name: contigs
label: Contigs
Expand All @@ -54,7 +74,7 @@
- name: name
label: Name
type: basic:string
default: "ABySS assembly ({{ reads.fastq.file|basename|default:'?' }})"
default: "ABySS assembly ({{ options.name }})"
- name: alias
label: Alias
type: basic:string
Expand Down Expand Up @@ -83,18 +103,35 @@
re-require common
re-require abyss-1.9.0
NAME_1=`basename '{{reads.fastq.file}}' .fastq.gz`
NAME_2=`basename '{{reads.fastq2.file}}' .fastq.gz`
cp '{{reads.fastq.file}}' ${NAME_1}_1.fastq.gz
cp '{{reads.fastq2.file}}' ${NAME_2}_2.fastq.gz
{% if not paired_end and not se and not unmapped %}
re-error "No input files provided. Please use either Paired-end or Single-end input files to run Abyss."
{% endif %}
{% if paired_end %}
ln -s '{{paired_end.fastq.file}}' fw_1.fastq.gz
ln -s '{{paired_end.fastq2.file}}' rw_2.fastq.gz
{% endif %}
{% if use_unmapped %}
{% if use_unmapped and not unmapped %}
re-error "Use unmapped reads option is selected but the input file is not provided."
{% else %}
SE='se={{ unmapped.unmapped.file }}'
{% endif %}
{% elif se and not use_unmapped %}
SE='se={{ se.fastq.file }}'
{% endif %}
re-progress 0.1
abyss-pe name='{{options.name}}' k='{{options.k}}' s='{{options.s}}' {% if se %} se='{{se.fastq.file}}' {% endif %} in=''${NAME_1}'_1.fastq.gz '${NAME_2}'_2.fastq.gz'
# remove whitespace from a sample name
NAME="$(echo -e "{{options.name}}" | tr -d '[[:space:]]')"
abyss-pe name=${NAME} k='{{options.k}}' s='{{options.s}}' n='{{options.n}}' {% if paired_end %} in='fw_1.fastq.gz rw_2.fastq.gz' {% endif %} ${SE}
re-checkrc
re-progress 0.9
zip '{{options.name}}'_contigs *.fa
zip ${NAME}_contigs *.fa
re-save-file contigs '{{options.name}}'_contigs.zip
re-save-file stats '{{options.name}}'-stats.tab
re-save-file contigs ${NAME}_contigs.zip
re-save-file stats ${NAME}-stats.tab
11 changes: 9 additions & 2 deletions resolwe_bio/tests/test_assembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ def test_abyss(self):
inputs = {'src1': 'reads_paired_abyss_1.fastq.gz', 'src2': 'reads_paired_abyss_2.fastq.gz'}
reads = self.run_processor('import:upload:reads-fastq-paired-end', inputs)

inputs = {'reads': reads.pk,
inputs = {'paired_end': reads.pk,
'se': se_reads.pk,
'options': {'k': 25,
'name': 'ecoli'}}

self.run_processor('assembler:abyss', inputs)
# self.assertFiles(abyss, 'contigs', 'contigs.zip', compression='zip')

inputs = {'paired_end': reads.pk,
'se': se_reads.pk,
'use_unmapped': True,
'options': {'k': 25,
'name': 'ecoli'}}

self.run_processor('assembler:abyss', inputs, 'error')

0 comments on commit f5c39b6

Please sign in to comment.