-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathst31_mancheck.sh
35 lines (29 loc) · 1.09 KB
/
st31_mancheck.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
#!/bin/bash
##ragtag_fc identified as best asm for st31
##nina idenfieds contig22 and scaffold 19 as potentially one contig
datadir=/pym/Data/Nanopore/projects/prolificans/st31
asm=$datadir/ragtag/fc/st31.ragtag_fc.scaffolds.fasta
fq=$datadir/reads/ont/st31_long.fastq.gz
if [ $1 == align ] ; then
mkdir -p $datadir/mancheck
prefix=`basename $asm .fasta`
minimap2 -t 36 -ax map-ont $asm $fq |
samtools view -@ 36 -b |
samtools sort -@ 36 -o $datadir/mancheck/$prefix.sorted.bam
samtools index $datadir/mancheck/$prefix.sorted.bam
fi
if [ $1 == getpaf ] ; then
##paf file will probably be easier to work with for what I want
prefix=`basename $asm .fasta`
minimap2 -t 36 -x map-ont $asm $fq \
> $datadir/mancheck/$prefix.paf
fi
if [ $1 == filtpaf ] ; then
prefix=`basename $asm .fasta`
grep contig_22_RagTag $datadir/mancheck/$prefix.paf | \
cut -d $'\t' -f 1-12 \
> $datadir/mancheck/$prefix.contig_22_RagTag.paf
grep scaffold_19_RagTag $datadir/mancheck/$prefix.paf | \
cut -d $'\t' -f 1-12 \
> $datadir/mancheck/$prefix.scaffold_19_RagTag.paf
fi