forked from marbl/canu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bogus-run.sh
82 lines (66 loc) · 1.74 KB
/
bogus-run.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/sh
# Build ideal unitigs given a fasta or frg file.
# Align ideal unitigs back to the reference with nucmer.
# Generate a mummerplot.
#
# ASSUMES all programs are in your path.
# mummer: nucmer, mummerplot
# kmer: snapper2, convertToExtent
# wgs-assembler: bogus
# Edit reference to make defline have only one work. This is necessary because snapper reports the
# whole line, but bogus truncates to the first word.
FAS="../FRAGS/porphyromonas_gingivalis_w83.flx.3200bp.0900bp.FJRUAFO0.fasta"
REF="../AE015924.fasta"
if [ $# -gt 0 ] ; then
FAS=$1
shift
fi
if [ $# -gt 0 ] ; then
REF=$1
shift
fi
OUT=`echo $FAS | tr '/' ' ' | awk '{ print $NF}' | sed s/.fasta//`
if [ ! -e $FAS ] ; then
echo "Failed to find FASTA $FAS"
exit
fi
if [ ! -e $REF ] ; then
echo "Failed to find REFERENCE $REF"
exit
fi
if [ `cat $REF | wc -l` != 2 ] ; then
echo "REFERENCE is multi-line FASTA, sequence must be on one line."
exit
fi
if [ ! -e $OUT.snapper ] ; then
snapper2 \
-queries $FAS \
-genomic $REF \
-minmatchidentity 94 -minmatchcoverage 1 -verbose -mersize 16 \
-output $OUT.snapper
fi
if [ ! -e $OUT.snapper.extent ] ; then
convertToExtent \
< $OUT.snapper \
| grep -v ^cDNAid \
| sort -k7n \
> $OUT.snapper.extent
fi
if [ ! -e $OUT.ideal.fasta ] ; then
bogus \
-snapper $OUT.snapper.extent \
-reference $REF \
-output $OUT.ideal
fi
if [ ! -e $OUT.ideal.fasta ] ; then
echo "No fasta output from bogus, not mapping to reference."
exit
fi
if [ ! -e $OUT.ideal.delta ] ; then
nucmer --maxmatch --coords -p $OUT.ideal \
$REF \
$OUT.ideal.fasta
fi
if [ ! -e $OUT.ideal.png ] ; then
mummerplot --layout --filter -p $OUT.ideal -t png $OUT.ideal.delta
fi