Add MCMCtree workflow and SNaQ analysis scripts
- Updated `pixi.toml` to include new R package dependencies for MCMCtree workflow. - Modified markdown file to remove unnecessary simulation data discussion. - Introduced `.lintr` configuration for linting R scripts. - Created `mcmctree.ctl` control file for MCMCtree analysis. - Developed `mcmctree_workflow.r` script to orchestrate MCMCtree analysis with model testing and ESS checks. - Added `06.snaq.jl` script for SNaQ analysis with plotting capabilities. - Implemented `07.mcmctree.sh` bash script to run MCMCtree on multiple alignments in parallel.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#! /bin/bash
|
||||
set -e
|
||||
SCRIPTS=${SCRIPTS:-"$PROJECTHOME/99.scripts"}
|
||||
THREADS=${THREADS:-16}
|
||||
|
||||
if [ "$#" -ne 4 ]; then
|
||||
echo "Usage: $0 <aln_dir> <ml_dir> <out_dir> <alignment_ext>"
|
||||
echo "Run MCMCtree on orthogroup alignments with corresponding ML trees"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
aln_dir=$1
|
||||
ml_dir=$2
|
||||
out_dir=$3
|
||||
ext=$4
|
||||
mkdir -p "$out_dir"
|
||||
echo -n >mcmctree.cmds
|
||||
ctlfile=$(readlink -f "$SCRIPTS/miscs/mcmctree.ctl")
|
||||
for i in "$aln_dir"/*."$ext"; do
|
||||
j=$(basename "$i" ."$ext")
|
||||
aln=$(readlink -f "$i")
|
||||
ml_tree=$(readlink -f "$ml_dir/${j}/${j}.raxml.bestTree")
|
||||
mkdir -p "${out_dir}/${j}"
|
||||
cmd="cd ${out_dir}/${j} && Rscript $SCRIPTS/miscs/mcmctree_workflow.r"
|
||||
params="-a $aln -t $ml_tree -c ${ctlfile} -p ${j}"
|
||||
echo "$cmd $params > mcmctree.log 2>&1" >>mcmctree.cmds
|
||||
done
|
||||
xargs -t -P "$THREADS" -I cmd -a mcmctree.cmds bash -c "cmd"
|
||||
echo "MCMCtree all completed."
|
||||
Reference in New Issue
Block a user