Skip to content

Commit

Permalink
0.7.15
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsmirnov committed Mar 26, 2018
1 parent e89f316 commit 15ba4f7
Show file tree
Hide file tree
Showing 9 changed files with 76,537 additions and 76,504 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.7.15] - 2018-03-26
### Fixed
- Fix a crash when a non-integer unit index is set.
- Fix message about current unit after try to change.
- Use default gradient color for the case of no temperature/occupancy.
- Use average temperature and occupancy for residue coloring.
- Use `groupId` as a sequence index for MMTF.

## [0.7.14] - 2018-03-12
### Added
- Add GitHub and EPAM urls to the demo app menu.
Expand Down Expand Up @@ -233,7 +241,8 @@ in [0.7.7+hotfix] and later releases.
- Update dependencies to the latest supported versions.
- Move the project to GitHub.

[Unreleased]: https://github.com/epam/miew/compare/v0.7.14...HEAD
[Unreleased]: https://github.com/epam/miew/compare/v0.7.15...HEAD
[0.7.15]: https://github.com/epam/miew/compare/v0.7.14...v0.7.15
[0.7.14]: https://github.com/epam/miew/compare/v0.7.13...v0.7.14
[0.7.13]: https://github.com/epam/miew/compare/v0.7.12...v0.7.13
[0.7.12]: https://github.com/epam/miew/compare/v0.7.11...v0.7.12
Expand Down
152,908 changes: 76,460 additions & 76,448 deletions dist/Miew.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/Miew.js.map

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dist/Miew.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/Miew.min.js.map

Large diffs are not rendered by default.

96 changes: 54 additions & 42 deletions dist/Miew.module.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** Miew - 3D Molecular Viewer v0.7.14 Copyright (c) 2015-2018 EPAM Systems, Inc. */
/** Miew - 3D Molecular Viewer v0.7.15 Copyright (c) 2015-2018 EPAM Systems, Inc. */

var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

Expand Down Expand Up @@ -60926,8 +60926,7 @@ function CanvasRenderer() {

}


