-
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 #310 from veg/develop
NRM
- Loading branch information
Showing
6 changed files
with
137 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
var config = require("../../config.json"), | ||
hyphyJob = require("../hyphyjob.js").hyphyJob, | ||
code = require("../code").code, | ||
util = require("util"), | ||
fs = require("fs"), | ||
path = require("path"); | ||
|
||
var nrm = function(socket, stream, params) { | ||
|
||
var self = this; | ||
self.socket = socket; | ||
self.stream = stream; | ||
self.params = params; | ||
|
||
// object specific attributes | ||
self.type = "nrm"; | ||
self.qsub_script_name = "nrm.sh"; | ||
self.qsub_script = __dirname + "/" + self.qsub_script_name; | ||
|
||
// parameter attributes | ||
self.msaid = self.params.msa._id; | ||
self.id = self.params.analysis._id; | ||
self.nwk_tree = self.params.msa[0].usertree || self.params.msa[0].nj; | ||
|
||
// 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 + ".nrm"; | ||
self.results_fn = self.fn + ".NRM.json"; | ||
self.progress_fn = self.fn + ".nrm.progress"; | ||
self.tree_fn = self.fn + ".tre"; | ||
|
||
self.qsub_params = [ | ||
"-l walltime=" + | ||
config.nrm_walltime + | ||
",nodes=1:ppn=" + | ||
config.nrm_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_fn + | ||
",cwd=" + | ||
__dirname + | ||
",msaid=" + | ||
self.msaid + | ||
",procs=" + | ||
config.nrm_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(nrm, hyphyJob); | ||
exports.nrm = nrm; |
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,31 @@ | ||
#!/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.1.6 | ||
|
||
FN=$fn | ||
CWD=$cwd | ||
TREE_FN=$tree_fn | ||
STATUS_FILE=$sfn | ||
PROGRESS_FILE=$pfn | ||
RESULTS_FN=$rfn | ||
GENETIC_CODE=$genetic_code | ||
RATE_CLASSES=$rate_classes | ||
PROCS=$procs | ||
|
||
HYPHY=$CWD/../../.hyphy/hyphy | ||
HYPHY_PATH=$CWD/../../.hyphy/res/ | ||
HYPHY_ANALYSES_PATH=$CWD/../../.hyphy-analyses | ||
NRM=$HYPHY_ANALYSES_PATH/NucleotideNonREV/NRM.bf | ||
|
||
export HYPHY_PATH=$HYPHY_PATH | ||
trap 'echo "Error" > $STATUS_FILE; exit 1' ERR | ||
|
||
echo "$HYPHY LIBPATH=$HYPHY_PATH $NRM --alignment $FN --output $RESULTS_FN" | ||
$HYPHY LIBPATH=$HYPHY_PATH $NRM --alignment $FN --output $RESULTS_FN > $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