#Paired-End read mapping in stampy- for loop #Written by E Heppenheimer, Summer 2017 #This loop will properly match read pairs (assuming you have several distinct read pairs you would like to map in one directory) #This particular set of commands assumes the read names have the same prefix, followed by either ".1.1.fq.gz" or ".2.2.fq.gz" #You can either alter this expectations in the code, or rename your files so they follow this convention #See Stampy documentation for info on generating index and hash files #as of April 2018, that info was available here: http://www.well.ox.ac.uk/~gerton/README.txt #assuming the working directory contains many read pair files with above naming conventions: FILES=*1.fq.gz for f in $FILES do pre=$(echo $f |awk -F'.' '{print $1"\n"}') suf=".sam" f2="${f/.1.1./.2.2.}" /path/to/stampy.py -g /path/to/index -h /path/to/hash -o $pre$suf -M $f $f2 done