Skip to content

Commit

Permalink
#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 574a0d3 commit 15f5d9a
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 128 deletions.
10 changes: 7 additions & 3 deletions app/models/meme.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ var MEME = mongoose.Schema({
results: Object,
resample: Number,
bootstrap: Boolean,
multiple_hits: String,
site_multihit: String,
rates: Number,
impute_states: String,
});

MEME.add(AnalysisSchema);
Expand Down Expand Up @@ -113,13 +117,13 @@ MEME.statics.spawn = function (fn, options, callback) {
logger.error(
"meme rename failed" +
" Errored on line 113~ within models/meme.js :: move_cb " +
err
err,
);
callback(err, null);
} else {
var move = Msa.removeTreeFromFile(
meme_result.filepath,
meme_result.filepath
meme_result.filepath,
);
move.then(
(val) => {
Expand All @@ -130,7 +134,7 @@ MEME.statics.spawn = function (fn, options, callback) {
},
(reason) => {
res.json(500, { error: "issue removing tree from file" });
}
},
);
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/routes/meme.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ exports.invoke = function (req, res) {
datatype: 0,
gencodeid: postdata.gencodeid,
mail: postdata.mail,
multiple_hits: postdata.multiple_hits,
site_multihit: postdata.site_multihit,
rates: parseInt(postdata.rates),
resample: parseInt(postdata.resample || 0),
impute_states: postdata.impute_states,
};

//// Check advanced options
Expand Down
2 changes: 1 addition & 1 deletion app/templates/meme/form.ejs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%- include("../includes/header.ejs") %>
<div id="container" class="container">
<%- include("header.ejs") %>
<%- include("../partials/msa/form.ejs") %>
<%- include("./msa_form.ejs") %>
<%- include("../includes/modal.ejs") %>
</div>
<%- include("../includes/footer.ejs") %>
243 changes: 119 additions & 124 deletions app/templates/meme/msa_form.ejs
Original file line number Diff line number Diff line change
@@ -1,136 +1,131 @@
<%- include("../includes/header.ejs") %>
<div id="container" class="container">
<%- include("header.ejs") %>

<!--
<div class="nav nav-list span4i">
<a href="/help" target="_blank"><span class="glyphicon glyphicon-info-sign"></span></a>
</div>
-->

<div class="row">

<form id="msa-form" class="form-horizontal upload-form col-12" name="uploadform" enctype="multipart/form-data" method="post" action=<%= post_to %>>

<div id="seq-file-div" class="upload-div">
<input id="seq-file" type="file" name="files">
<div id="file-progress" class="progress progress-striped active hidden">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="1" aria-valuemax="100">
<span class="sr-only">0% Complete</span>
</div>
</div>
</div>

<div class="upload-div">
<label id="geneticcode-content">Genetic Code<a href="/help#genetic-code" target="_blank"><sup>?</sup></a></label>
<select name="gencodeid">

<option value="0">
Universal code
</option>

<option value="1">
Vertebrate mitochondrial DNA code
</option>

<option value="2">
Yeast mitochondrial DNA code
</option>

<option value="3">
Mold, Protozoan and Coelenterate mt;
Mycloplasma/Spiroplasma
</option>

<option value="4">
Invertebrate mitochondrial DNA code
</option>

<option value="5">
Ciliate, Dasycladacean and Hexamita Nuclear code
</option>

<option value="6">
Echinoderm mitochondrial DNA code
</option>

<option value="7">
Euplotid Nuclear code
</option>

<option value="8">
Alternative Yeast Nuclear code
</option>

<option value="9">
Ascidian mitochondrial DNA code
</option>

<option value="10">
Flatworm mitochondrial DNA code
</option>

<option value="11">
Blepharisma Nuclear code
</option>

</select>
</div>

<div class="form-group <%if (typeof errors != "undefined" && typeof errors.mail != "undefined") { %>has-error<% } %>">
<label id="datatype-content">Notify When Completed</label>
<input name="mail" type="text" class="form-control" placeholder="Email Address">
</div><!-- /form-group -->

<div class="accordion" id="accordionExample">
<div class="card">
<div class="card-header" id="headingOne">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Advanced Options
</button>
</h5>
</div>

<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
<div class="card-body">
<div class="resample">
<p>[Advanced setting, will result in MUCH SLOWER run time] Perform parametric bootstrap resampling to derive site-level null LRT distributions up to this many replicates per site. Recommended use for small to medium (<30 sequences) datasets.</p>
<label>Resample?</label>
<input type="number" id="resample" name="resample" placeholder="50" min="0" max="1000">
</div>
<!--
<div class="nav nav-list span4i">
<a href="/help" target="_blank"><span class="glyphicon glyphicon-info-sign"></span></a>
</div>
-->

<div class="row">

<form id="msa-form" class="form-horizontal upload-form col-12" name="uploadform" enctype="multipart/form-data" method="post" action=<%= post_to %>>

<div id="seq-file-div" class="upload-div">
<input id="seq-file" type="file" name="files">
<div id="file-progress" class="progress progress-striped active hidden">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="1" aria-valuemax="100">
<span class="sr-only">0% Complete</span>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="upload-div">
<label id="geneticcode-content">Genetic Code<a href="/help#genetic-code" target="_blank"><sup>?</sup></a></label>
<select name="gencodeid">

<option value="0">
Universal code
</option>

<option value="1">
Vertebrate mitochondrial DNA code
</option>

<button id="submit-button" type="submit" class="dm-continue-btn btn float-right">
Run Analysis
<span class="fa fa-play"></span></button>
</button>
<option value="2">
Yeast mitochondrial DNA code
</option>

</form>
</div>
<option value="3">
Mold, Protozoan and Coelenterate mt;
Mycloplasma/Spiroplasma
</option>

</div>
<option value="4">
Invertebrate mitochondrial DNA code
</option>

<script src="/assets/js/msa/form.js"></script>
<option value="5">
Ciliate, Dasycladacean and Hexamita Nuclear code
</option>

<option value="6">
Echinoderm mitochondrial DNA code
</option>

<option value="7">
Euplotid Nuclear code
</option>

<div aria-labelledby="errorModalLabel" role="dialog" id="errorModal" class="modal ng-scope">
<div class="modal-dialog"><div class="modal-content">
<div class="modal-header dialog-header-error">
<button data-dismiss="modal" class="close" type="button">×</button>
<h4 class="modal-title text-danger"><span class="glyphicon glyphicon-warning-sign"></span> Error</h4>
</div>
<div id="modal-error-msg" class="modal-body text-danger">This is my error message</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-primary" type="button">Close</button>
</div>
<option value="8">
Alternative Yeast Nuclear code
</option>

<option value="9">
Ascidian mitochondrial DNA code
</option>

<option value="10">
Flatworm mitochondrial DNA code
</option>

<option value="11">
Blepharisma Nuclear code
</option>

</select>
</div>
</div>

<div class="upload-div">
<label for="multiple-hits">Multiple Hits</label>
<select name="multiple_hits" id="multiple-hits">
<option value="None">None</option>
<option value="Double">Double</option>
<option value="Double+Triple">Double+Triple</option>
</select>
</div>

<div class="upload-div">
<label for="site-multihit">Site Multihit</label>
<select name="site_multihit" id="site-multihit">
<option value="Estimate">Estimate</option>
<option value="Global">Global</option>
</select>
</div>

<div class="upload-div">
<label for="rates">Rates</label>
<select name="rates" id="rates">
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>

<div class="upload-div">
<label for="resample">Resample</label>
<input type="number" id="resample" name="resample" min="0" placeholder="0">
</div>

<div class="upload-div">
<label for="impute-states">Impute States</label>
<select name="impute_states" id="impute-states">
<option value="No">No</option>
<option value="Yes">Yes</option>
</select>
</div>

<div class="form-group <%if (typeof errors != "undefined" && typeof errors.mail != "undefined") { %>has-error<% } %>">
<label id="datatype-content">Notify When Completed</label>
<input name="mail" type="text" class="form-control" placeholder="Email Address">
</div><!-- /form-group -->

<button id="submit-button" type="submit" class="dm-continue-btn btn float-right">
Run Analysis
<span class="fa fa-play"></span></button>
</button>

</form>
</div>

<%- include("../includes/footer.ejs") %>
</div>

<script src="/assets/js/msa/form.js"></script>

0 comments on commit 15f5d9a

Please sign in to comment.