Skip to content

Commit 6c9f3fc

Browse files
authored
Merge pull request #260 from veg/develop
Develop
2 parents 298a3d7 + e8ea20a commit 6c9f3fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+1987
-340
lines changed

.babelrc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"plugins": [
3+
"@babel/plugin-proposal-class-properties"
4+
],
5+
"presets": [
6+
"@babel/preset-env",
7+
"@babel/preset-react"
8+
],
9+
"env": {
10+
"start": {
11+
"presets": [
12+
"@babel/preset-env"
13+
]
14+
}
15+
}
16+
}

AUTHORS

-3
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ datamonkey-js
44
INSTALL
55
===========================
66
## System Dependencies
7-
* node >= 12
7+
* node >= 14
88
* mongodb-server
99
* redis
1010

app/models/contrast-fel.js

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
var mongoose = require("mongoose"),
2+
extend = require("mongoose-schema-extend"),
3+
path = require("path"),
4+
Msa = require(__dirname + "/msa");
5+
6+
var AnalysisSchema = require(__dirname + "/analysis");
7+
8+
var ContrastFEL = AnalysisSchema.extend({
9+
tagged_nwk_tree: String,
10+
analysis_type: Number,
11+
original_extension: String,
12+
last_status_msg: String,
13+
branch_sets: [String],
14+
results: Object,
15+
ds_variation: Number
16+
});
17+
18+
ContrastFEL.virtual("pmid").get(function() {
19+
return "22807683";
20+
});
21+
22+
ContrastFEL.virtual("analysistype").get(function() {
23+
return "cfel";
24+
});
25+
26+
ContrastFEL.virtual("upload_redirect_path").get(function() {
27+
return path.join("/contrast_fel/", String(this._id), "/select-foreground");
28+
});
29+
30+
/**
31+
* Complete file path for document's file upload
32+
*/
33+
ContrastFEL.virtual("filepath").get(function() {
34+
return path.join(__dirname, "/../../uploads/msa/", this._id + ".fasta");
35+
});
36+
37+
/**
38+
* Original file path for document's file upload
39+
*/
40+
ContrastFEL.virtual("original_fn").get(function() {
41+
return path.resolve(
42+
__dirname +
43+
"/../../uploads/msa/" +
44+
this._id +
45+
"-original." +
46+
this.original_extension
47+
);
48+
});
49+
50+
/**
51+
* Filename of document's file upload
52+
*/
53+
ContrastFEL.virtual("status_stack").get(function() {
54+
return ["queue", "running", "completed"];
55+
});
56+
57+
/**
58+
* URL for a busted path
59+
*/
60+
ContrastFEL.virtual("url").get(function() {
61+
return "http://" + setup.host + "/contrast_fel/" + this._id;
62+
});
63+
64+
module.exports = mongoose.model("ContrastFEL", ContrastFEL);

app/models/gard.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ GARD.virtual("status_stack").get(function() {
4747
});
4848

