Skip to content

Commit beb73ca

Browse files
committed
2 parents 80f3745 + 69021d6 commit beb73ca

File tree

7 files changed

+69
-61
lines changed

7 files changed

+69
-61
lines changed

dist/UI/UI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ class fluxGraph {
994994
// this.chart.toBase64Image();
995995
//}
996996
},
997-
responsiveAnimationDuration: 0,
997+
responsiveAnimationDuration: 0, // animation duration after a resize
998998
responsive: true,
999999
title: {
10001000
display: true,

dist/file_handling/order_parameter_selector.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ let loadHyperSelector = () => {
5858
// mode:"dataset", // it is possible to remove the line view from the plot
5959
// intersect:true // on hover, but i find it to distracting
6060
},
61-
responsiveAnimationDuration: 0,
61+
responsiveAnimationDuration: 0, // animation duration after a resize
6262
scales: {
6363
xAxes: [{ display: true, scaleLabel: { display: true, labelString: 'Time' }, gridLines: { drawOnChartArea: false } }],
6464
yAxes: [{ display: true, gridLines: { drawOnChartArea: false } }],
6565
},
66-
spanGaps: true,
66+
spanGaps: true, // handle null in the chart data
6767
annotation: {
6868
events: ["click"],
6969
annotations: [
@@ -143,7 +143,7 @@ let handleParameterDrop = (files) => {
143143
else {
144144
console.log("adding new axis");
145145
myChart.options.scales.yAxes.push({
146-
type: 'linear',
146+
type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance
147147
display: true,
148148
position: 'left',
149149
id: `y-axis-id${axis_counter}`,
@@ -159,7 +159,7 @@ let handleParameterDrop = (files) => {
159159
labels: labels,
160160
datasets: [
161161
{
162-
label: parameter_name,
162+
label: parameter_name, //files[0].name.split(".")[0],
163163
data: data,
164164
fill: false,
165165
borderColor: chartColorMap.get(),
@@ -170,7 +170,7 @@ let handleParameterDrop = (files) => {
170170
}
171171
else {
172172
myChart.data.datasets.push({
173-
label: parameter_name,
173+
label: parameter_name, //files[i].name.split(".")[0],
174174
data: data,
175175
fill: false,
176176
borderColor: chartColorMap.get(),

dist/file_handling/output_file.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ function getNewIds(useNew = false) {
128128
});
129129
// these subtypes are not implemented in the CG-oxDNA model, just used for a 'relative' subtype that oxDNA will take as input
130130
let gsSubtypes = {
131-
subtypelist: [],
132-
masses: [],
133-
radii: [],
131+
subtypelist: [], // per particle subtype assignment
132+
masses: [], //
133+
radii: [], //
134134
subtype: -1
135135
};
136136
// Next, generic sphere objects
@@ -477,9 +477,9 @@ function makeUNFOutput(name) {
477477
let naStrandsSchema = {
478478
"id": strand.id,
479479
"name": strand.label,
480-
"isScaffold": strand.getLength() > 1000 ? true : false,
481-
"naType": strand.end5.isDNA() ? "DNA" : "RNA",
482-
"color": strand.end5.color ? '#'.concat(strand.end5.color.getHexString()) : '',
480+
"isScaffold": strand.getLength() > 1000 ? true : false, //entirely arbitrary, but generally right.
481+
"naType": strand.end5.isDNA() ? "DNA" : "RNA", // Nucleotide type is actually pretty poorly defined in oxView, so this is the best I can do
482+
"color": strand.end5.color ? '#'.concat(strand.end5.color.getHexString()) : '', // OxView defines colors on a per-nucleotide level while UNF defines it at the strand level.
483483
"fivePrimeId": strand.end5.id,
484484
"threePrimeId": strand.end3.id,
485485
"pdbFileId": 0,
@@ -504,7 +504,7 @@ function makeUNFOutput(name) {
504504
let aaChainSchema = {
505505
"id": strand.id,
506506
"chainName": strand.label,
507-
"color": strand.end5.color ? '#'.concat(strand.end5.color.getHexString()) : '',
507+
"color": strand.end5.color ? '#'.concat(strand.end5.color.getHexString()) : '', // OxView defines colors on a per-nucleotide level while UNF defines it at the strand level.
508508
"pdbFileId": 0,
509509
"nTerm": strand.end5.id,
510510
"cTerm": strand.end3.id,

dist/file_handling/pdb_worker.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,48 +20,48 @@ this.onmessage = function (e) {
2020
postMessage(ret, undefined);
2121
};
2222
var backboneColors = [
23-
new THREE.Color(0xfdd291),
24-
new THREE.Color(0xffb322),
25-
new THREE.Color(0x437092),
23+
new THREE.Color(0xfdd291), //light yellow
24+
new THREE.Color(0xffb322), //goldenrod
25+
new THREE.Color(0x437092), //dark blue
2626
new THREE.Color(0x6ea4cc), //light blue
2727
];
2828
var nucleosideColors = [
29-
new THREE.Color(0x4747B8),
30-
new THREE.Color(0xFFFF33),
29+
new THREE.Color(0x4747B8), //A or K; Royal Blue
30+
new THREE.Color(0xFFFF33), //G or C; Medium Yellow
3131
//C or A
32-
new THREE.Color(0x8CFF8C),
32+
new THREE.Color(0x8CFF8C), //Medium green
3333
//T/U or T
34-
new THREE.Color(0xFF3333),
34+
new THREE.Color(0xFF3333), //Red
3535
//E
36-
new THREE.Color(0x660000),
36+
new THREE.Color(0x660000), //Dark Brown
3737
//S
38-
new THREE.Color(0xFF7042),
38+
new THREE.Color(0xFF7042), //Medium Orange
3939
//D
40-
new THREE.Color(0xA00042),
40+
new THREE.Color(0xA00042), //Dark Rose
4141
//N
42-
new THREE.Color(0xFF7C70),
42+
new THREE.Color(0xFF7C70), //Light Salmon
4343
//Q
44-
new THREE.Color(0xFF4C4C),
44+
new THREE.Color(0xFF4C4C), //Dark Salmon
4545
//H
46-
new THREE.Color(0x7070FF),
46+
new THREE.Color(0x7070FF), //Medium Blue
4747
//G
48-
new THREE.Color(0xEBEBEB),
48+
new THREE.Color(0xEBEBEB), // light GREY
4949
//P
50-
new THREE.Color(0x525252),
50+
new THREE.Color(0x525252), //Dark Grey
5151
//R
52-
new THREE.Color(0x00007C),
52+
new THREE.Color(0x00007C), //Dark Blue
5353
//V
54-
new THREE.Color(0x5E005E),
54+
new THREE.Color(0x5E005E), //Dark Purple
5555
//I
56-
new THREE.Color(0x004C00),
56+
new THREE.Color(0x004C00), //Dark Green
5757
//L
58-
new THREE.Color(0x455E45),
58+
new THREE.Color(0x455E45), //Olive Green
5959
//M
60-
new THREE.Color(0xB8A042),
60+
new THREE.Color(0xB8A042), //Light Brown
6161
//F
62-
new THREE.Color(0x534C42),
62+
new THREE.Color(0x534C42), //Olive Grey
6363
//Y
64-
new THREE.Color(0x8C704C),
64+
new THREE.Color(0x8C704C), //Medium Brown
6565
//W
6666
new THREE.Color(0x4F4600), //Olive Brown
6767
];

dist/model/RNA.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ class RNANucleotide extends Nucleotide {
4545
// Current nucleotide information
4646
const oldA1 = this.getA1();
4747
const oldA3 = this.getA3();
48-
// You can define the helix axis based on a1 and a3. This is the inverse of how a3 is assigned below.
49-
dir = (oldA3.clone().sub(oldA1.clone().multiplyScalar(Math.sin(inclination))).divideScalar(-(Math.cos(inclination) - Math.pow(Math.sin(inclination), 2))));
48+
// You can define the helix axis based on a1 and a3.
49+
// The helix direction is the inverse of the normal vector a3 ajusted for the inclination.
50+
let normA1A3 = oldA1.clone().cross(oldA3); // normal vector to the plane defined by a1 and a3
51+
let q_dir = new THREE.Quaternion(); // quaternion to rotate a3 to the correct orientation
52+
q_dir.setFromAxisAngle(normA1A3, inclination); // rotate a3 to
53+
let dir = oldA3.clone().applyQuaternion(q_dir).multiplyScalar(-1);
5054
dir.normalize();
5155
// Correctly orient the helix for the direction you're going
5256
if (direction == "n5") {

dist/scene/mesh_setup.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,49 +38,49 @@ function switchMaterial(material) {
3838
}
3939
// Default colors for the backbones
4040
var backboneColors = [
41-
new THREE.Color(0xfdd291),
42-
new THREE.Color(0xffb322),
43-
new THREE.Color(0x437092),
41+
new THREE.Color(0xfdd291), //light yellow
42+
new THREE.Color(0xffb322), //goldenrod
43+
new THREE.Color(0x437092), //dark blue
4444
new THREE.Color(0x6ea4cc), //light blue
4545
];
4646
// define nucleoside colors
4747
var nucleosideColors = [
48-
new THREE.Color(0x4747B8),
49-
new THREE.Color(0xFFFF33),
48+
new THREE.Color(0x4747B8), //A or K; Royal Blue
49+
new THREE.Color(0xFFFF33), //G or C; Medium Yellow
5050
//C or A
51-
new THREE.Color(0x8CFF8C),
51+
new THREE.Color(0x8CFF8C), //Medium green
5252
//T/U or T
53-
new THREE.Color(0xFF3333),
53+
new THREE.Color(0xFF3333), //Red
5454
//E
55-
new THREE.Color(0x660000),
55+
new THREE.Color(0x660000), //Dark Brown
5656
//S
57-
new THREE.Color(0xFF7042),
57+
new THREE.Color(0xFF7042), //Medium Orange
5858
//D
59-
new THREE.Color(0xA00042),
59+
new THREE.Color(0xA00042), //Dark Rose
6060
//N
61-
new THREE.Color(0xFF7C70),
61+
new THREE.Color(0xFF7C70), //Light Salmon
6262
//Q
63-
new THREE.Color(0xFF4C4C),
63+
new THREE.Color(0xFF4C4C), //Dark Salmon
6464
//H
65-
new THREE.Color(0x7070FF),
65+
new THREE.Color(0x7070FF), //Medium Blue
6666
//G
67-
new THREE.Color(0xEBEBEB),
67+
new THREE.Color(0xEBEBEB), // light GREY
6868
//P
69-
new THREE.Color(0x525252),
69+
new THREE.Color(0x525252), //Dark Grey
7070
//R
71-
new THREE.Color(0x00007C),
71+
new THREE.Color(0x00007C), //Dark Blue
7272
//V
73-
new THREE.Color(0x5E005E),
73+
new THREE.Color(0x5E005E), //Dark Purple
7474
//I
75-
new THREE.Color(0x004C00),
75+
new THREE.Color(0x004C00), //Dark Green
7676
//L
77-
new THREE.Color(0x455E45),
77+
new THREE.Color(0x455E45), //Olive Green
7878
//M
79-
new THREE.Color(0xB8A042),
79+
new THREE.Color(0xB8A042), //Light Brown
8080
//F
81-
new THREE.Color(0x534C42),
81+
new THREE.Color(0x534C42), //Olive Grey
8282
//Y
83-
new THREE.Color(0x8C704C),
83+
new THREE.Color(0x8C704C), //Medium Brown
8484
//W
8585
new THREE.Color(0x4F4600), //Olive Brown
8686
];

ts/model/RNA.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,12 @@ class RNANucleotide extends Nucleotide {
5555
const oldA1 = this.getA1();
5656
const oldA3 = this.getA3();
5757

58-
// You can define the helix axis based on a1 and a3. This is the inverse of how a3 is assigned below.
59-
dir = (oldA3.clone().sub(oldA1.clone().multiplyScalar(Math.sin(inclination))).divideScalar(-(Math.cos(inclination) - Math.pow(Math.sin(inclination),2))));
58+
// You can define the helix axis based on a1 and a3.
59+
// The helix direction is the inverse of the normal vector a3 ajusted for the inclination.
60+
let normA1A3 = oldA1.clone().cross(oldA3); // normal vector to the plane defined by a1 and a3
61+
let q_dir = new THREE.Quaternion(); // quaternion to rotate a3 to the correct orientation
62+
q_dir.setFromAxisAngle(normA1A3, inclination); // rotate a3 to
63+
let dir = oldA3.clone().applyQuaternion(q_dir).multiplyScalar(-1);
6064
dir.normalize();
6165

6266
// Correctly orient the helix for the direction you're going

0 commit comments

Comments
 (0)