Skip to content

Instantly share code, notes, and snippets.

@josephhughes
Created June 8, 2021 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephhughes/fd6a3804f2120c5ad15a52f0edb9e36a to your computer and use it in GitHub Desktop.
Save josephhughes/fd6a3804f2120c5ad15a52f0edb9e36a to your computer and use it in GitHub Desktop.
#!/bin/bash
# ./alignScript.sh ref pair1 pair2 name
ref_name=$1
pair1=$2
pair2=$3
name=$4
bwa index $ref_name
bwa mem $ref_name $pair1 $pair2 > ${name}.sam
samtools sort ${name}.sam -o ${name}.bam
samtools index ${name}.bam
rm ${name}.sam
samtools idxstats ${name}.bam
weeSAM --bam ${name}.bam --html ${name} --overwrite
samtools mpileup -aa -d 0 -Q 0 ${name}.bam | ivar consensus -p ${name}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment