-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvClassifier
executable file
·81 lines (74 loc) · 4.73 KB
/
vClassifier
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /bin/bash
################################################################################
################################################################################
################################################################################
# #
# Copyright (C) 2024 Kun Zhou #
# #
# This program 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 2 of the License, or #
# (at your option) any later version. #
# #
# This program 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. #
# #
# #
################################################################################
################################################################################
################################################################################
################################################################################
# Help #
################################################################################
Help()
{
echo "vClassifier v1.0 :: classification of viral genomes based on phylogeny and genome identity"
echo
echo "Usage: vClassifier [-i|-l|-t|-p|-m|-o|-h]"
echo "options:"
echo "-i Input nucleotide sequences in FASTA format. Please note that providing the full path is recommended to avoid errors."
echo "-l A file containing family or subfamily information for the input nucleotide sequences. The first column should list the query IDs, and the second column should provide the corresponding family or subfamily taxonomy. Please note that providing the full path is recommended to avoid errors."
echo "-t Number of threads to use for parallel running."
echo "-p Full installation path for vClassifier. Please verify that the directories for the database and scripts are present under this path."
echo "-m vClassifier mode. Input 'family' or 'subfamily' only. Mode 'family': inputs are viral genomes that include family information. Mode 'subfamily': inputs are viral genomes that include subfamily information."
echo "-o Output folder."
echo "-h Show help on version and usage."
}
################################################################################
################################################################################
# Main program #
################################################################################
################################################################################
################################################################################
# Process the input options. Add options as needed. #
################################################################################
# Get the options
while getopts :hl:t:i:p:m:o: option
do
case "${option}" in
i) query_genome=${OPTARG};;
l) query_taxonomy=${OPTARG};;
t) threads=${OPTARG};;
p) installer_dir=${OPTARG};;
m) mode=${OPTARG};;
o) output_dir=${OPTARG};;
h) Help
exit;;
\?) echo "Error: Invalid option."
exit;;
esac
done
################################################################################
#Invoke a separate shell file for the classification of viral families #
#or subfamilies #
################################################################################
installer_dir_modified=$(echo $installer_dir|sed 's/\/*$//')
if [ $mode = "family" ];then
bash $installer_dir/scripts/vClassifier_family.sh -i $query_genome -l $query_taxonomy -p $installer_dir_modified -o $output_dir -t $threads
fi
if [ $mode = "subfamily" ];then
bash $installer_dir/scripts/vClassifier_subfamily.sh -i $query_genome -l $query_taxonomy -p $installer_dir_modified -o $output_dir -t $threads
fi