Skip to content

Instantly share code, notes, and snippets.

@Riey
Last active August 28, 2025 07:51
Show Gist options
  • Select an option

  • Save Riey/6bdfba58caf25a0b13856548cddb67b8 to your computer and use it in GitHub Desktop.

Select an option

Save Riey/6bdfba58caf25a0b13856548cddb67b8 to your computer and use it in GitHub Desktop.
run-lucaprot in colab
# Usage: ./run-lucaprot.sh <fasta_folder> <result_folder>
fasta_folder="$1"
result_folder="$2"
emb_folder="$result_folder/emb"
if [ -z "$fasta_folder" ] || [ -z "$result_folder" ]; then
echo "Usage: $0 <fasta_folder> <result_folder>"
exit 1
fi
mkdir -p "$result_folder"
for fasta_file in "$fasta_folder"/*.fasta; do
base=$(basename "$fasta_file" .fasta)
result_file="$result_folder/$base.csv"
temp_file="$result_file.tmp"
# If result file exists and is non-empty, skip
if [ -s "$result_file" ]; then
echo "Skipping $base (already finished)"
continue
fi
# If previous temporary file is exists, delete it
if [ -s "$temp_file" ]; then
rm "$temp_file"
fi
echo "Processing $base..."
python src/predict_many_samples.py \
--fasta_file "$fasta_file" \
--emb_dir "$emb_folder" \
--save_file "$temp_file" \
--truncation_seq_length 4096 \
--dataset_name rdrp_40_extend \
--dataset_type protein \
--task_type binary_class \
--model_type sefn \
--time_str 20230201140320 \
--step 100000 \
--threshold 0.5 \
--print_per_number 100 \
--gpu_id 0
# If temp file is non-empty, move to result file
if [ -s "$temp_file" ]; then
mv "$temp_file" "$result_file"
echo "Finished $base."
else
echo "$base did not finish successfully."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment