Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
FROM ubuntu

RUN apt-get update && apt-get install -y wget build-essential git-core cmake zlib1g-dev libncurses-dev python python-dev python-pip
RUN apt-get update && apt-get install -y wget build-essential git-core cmake zlib1g-dev libncurses-dev python python-dev python-pip samtools
RUN pip install pysam

WORKDIR /opt
RUN wget https://github.com/genome/somatic-sniper/archive/v1.0.5.0.tar.gz && tar xvzf v1.0.5.0.tar.gz && rm v1.0.5.0.tar.gz

RUN cd /opt/somatic-sniper-1.0.5.0 && mkdir build && cd build && cmake ../ && make deps && make -j && make install
RUN cp /opt/somatic-sniper-1.0.5.0/build/vendor/samtools/samtools /usr/bin/

COPY SomaticSniper.py /opt/
RUN chmod +x /opt/SomaticSniper.py
RUN chmod +x /opt/SomaticSniper.py
18 changes: 18 additions & 0 deletions Dockstore.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"reference": {
"path": "http://hgwdev.cse.ucsc.edu/~jeltje/public_data/genome.fa.gz",
"class": "File"
},
"normalbam": {
"path":"https://dcc.icgc.org/api/v1/download?fn=/PCAWG/reference_data/data_for_testing/HCC1143_ds/HCC1143_BL.bam",
"class": "File"
},
"mutations": {
"path": "/tmp/out.vcf",
"class": "File"
},
"tumorbam": {
"path":"https://dcc.icgc.org/api/v1/download?fn=/PCAWG/reference_data/data_for_testing/HCC1143_ds/HCC1143.bam",
"class": "File"
}
}
17 changes: 16 additions & 1 deletion SomaticSniper.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ def sniper_argparser():
group.add_argument('--sniper-exe', dest='sniper_exe', default='bam-somaticsniper', help='SomaticSniper Exec Name')
return parser

def gunzip(infile, outfile):
cmd = ' '.join(['zcat', infile])
with open(outfile, 'w') as outF:
p = subprocess.Popen(cmd, shell=True, stdout=outF, stderr=subprocess.PIPE)
stdout,stderr = p.communicate()
if len(stderr):
print "unzip command failed:", stderr
raise Exception("unzip failed")

def tcga_header_arguments():
return set(('reference_id', 'center',
'tumor_uuid', 'tumor_barcode', 'tumor_accession', 'tumor_platform',
Expand Down Expand Up @@ -87,7 +96,13 @@ def create_sniper_cmdline(namespace_dict, reference, tumor_bam, normal_bam, temp

def create_workspace(workdir, reference, tumor_bam, normal_bam):

new_ref = symlink_workspace_file(workdir, reference, "ref_genome.fasta")
if reference.endswith('.gz'):
new_ref = os.path.join(args.workdir, "ref_genome.fasta")
gunzip(args.f, new_ref)
args.f = new_ref
else:
new_ref = symlink_workspace_file(workdir, reference, "ref_genome.fasta")

if not os.path.exists(reference + ".fai"):
print "Indexing", new_ref
subprocess.check_call( ["/usr/bin/samtools", "faidx", new_ref] )
Expand Down
128 changes: 128 additions & 0 deletions somatic_sniper.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/usr/bin/env cwl-runner
#
# Author: Jeltje van Baren jeltje.van.baren@gmail.com

cwlVersion: v1.0
class: CommandLineTool
baseCommand: [ /opt/SomaticSniper.py, -F, vcf, --workdir, ./ ]

doc: "Runs somatic sniper snp caller on input bam files"

hints:
DockerRequirement:
dockerPull: quay.io/opengenomics/somatic-sniper

#requirements:
# - class: InlineJavascriptRequirement

inputs:

reference:
type: File
doc: |
reference sequence in the FASTA format
inputBinding:
position: 3
prefix: -f

tumor_name:
type: string?
doc: |
tumor sample id (for VCF header) [TUMOR]
inputBinding:
position: 3
prefix: -t

normal_name:
type: string?
doc: |
normal sample id (for VCF header) [NORMAL]
inputBinding:
position: 3
prefix: -n

minmapqual:
type: int?
doc: |
filtering reads with mapping quality less than [0]
inputBinding:
position: 3
prefix: -q

snvqual:
type: int?
doc: |
filtering somatic snv output with somatic quality less than [15]
inputBinding:
position: 3
prefix: -Q

noLOH:
type: boolean?
doc: |
do not report LOH variants as determined by genotypes
inputBinding:
position: 3
prefix: -L

noGainOfRef:
type: boolean?
doc: |
do not report Gain of Reference variants as determined by genotypes
inputBinding:
position: 3
prefix: -G

noSomaticPriors:
type: boolean?
doc: |
disable priors in the somatic calculation. Increases sensitivity for solid tumors
inputBinding:
position: 3
prefix: -p

doPriors:
type: boolean?
doc: |
Use prior probabilities accounting for the somatic mutation rate
inputBinding:
position: 3
prefix: -J

priorProb:
type: float?
doc: |
prior probability of a somatic mutation (implies -J) [0.010000]
inputBinding:
position: 3
prefix: -s

tumorbam:
type: File
doc: |
tumor bamfile
inputBinding:
position: 1

normalbam:
type: File
doc: |
normal bamfile
inputBinding:
position: 2

output_name:
type: string
default: mutations.vcf
doc: |
Name of output file
inputBinding:
position: 5

outputs:

mutations:
type: File?
outputBinding:
glob: $(inputs.output_name)

77 changes: 0 additions & 77 deletions somatic_sniper.cwl.yaml

This file was deleted.