-
Notifications
You must be signed in to change notification settings - Fork 1
/
seq2snp.sh
executable file
·36 lines (24 loc) · 971 Bytes
/
seq2snp.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
#!/bin/bash
#$ -t 1-5
#$ -cwd
#$ -N Fg.reseq
#$ -j y
mkdir -p data/sam
mkdir -p data/bam
mkdir -p data/vcf
reseq=("HN9-1" "HN-Z6" "YL-1" "CS3005")
dir=${reseq[$(expr $SGE_TASK_ID - 1)]}
if [ -d data/reseq/$dir ]; then
# Mapping
bowtie2 -x data/refseq/FG.RR.27.genome -1 data/reseq/$dir/cleandata_500_1.fq.gz -2 data/reseq/$dir/cleandata_500_2.fq.gz -S data/sam/$dir.sam
# Covert to bam
samtools view -bS data/sam/$dir.sam > data/bam/$dir.bam
# Sort bam
samtools sort data/bam/$dir.bam data/bam/$dir.sorted
# Call var
samtools mpileup -uf data/refseq/FG.RR.27.genome.fa data/bam/$dir.sorted.bam | bcftools call -cv -O v - > data/vcf/$dir.vcf
# Call snp
samtools mpileup -uf data/refseq/FG.RR.27.genome.fa data/bam/$dir.sorted.bam | bcftools call -cv -V indels -O v - > data/vcf/$dir.snps.vcf
# Call indel
samtools mpileup -uf data/refseq/FG.RR.27.genome.fa data/bam/$dir.sorted.bam | bcftools call -cv -V snps -O v - > data/vcf/$dir.indels.vcf
fi