+
+
+ Current site:
+ this.handleInputChange(e)}
+ ref={input => {
+ this.numberInput = input;
+ }}
+ style={{ width: 50 }}
+ />
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+BUSTEDAlignmentTreeERWidget.defaultProps = {
+ site_size: 20
+};
+
class BUSTEDContents extends React.Component {
constructor(props) {
super(props);
@@ -789,6 +1154,7 @@ class BUSTEDContents extends React.Component {
fits: null,
input_data: null,
json: null,
+ numberOfSites: null,
tree_settings: tree_settings,
colorGradient: ["#00a99d", "#000000"],
grayScaleGradient: ["#444444", "#000000"]
@@ -841,10 +1207,17 @@ class BUSTEDContents extends React.Component {
] = this.formatBranchAnnotations(data);
}
+ const srv = _.pluck(
+ _.pluck(_.values(data.fits), "Rate Distributions"),
+ "Synonymous site-to-site rates"
+ ).some(x => x);
+
this.setState({
p: data["test results"]["p-value"],
+ srv: srv,
input_data: data["input"],
fits: data["fits"],
+ numberOfSites: data.input["number of sites"],
omegas: formatted_omegas,
json: data,
evidence_ratio_data: _.isEmpty(data["Evidence Ratios"])
@@ -888,13 +1261,15 @@ class BUSTEDContents extends React.Component {
getSummaryForRendering = () => {
var significant = this.state.p < 0.05,
+ srv_suffix = this.state.srv ? "" : "out",
message;
if (significant) {
message = (
@@ -947,7 +1326,11 @@ class BUSTEDContents extends React.Component {
-
+
This table reports a statistical summary of the models fit to the
data. Here, Unconstrained model refers to the
@@ -973,6 +1356,26 @@ class BUSTEDContents extends React.Component {
/>
+
+ {self.props.fasta ? (
+
+
+ Compare (possibility distant) sites with sequence and phylogentic information.Add or remove sites with the corresponding buttons."
+ }
+ />
+
+
+
+ ) : null}
);
}
@@ -986,7 +1389,9 @@ function BUSTED(props) {
{ label: "summary", href: "summary-div" },
{ label: "model statistics", href: "hyphy-model-fits" },
{ label: "tree", href: "phylogenetic-tree" }
- ]}
+ ].concat(
+ props.fasta ? { label: "phylo alignment", href: "phylo-alignment" } : []
+ )}
methodName="Branch-site Unrestricted Statistical Test for Episodic Diversification"
fasta={props.fasta}
originalFile={props.originalFile}
diff --git a/src/jsx/components/branch_table.jsx b/src/jsx/components/branch_table.jsx
index bf732439..6e44937d 100644
--- a/src/jsx/components/branch_table.jsx
+++ b/src/jsx/components/branch_table.jsx
@@ -1,7 +1,8 @@
-var React = require("react");
+var React = require("react"),
+ createReactClass = require("create-react-class");
import { PropChart } from "./prop_chart.jsx";
-var BranchTable = React.createClass({
+var BranchTable = createReactClass({
getInitialState: function() {
// add the following
var table_row_data = this.getBranchRows(
diff --git a/src/jsx/components/input_info.jsx b/src/jsx/components/input_info.jsx
index b61780d3..19789817 100644
--- a/src/jsx/components/input_info.jsx
+++ b/src/jsx/components/input_info.jsx
@@ -68,35 +68,27 @@ class InputInfo extends React.Component {
className="dropdown-menu"
aria-labelledby="dropdown-menu-button"
>
- {this.props.originalFile
- ? [
-
-
- Original file
-
-
- ]
- : null}
- {this.props.analysisLog
- ? [
-
-
- Analysis log
-
-
- ]
- : null}
- {this.props.fasta
- ? [
-
- this.open("msa")}>View MSA
-
- ]
- : null}
+ {this.props.originalFile ? (
+
+
+ Original file
+
+
+ ) : null}
+ {this.props.analysisLog ? (
+
+ Analysis log
+
+ ) : null}
+ {this.props.fasta ? (
+
+ this.open("msa")}>View MSA
+
+ ) : null}
{this.props.partitionedData ? (
diff --git a/src/jsx/components/model_fits.jsx b/src/jsx/components/model_fits.jsx
index 64cb1ae7..55ab0328 100644
--- a/src/jsx/components/model_fits.jsx
+++ b/src/jsx/components/model_fits.jsx
@@ -1,6 +1,7 @@
-var React = require("react");
+var React = require("react"),
+ createReactClass = require("create-react-class");
-var ModelFits = React.createClass({
+var ModelFits = createReactClass({
getInitialState: function() {
var table_row_data = this.getModelRows(this.props.json),
table_columns = this.getModelColumns(table_row_data);
diff --git a/src/jsx/components/navbar.jsx b/src/jsx/components/navbar.jsx
index 046b5e15..9220c39b 100644
--- a/src/jsx/components/navbar.jsx
+++ b/src/jsx/components/navbar.jsx
@@ -1,10 +1,11 @@
-var React = require("react");
+var React = require("react"),
+ createReactClass = require("create-react-class");
import { Link } from "react-router-dom";
const hyphy_logo = require("../../../images/hyphy-logo.svg");
// eslint-disable-next-line
-var Hamburger = React.createClass({
+var Hamburger = createReactClass({
render: function() {
return (
{React.createElement(this.props.children, {
- json: this.state.json
+ json: this.state.json,
+ fasta: this.props.fasta
})}
diff --git a/src/jsx/components/tables.jsx b/src/jsx/components/tables.jsx
index 4098bab6..e1c67544 100644
--- a/src/jsx/components/tables.jsx
+++ b/src/jsx/components/tables.jsx
@@ -1,4 +1,5 @@
var React = require("react"),
+ createReactClass = require("create-react-class"),
_ = require("underscore"),
d3 = require("d3"),
datamonkey = require("../../datamonkey/datamonkey.js");
@@ -6,7 +7,7 @@ import CsvExport from "csvexport";
import PropTypes from "prop-types";
-const DatamonkeyTableRow = React.createClass({
+const DatamonkeyTableRow = createReactClass({
/**
A single table row
@@ -288,7 +289,7 @@ const DatamonkeyTableRow = React.createClass({
}
});
-var DatamonkeyTable = React.createClass({
+var DatamonkeyTable = createReactClass({
/**
* A table composed of rows
* @param *headerData* -- an array of cells (see DatamonkeyTableRow) to render as the header
@@ -610,7 +611,7 @@ var DatamonkeyTable = React.createClass({
}
});
-var DatamonkeyRateDistributionTable = React.createClass({
+var DatamonkeyRateDistributionTable = createReactClass({
/** render a rate distribution table from JSON formatted like this
{
"non-synonymous/synonymous rate ratio for *background*":[ // name of distribution
@@ -664,7 +665,7 @@ var DatamonkeyRateDistributionTable = React.createClass({
}
});
-var DatamonkeyPartitionTable = React.createClass({
+var DatamonkeyPartitionTable = createReactClass({
dm_formatterFloat: d3.format(".3r"),
dm_formatterProp: d3.format(".3p"),
@@ -860,7 +861,7 @@ var DatamonkeyPartitionTable = React.createClass({
}
});
-var DatamonkeyModelTable = React.createClass({
+var DatamonkeyModelTable = createReactClass({
// render a model fit table from a JSON object with entries like this
// "Global MG94xREV":{ model name
// "log likelihood":-5453.527975908821,
@@ -1062,7 +1063,7 @@ var DatamonkeyModelTable = React.createClass({
}
});
-var DatamonkeyTimersTable = React.createClass({
+var DatamonkeyTimersTable = createReactClass({
dm_percentageFormatter: d3.format(".2%"),
propTypes: {
diff --git a/src/jsx/components/tree.jsx b/src/jsx/components/tree.jsx
index c6ea4ace..702ae8da 100644
--- a/src/jsx/components/tree.jsx
+++ b/src/jsx/components/tree.jsx
@@ -1,4 +1,5 @@
-var React = require("react");
+var React = require("react"),
+ createReactClass = require("create-react-class");
var download = require("in-browser-download");
var d3_save_svg = require("d3-save-svg");
@@ -7,7 +8,7 @@ import { saveSvgAsPng } from "save-svg-as-png";
require("phylotree");
require("phylotree.css");
-var Tree = React.createClass({
+var Tree = createReactClass({
getDefaultProps: function() {
return {
color_gradient: ["#5e4fa2", "#3288bd", "#e6f598", "#f46d43", "#9e0142"],
@@ -251,8 +252,7 @@ var Tree = React.createClass({
}
// clear existing linearGradients
- d3
- .selectAll(".legend-definitions")
+ d3.selectAll(".legend-definitions")
.selectAll("linearGradient")
.remove();
d3.selectAll("#color-legend").remove();
@@ -655,8 +655,7 @@ var Tree = React.createClass({
});
this.assignBranchAnnotations();
- d3
- .select("#dm-phylotree")
+ d3.select("#dm-phylotree")
.append("rect")
.attr("width", "100%")
.attr("height", "100%")
@@ -843,7 +842,8 @@ var Tree = React.createClass({
autoComplete="off"
checked=""
title="Layout left-to-right"
- />Linear
+ />
+ Linear