#!/bin/bash

READDIR="/home/reads/" # Directory all reads are stored in
GENOME="/home/ref_chr_17" # reference genome 
THREADS="8" # no. of threads available


for file in $READDIR*.1.fastq; do prefix=${file%%.fastq}; prefix=${prefix##$READDIR};smalt_x86_64 map -f sam -n $THREADS -o $prefix.sam $GENOME $READDIR$prefix\.fastq; done

