Files
2026-08-03 18:42:47 +08:00

65 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
#
# This is a utility as part of the InterProScan v5 installation
# get nucleotide input and generate ORFs using EMBOSS getorf
#
#usage: translate -i <input_file> -o <output_file>
#
while [[ $# -gt 1 ]]
do
key="$1"
case $key in
-i|--input)
INPUTPATH="$2"
shift # past argument
;;
-o|--output)
OUTPUTPATH="$2"
shift # past argument
;;
--default)
DEFAULT=YES
;;
*)
# unknown option
;;
esac
shift # past argument or value
done
#echo INPUTPATH = "${INPUTPATH}"
#echo OUTPUTPATH = "${OUTPUTPATH}"
input_file=`realpath ${INPUTPATH}`
output_file=`realpath ${OUTPUTPATH}`
if [ -f $input_file ]
then
#echo "input is $input_file";
timenow=`date +"%T"`
echo "started translate at $timenow";
else
echo "input file not found: $input_file ";
exit
fi
USER_DIR=$PWD
INSTALL_DIR="${BASH_SOURCE[0]}"
while [ -h "$INSTALL_DIR" ]; do
cd "$(dirname "$INSTALL_DIR")"
INSTALL_DIR="$(readlink "$(basename "$INSTALL_DIR")")"
done
cd "$(dirname "$INSTALL_DIR")"
INSTALL_DIR="$(pwd)/"
# set environment variables for getorf
export EMBOSS_ACDROOT=${INSTALL_DIR}
export EMBOSS_DATA=${INSTALL_DIR}
${INSTALL_DIR}/getorf -sf pearson -sequence $input_file -outseq $output_file -minsize 75
count=`grep -c '>' $output_file`
echo "$count ORFs in $output_file"