#!/bin/sh -e

##########################################################################
#   Description:
#       
#   History:
#   Date        Name        Modification
#   2022-03-07  Jason Bacon Begin
##########################################################################

usage()
{
    printf "Usage: $0 adjacent-genes max-nt gene-name species [species ...]\n"
    exit 1
}


##########################################################################
#   Main
##########################################################################

if [ $# -lt 3 ]; then
    usage
fi
adjacent=$1
max_nt=$2
gene=$3
shift
shift
shift

if [ $# = 0 ]; then
    for file in Regions/*-$gene-*-$adjacent-$max_nt.gff3; do
	ms-plot.py $file
    done
else
    for species in "$@"; do
	for file in Regions/$species-$gene-*-$adjacent-$max_nt.gff3; do
	    ms-plot.py $file
	done
    done
fi
