-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from veg/develop
Updating GARD to latest version of HyPhy. Updating all methods to use kwargs.
- Loading branch information
Showing
20 changed files
with
612 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
var config = require("../../config.json"), | ||
hyphyJob = require("../hyphyjob.js").hyphyJob, | ||
code = require("../code").code, | ||
util = require("util"), | ||
fs = require("fs"), | ||
path = require("path"); | ||
|
||
var cfel = function(socket, stream, params) { | ||
|
||
var self = this; | ||
self.socket = socket; | ||
self.stream = stream; | ||
self.params = params; | ||
|
||
fs.writeFile('./cfel_params.json', JSON.stringify(self.params), function(err) { | ||
if (err) throw err; | ||
}); | ||
|
||
|
||
// object specific attributes | ||
self.type = "cfel"; | ||
self.qsub_script_name = "cfel.sh"; | ||
self.qsub_script = __dirname + "/" + self.qsub_script_name; | ||
|
||
// parameter attributes | ||
self.msaid = self.params.msa._id; | ||
self.id = self.params.analysis._id; | ||
self.genetic_code = code[self.params.msa[0].gencodeid + 1]; | ||
self.nwk_tree = self.params.analysis.tagged_nwk_tree; | ||
self.branch_sets = self.params.analysis.branch_sets.join(":"); | ||
self.rate_variation = self.params.analysis.ds_variation == 1 ? "Yes" : "No"; | ||
|
||
// parameter-derived attributes | ||
self.fn = __dirname + "/output/" + self.id; | ||
self.output_dir = path.dirname(self.fn); | ||
self.status_fn = self.fn + ".status"; | ||
self.results_short_fn = self.fn + ".cfel"; | ||
self.results_fn = self.fn + ".FEL.json"; | ||
self.progress_fn = self.fn + ".cfel.progress"; | ||
self.tree_fn = self.fn + ".tre"; | ||
|
||
self.qsub_params = [ | ||
"-l walltime=" + | ||
config.cfel_walltime + | ||
",nodes=1:ppn=" + | ||
config.cfel_procs, | ||
"-q", | ||
config.qsub_avx_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 + | ||
",genetic_code=" + | ||
self.genetic_code + | ||
",analysis_type=" + | ||
self.type + | ||
",branch_sets=" + | ||
self.branch_sets + | ||
",rate_variation=" + | ||
self.rate_variation + | ||
",cwd=" + | ||
__dirname + | ||
",msaid=" + | ||
self.msaid + | ||
",procs=" + | ||
config.cfel_procs, | ||
"-o", | ||
self.output_dir, | ||
"-e", | ||
self.output_dir, | ||
self.qsub_script | ||
]; | ||
|
||
// Write tree to a file | ||
fs.writeFile(self.tree_fn, self.nwk_tree, function(err) { | ||
if (err) throw err; | ||
}); | ||
|
||
// Ensure the progress file exists | ||
fs.openSync(self.progress_fn, "w"); | ||
self.init(); | ||
}; | ||
|
||
util.inherits(cfel, hyphyJob); | ||
exports.cfel = cfel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
export PATH=/usr/local/bin:$PATH | ||
source /etc/profile.d/modules.sh | ||
|
||
module load aocc/1.3.0 | ||
module load openmpi/gnu/3.0.2 | ||
|
||
FN=$fn | ||
CWD=$cwd | ||
TREE_FN=$tree_fn | ||
STATUS_FILE=$sfn | ||
PROGRESS_FILE=$pfn | ||
RESULTS_FN=$rfn | ||
GENETIC_CODE=$genetic_code | ||
RATE_VARIATION=$rate_variation | ||
PROCS=$procs | ||
|
||
sets=(`echo $branch_sets | sed 's/:/\n/g'`) | ||
|
||
BRANCH_SETS=$(for x in ${sets[@]}; do echo -n " --branch-set $x "; done;) | ||
|
||
HYPHY=$CWD/../../.hyphy/HYPHYMPI | ||
HYPHY_PATH=$CWD/../../.hyphy/res/ | ||
RESULTS_FILE=$fn.FEL.json | ||
|
||
export HYPHY_PATH=$HYPHY_PATH | ||
|
||
trap 'echo "Error" > $STATUS_FILE; exit 1' ERR | ||
echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH contrast-fel --alignment $FN --tree $TREE_FN $BRANCH_SETS --output $RESULTS_FILE >> $PROGRESS_FILE" | ||
mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH contrast-fel --alignment $FN --tree $TREE_FN $BRANCH_SETS --output $RESULTS_FILE >> $PROGRESS_FILE | ||
echo "Completed" > $STATUS_FILE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.