-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
71 lines (65 loc) · 2.7 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
Adds elements to front page of TreeN93 site.
Descriptions of the project and what it can be used for.
And links to the different parts.
*/
/*
create divs and add them to page
*/
var titleDiv = document.createElement("div");
var buildDiv = document.createElement("div");
var vizDiv = document.createElement("div");
var noteDiv = document.createElement("div");
var elementsList = [titleDiv, document.createElement("hr"), buildDiv, document.createElement("hr"), vizDiv, document.createElement("hr"), noteDiv];
for (var element of elementsList){
document.body.appendChild(element);
}
/*
add content to title div
*/
var titleP = document.createElement("p");
titleP.innerHTML = "Welcome to TreeN93<br><br>TreeN93 is a website for building \
and visualizing single-linkage hierarchical clustering trees of viral sequences \
based on pairwise distances between the sequences and a user-chosen clustering \
threshold<br>View the code at \
<a target='_blank' href='https://github.com/Niema-Lab/TreeN93'>\
https://github.com/Niema-Lab/TreeN93</a><br>";
titleDiv.appendChild(titleP);
/*
add content to build div
*/
var buildP = document.createElement("p");
buildP.innerHTML = "TreeN93 Build<br><br>A tool to build a tree from pairwise \
TN93 distances between leaf nodes, and to save the tree in the Newick file \
format<br>Use the site at \
<a target='_blank' href='https://niema-lab.github.io/TreeN93/Build/'>\
https://niema-lab.github.io/TreeN93/Build/</a><br>";
buildDiv.appendChild(buildP);
/*
add content to viz div
*/
var vizP = document.createElement("p");
vizP.innerHTML = "TreeN93 Viz<br><br>A tool to visualize clusters on the tree \
from a user-inputted distance threshold, and to find the minimum, threshold that \
yields the maximum number of clusters<br>Use the site at \
<a target='_blank' href='https://niema-lab.github.io/TreeN93/Viz/'>\
https://niema-lab.github.io/TreeN93/Viz/</a><br>";
vizDiv.appendChild(vizP);
/*
add content to note div
*/
var noteP = document.createElement("p");
noteP.innerHTML = "Note: All computations performed by TreeN93 are done in the user's \
browser. Thus, TreeN93's ability to operate on large data sets is limited by the \
available memory of the user's browser. If too large of a file is given as an \
input for TreeN93, the computations may fail and the desired results on the \
webpage may not appear. To perform clustering on larger data sets, download the \
Python code and run it locally <a target='_blank' href='https://github.com/Niema-Lab/TreeN93/tree/master/Python'>https://github.com/Niema-Lab/TreeN93/tree/master/Python</a>";
noteDiv.appendChild(noteP);
/*
add margins to everything
*/
for (var element of elementsList){
element.style["margin-left"] = "10%";
element.style["margin-right"] = "10%";
}