Skip to content

Commit

Permalink
Adding wrapper files
Browse files Browse the repository at this point in the history
  • Loading branch information
kellrott committed Jul 13, 2015
1 parent 5b15122 commit 8c7fbe4
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# broad-variant-pipeline-tool

NOTE: The Docker container needed to run this tool must be obtained from the Broad after signing MTA
50 changes: 50 additions & 0 deletions broad_variant_pipeline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash
export INDIVIDUAL_ID=$1
export BAM_TUMOR=$2
export BAM_TUMOR_BAI=$3
export BAM_NORMAL=$4
export BAM_NORMAL_BAI=$5
export REF_DIR=$6
export FINALRESULTSDIR=`readlink -f $7`

ln -s $BAM_TUMOR tumor.bam
ln -s $BAM_TUMOR_BAI tumor.bam.bai
ln -s $BAM_NORMAL normal.bam
ln -s $BAM_NORMAL_BAI normal.bam.bai

ln -s $REF_DIR /cga/fh/pcawg_pipeline/refdata

PIPELINE=/cga/fh/pcawg_pipeline/pipelines/pcawg_pipeline_v5.py

export PIPETTE_SERVER_DIR=/cga/fh/pcawg_pipeline/utils/pipette_server

export COMMDIR=$FINALRESULTSDIR/jobResults_pipette/status
#OUTDIR contains the intermediate files
export OUTDIR=$FINALRESULTSDIR/jobResults_pipette/jobs/$INDIVIDUAL_ID
#FINALRESULTSDIR contains all the files that should be kept after the pipeline completes
#export FINALRESULTSDIR=/cga/fh/pcawg_pipeline/jobResults_pipette/results

rm -rf $COMMDIR
mkdir -p $COMMDIR

set -e

python3 $PIPETTE_SERVER_DIR/pipetteSynchronousRunner.py $COMMDIR $OUTDIR $PIPELINE $COMMDIR $OUTDIR $INDIVIDUAL_ID `pwd`/tumor.bam `pwd`/normal.bam # > run.out 2> run.err

find $OUTDIR -name pipette.module.usage.txt | xargs sh -c 'for f; do cat "$f" ; done' true |sort | uniq > $FINALRESULTSDIR/summary.usage.txt

mkdir $FINALRESULTSDIR/gnos_vcfs
#cp $OUTDIR/links_for_gnos/*/*.vcf.gz $FINALRESULTSDIR/gnos_vcfs/
cp $FINALRESULTSDIR/jobResults_pipette/jobs/*/links_for_gnos/tabix_dRanger/*.broad-dRanger.DATECODE.somatic.sv.vcf.gz broad-dRanger.DATECODE.somatic.sv.vcf.gz
cp $FINALRESULTSDIR/jobResults_pipette/jobs/*/links_for_gnos/tabix_merge_sv_vcf/*.broad-dRanger_snowman.DATECODE.somatic.sv.vcf.gz broad-dRanger_snowman.DATECODE.somatic.sv.vcf.gz
cp $FINALRESULTSDIR/jobResults_pipette/jobs/*/links_for_gnos/tabix_mutect/*.broad-mutect.DATECODE.somatic.snv_mnv.vcf.gz broad-mutect.DATECODE.somatic.snv_mnv.vcf.gz
cp $FINALRESULTSDIR/jobResults_pipette/jobs/*/links_for_gnos/tabix_snowman_germline_indel/*.broad-snowman.DATECODE.germline.indel.vcf.gz broad-snowman.DATECODE.germline.indel.vcf.gz
cp $FINALRESULTSDIR/jobResults_pipette/jobs/*/links_for_gnos/tabix_snowman_germline_sv/*.broad-snowman.DATECODE.germline.sv.vcf.gz broad-snowman.DATECODE.germline.sv.vcf.gz
cp $FINALRESULTSDIR/jobResults_pipette/jobs/*/links_for_gnos/tabix_snowman_somatic_indel/*.broad-snowman.DATECODE.somatic.indel.vcf.gz broad-snowman.DATECODE.somatic.indel.vcf.gz
cp $FINALRESULTSDIR/jobResults_pipette/jobs/*/links_for_gnos/tabix_snowman_somatic_sv/*.broad-snowman.DATECODE.somatic.sv.vcf.gz broad-snowman.DATECODE.somatic.sv.vcf.gz

#collect the file outputs for return back to Broad
tar -cvhf $FINALRESULTSDIR/broad.tar.gz $OUTDIR/links_for_broad

#display any failing modules
cat summary.usage.txt
38 changes: 38 additions & 0 deletions broad_variant_pipeline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<tool id="broad_variant_pipline" name="BroadVariantPipeline" version="1.0.0">
<description></description>
<requirements>
<!-- This docker image is closed source and must be obtained seperately -->
<container type="docker">broad_variant_pipeline</container>
</requirements>
<command interpreter="bash">
broad_variant_pipeline.sh ${sample_id} ${tumor_bam} ${tumor_bam.metadata.bam_index} ${normal_bam} ${normal_bam.metadata.bam_index} ${broad_ref_dir} ./
</command>

<inputs>
<param name="sample_id" type="text" label="Sample Name"/>
<param name="tumor_bam" type="data" format="bam" label="Tumor BAM file"/>
<param name="normal_bam" type="data" format="bam" label="Normal BAM file"/>
<param name="broad_ref_dir" type="select" label="Broad Reference Directory">
<options from_file="broad_ref_dir.loc">
<column name="name" index="0"/>
<column name="value" index="1"/>
</options>
</param>
</inputs>
<outputs>
<data name="dRanger" format="vcf_bgzip" label="broad-dRanger.DATECODE.somatic.sv.vcf.gz" from_work_dir="broad-dRanger.DATECODE.somatic.sv.vcf.gz"/>
<data name="mutect" format="vcf_bgzip" label="broad-mutect.DATECODE.somatic.snv_mnv.vcf.gz" from_work_dir="broad-mutect.DATECODE.somatic.snv_mnv.vcf.gz"/>
<data name="snowman_dRanger" format="vcf_bgzip" label="broad-dRanger_snowman.DATECODE.somatic.sv.vcf.gz" from_work_dir="broad-dRanger_snowman.DATECODE.somatic.sv.vcf.gz"/>
<data name="snowman_germline_indel" format="vcf_bgzip" label="broad-snowman.DATECODE.germline.indel.vcf.gz" from_work_dir="broad-snowman.DATECODE.germline.indel.vcf.gz"/>
<data name="snowman_germline_sv" format="vcf_bgzip" label="broad-snowman.DATECODE.germline.sv.vcf.gz" from_work_dir="broad-snowman.DATECODE.germline.sv.vcf.gz"/>
<data name="snowman_somatic_indel" format="vcf_bgzip" label="broad-snowman.DATECODE.somatic.indel.vcf.gz" from_work_dir="broad-snowman.DATECODE.somatic.indel.vcf.gz"/>
<data name="snowman_somatic_sv" format="vcf_bgzip" label="broad-snowman.DATECODE.somatic.sv.vcf.gz" from_work_dir="broad-snowman.DATECODE.somatic.sv.vcf.gz"/>
<data format="data" name="broad_output" label="broad.tar.gz" from_work_dir="broad.tar.gz"/>
</outputs>
<stdio>
<exit_code range="1:" level="fatal" />
</stdio>
<help>
If you want help, you've come to the wrong place
</help>
</tool>

0 comments on commit 8c7fbe4

Please sign in to comment.