This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Running Hyphy Batch File

Hello there,

Im trying to run multiple files in hyphy (LEISR). However, the script is only for single execution as shown below : runLEISR.bf

LoadFunctionLibrary("LEISR.bf", { "0": "<full_path>/ file1.fasta", # alignment file "1": "<full_path>/tree.nhx", # tree file "2": "Protein", # analysis type "3": "JTT", # model type "4": "No"}); # use a model of rate heterogeneity when optimizing branch lengths

How can i alter this script to allow looping for over multiple input files ?

hyphy leisr batch file linux

I haven't used LEISR in hyphy suite, but I have used RELAX in hyphy suite as below for many files in a for loop. you can do some modifications. for each fasta and its corresponding tree file, you should arrange names. For example;

file1.fasta and file1.tree

to arrange names you can do; lets say your files start with OG

for i in OG* ; do mv -- "$i" "${i/%.fa/.fasta}" ; done

this command will change .fa to .fasta

then you can run hyphy LEISR as below with some modifications based on its usage

#!/usr/bin/bash
for f in *fasta; do hyphy RELAX --alignment "$f" --tree "${f%.fasta}.tree" --test Foreground ; done

Thank you for your suggestion, however this solution does not work with LEISR as it will prompt the interactive form. In addition, there are no help option under this approach for me to use as a guide.

0 answers

No answers yet.

Log in to answer this question.