var THREE = Object.freeze({
var THREE = /*#__PURE__*/Object.freeze({
WebGLRenderTargetCube: WebGLRenderTargetCube,
WebGLRenderTarget: WebGLRenderTarget,
WebGLRenderer: WebGLRenderer,
Expand Down Expand Up @@ -64723,6 +64722,8 @@ function Residue(chain, type, sequence, icode) {
this._isValid = true;
this._het = false;
this._molecule = null;
this.temperature = null;
this.occupancy = null;
}

// Getters and setters
Expand Down Expand Up @@ -64917,6 +64918,10 @@ Residue.prototype._finalize = function () {
this._leadAtom = null;
this._wingAtom = null;

var tempCount = 0;
var temperature = 0; // average temperature
var occupCount = 0;
var occupancy = 0; // average occupancy
// TODO: Is it correct? Is it fast?
this.forEachAtom(function (a) {
if (self._leadAtom === null) {
Expand All @@ -64929,9 +64934,24 @@ Residue.prototype._finalize = function () {
self._wingAtom = a;
}
}
if (a._temperature) {
temperature += a._temperature;
tempCount++;
}
if (a._occupancy) {
occupancy += a._occupancy;
occupCount++;
}
return self._leadAtom !== null && self._wingAtom !== null;
});

if (tempCount > 0) {
this.temperature = temperature / tempCount;
}
if (occupCount > 0) {
this.occupancy = occupancy / occupCount;
}

//Still try to make monomer look valid
if (this._leadAtom === null || this._wingAtom === null) {
this._isValid = false;
Expand Down Expand Up @@ -79286,6 +79306,8 @@ Palette.prototype = {
defaultSecondaryColor: 0xFFFFFF,
secondaryColors: {},

defaultGradientColor: 0x000000,

defaultNamedColor: 0xFFFFFF,
namedColorsArray: [['indianred', 0xcd5c5c], ['lightcoral', 0xf08080], ['salmon', 0xfa8072], ['darksalmon', 0xe9967a], ['lightsalmon', 0xffa07a], ['crimson', 0xdc143c], ['red', 0xff0000], ['firebrick', 0xb22222], ['darkred', 0x8b0000], ['pink', 0xffc0cb], ['lightpink', 0xffb6c1], ['hotpink', 0xff69b4], ['deeppink', 0xff1493], ['mediumvioletred', 0xc71585], ['palevioletred', 0xdb7093], ['coral', 0xff7f50], ['tomato', 0xff6347], ['orangered', 0xff4500], ['darkorange', 0xff8c00], ['orange', 0xffa500], ['gold', 0xffd700], ['yellow', 0xffff00], ['lightyellow', 0xffffe0], ['lemonchiffon', 0xfffacd], ['lightgoldenrodyellow', 0xfafad2], ['papayawhip', 0xffefd5], ['moccasin', 0xffe4b5], ['peachpuff', 0xffdab9], ['palegoldenrod', 0xeee8aa], ['khaki', 0xf0e68c], ['darkkhaki', 0xbdb76b], ['lavender', 0xe6e6fa], ['thistle', 0xd8bfd8], ['plum', 0xdda0dd], ['violet', 0xee82ee], ['orchid', 0xda70d6], ['fuchsia', 0xff00ff], ['magenta', 0xff00ff], ['mediumorchid', 0xba55d3], ['mediumpurple', 0x9370db], ['rebeccapurple', 0x663399], ['blueviolet', 0x8a2be2], ['darkviolet', 0x9400d3], ['darkorchid', 0x9932cc], ['darkmagenta', 0x8b008b], ['purple', 0x800080], ['indigo', 0x4b0082], ['slateblue', 0x6a5acd], ['mediumslateblue', 0x7b68ee], ['darkslateblue', 0x483d8b], ['greenyellow', 0xadff2f], ['chartreuse', 0x7fff00], ['lawngreen', 0x7cfc00], ['lime', 0x00ff00], ['limegreen', 0x32cd32], ['palegreen', 0x98fb98], ['lightgreen', 0x90ee90], ['mediumspringgreen', 0x00fa9a], ['springgreen', 0x00ff7f], ['mediumseagreen', 0x3cb371], ['seagreen', 0x2e8b57], ['forestgreen', 0x228b22], ['green', 0x008000], ['darkgreen', 0x006400], ['yellowgreen', 0x9acd32], ['olivedrab', 0x6b8e23], ['olive', 0x808000], ['darkolivegreen', 0x556b2f], ['mediumaquamarine', 0x66cdaa], ['darkseagreen', 0x8fbc8f], ['lightseagreen', 0x20b2aa], ['darkcyan', 0x008b8b], ['teal', 0x008080], ['aqua', 0x00ffff], ['cyan', 0x00ffff], ['lightcyan', 0xe0ffff], ['paleturquoise', 0xafeeee], ['aquamarine', 0x7fffd4], ['turquoise', 0x40e0d0], ['mediumturquoise', 0x48d1cc], ['darkturquoise', 0x00ced1], ['cadetblue', 0x5f9ea0], ['steelblue', 0x4682b4], ['lightsteelblue', 0xb0c4de], ['powderblue', 0xb0e0e6], ['lightblue', 0xadd8e6], ['skyblue', 0x87ceeb], ['lightskyblue', 0x87cefa], ['deepskyblue', 0x00bfff], ['dodgerblue', 0x1e90ff], ['cornflowerblue', 0x6495ed], ['royalblue', 0x4169e1], ['blue', 0x0000ff], ['mediumblue', 0x0000cd], ['darkblue', 0x00008b], ['navy', 0x000080], ['midnightblue', 0x191970], ['cornsilk', 0xfff8dc], ['blanchedalmond', 0xffebcd], ['bisque', 0xffe4c4], ['navajowhite', 0xffdead], ['wheat', 0xf5deb3], ['burlywood', 0xdeb887], ['tan', 0xd2b48c], ['rosybrown', 0xbc8f8f], ['sandybrown', 0xf4a460], ['goldenrod', 0xdaa520], ['darkgoldenrod', 0xb8860b], ['peru', 0xcd853f], ['chocolate', 0xd2691e], ['saddlebrown', 0x8b4513], ['sienna', 0xa0522d], ['brown', 0xa52a2a], ['maroon', 0x800000], ['white', 0xffffff], ['snow', 0xfffafa], ['honeydew', 0xf0fff0], ['mintcream', 0xf5fffa], ['azure', 0xf0ffff], ['aliceblue', 0xf0f8ff], ['ghostwhite', 0xf8f8ff], ['whitesmoke', 0xf5f5f5], ['seashell', 0xfff5ee], ['beige', 0xf5f5dc], ['oldlace', 0xfdf5e6], ['floralwhite', 0xfffaf0], ['ivory', 0xfffff0], ['antiquewhite', 0xfaebd7], ['linen', 0xfaf0e6], ['lavenderblush', 0xfff0f5], ['mistyrose', 0xffe4e1], ['gainsboro', 0xdcdcdc], ['lightgray', 0xd3d3d3], ['silver', 0xc0c0c0], ['darkgray', 0xa9a9a9], ['gray', 0x808080], ['dimgray', 0x696969], ['lightslategray', 0x778899], ['slategray', 0x708090], ['darkslategray', 0x2f4f4f], ['black', 0x000000]],

Expand Down Expand Up @@ -80005,33 +80027,24 @@ TemperatureColorer.prototype.getAtomColor = function (atom, _complex) {
}
return this.palette.getGradientColor(factor, opts.gradient);
}
return this.palette.defaultElementColor;
return this.palette.defaultGradientColor;
};

TemperatureColorer.prototype.getResidueColor = function (_residue, _complex) {
TemperatureColorer.prototype.getResidueColor = function (residue, _complex) {
var opts = this.opts;
if (!opts) {
return this.palette.defaultResidueColor;
return this.palette.defaultGradientColor;
}
// get temperature from CA atom for residue color definition
var temperatureCA = -1;
_residue.forEachAtom(function (a) {
if (a._temperature && a._role === chem.Element.Constants.Lead) {
temperatureCA = a._temperature;
}
});
if (temperatureCA > 0) {
if (residue.temperature) {
var factor = 0;
if (opts.min === opts.max) {
factor = temperatureCA > opts.max ? 1 : 0;
factor = residue.temperature > opts.max ? 1 : 0;
} else {
factor = (temperatureCA - opts.min) / (opts.max - opts.min);
factor = (residue.temperature - opts.min) / (opts.max - opts.min);
}
//const factor = (temperatureCA - opts.min) / (opts.max - opts.min);
return this.palette.getGradientColor(factor, opts.gradient);
}
// no CA atom?
return this.palette.defaultResidueColor;
return this.palette.defaultGradientColor;
};

/**
Expand Down Expand Up @@ -80062,27 +80075,19 @@ OccupancyColorer.prototype.getAtomColor = function (atom, _complex) {
var factor = 1 - atom._occupancy;
return this.palette.getGradientColor(factor, opts.gradient);
}
return this.palette.defaultElementColor;
return this.palette.defaultGradientColor;
};

OccupancyColorer.prototype.getResidueColor = function (_residue, _complex) {
OccupancyColorer.prototype.getResidueColor = function (residue, _complex) {
var opts = this.opts;
if (!opts) {
return this.palette.defaultResidueColor;
return this.palette.defaultGradientColor;
}
// get temperature from CA atom for residue color definition
var occupancyCA = -1;
_residue.forEachAtom(function (a) {
if (a._occupancy && a._role === chem.Element.Constants.Lead) {
occupancyCA = a._occupancy;
}
});
if (occupancyCA > 0) {
var factor = 1 - occupancyCA;
if (residue.occupancy > 0) {
var factor = 1 - residue.occupancy;
return this.palette.getGradientColor(factor, opts.gradient);
}
// no CA atom?
return this.palette.defaultResidueColor;
return this.palette.defaultGradientColor;
};

function HydrophobicityColorer(opts) {
Expand Down Expand Up @@ -84314,7 +84319,7 @@ MMTFParser.prototype._onGroup = function (groupData) {

var chain = this._complex._chains[groupData.chainIndex];
var icode = !groupData.insCode.charCodeAt(0) ? '' : groupData.insCode;
var residue = chain.addResidue(groupData.groupName, groupData.sequenceIndex, icode);
var residue = chain.addResidue(groupData.groupName, groupData.groupId, icode);
residue._index = groupData.groupIndex;

this._updateSecStructure(this._complex, residue, groupData);
Expand Down Expand Up @@ -88513,7 +88518,7 @@ var WebVRPoC = function () {
return WebVRPoC;
}();

/* global "0.7.14":false */
/* global "0.7.15":false */

//////////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -90253,19 +90258,26 @@ Miew.prototype._rebuildObjects = function () {

Miew.prototype.changeUnit = function (unitIdx, name) {
var visual = this._getComplexVisual(name);
if (unitIdx === undefined) {
if (!visual) {
throw new Error('There is no complex to change!');
}

function currentUnitInfo() {
var unit = visual ? visual.getComplex().getCurrentStructure() : 0;
var type = unit > 0 ? 'Bio molecule ' + unit : 'Asymmetric unit';
return 'Current unit: ' + unit + ' (' + type + ')';
}
if (!visual) {
throw new Error('There is no complex to change!');

if (unitIdx === undefined) {
return currentUnitInfo();
}
if (lodash.isString(unitIdx)) {
unitIdx = Math.max(parseInt(unitIdx, 10), 0);
}
if (visual.getComplex().setCurrentStructure(unitIdx)) {
this._resetScene();
}

return '';
return currentUnitInfo();
};

/**
Expand Down Expand Up @@ -92104,7 +92116,7 @@ Miew.prototype.exportCML = function () {
////////////////////////////////////////////////////////////////////////////
// Additional exports

Miew.prototype.VERSION = typeof "0.7.14" !== 'undefined' && "0.7.14" || '0.0.0-dev';
Miew.prototype.VERSION = typeof "0.7.15" !== 'undefined' && "0.7.15" || '0.0.0-dev';
// Miew.prototype.debugTracer = new utils.DebugTracer(Miew.prototype);

lodash.assign(Miew, /** @lends Miew */{
Expand Down Expand Up @@ -92312,7 +92324,7 @@ case 37:
this.$ = yy.echo(yy.miew.changeUnit());
break;
case 38:
this.$ = yy.miew.changeUnit($$[$0]);
this.$ = yy.echo(yy.miew.changeUnit($$[$0]));
break;
case 39:
this.$ = yy.miew.dssp();
Expand Down
2 changes: 1 addition & 1 deletion dist/Miew.module.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miew",
"version": "0.7.14",
"version": "0.7.15",
"description": "Miew - 3D Molecular Viewer",
"author": "EPAM Systems, Inc.",
"main": "dist/Miew.js",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sonar.projectKey=epam:miew
sonar.projectName=Miew - 3D Molecular Viewer
sonar.projectVersion=0.7.14
sonar.projectVersion=0.7.15

sonar.links.homepage=https://github.com/epam/miew
sonar.links.ci=https://travis-ci.org/epam/miew
Expand Down

0 comments on commit 15ba4f7

Please sign in to comment.