Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would be nice if run0.{sh,bat} could use variables. #2

Open
SimonGreenhill opened this issue Jun 20, 2016 · 0 comments
Open

Would be nice if run0.{sh,bat} could use variables. #2

SimonGreenhill opened this issue Jun 20, 2016 · 0 comments

Comments

@SimonGreenhill
Copy link
Contributor

e.g. instead of multiple lines of this:

cp /tmp/analysis/step0/beast.xml.state /tmp/analysis/step1
cd "/tmp/analysis/step1"
java -cp "/Applications/Phylogenetics/BEAST 2.4.0/BEAUti.app/Contents/Java/Classes:/Applications/Phylogenetics/BEAST 2.4.0/BEAUti.app/Contents/Java/launcher.jar:/Users/simon/Library/Application Support/BEAST/2.4/BEAST/lib/beast.jar:/Users/simon/Library/Application Support/BEAST/2.4/BEAST/lib/beast.src.jar:/Applications/Phylogenetics/BEAST 2.4.0/lib/beast.src.jar:/Users/simon/Library/Application Support/BEAST/2.4/Babel/lib/Babel.addon.jar:/Users/simon/Library/Application Support/BEAST/2.4/Babel/lib/itextpdf-5.5.9.jar:/Users/simon/Library/Application Support/BEAST/2.4/BDSKY/lib/BDSSM.addon.jar:/Users/simon/Library/Application Support/BEAST/2.4/BEAST_CLASSIC/lib/BEAST_CLASSIC.addon.jar:/Users/simon/Library/Application Support/BEAST/2.4/BEAST_CLASSIC/lib/mtj.jar:/Users/simon/Library/Application Support/BEAST/2.4/BEASTLabs/lib/BEASTlabs.addon.jar:/Users/simon/Library/Application Support/BEAST/2.4/MODEL_SELECTION/lib/MODEL_SELECTION.addon.jar:/Users/simon/Library/Application Support/BEAST/2.4/morph-models/lib/MM.addon.jar:/Users/simon/Library/Application Support/BEAST/2.4/subst-bma/lib/SubstBMA.addon.jar:/Applications/Phylogenetics/BEAST 2.4.0/lib/beast.src.jar:/Users/simon/Library/Application Support/BEAST/2.4/BEAST/lib/beast.src.jar" beast.app.beastapp.BeastMain -resume -java -seed 815032149 beast.xml

could become:

SEED=815032149
CWD="/tmp/analysis/"
CLASSPATH="/Applications/Phylogenetics/BEAST ....etc"

cp $(CWD)step0/beast.xml.state $(CWD)step1
cd "$(CWD)step1"
java -cp $(CLASSPATH) beast.app.beastapp.BeastMain -resume -java -seed $(SEED) beast.xml

...which would then make the subsequent analysis scripts easier to move between machines (say from laptop to a cluster, where e.g. CWD and CLASSPATH is different).

Not sure how .bat files handle variables though, so this might be tricky to get working cross-platform.

Even better would be a loop, as then you could just increment $MAX_STEPS and rerun, but again cross-platform compatibility could be nightmare (e.g. from memory for loop syntax isn't consistent even across POSIX).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant