annotate lumpy_wrapper.tcsh @ 7:f82a18f7a946 draft

planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 742dbf78a7c630bab88120e97f548a83baea39d7
author hepcat72
date Fri, 26 Oct 2018 10:38:30 -0400
parents ea7edefc72c3
children 007ad934287e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
1 #!/bin/tcsh
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
2
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
3 #USAGE: lumpy_pipeline.tcsh PAIREDENDRUN OUTVCF BAMS
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
4 #EXAMPLE: lumpy_pipeline.tcsh 1 lumpy.vcf *.bam
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
5
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
6 #PAIREDENDRUN - 1=paired end 0=single end
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
7 #BAMS - Any bam files (will be sorted if not sorted & indexed if not indexed)
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
8
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
9 #REQUIRED DEPENDENCIES:
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
10 #lumpy
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
11 #samtools
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
12 #samblaster
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
13
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
14 setenv PAIREDENDRUN `echo $argv | cut -f 1 -d " "`
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
15 setenv OUTVCF `echo $argv | cut -f 2 -d " "`
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
16 setenv MYARGV `echo $argv | cut -f 3-999 -d " "`
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
17
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
18 setenv BAMS ''
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
19 setenv SPLTS ''
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
20 setenv DSCDS ''
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
21 setenv SPLTOPTS ''
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
22
2
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
23 ##
4
ea7edefc72c3 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit a1d97ac3e9258a4f7cc1c59161820f55e2cdc347
hepcat72
parents: 2
diff changeset
24 ## The following is a work-around to a condition that causes a segfault in lumpy from lumpyexpress due to a new min_element threshold.
ea7edefc72c3 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit a1d97ac3e9258a4f7cc1c59161820f55e2cdc347
hepcat72
parents: 2
diff changeset
25 ## This is a kluge, but hopefully the segfault issue with lumpyexpress will be fixed soon.
2
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
26 ##
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
27
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
28 setenv LUMPYEXPRESSSCPT lumpyexpress
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
29 setenv LUMPYEXPRESSLOC `which lumpyexpress`
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
30 setenv LUMPYDIR `dirname $LUMPYEXPRESSLOC`
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
31 setenv LUMPYCONFIG lumpyexpress.config
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
32 setenv DISTROSCPT pairend_distro.py
4
ea7edefc72c3 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit a1d97ac3e9258a4f7cc1c59161820f55e2cdc347
hepcat72
parents: 2
diff changeset
33 setenv DISTROLOC `which $LUMPYDIR/../*/*/*/$DISTROSCPT`
2
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
34 perl -e 'while(<STDIN>){s/min_elements = 10+/min_elements = 1/;print}' < $DISTROLOC > ./$DISTROSCPT
7
f82a18f7a946 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 742dbf78a7c630bab88120e97f548a83baea39d7
hepcat72
parents: 4
diff changeset
35 perl -e 'while(<STDIN>){s/PAIREND_DISTRO=.*/PAIREND_DISTRO=$ARGV[0]/;print}' `pwd`/$DISTROSCPT < $LUMPYDIR/$LUMPYCONFIG > ./$LUMPYCONFIG
2
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
36 chmod 555 ./$DISTROSCPT
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
37
0
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
38 foreach b ( $MYARGV )
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
39
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
40 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
41 echo Preparing $b
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
42
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
43 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
44 echo Parsing sample name
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
45 set SAMPLE=`echo $b | perl -e 'while(<>){s/\.bam//;print}'`
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
46
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
47 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
48 echo "Unable to parse sample name in $b"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
49 exit 1
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
50 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
51
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
52 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
53 echo "Checking BAM $b"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
54 samtools view -H $b | perl -e '$y=0;while(<>){if(/SO:coordinate/){$y=1;}}if($y == 0){exit(2)}'
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
55
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
56 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
57 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
58 echo "Sorting BAM $b"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
59 samtools sort -o $b.sort -O BAM $b
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
60 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
61 echo "Error sorting BAM $b"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
62 exit 2
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
63 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
64 mv -f $b.sort $b
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
65 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
66 echo "Error renaming BAM $b.sort $b"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
67 exit 3
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
68 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
69 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
70
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
71 perl -e 'unless(-e "$ARGV[0].bai"){exit(3)}' $b
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
72 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
73 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
74 echo "Indexing BAM $b"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
75 samtools index -b $b
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
76 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
77 echo "Error indexing BAM"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
78 exit 4
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
79 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
80 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
81
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
82 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
83 echo Getting splitters
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
84 samtools sort -n -O sam $b | samblaster -q -s /dev/stdout -o /dev/null | samtools view -Sb - | samtools sort - -o ${SAMPLE}.splitters.bam
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
85
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
86 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
87 echo "Getting splitters from $b failed"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
88 exit 5
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
89 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
90
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
91 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
92 echo Indexing splitters
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
93 samtools index -b ${SAMPLE}.splitters.bam
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
94
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
95 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
96 echo "Indexing discordants in $b failed"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
97 exit 6
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
98 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
99
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
100 if ( $PAIREDENDRUN ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
101 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
102 echo Getting discordants
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
103 samtools view -b -F 1294 $b | samtools sort - -o ${SAMPLE}.discordants.bam
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
104
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
105 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
106 echo "Getting discordants from $b failed"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
107 exit 7
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
108 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
109
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
110 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
111 echo Indexing discordants
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
112 samtools index -b ${SAMPLE}.discordants.bam
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
113
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
114 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
115 echo "Indexing discordants in $b failed"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
116 exit 8
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
117 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
118
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
119 if ( ${?DSCDS} > 0 && ${%DSCDS} > 0 ) setenv DSCDS "$DSCDS,${SAMPLE}.discordants.bam"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
120 if ( ${?DSCDS} == 0 || ${%DSCDS} == 0 ) setenv DSCDS ${SAMPLE}.discordants.bam
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
121
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
122 if ( ${?SPLTS} > 0 && ${%SPLTS} > 0 ) setenv SPLTS "$SPLTS,${SAMPLE}.splitters.bam"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
123 if ( ${?SPLTS} == 0 || ${%SPLTS} == 0 ) setenv SPLTS ${SAMPLE}.splitters.bam
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
124
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
125 else
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
126
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
127 if ( ${?SPLTOPTS} > 0 && ${%SPLTOPTS} > 0 ) setenv SPLTOPTS "$SPLTOPTS -sr id:${SAMPLE},bam_file:${SAMPLE}.splitters.bam,back_distance:10,weight:1,min_mapping_threshold:20"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
128 if ( ${?SPLTOPTS} == 0 || ${%SPLTOPTS} == 0 ) setenv SPLTOPTS "-sr id:${SAMPLE},bam_file:${SAMPLE}.splitters.bam,back_distance:10,weight:1,min_mapping_threshold:20"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
129
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
130 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
131
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
132 if ( ${?BAMS} > 0 && ${%BAMS} > 0 ) setenv BAMS "$BAMS,$b"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
133 if ( ${?BAMS} == 0 || ${%BAMS} == 0 ) setenv BAMS $b
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
134
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
135 end
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
136
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
137 if ( $PAIREDENDRUN ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
138
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
139 echo
7
f82a18f7a946 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 742dbf78a7c630bab88120e97f548a83baea39d7
hepcat72
parents: 4
diff changeset
140 echo "Running: $LUMPYEXPRESSSCPT -K `pwd`/$LUMPYCONFIG -B $BAMS -S $SPLTS -D $DSCDS -o $OUTVCF"
f82a18f7a946 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 742dbf78a7c630bab88120e97f548a83baea39d7
hepcat72
parents: 4
diff changeset
141 $LUMPYEXPRESSSCPT -K `pwd`/$LUMPYCONFIG -B $BAMS -S $SPLTS -D $DSCDS -o $OUTVCF
0
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
142
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
143 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
144 echo "lumpyexpress failed"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
145 exit 9
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
146 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
147
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
148 else
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
149
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
150 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
151 echo "Running lumpy: lumpy -mw 4 -tt 0 $SPLTOPTS > $OUTVCF"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
152 lumpy -mw 4 -tt 0 $SPLTOPTS > $OUTVCF
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
153
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
154 if ( $status ) then
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
155 echo "lumpy failed"
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
156 exit 10
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
157 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
158
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
159 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
160
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
161 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
162 echo DONE