veg / hyphy

HyPhy: Hypothesis testing using Phylogenies
http://www.hyphy.org
Other
201 stars 68 forks source link

batch use hyphy #1576

Closed hrluo93 closed 1 year ago

hrluo93 commented 1 year ago

Dear hyphy,

I have to run 5000+ ortho alignments in the busted batch script. While I running my batch file, like this

conda activate py3.6 ls *.fasta |cut -d "." -f 1-4 | while read file;do gname=ls ${file}.fasta | cut -d "-" -f 3 iqtree -s ${file}.fasta -nt 12 --prefix ${gname} -redo sed -i 's/Gma/Gma{Foreground}/g' ${gname}.treefile hyphy busted --alignment ${file}.fasta --tree ${gname}.treefile --branches Foreground cat ${file}.fasta.BUSTED.json | grep -e "LRT" -e "p-value" -e "original name" > res/${gname}.txt done

busted cannot run and showed errors Could not read batch file '/mnt/j/newanno/gmaorth/4sp/hyphy/fastain/busted'. Path stack: /mnt/j/newanno/gmaorth/4sp/hyphy/fastain/res/ /mnt/j/newanno/gmaorth/4sp/hyphy/fastain/

how can I run hyphy in the original bash script?

best wishes!

hrluo93 commented 1 year ago

GitHub changed my command 微信图片_20230302231412

spond commented 1 year ago

Dear @hrluo93,

HyPhy can't find its standard library directory. Look for the HyPhy install/source directory (it will have the following subdirectory)

├── res
│   ├── GeneticCodes
│   ├── SubstitutionClasses
│   ├── SubstitutionModels
│   ├── TemplateBatchFiles
│   └── data

Then, on your command line executing hyphy specify

hyphy LIBPATH=/path/to/res <other arguments>

Best, Sergei

PS For processing json files, I would recommend jq instead of grep. Much cleaner and robust.

hrluo93 commented 1 year ago

Dear Sergei,

Solved! Thank you very much for your reply and suggestions! Thanks for the Hyphy, a powerful tool!

Best wishes! Ran!

github-actions[bot] commented 1 year ago

Stale issue message