|
|
|
get_data_time(){ |
|
date=$(ls outputs/ | head -n 1) |
|
time=$(ls outputs/*/ | head -n 1) |
|
date=$date |
|
time=$time |
|
} |
|
|
|
train_model(){ |
|
python -m transforna --config-dir="/nfs/home/yat_ldap/VS_Projects/TransfoRNA-Framework/conf"\ |
|
model_name=$1 trained_on=$2 num_replicates=$4 |
|
|
|
get_data_time |
|
|
|
mv outputs/$date/$time outputs/$date/$3 |
|
ls outputs/$date/ |
|
rm -rf models/tcga/TransfoRNA_${2^^}/$5/$3 |
|
|
|
|
|
|
|
mv -f outputs/$date/$3 models/tcga/TransfoRNA_${2^^}/$5/ |
|
rm -rf outputs/ |
|
|
|
} |
|
|
|
eval "$(conda shell.bash hook)" |
|
conda activate transforna |
|
|
|
|
|
if [[ ! -d "models/tcga/TransfoRNA_ID/major_class" ]]; then |
|
mkdir -p models/tcga/TransfoRNA_ID/major_class |
|
fi |
|
if [[ ! -d "models/tcga/TransfoRNA_FULL/sub_class" ]]; then |
|
mkdir -p models/tcga/TransfoRNA_FULL/sub_class |
|
fi |
|
if [[ ! -d "models/tcga/TransfoRNA_ID/sub_class" ]]; then |
|
mkdir -p models/tcga/TransfoRNA_ID/sub_class |
|
fi |
|
if [[ ! -d "models/tcga/TransfoRNA_FULL/major_class" ]]; then |
|
mkdir -p models/tcga/TransfoRNA_FULL/major_class |
|
fi |
|
|
|
rm -rf outputs |
|
|
|
|
|
|
|
models=("seq" "seq-seq" "seq-rev" "seq-struct" "baseline") |
|
models_capitalized=("Seq" "Seq-Seq" "Seq-Rev" "Seq-Struct" "Baseline") |
|
|
|
|
|
num_replicates=5 |
|
|
|
|
|
|
|
|
|
|
|
sed -i "s/clf_target:str = 'sub_class_hico'/clf_target:str = 'major_class_hico'/g" conf/train_model_configs/tcga.py |
|
|
|
cat conf/train_model_configs/tcga.py |
|
|
|
for i in ${!models[@]}; do |
|
echo "Training model ${models_capitalized[$i]} for id on major_class" |
|
train_model ${models[$i]} id ${models_capitalized[$i]} $num_replicates "major_class" |
|
echo "Training model ${models[$i]} for full on major_class" |
|
train_model ${models[$i]} full ${models_capitalized[$i]} 1 "major_class" |
|
done |
|
|
|
|
|
|
|
|
|
|
|
sed -i "s/clf_target:str = 'major_class_hico'/clf_target:str = 'sub_class_hico'/g" conf/train_model_configs/tcga.py |
|
|
|
for i in ${!models[@]}; do |
|
echo "Training model ${models_capitalized[$i]} for id on sub_class" |
|
train_model ${models[$i]} id ${models_capitalized[$i]} $num_replicates "sub_class" |
|
echo "Training model ${models[$i]} for full on sub_class" |
|
train_model ${models[$i]} full ${models_capitalized[$i]} 1 "sub_class" |
|
done |
|
|
|
|