Skip to content

Commit

Permalink
veg/datamonkey-js#752 -- adding new meme options
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenweaver committed Nov 27, 2024
1 parent 9fd6f01 commit 21ee61c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
27 changes: 20 additions & 7 deletions app/meme/meme.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var config = require("../../config.json"),
fs = require("fs"),
path = require("path");

var meme = function(socket, stream, params) {
var meme = function (socket, stream, params) {
var self = this;
self.socket = socket;
self.stream = stream;
Expand All @@ -26,6 +26,12 @@ var meme = function(socket, stream, params) {
self.bootstrap = self.params.analysis.bootstrap;
self.resample = self.params.analysis.resample;

self.multiple_hits = self.params.multiple_hits;
self.site_multihit = self.params.site_multihit;
self.rates = self.params.rates;
self.resample = self.params.resample;
self.impute_states = self.params.impute_states;

// parameter-derived attributes
self.fn = __dirname + "/output/" + self.id;
self.output_dir = path.dirname(self.fn);
Expand All @@ -36,10 +42,7 @@ var meme = function(socket, stream, params) {
self.tree_fn = self.fn + ".tre";

self.qsub_params = [
"-l walltime=" +
config.meme_walltime +
",nodes=1:ppn=" +
config.meme_procs,
"-l walltime=" + config.meme_walltime + ",nodes=1:ppn=" + config.meme_procs,
"-q",
config.qsub_queue,
"-v",
Expand All @@ -59,6 +62,16 @@ var meme = function(socket, stream, params) {
self.bootstrap +
",resample=" +
self.resample +
",multiple_hits=" +
self.multiple_hits +
",site_multihit=" +
self.site_multihit +
",rates=" +
self.rates +
",resample=" +
self.resample +
",impute_states=" +
self.impute_states +
",genetic_code=" +
self.genetic_code +
",analysis_type=" +
Expand All @@ -73,11 +86,11 @@ var meme = function(socket, stream, params) {
self.output_dir,
"-e",
self.output_dir,
self.qsub_script
self.qsub_script,
];

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

Expand Down
17 changes: 7 additions & 10 deletions app/meme/meme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ CWD=$cwd
TREE_FN=$tree_fn
STATUS_FILE=$sfn
PROGRESS_FILE=$pfn
#BOOTSTRAP=$bootstrap
#RESAMPLE=$resample
MULTIPLE_HITS="$multiple_hits"
SITE_MULTIHIT="$site_multihit"
RATES="$rates"
RESAMPLE="$resample"
IMPUTE_STATES="$impute_states"
RESULTS_FN=$fn.MEME.json
GENETIC_CODE=$genetic_code
PROCS=$procs
Expand All @@ -24,13 +27,7 @@ export HYPHY_PATH=$HYPHY_PATH

trap 'echo "Error" > $STATUS_FILE; exit 1' ERR

#if [ $BOOTSTRAP = "true" ]
#then
echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH meme --alignment $FN --tree $TREE_FN --code $GENETIC_CODE >> $PROGRESS_FILE"
mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH ENV="TOLERATE_NUMERICAL_ERRORS=1;" meme --alignment $FN --tree $TREE_FN --code $GENETIC_CODE >> $PROGRESS_FILE
#else
# echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH meme --alignment $FN --tree $TREE_FN --code $GENETIC_CODE >> $PROGRESS_FILE"
# mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH ENV="TOLERATE_NUMERICAL_ERRORS=1;" meme --alignment $FN --tree $TREE_FN --code $GENETIC_CODE >> $PROGRESS_FILE
#fi
echo "mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH meme --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --multiple-hits $MULTIPLE_HITS --site-multihit $SITE_MULTIHIT --rates $RATES --resample $RESAMPLE --impute-states $IMPUTE_STATES >> $PROGRESS_FILE"
mpirun -np $PROCS $HYPHY LIBPATH=$HYPHY_PATH ENV="TOLERATE_NUMERICAL_ERRORS=1;" meme --alignment $FN --tree $TREE_FN --code $GENETIC_CODE --multiple-hits $MULTIPLE_HITS --site-multihit $SITE_MULTIHIT --rates $RATES --resample $RESAMPLE --impute-states $IMPUTE_STATES >> $PROGRESS_FILE

echo "Completed" > $STATUS_FILE

0 comments on commit 21ee61c

Please sign in to comment.