openchemlib-extended
Advanced tools
Comparing version 1.5.0 to 1.8.0
{ | ||
"name": "openchemlib-extended", | ||
"version": "1.5.0", | ||
"version": "1.8.0", | ||
"description": "Openchemlib extended", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -34,7 +34,11 @@ # openchemlib-extended | ||
### getGroupedDiastereotopicAtomIDs() | ||
### getGroupedDiastereotopicAtomIDs(options) | ||
Return an array containing the all the different diastereotopic atoms in the molecule with the occurence of each of them. | ||
Returns an array containing all the different diastereotopic atoms in the molecule with the occurence of each of them. | ||
It may be usefull to first create the implicite hydrogens before using the method ``Molecule.addImplicitHydrogens()```. | ||
options: | ||
* atomLabel: filter to show only a specific atom (default: '') | ||
### toDiastereotopicSVG(options) | ||
@@ -49,2 +53,19 @@ | ||
### getGroupedHOSECodes(options) | ||
Returns an extended groupedDiastereotopicID with hoses | ||
options: | ||
* atomLabel: filter to show only a specific atom (default: '') | ||
### toVisualizerMolfile | ||
### getNumberOfAtoms | ||
### getExtendedDiastereotopicAtomIDs | ||
Return an array of explicit hydrogens added molecule of diastereotopicAtomIDs. | ||
Extra information like the diastereotopicIDs of the molecule are added | ||
## License | ||
@@ -51,0 +72,0 @@ |
'use strict'; | ||
module.exports = function getGroupedDiastereotopicAtomIDs() { | ||
var diaIDs=this.getDiastereotopicAtomIDs(); | ||
module.exports = function getGroupedDiastereotopicAtomIDs(options) { | ||
var options=options || {}; | ||
var label=options.atomLabel; | ||
var diaIDs=this.getDiastereotopicAtomIDs(options); | ||
var diaIDsObject={}; | ||
for (var i=0; i<diaIDs.length; i++) { | ||
var diaID=diaIDs[i]; | ||
if (! diaIDsObject[diaID]) { | ||
diaIDsObject[diaID]={ | ||
counter:1, | ||
atom: [i], | ||
oclID: diaID, | ||
_highlight: [diaID] | ||
if (! label || this.getAtomLabel(i)===label) { | ||
var diaID=diaIDs[i]; | ||
if (! diaIDsObject[diaID]) { | ||
diaIDsObject[diaID]={ | ||
counter:1, | ||
atoms: [i], | ||
oclID: diaID, | ||
atomLabel: this.getAtomLabel(i), | ||
_highlight: [diaID] | ||
} | ||
} else { | ||
diaIDsObject[diaID].counter++; | ||
diaIDsObject[diaID].atoms.push(i); | ||
} | ||
} else { | ||
diaIDsObject[diaID].counter++; | ||
diaIDsObject[diaID].atom.push(i); | ||
} | ||
@@ -20,0 +26,0 @@ } |
@@ -6,3 +6,4 @@ 'use strict'; | ||
module.exports = function getGroupedHOSECodes(options) { | ||
var diaIDs=this.getGroupedDiastereotopicAtomIDs(); | ||
var options=options || {}; | ||
var diaIDs=this.getGroupedDiastereotopicAtomIDs(options); | ||
diaIDs.forEach(function(diaID) { | ||
@@ -9,0 +10,0 @@ var hoses=Util.getHoseCodesFromDiastereotopicID(diaID.oclID, options); |
'use strict'; | ||
module.exports = function getNumberOfAtoms(label) { | ||
module.exports = function getNumberOfAtoms(options) { | ||
var options=options || {}; | ||
var label=options.atomLabel; | ||
var mf = this.getMolecularFormula().formula; | ||
@@ -5,0 +7,0 @@ var parts = mf.split(/(?=[A-Z])/); |
'use strict'; | ||
module.exports = function toDiastereotopicSVG(options) { | ||
options=options || {}; | ||
var options=options || {}; | ||
var width=options.width||300; | ||
@@ -6,0 +6,0 @@ var height=options.width||200; |
@@ -9,3 +9,3 @@ 'use strict'; | ||
diaIDs.forEach(function(diaID) { | ||
atoms[diaID.oclID]=diaID.atom; | ||
atoms[diaID.oclID]=diaID.atoms; | ||
highlight.push(diaID.oclID); | ||
@@ -12,0 +12,0 @@ }) |
@@ -12,2 +12,3 @@ 'use strict'; | ||
OCL.Molecule.prototype.getGroupedDiastereotopicAtomIDs = require('./extend/getGroupedDiastereotopicAtomIDs'); | ||
OCL.Molecule.prototype.getExtendedDiastereotopicAtomIDs = require('./extend/getExtendedDiastereotopicAtomIDs'); | ||
OCL.Molecule.prototype.toVisualizerMolfile = require('./extend/toVisualizerMolfile'); | ||
@@ -14,0 +15,0 @@ OCL.Molecule.prototype.getGroupedHOSECodes = require('./extend/getGroupedHOSECodes'); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
19325
16
424
81
0