New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

openchemlib-extended

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openchemlib-extended - npm Package Compare versions

Comparing version 1.5.0 to 1.8.0

src/extend/getExtendedDiastereotopicAtomIDs.js

2

package.json
{
"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');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc