Permalink
Browse files

Merge pull request #131 from veg/develop

1.2.0
  • Loading branch information...
stevenweaver committed Sep 26, 2018
2 parents 1dbfc70 + c9171b2 commit c8269b435318a513c43500c0c5d9091dfb126341
Showing with 7,498 additions and 6,761 deletions.
  1. +5 −0 .gitignore
  2. +11 −10 .travis.yml
  3. +1 −1 Makefile
  4. +1 −1 README.md
  5. +7 −1 app/models/absrel.js
  6. +29 −18 app/models/analysis.js
  7. +4 −0 app/models/busted.js
  8. +7 −1 app/models/fel.js
  9. +0 −2 app/models/flea.js
  10. +1 −2 app/models/gard.js
  11. +18 −20 app/models/hivtrace.js
  12. +49 −59 app/models/msa.js
  13. +7 −1 app/models/relax.js
  14. +39 −69 app/routes/absrel.js
  15. +63 −0 app/routes/analysis.js
  16. +44 −74 app/routes/busted.js
  17. +2 −44 app/routes/fade.js
  18. +40 −79 app/routes/fel.js
  19. +35 −46 app/routes/flea.js
  20. +18 −56 app/routes/fubar.js
  21. +26 −53 app/routes/gard.js
  22. +5 −9 app/routes/hivtrace.js
  23. +10 −12 app/routes/home.js
  24. +17 −51 app/routes/meme.js
  25. +4 −24 app/routes/prime.js
  26. +39 −68 app/routes/relax.js
  27. +17 −51 app/routes/slac.js
  28. +16 −13 app/task-runners/hivtrace/attribute-mapper.js
  29. +32 −54 app/templates/absrel/form.ejs
  30. +16 −2 app/templates/absrel/results.ejs
  31. +38 −28 app/templates/analyses.ejs
  32. +31 −60 app/templates/busted/form.ejs
  33. +16 −2 app/templates/busted/results.ejs
  34. +6 −87 app/templates/busted/upload_msa.ejs
  35. +4 −243 app/templates/citations.ejs
  36. +1 −1 app/templates/development.ejs
  37. +1 −1 app/templates/fade/form.ejs
  38. +31 −53 app/templates/fel/form.ejs
  39. +8 −11 app/templates/fel/msa_form.ejs
  40. +18 −2 app/templates/fel/results.ejs
  41. +5 −3 app/templates/flea/form.ejs
  42. +1 −2 app/templates/fubar/form.ejs
  43. +0 −20 app/templates/fubar/msa_form.ejs
  44. +18 −2 app/templates/fubar/results.ejs
  45. +18 −2 app/templates/gard/results.ejs
  46. +4 −51 app/templates/help.ejs
  47. +3 −3 app/templates/hivtrace/attribute_map_assignment.ejs
  48. +317 −270 app/templates/hivtrace/form.ejs
  49. +3 −3 app/templates/hivtrace/results.ejs
  50. +12 −15 app/templates/includes/footer.ejs
  51. +80 −39 app/templates/includes/header.ejs
  52. +3 −2 app/templates/index.ejs
  53. +2 −2 app/templates/jobqueue.ejs
  54. +16 −2 app/templates/meme/results.ejs
  55. +40 −33 app/templates/partials/jobs/jobpage.ejs
  56. +3 −3 app/templates/partials/msa/attribute_map_assignment.ejs
  57. +7 −12 app/templates/partials/msa/form.ejs
  58. +5 −5 app/templates/partials/msa/summary.ejs
  59. +32 −74 app/templates/relax/form.ejs
  60. +18 −2 app/templates/relax/results.ejs
  61. +6 −9 app/templates/relax/upload_msa.ejs
  62. +18 −2 app/templates/slac/results.ejs
  63. +301 −300 config/globals.js
  64. +166 −153 config/routes.js
  65. +7 −5 config/setup.js.tpl
  66. +136 −136 lib/biohelpers/sequenceio.js
  67. +7 −9 lib/error.js
  68. +39 −33 lib/helpers.js
  69. +251 −293 lib/hpcsocket.js
  70. +36 −15 lib/loadBal.js
  71. +23 −23 lib/logger.js
  72. +30 −39 lib/mailer.js
  73. +17 −18 lib/queue.js
  74. +8 −11 lib/usageStatistics.js
  75. +21 −8 package.json
  76. +125 −129 public/assets/css/datamonkey.css
  77. +51 −49 public/assets/css/hivtrace.css
  78. +29 −12 public/assets/css/stats.css
  79. BIN public/assets/img/code.png
  80. +0 −209 public/assets/js/absrel/fg-selection.js
  81. +0 −213 public/assets/js/busted/fg-selection.js
  82. +56 −50 public/assets/js/busted/msa_form.js
  83. +62 −54 public/assets/js/fade/msa_form.js
  84. +0 −209 public/assets/js/fel/fg-selection.js
  85. +41 −44 public/assets/js/fel/msa_form.js
  86. +82 −97 public/assets/js/job.js
  87. +37 −43 public/assets/js/msa/form.js
  88. +0 −302 public/assets/js/relax/fg-selection.js
  89. +26 −31 public/assets/js/relax/msa_form.js
  90. +71 −71 server.js
  91. +25 −18 src/entry.js
  92. +118 −95 src/js/datamonkey.js
  93. +42 −0 src/js/datamonkey_branch_selection.js
  94. +139 −87 src/js/datamonkey_helpers.js
  95. +620 −241 src/jsx/analysis_tree.jsx
  96. +132 −0 src/jsx/analyzing_data.jsx
  97. +46 −37 src/jsx/attribute_table.jsx
  98. +266 −295 src/jsx/branch-selection.jsx
  99. +476 −0 src/jsx/citations.jsx
  100. +559 −0 src/jsx/data_files.jsx
  101. +279 −211 src/jsx/forms/fubar.jsx
  102. +128 −130 src/jsx/forms/gard.jsx
  103. +131 −125 src/jsx/forms/slac.jsx
  104. +64 −0 src/jsx/help.jsx
  105. +54 −0 src/jsx/job_log.jsx
  106. +52 −53 src/jsx/jobqueue.jsx
  107. +316 −204 src/jsx/stats.jsx
  108. +143 −0 src/jsx/tree_btn_group.jsx
  109. +0 −562 src/less/bootstrap.less
  110. +687 −0 src/scss/application.scss
  111. +1 −0 src/scss/variables.scss
  112. +16 −24 test/loadBalTest.js
  113. +10 −14 test/manual/mail.js
  114. +200 −183 test/msa.js
  115. +25 −34 test/relax.js
  116. +14 −21 test/sequenceio.js
  117. +5 −6 webpack.config.js
