#!/bin/sh

#change this if the path is different 
convert=/usr/local/bin/srf2fastq

srf_file=$1
use_filter=$2
use_paired=$3
fastq_file1=$4
fastq_file2=$5
options='-c '

if [ $use_filter == 'Y' ]
then
  options="$options -C"
fi

if [ $use_paired == 'Y' ]
then
  options="$options -n -a -s ${fastq_file1}"
  ${convert} ${options} ${srf_file}
  #after conversion rename files
  mv ${fastq_file1}_1.fastq ${fastq_file1}
  mv ${fastq_file1}_2.fastq ${fastq_file2}
else
  ${convert} ${options} ${srf_file} > ${fastq_file1}
fi

