-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor: left over from last merge - runs hagfish
- Loading branch information
Showing
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
lib/python/moa/template/local_templates/autohagfish.jinja2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
### prepare | ||
|
||
if [[ ! -f "db.1.ebwt" ]] | ||
then | ||
echo "Building index for {{ fasta }}" | ||
bowtie-build {{ fasta }} db | ||
else | ||
echo "Skip bowtie build - files exists" | ||
fi | ||
|
||
### run | ||
|
||
DEBUG="" | ||
|
||
mkdir -p touch | ||
[[ -f "{{ outbase }}.unsorted" ]] || ( | ||
echo "Running bowtie for" | ||
echo " forward: {{ fw_fq }}" | ||
echo " reverse: {{ rev_fq }}" | ||
if [[ $DEBUG == 'echo' ]] | ||
then | ||
echo bowtie -I 1 -X 10000 -p {{ threads }} --fr -S \ | ||
db -1 {{ fw_fq }} -2 {{ rev_fq }} \ | ||
\| samtools view -f 2 -bS - \> {{ outbase }}.unsorted | ||
else | ||
bowtie -I 1 -X 10000 -p {{ threads }} --fr -S \ | ||
db -1 {{ fw_fq }} -2 {{ rev_fq }} \ | ||
| samtools view -f 2 -bS - > {{ outbase }}.unsorted | ||
fi | ||
) | ||
|
||
[[ -f "{{ outbase }}.bam" ]] || ( | ||
echo "Sorting {{ outbase }}.bam" | ||
$DEBUG samtools sort {{ outbase }}.unsorted {{ outbase }} | ||
) | ||
|
||
[[ -f "{{ outbase }}.bai" ]] || ( | ||
echo "Indexing {{ outbase }}" | ||
$DEBUG samtools index {{ outbase }}.bam | ||
) | ||
|
||
[[ -d "readpairs/{{ outbase }}" ]] || ( | ||
echo "running hagfish_extract for {{ outbase }}" | ||
$DEBUG hagfish_extract -v {{ outbase }}.bam | ||
) | ||
|
||
### finish | ||
|
||
hagfish_gapfinder -v -f {{ fasta }} | ||
hagfish_coverage_combine -v | ||
hagfish_report -v | ||
|
||
### clean | ||
|
||
rm -rf `dirname {{ output }}` | ||
rm -rf bins combined coverage readpairs report seqInfo stats | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
author: Mark Fiers | ||
backend: ruff | ||
commands: | ||
run: | ||
help: 'Run hagfish' | ||
mode: map | ||
clean: | ||
mode: simple | ||
help: remove all Hagfish files | ||
finish: | ||
help: finish up - find gaps - combine plots - create a report | ||
mode: simple | ||
creation_date: Tue Mar 29 16:34:19 2011 | ||
description: Run the preparatory steps for hagfish | ||
filesets: | ||
fasta: | ||
category: prerequisite | ||
help: fasta sequence of the reference | ||
type: single | ||
optional: false | ||
fw_fq: | ||
category: input | ||
help: 'forward fq input' | ||
optional: false | ||
pattern: '*/*1.fq' | ||
type: set | ||
rev_fq: | ||
category: input | ||
help: 'reverse fq input' | ||
optional: true | ||
pattern: '*/*2.fq' | ||
type: map | ||
source: fw_fq | ||
outbase: | ||
category: output | ||
help: 'basename for output files' | ||
optional: true | ||
pattern: './*' | ||
type: map | ||
source: fw_fq | ||
parameters: | ||
threads: | ||
default: 8 | ||
help: 'no threads to use' | ||
optional: true | ||
type: integer | ||
min_ok: | ||
default: 0 | ||
help: Minimal acceptable insert size for an aligned pair. If omitted, | ||
hagfish will make an estimate | ||
optional: true | ||
type: int | ||
max_ok: | ||
default: 0 | ||
help: Maximal acceptable insert size for an aligned pair. If omitted, | ||
hagfish will make an estimate | ||
optional: true | ||
type: int | ||
moa_id: autohagfish | ||
modification_date: Thu, 19 May 2011 20:49:04 +1200 | ||
name: autohagfish | ||
title: Automatically run bowtie & hagfish combined |