Skip to content

Instantly share code, notes, and snippets.

@idolawoye
Last active January 30, 2019 13:42
Show Gist options
  • Select an option

  • Save idolawoye/069615f51911b1c64d985cf816fa04be to your computer and use it in GitHub Desktop.

Select an option

Save idolawoye/069615f51911b1c64d985cf816fa04be to your computer and use it in GitHub Desktop.
BWA mapping of different samples against a reference genome
total_files=`find -name '*.fastq' | wc -l`
arr=( $(ls *.fastq) )
echo "mapping started" >> map.log
echo "---------------" >> map.log
for ((i=0; i<$total_files; i+=2))
{
ref_genome=../ref.gb
sample_name=`echo ${arr[$i]} | awk -F "_" '{print $1}'`
echo "[mapping running for] $sample_name"
printf "\n"
echo "bwa mem -t 12 $ref_genome ${arr[$i]} ${arr[$i+1]} > $sample_name.sam" >> map.log
bwa mem -t 12 A1_denovo_assembly.fasta ${arr[$i]} ${arr[$i+1]} > $sample_name.sam
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment