Skip to content

Commit

Permalink
veg/datamonkey-js#752 -- adding new fel options
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenweaver committed Nov 26, 2024
1 parent 4f9c490 commit 9fd6f01
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 40 deletions.
79 changes: 44 additions & 35 deletions app/fel/fel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ var config = require("../../config.json"),
fs = require("fs"),
path = require("path");

var fel = function(socket, stream, params) {
var fel = function (socket, stream, params) {
var self = this;
self.socket = socket;
self.stream = stream;
self.params = params;

// object specific attributes
self.type = "fel";

// New attributes for multiple hits and site multihit
self.multiple_hits = self.params.analysis.multiple_hits || "None"; // e.g., [Double, Double+Triple, None]
self.site_multihit = self.params.analysis.site_multihit || "Estimate"; // e.g., [Estimate, Global]

self.qsub_script_name = "fel.sh";
self.qsub_script = __dirname + "/" + self.qsub_script_name;

Expand All @@ -38,52 +43,56 @@ var fel = function(socket, stream, params) {
self.tree_fn = self.fn + ".tre";

self.qsub_params = [
"-l walltime=" +
config.fel_walltime +
",nodes=1:ppn=" +
"-l walltime=" +
config.fel_walltime +
",nodes=1:ppn=" +
config.fel_procs,
"-q",
config.qsub_queue,
"-v",
"fn=" +
self.fn +
",tree_fn=" +
self.tree_fn +
",sfn=" +
self.status_fn +
",pfn=" +
self.progress_fn +
",rfn=" +
self.results_short_fn +
",treemode=" +
self.treemode +
",bootstrap=" +
self.bootstrap +
",resample=" +
self.resample+
",genetic_code=" +
self.genetic_code +
",analysis_type=" +
self.type +
",rate_variation=" +
self.rate_variation +
",ci=" +
self.ci +
",cwd=" +
__dirname +
",msaid=" +
self.msaid +
",procs=" +
config.fel_procs,
self.fn +
",tree_fn=" +
self.tree_fn +
",sfn=" +
self.status_fn +
",pfn=" +
self.progress_fn +
",rfn=" +
self.results_short_fn +
",treemode=" +
self.treemode +
",bootstrap=" +
self.bootstrap +
",resample=" +
self.resample +
",genetic_code=" +
self.genetic_code +
",analysis_type=" +
self.type +
",rate_variation=" +
self.rate_variation +
",ci=" +
self.ci +
",cwd=" +
__dirname +
",msaid=" +
self.msaid +
",procs=" +
config.fel_procs +
",multiple_hits=" +
self.multiple_hits +
",site_multihit=" +
self.site_multihit,
"-o",
self.output_dir,
"-e",
self.output_dir,
self.qsub_script
self.qsub_script,
];

// Write tree to a file
fs.writeFile(self.tree_fn, self.nwk_tree, function(err) {
fs.writeFile(self.tree_fn, self.nwk_tree, function (err) {
if (err) throw err;
});

Expand Down
11 changes: 6 additions & 5 deletions app/fel/fel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RESAMPLE=$resample
RESULTS_FN=$rfn
GENETIC_CODE=$genetic_code
RATE_VARIATION=$rate_variation
MULTIPLE_HITS=$multiple_hits
SITE_MULTIHIT=$site_multihit
PROCS=$procs

HYPHY=$CWD/../../.hyphy/HYPHYMPI
Expand All @@ -30,12 +32,11 @@ trap 'echo "Error" > $STATUS_FILE; exit 1' ERR

if [ $BOOTSTRAP = "true" ]
then
echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --resample $RESAMPLE --ci $CI >> $PROGRESS_FILE"
mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH ENV="TOLERATE_NUMERICAL_ERRORS=1;" $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --resample $RESAMPLE --ci $CI >> $PROGRESS_FILE
echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --resample $RESAMPLE --ci $CI --multiple-hits $MULTIPLE_HITS --site-multihit $SITE_MULTIHIT >> $PROGRESS_FILE"
mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH ENV="TOLERATE_NUMERICAL_ERRORS=1;" $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --resample $RESAMPLE --ci $CI --multiple-hits $MULTIPLE_HITS --site-multihit $SITE_MULTIHIT >> $PROGRESS_FILE
else
echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --ci $CI >> $PROGRESS_FILE"
mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH ENV="TOLERATE_NUMERICAL_ERRORS=1;" $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --ci $CI >> $PROGRESS_FILE
echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --ci $CI --multiple-hits $MULTIPLE_HITS --site-multihit $SITE_MULTIHIT >> $PROGRESS_FILE"
mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH ENV="TOLERATE_NUMERICAL_ERRORS=1;" $FEL --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --branches FG --srv $RATE_VARIATION --output $RESULTS_FILE --ci $CI --multiple-hits $MULTIPLE_HITS --site-multihit $SITE_MULTIHIT >> $PROGRESS_FILE
fi

echo "Completed" > $STATUS_FILE

0 comments on commit 9fd6f01

Please sign in to comment.