Hi Cecile:
Thank you very much for your reply! I updated my script based on the exmaple you shared, but got similar error. The julia script now was:
"""
#!/usr/bin/env julia
# file "runSNaQ.jl". run in the shell like this in general:
# julia runSNaQ.jl hvalue nruns
# example for h=2 and default 10 runs:
# julia runSNaQ.jl 2
# or example for h=3 and 50 runs:
# julia runSNaQ.jl 3 50
length(ARGS) > 0 ||
error("need 1 or 2 arguments: # reticulations (h) and # runs (optional, 10 by default)")
nruns = 10
if length(ARGS) > 1
nruns = parse(Int, ARGS[2])
end
outputfile = string("net", h, "_", nruns, "runs") # example: "net2_10runs"
seed = 1234 + h # change as desired! Best to have it different for different h
@info "will run SNaQ with h=$h, # of runs=$nruns, seed=$seed, output will go to: $outputfile"
using Distributed
addprocs(nruns)
@everywhere using SNaQ,PhyloNetworks
net0 = readnewick("../astral4_group1_pruned.tre");
using DataFrames, CSV
df_sp = CSV.read("../tableCF.txt", DataFrame; pool=false);
d_sp = readtableCF!(df_sp);
net = snaq!(net0, d_sp, hmax=h, filename=outputfile, seed=seed, runs=nruns)
"""
The bash script I used to submit the job was:
"""
#!/bin/bash
#SBATCH -J s05_snaq_cecile
#SBATCH -o %x-%j.log
#SBATCH -e %x-%j.err
#SBATCH -p vip_67
#SBATCH -N 1
#SBATCH -n 10
#SBATCH --mem=30G
source /public1/soft/modules/module.sh
module purge
module load miniforge/24.11
source ~/.bashrc
conda activate phylonet-env
SPP_TREE=/public1/home/m6l601321/ilex_backbone/captus_alignment_minsam090/phylonetworks_85spp/group1/astral4_group1_pruned.tre
CF_TABLE=/public1/home/m6l601321/ilex_backbone/captus_alignment_minsam090/phylonetworks_85spp/group1/tableCF.txt
mkdir -p Cecile_snaq_analyses
cd Cecile_snaq_analyses
## --array: to run multiple instances of this script,
## one for each value in the array.
## 1 instance = 1 task
## -J job name
## -n number of cores (CPUs) per task
for HMAX in $(seq 0 9)
do
echo "number ${HMAX} is used as hmax"
echo "start of SNaQ parallel runs on $(hostname)"
# finally: launch the julia script, using Julia executable appropriate for slurm, with full paths:
julia -p10 --history-file=no -- ../runSNaQ_Cecile.jl $HMAX > net${HMAX}_runs.screenlog 2>&1
echo "end of SNaQ run with ${HMAX} as hmax..."
done
"""
I set the hmax ranging from 0 to 9. However, the analyses of hmax = 0, 1, 3, 4, 5, 6, 7, 8 finished successfully. The analyses of hmax = 2 and 9 were failed, which their screenlog files are attached here. Is it because the species tree didn't have any gene flow when the hmax = 2 and 9? Could you please have a look on this problem when you have time? Thanks very much for your time and help!
Best regards,