Skip to content

Commit

Permalink
Add pindel wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Feb 17, 2017
1 parent 48f70c2 commit 2acceca
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bio/pindel/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- bioconda
- r
dependencies:
- pindel ==0.2.5b8
4 changes: 4 additions & 0 deletions bio/pindel/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: pindel
description: Call variants with pindel.
authors:
- Johannes Köster
16 changes: 16 additions & 0 deletions bio/pindel/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rule pindel:
input:
ref="genome.fasta",
# samples to call
samples=["mapped/a.bam"],
# bam configuration file, see http://gmt.genome.wustl.edu/packages/pindel/quick-start.html
config="pindel_config.txt"
output:
"calls/pindel.vcf"
params:
"" # optional parameters (except -i, -f, -o)
log:
"logs/pindel.log"
threads: 4
wrapper:
"master/bio/pindel"
2 changes: 2 additions & 0 deletions bio/pindel/test/genome.fasta
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>Sheila
GCTAGCTCAGAAAAAAAAAA
1 change: 1 addition & 0 deletions bio/pindel/test/genome.fasta.fai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Sheila 20 8 20 21
Binary file added bio/pindel/test/mapped/a.bam
Binary file not shown.
1 change: 1 addition & 0 deletions bio/pindel/test/pindel_config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mapped/a.bam 300 a
8 changes: 8 additions & 0 deletions bio/pindel/test_wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import subprocess
import os

def setup_module():
os.chdir(os.path.join(os.path.dirname(__file__), "test"))

def test():
subprocess.check_call(["snakemake", "calls/pindel.vcf", "--use-conda", "-F"])
13 changes: 13 additions & 0 deletions bio/pindel/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2016, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"

import os
from snakemake.shell import shell


log = snakemake.log_fmt_shell(stdout=True, stderr=True)
prefix = os.path.dirname(snakemake.output[0])

shell("pindel {params} -i {snakemake.input.conf} -f {snakemake.input.ref} -o {prefix} {log}")

0 comments on commit 2acceca

Please sign in to comment.