forked from fritzsedlazeck/SVCollector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SVCollector.sh
executable file
·37 lines (26 loc) · 916 Bytes
/
SVCollector.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
if [ $# -ne 3 ]
then
echo "USAGE: SVCollector.sh samples.vcf numtoplot workdir"
exit 1
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SVC=$DIR/src/SVCollector
PLOT=$DIR/vis/SVCollectorPlot.R
VCF=$1
NUMTOPLOT=$2
OUTDIR=$3
mkdir -p $OUTDIR
VCFB=`basename $VCF`
RANDOMTRIALS=10
echo "Analyzing $VCF"
echo " computing greedy selection (disable min allele freq)"
$SVC greedy $VCF -1 $NUMTOPLOT 0 $OUTDIR/$VCFB.greedy >& $OUTDIR/$VCFB.greedy.log
echo " computing topN selection"
$SVC topN $VCF $NUMTOPLOT $OUTDIR/$VCFB.topN >& $OUTDIR/$VCFB.topN.log
echo " computing random selection over $RANDOMTRIALS trials "
(seq $RANDOMTRIALS | parallel -t $SVC random $VCF $NUMTOPLOT $OUTDIR/$VCFB.random.{}) >& $OUTDIR/$VCFB.randomlog
echo " cleaning _tmp files"
rm -f $OUTDIR/*_tmp
echo " plotting results"
$PLOT $OUTDIR/$VCFB.greedy $OUTDIR/$VCFB.topN $OUTDIR/$VCFB.random $OUTDIR/$VCFB.png