4949
/**
50-
* URL for a busted path
50+
* URL for GARD path
5151
*/
5252
GARD.virtual("url").get(function() {
5353
return "http://" + setup.host + "/gard/" + this._id;

app/models/hivtrace.js

-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ path = require("path");
55
var mongoose = require("mongoose"),
66
moment = require("moment"),
77
d3 = require("d3"),
8-
check = require("validator").check,
98
globals = require("../../config/globals.js"),
10-
sanitize = require("validator").sanitize,
119
fs = require("fs"),
1210
readline = require("readline"),
1311
spawn = require("child_process").spawn,

app/models/msa.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
var mongoose = require("mongoose"),
22
moment = require("moment"),
3-
check = require("validator").check,
43
globals = require("../../config/globals.js"),
54
spawn = require("child_process").spawn,
6-
sanitize = require("validator").sanitize,
75
fs = require("fs"),
86
winston = require("winston"),
97
_ = require("lodash"),
@@ -66,7 +64,6 @@ var Msa = new Schema({
6664
visit_code: String,
6765
visit_date: Date,
6866
original_filename: String,
69-
mailaddr: String,
7067
created: {
7168
type: Date,
7269
default: Date.now
@@ -193,16 +190,6 @@ Msa.statics.deliverFasta = function(filepath) {
193190

194191
var MsaModel = mongoose.model("MsaModel", Msa);
195192

196-
MsaModel.schema.path("mailaddr").validate(function(value) {
197-
if (value) {
198-
check(value)
199-
.len(6, 64)
200-
.isEmail();
201-
} else {
202-
return true;
203-
}
204-
}, "Invalid email");
205-
206193
Msa.methods.AnalysisCount = function(cb) {
207194
var type_counts = {};
208195
var c = 0;
@@ -397,7 +384,7 @@ Msa.statics.parseFile = function(fn, datatype, gencodeid, cb) {
397384
msa.gencodeid = file_info.gencodeid;
398385
msa.sites = file_info.sites;
399386
msa.sequences = file_info.sequences;
400-
msa.timestamp = file_info.timestamp;
387+
msa.timestamp = _.trim(file_info.timestamp);
401388
msa.goodtree = file_info.goodtree;
402389
msa.nj = file_info.nj;
403390
msa.usertree = fpi[0].usertree;

app/models/multihit.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
var mongoose = require("mongoose"),
2+
extend = require("mongoose-schema-extend"),
3+
winston = require("winston"),
4+
path = require("path"),
5+
Msa = require(__dirname + "/msa");
6+
7+
var AnalysisSchema = require(__dirname + "/analysis");
8+
9+
var MULTIHIT = AnalysisSchema.extend({
10+
last_status_msg: String,
11+
results: Object,
12+
triple_islands: String,
13+
rate_classes: Number
14+
});
15+
16+
MULTIHIT.virtual("analysistype").get(function() {
17+
return "multihit";
18+
});
19+
20+
MULTIHIT.virtual("pmid").get(function() {
21+
return "TBD";
22+
});
23+
24+
/**
25+
* Filename of document's file upload
26+
*/
27+
MULTIHIT.virtual("status_stack").get(function() {
28+
return ["queue", "running", "completed"];
29+
});
30+
31+
MULTIHIT.virtual("upload_redirect_path").get(function() {
32+
return path.join("/multihit/", String(this._id));
33+
});
34+
35+
/**
36+
* Complete file path for document's file upload
37+
*/
38+
MULTIHIT.virtual("filepath").get(function() {
39+
return path.resolve(__dirname + "/../../uploads/msa/" + this._id + ".fasta");
40+
});
41+
42+
/**
43+
* URL for a multihit path
44+
*/
45+
MULTIHIT.virtual("url").get(function() {
46+
return "http://" + setup.host + "/multihit/" + this._id;
47+
});
48+
49+
module.exports = mongoose.model("MULTIHIT", MULTIHIT);

app/routes/analysis.js

+3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ var mongoose = require("mongoose"),
1111
Sequences = mongoose.model("Sequences"),
1212
PartitionInfo = mongoose.model("PartitionInfo"),
1313
FEL = mongoose.model("FEL"),
14+
ContrastFEL = mongoose.model("ContrastFEL"),
1415
aBSREL = mongoose.model("aBSREL"),
1516
Busted = mongoose.model("Busted"),
1617
FUBAR = mongoose.model("FUBAR"),
1718
GARD = mongoose.model("GARD"),
1819
MEME = mongoose.model("MEME"),
20+
MULTIHIT = mongoose.model("MULTIHIT"),
1921
Relax = mongoose.model("Relax"),
2022
HivTrace = mongoose.model("HivTrace"),
2123
Fade = mongoose.model("Fade"),
@@ -40,6 +42,7 @@ exports.getInfo = function(model_up, req, res) {
4042
};
4143

4244
exports.getResults = function(model_up, req, res) {
45+
4346
model_up.findOne({ _id: req.params.id }, function(err, model_var) {
4447
if (err || !model_var) {
4548
res.json(500, error.errorResponse("invalid id : " + req.params.id));

0 commit comments

Comments
 (0)