#!/bin/bash


#script to convert sam files to bam files on MR home server.

#setting loop parameters
for f in *.sam; 
do
	PREFIX1="${f%.sam}"	
	samtools sort -@ 2 -o $PREFIX1.bam $PREFIX1.sam
done

# to run this in background type "nohup ./scriptname.sh &" without quotes or try "nohup yourscript > logfilename 2>&1 &" 
