#!/bin/sh

Filename='/srv/scratch/shared/surya/imk1/TFBindingPredictionProject/src/filterReadsMultiMapTestScript.sh'
Ouptprefix='/srv/scratch/shared/surya/imk1/TFBindingPredictionProject/src/filterReadsMultiMapTest'
Name='filterReadsMultiMapTest'
Module='homer'
Count=0

while read line;
do
	Count=$((Count+1));
	Outfilename=$Ouptprefix$Count".sh";
	echo "$line" >  $Outfilename;
	#echo "source /users/imk1/.bashrc \n $line" >  $Outfilename;
	#echo "module add "$Module" \n $line" >  $Outfilename;
	command1="qsub -pe shm 1 -N $Name$Count -o ";
	#command1="qsub -q q@surya -pe shm 1 -N $Name$Count -o ";
	command2="$Ouptprefix$Count.o -e ";
	command3="$Ouptprefix$Count.e ";
	command4=$Outfilename;
	$command1$command2$command3$command4;
	sleep .2
done < $Filename
