#!/usr/bin/env bash
#
# orthologer - Pipeline for deducing orthology from fasta files.
# Copyright (C) 2005-2023 E. Zdobnov lab: F. Tegenfeldt
# <fredrik.tegenfeldt@unige.ch> based on code by E. Kriventseva
#
# This file is part of orthologer.
#
# orthologer is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# orthologer is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with orthologer.  If not, see <http://www.gnu.org/licenses/>.
#
#
# Tool to plot all 
#
alltodos="$*"
[ -x common.sh ] || echo "ERROR: no common.sh file found!"
source common.sh

evolrates=$(ls $DIR_PROJECT_CLUSTER/*.evolrate)
[ ${#alltodos} -gt 0 ] || alltodos=$TODO

fileopts=
lblopts=
for t in $(echo $alltodos); do
    [ -f $t ] || { warning_msg "ignoring missing todo file: $t"; continue; }
    label=$(file_basename $t)
    erate=$DIR_PROJECT_CLUSTER/${label}.evolrate
    [ -f $erate ] || { warning_msg "ignoring missing evolrate file: $erate"; continue; }
    echo "adding label $label"
    fileopts="$fileopts -f $erate"
    lblopts="$lblopts -l $label"
done

$DIR_ORTHOLOGER_BIN/plot_evolrate.py $fileopts
