From 574a0d3d49693789a9f4249931e5867248a49343 Mon Sep 17 00:00:00 2001 From: Steven Weaver Date: Tue, 26 Nov 2024 14:19:46 -0800 Subject: [PATCH] veg/datamonkey-js#752 -- adding new fel options --- app/models/fel.js | 16 +++++++++++++--- app/routes/fel.js | 10 +++++++--- app/templates/fel/msa_form.ejs | 16 ++++++++++++++++ public/assets/js/fel/msa_form.js | 8 +++++--- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/app/models/fel.js b/app/models/fel.js index c4933642..9ec1e38a 100644 --- a/app/models/fel.js +++ b/app/models/fel.js @@ -15,6 +15,16 @@ var FEL = mongoose.Schema({ resample: Number, ci: Boolean, bootstrap: Boolean, + multiple_hits: { + type: String, + enum: ["None", "Double", "Double+Triple"], + default: "None", + }, + site_multihit: { + type: String, + enum: ["Estimate", "Global"], + default: "Estimate", + }, }); FEL.add(AnalysisSchema); @@ -47,7 +57,7 @@ FEL.virtual("original_fn").get(function () { "/../../uploads/msa/" + this._id + "-original." + - this.original_extension + this.original_extension, ); }); @@ -123,7 +133,7 @@ FEL.statics.spawn = function (fn, options, callback) { } else { var move = Msa.removeTreeFromFile( fel_result.filepath, - fel_result.filepath + fel_result.filepath, ); move.then( (val) => { @@ -137,7 +147,7 @@ FEL.statics.spawn = function (fn, options, callback) { }, (reason) => { callback(err, "issue removing tree from file"); - } + }, ); } } diff --git a/app/routes/fel.js b/app/routes/fel.js index cdd89c3f..711919f7 100644 --- a/app/routes/fel.js +++ b/app/routes/fel.js @@ -36,6 +36,8 @@ exports.uploadFile = function (req, res) { fel.original_extension = path.basename(fn).split(".")[1]; fel.mail = postdata.mail; fel.ci = postdata.confidence_interval == "true"; + fel.multiple_hits = postdata.multiple_hits; + fel.site_multihit = postdata.site_multihit; // Check advanced options if (!_.isNaN(resample)) { @@ -87,7 +89,7 @@ exports.uploadFile = function (req, res) { } else { var move = Msa.removeTreeFromFile( fel_result.filepath, - fel_result.filepath + fel_result.filepath, ); move.then( (val) => { @@ -98,7 +100,7 @@ exports.uploadFile = function (req, res) { }, (reason) => { res.json(500, { error: "issue removing tree from file" }); - } + }, ); } } @@ -116,7 +118,7 @@ exports.uploadFile = function (req, res) { helpers.moveSafely( req.files.files.file, fel_result.filepath, - move_cb + move_cb, ); }); }); @@ -148,6 +150,8 @@ exports.invoke = function (req, res) { // User Parameters fel.tagged_nwk_tree = postdata.nwk_tree; fel.analysis_type = postdata.analysis_type; + fel.multiple_hits = postdata.multiple_hits; // new + fel.site_multihit = postdata.site_multihit; // new fel.status = fel.status_stack[0]; fel.save(function (err, result) { diff --git a/app/templates/fel/msa_form.ejs b/app/templates/fel/msa_form.ejs index 550d3e37..8d5eacac 100644 --- a/app/templates/fel/msa_form.ejs +++ b/app/templates/fel/msa_form.ejs @@ -88,6 +88,22 @@ +
+ + +
+ +
+ + +
has-error<% } %>"> diff --git a/public/assets/js/fel/msa_form.js b/public/assets/js/fel/msa_form.js index c19ec83c..593bc1ac 100644 --- a/public/assets/js/fel/msa_form.js +++ b/public/assets/js/fel/msa_form.js @@ -13,17 +13,19 @@ $(function () { formData.append("gencodeid", $("select[name='gencodeid']").val()); formData.append("ds_variation", $("#ds-variation").val()); formData.append("resample", $("#resample").val()); + formData.append("multiple_hits", $("select[name='multiple_hits']").val()); + formData.append("site_multihit", $("select[name='site_multihit']").val()); formData.append( "receive_mail", - $("input[name='receive_mail']").prop("checked") + $("input[name='receive_mail']").prop("checked"), ); formData.append("mail", $("input[name='mail']").val()); formData.append( "confidence_interval", - $("input[name='confidence-interval']").prop("checked") + $("input[name='confidence-interval']").prop("checked"), ); var action_url = $("#msa-form").attr("action"); @@ -64,7 +66,7 @@ $(function () { window.location.href = result.upload_redirect_path; } else { $("#modal-error-msg").text( - "We received data in an unexpected format from the server." + "We received data in an unexpected format from the server.", ); $("#errorModal").modal(); $("#file-progress").css("display", "none");