View
@@ -38,3 +38,8 @@ public/assets/js/datamonkey.css*
public/assets/js/datamonkey.js*
*vendor*
*.aa
dump.rdb
.DS_Store
.yalc/
yalc.lock
View
@@ -1,6 +1,6 @@
language: node_js
services:
services:
- mongodb
- redis-server
@@ -10,18 +10,19 @@ node_js:
sudo: false
notifications:
email:
recipients:
- spond@temple.edu
- steven@stevenweaver.org
- sshank@temple.edu
on_success: always
on_failure: always
email:
recipients:
- spond@temple.edu
- steven@stevenweaver.org
- sshank@temple.edu
on_success: always
on_failure: always
branches:
only:
- master
- develop
- master
- develop
- bootstrap4
cache:
yarn: true
View
@@ -10,4 +10,4 @@ install:
@cd ./.tn93/ && cmake . && make && cd ../
@yarn install
@webpack
@mkdir -p ./uploads/msa ./uploads/hivtrace;
@mkdir -p ./uploads/msa ./uploads/hivtrace ./results/jobs/;
View
@@ -53,4 +53,4 @@ Start datamonkey.js
node server.js
Datamonkey should now be running at [localhost:4000](http://localhost:4000).
Datamonkey should now be running at [localhost:4002](http://localhost:4002).
View
@@ -39,7 +39,13 @@ aBSREL.virtual("filepath").get(function() {
* Original file path for document's file upload
*/
aBSREL.virtual("original_fn").get(function() {
return path.resolve(__dirname + "/../../uploads/msa/" + this._id + "-original." + this.original_extension);
return path.resolve(
__dirname +
"/../../uploads/msa/" +
this._id +
"-original." +
this.original_extension
);
});
/**
View
@@ -1,17 +1,18 @@
var mongoose = require("mongoose"),
globals = require("../../config/globals.js"),
setup = require("./../../config/setup"),
moment = require("moment"),
_ = require("underscore"),
winston = require("winston"),
hpcsocket = require(__dirname + "/../../lib/hpcsocket.js"),
Msa = require(__dirname + "/msa"),
extend = require("mongoose-schema-extend");
var redis = require('redis'),
var redis = require("redis"),
client = redis.createClient();
var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;
var Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
var AnalysisSchema = new Schema({
msa: [Msa.MsaSchema],
@@ -39,10 +40,15 @@ AnalysisSchema.virtual("since_created").get(function() {
* Original file path for document's file upload
*/
AnalysisSchema.virtual("original_fn").get(function() {
return path.resolve(__dirname + "/../../uploads/msa/" + this._id + "-original." + this.original_extension);
return path.resolve(
__dirname +
"/../../uploads/msa/" +
this._id +
"-original." +
this.original_extension
);
});
AnalysisSchema.virtual("max_sites").get(function() {
return 12000;
});
@@ -77,13 +83,11 @@ AnalysisSchema.statics.pendingJobs = function(cb) {
};
AnalysisSchema.statics.submitJob = function(job, cb) {
winston.info(
"submitting " + job.analysistype + " : " + job._id + " to cluster"
);
var jobproxy = new hpcsocket.HPCSocket(
{
filepath: job.filepath,
msa: job.msa,
@@ -94,7 +98,6 @@ AnalysisSchema.statics.submitJob = function(job, cb) {
"spawn",
cb
);
};
AnalysisSchema.statics.subscribePendingJobs = function() {
@@ -114,10 +117,10 @@ AnalysisSchema.statics.usageStatistics = function(cb) {
.sort({ created: -1 })
.limit(1)
.exec(function(err1, items1) {
if (err1 || items1.length == 0){
if (err1 || items1.length == 0) {
cb(err1, null);
return;
};
}
self
.find(
{
@@ -134,12 +137,15 @@ AnalysisSchema.statics.usageStatistics = function(cb) {
}
)
.exec(function(err, items) {
client.set(self.collection.name + "_job_stats", JSON.stringify(items), (err, reply) => {});
client.set(
setup.database_name + "_" + self.collection.name + "_job_stats",
JSON.stringify(items),
(err, reply) => {}
);
cb(err, items);
});
});
};
});
});
};
/**
* unix timestamp
*/
@@ -153,6 +159,12 @@ AnalysisSchema.virtual("generic_error_msg").get(function() {
return error_msg;
});
AnalysisSchema.virtual("results_path").get(function() {
return path.resolve(
__dirname + "../../../results/jobs/" + this._id + "-results" + ".json"
);
});
AnalysisSchema.methods.resubscribe = function() {
var jobproxy = new hpcsocket.HPCSocket(
{
@@ -181,8 +193,7 @@ AnalysisSchema.methods.cancel = function(callback) {
};
AnalysisSchema.statics.cachePath = function() {
return this.collection.name + "_job_stats";
};
return setup.database_name + "_" + this.collection.name + "_job_stats";
};
module.exports = AnalysisSchema;
View
@@ -27,6 +27,10 @@ Busted.virtual("status_stack").get(function() {
return ["queue", "running", "completed"];
});
Busted.virtual("upload_redirect_path").get(function() {
return path.join("/busted/", String(this._id), "/select-foreground");
});
/**
* Complete file path for document's file upload
*/
View
@@ -37,7 +37,13 @@ FEL.virtual("filepath").get(function() {
* Original file path for document's file upload
*/
FEL.virtual("original_fn").get(function() {
return path.resolve(__dirname + "/../../uploads/msa/" + this._id + "-original." + this.original_extension);
return path.resolve(
__dirname +
"/../../uploads/msa/" +
this._id +
"-original." +
this.original_extension
);
});
/**
View
@@ -80,8 +80,6 @@ Flea.virtual("pdb_structure").get(function() {
return __dirname + "/../../public/assets/flea/pdbs/env_structure.pdb";
});
/**
* URL for a envmonkey path
*/
View
@@ -33,13 +33,12 @@ GARD.virtual("filepath").get(function() {
});
/**
* Result NEXUS file
* Result NEXUS file
*/
GARD.virtual("result_nexus_fn").get(function() {
return __dirname + "/../../uploads/msa/" + this._id + ".gard.result.nex";
});
/**
* Filename of document's file upload
*/
View
@@ -29,7 +29,8 @@ var error_codes = {
FAILED_ASSIGNMENT: 1
};
var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;
var Schema = mongoose.Schema,
ObjectId = Schema.ObjectId;
function notEmptyValidator(val) {
return val !== null;
@@ -107,7 +108,7 @@ var HivTrace = new Schema({
validate: [notEmptyValidator, "Ambiguity Handling field is empty"]
},
sequence_length: Number,
job_started : { type: Boolean, default:false },
job_started: { type: Boolean, default: false },
status_stack: Array,
status: {
type: String
@@ -208,29 +209,29 @@ HivTrace.virtual("analysistype").get(function() {
});
/**
* file path for aligned document
*/
* file path for aligned document
*/
HivTrace.virtual("aligned_fasta_fn").get(function() {
return __dirname + "/../../uploads/hivtrace/" + this._id + ".aligned.fa";
});
/**
* file path for trace results
*/
* file path for trace results
*/
HivTrace.virtual("trace_results").get(function() {
return __dirname + "/../../uploads/hivtrace/" + this._id + ".trace.json";
});
/**
* file path for trace results
*/
* file path for trace results
*/
HivTrace.virtual("rel_trace_results").get(function() {
return this._id + ".trace.json";
});
/**
* relative file path for aligned document
*/
* relative file path for aligned document
*/
HivTrace.virtual("rel_aligned_fasta_fn").get(function() {
return this._id + ".aligned.fa";
});
@@ -257,7 +258,7 @@ HivTrace.virtual("status_index").get(function() {
* Percentage of job complete
*/
HivTrace.virtual("percentage_complete").get(function() {
return (this.status_index + 1) / this.status_stack.length * 100 + "%";
return ((this.status_index + 1) / this.status_stack.length) * 100 + "%";
});
/**
@@ -275,7 +276,6 @@ HivTrace.virtual("url").get(function() {
});
HivTrace.methods.saveAttributes = function(cb) {
var self = this;
// Once annotations are configured, save the mapped attributes so that we
@@ -290,19 +290,16 @@ HivTrace.methods.saveAttributes = function(cb) {
});
var patient_attributes = _.map(headers, function(d) {
var attrs = d.split(delimiter);
var key_val = _.object(annotations, attrs);
key_val["header"] = d;
return key_val;
});
// save attributes for each patient
self.patient_attributes = patient_attributes;
cb(null, self);
};
HivTrace.methods.addAttributesToResults = function(cb) {
@@ -312,9 +309,9 @@ HivTrace.methods.addAttributesToResults = function(cb) {
var attr_keys = _.keys(attributes[0]);
var category_map = {
"categorical" : "String",
"individual" : "String",
"temporal" : "Date"
categorical: "String",
individual: "String",
temporal: "Date"
};
// transform attributes to be a dictionary
@@ -337,6 +334,7 @@ HivTrace.methods.addAttributesToResults = function(cb) {
// read from trace results
fs.readFile(self.trace_results, function(err, results) {
//fs.readFile(path.resolve(__dirname + "../../../results/jobs/" + this._id + "-results" + ".json"), function(err, results) {
if (err) {
cb(err, null);
return;
@@ -456,10 +454,10 @@ HivTrace.statics.usageStatistics = function(cb) {
.sort({ created: -1 })
.limit(1)
.exec(function(err1, items1) {
if (err1 || items1.length == 0){
if (err1 || items1.length == 0) {
cb(err1, null);
return;
};
}
self
.find(
{
Oops, something went wrong.

0 comments on commit c8269b4

Please sign in to comment.