annotate lumpy_wrapper.tcsh @ 2:bfd745cf84c2 draft

planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
author hepcat72
date Thu, 25 Oct 2018 13:53:31 -0400
parents e5150e64206a
children ea7edefc72c3
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 ##
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
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
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
25 ##
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 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
28 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
29 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
30 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
31 setenv DISTROSCPT pairend_distro.py
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 DISTROLOC `which $DISTROSCPT`
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
33 perl -e 'while(<STDIN>){s/min_elements = 10+/min_elements = 1/;print}' < $DISTROLOC > ./$DISTROSCPT
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/PAIREND_DISTRO=.*/PAIREND_DISTRO=$ARGV[0]/;print}' ./$DISTROSCPT < $LUMPYDIR/$LUMPYCONFIG > ./$LUMPYCONFIG
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
35 perl -e 'while(<STDIN>){s/PAIREND_DISTRO=.*/PAIREND_DISTRO=$ARGV[0]/;print}' ./$DISTROSCPT < $LUMPYEXPRESSLOC > ./$LUMPYEXPRESSSCPT
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 chmod 555 ./$LUMPYEXPRESSSCPT
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
38
0
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
39 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
40
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
42 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
43
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
45 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
46 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
47
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
48 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
49 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
50 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
51 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
52
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
54 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
55 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
56
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
57 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
58 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
59 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
60 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
61 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
62 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
63 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
64 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
65 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
66 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
67 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
68 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
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 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
71
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
72 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
73 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
74 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
75 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
76 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
77 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
78 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
79 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
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 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
82
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
84 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
85 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
86
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
87 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
88 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
89 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
90 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
91
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
93 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
94 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
95
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
96 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
97 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
98 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
99 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
100
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
101 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
102 echo
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
103 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
104 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
105
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
106 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
107 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
108 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
109 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
110
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
112 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
113 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
114
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
115 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
116 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
117 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
118 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
119
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 "$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 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
122
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 "$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 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
125
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
126 else
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
127
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 "$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 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
130
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
131 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
132
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 "$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 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
135
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
136 end
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
137
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
138 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
139
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
140 echo
2
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
141 echo "Running: ./$LUMPYEXPRESSSCPT -B $BAMS -S $SPLTS -D $DSCDS -o $OUTVCF"
bfd745cf84c2 planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 3e9afda4e4ad444b21dc30b866074ed6fa527bfa
hepcat72
parents: 0
diff changeset
142 ./$LUMPYEXPRESSSCPT -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
143
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
144 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
145 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
146 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
147 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
148
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
149 else
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
150
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
152 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
153 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
154
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
155 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
156 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
157 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
158 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
159
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
160 endif
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
161
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
e5150e64206a planemo upload for repository https://github.com/hepcat72/robs_galaxy_tools/tree/master/tools/lumpyexpress commit 9c7264014db750b32a8fa78f511c7efbd12529d9-dirty
hepcat72
parents:
diff changeset
163 echo DONE