{"action":"created","comment":{"url":"https://api.github.com/repos/rdkit/rdkit/pulls/comments/89951500","pull_request_review_id":10477025,"id":89951500,"diff_hunk":"@@ -0,0 +1,220 @@\n+#include <cstdlib>\n+#include <iostream>\n+#include \"MolData3Ddescriptors.h\"\n+#include <GraphMol/RDKitBase.h>\n+\n+#include \"GraphMol/PartialCharges/GasteigerCharges.h\"\n+#include \"GraphMol/PartialCharges/GasteigerParams.h\"\n+\n+\n+\n+using namespace std;\n+\n+MolData3Ddescriptors::MolData3Ddescriptors(){}\n+\n+\n+std::vector<double> MolData3Ddescriptors::GetUn(int numAtoms){\n+\n+  std::vector<double> u(numAtoms, 1.0);\n+\n+  return u;\n+}\n+\n+std::vector<double> MolData3Ddescriptors::GetRelativeMW(const RDKit::ROMol& mol){\n+  double* relativeMw=data3D.getMW();\n+  int numAtoms= mol.getNumAtoms();\n+\n+  std::vector<double> pol(numAtoms, 0.0);\n+  for( int i=0; i<numAtoms; ++i){\n+\n+    pol[i]=relativeMw[mol.getAtomWithIdx(i)->getAtomicNum()-1];\n+  }\n+  return pol;\n+}\n+\n+std::vector<double> MolData3Ddescriptors::GetRelativePol(const RDKit::ROMol& mol){\n+   int numAtoms= mol.getNumAtoms();\n+  double* relativePol=data3D.getPOL();\n+\n+  std::vector<double> pol(numAtoms, 0.0);\n+  for( int i=0; i<numAtoms; ++i){\n+\n+    pol[i]=relativePol[mol.getAtomWithIdx(i)->getAtomicNum()-1];\n+\n+  }\n+  return pol;\n+}\n+\n+std::vector<double> MolData3Ddescriptors::GetRelativeVdW(const RDKit::ROMol& mol){\n+   int numAtoms= mol.getNumAtoms();\n+   double* relativeVdW=data3D.getVDW();\n+\n+  std::vector<double> vdw(numAtoms, 0.0);\n+  for( int i=0; i<numAtoms; ++i){\n+\n+    vdw[i]=relativeVdW[mol.getAtomWithIdx(i)->getAtomicNum()-1];\n+\n+  }\n+  return vdw;\n+}\n+\n+\n+std::vector<double> MolData3Ddescriptors::GetRelativeRcov(const RDKit::ROMol& mol){\n+  int numAtoms= mol.getNumAtoms();\n+  double* rcov=data3D.getRCOV();\n+\n+  std::vector<double> wroc(numAtoms, 0.0);\n+  for( int i=0; i<numAtoms; ++i){\n+\n+    wroc[i]=rcov[mol.getAtomWithIdx(i)->getAtomicNum()-1]/rcov[5];\n+  }\n+  return wroc;\n+}\n+\n+\n+std::vector<double> MolData3Ddescriptors::GetRelativeENeg(const RDKit::ROMol& mol){\n+   int numAtoms= mol.getNumAtoms();\n+   double* relativeNeg=data3D.getNEG();\n+\n+  std::vector<double> neg(numAtoms, 0.0);\n+  for( int i=0; i<numAtoms; ++i){\n+\n+    neg[i]=relativeNeg[mol.getAtomWithIdx(i)->getAtomicNum()-1];\n+  }\n+  return neg;\n+}\n+\n+\n+std::vector<double> MolData3Ddescriptors::GetRelativeIonPol(const RDKit::ROMol& mol){\n+   int numAtoms= mol.getNumAtoms();\n+\tdouble* absionpol=data3D.getIonPOL();\n+\n+  std::vector<double> ionpols(numAtoms, 0.0);\n+  for( int i=0; i<numAtoms; ++i){\n+\n+    ionpols[i]=absionpol[mol.getAtomWithIdx(i)->getAtomicNum()-1]/absionpol[5];\n+  }\n+  return ionpols;\n+}\n+\n+\n+std::vector<double> MolData3Ddescriptors::GetCharges(const RDKit::ROMol &mol) {\n+  std::vector<double> charges(mol.getNumAtoms(), 0);\n+  // use 12 iterations... can be more\n+  RDKit::computeGasteigerCharges(mol, charges, 12, true);\n+  return charges;\n+}\n+\n+int MolData3Ddescriptors::GetPrincipalQuantumNumber(int AtomicNum) {\n+  if (AtomicNum<=2) return 1;\n+  else if (AtomicNum<=10) return 2;\n+  else if (AtomicNum<=18) return 3;\n+  else if (AtomicNum<=36) return 4;\n+  else if (AtomicNum<=54) return 5;\n+  else if (AtomicNum<=86) return 6;\n+  else return 7;\n+}\n+\n+\n+std::vector<double> MolData3Ddescriptors::GetIState(const  RDKit::ROMol &mol){\n+  int numAtoms = mol.getNumAtoms();\n+  std::vector<double> Is;\n+\n+  for (int i = 0; i < numAtoms; ++i) {\n+    const RDKit::Atom * atom= mol.getAtomWithIdx(i);\n+    int atNum=atom->getAtomicNum();\n+    int degree = atom->getDegree();\n+    if (degree>0 and atNum>1) {\n+      int h = atom->getTotalNumHs();\n+      int Zv = RDKit::PeriodicTable::getTable()->getNouterElecs(atNum);\n+      double dv =(double) Zv-h;\n+      dv = dv / (double) (atNum-Zv-1);\n+      int N =  GetPrincipalQuantumNumber(atNum);\n+      Is.push_back(round(1000*(4.0/(N*N)*dv+1.0)/degree)/1000);  // WHIM-P5.pdf paper 1997  => +7 & NoHydrogens is used!\n+    }\n+    else Is.push_back(0);\n+ }\n+\n+ return Is;\n+}\n+\n+\n+// adaptation from EState.py \n+// we need the Is value only there\n+std::vector<double> MolData3Ddescriptors::GetEState(const  RDKit::ROMol &mol){\n+  int numAtoms = mol.getNumAtoms();\n+  std::vector<double> Is;\n+\n+  for (int i = 0; i < numAtoms; ++i) {\n+    const RDKit::Atom * atom= mol.getAtomWithIdx(i);\n+    int atNum=atom->getAtomicNum();\n+    int d = atom->getDegree();\n+    if (d>0 and atNum>1) {\n+      int h = atom->getTotalNumHs();\n+      int dv = RDKit::PeriodicTable::getTable()->getNouterElecs(atNum)-h;\n+      int N = GetPrincipalQuantumNumber(atNum); // period value\n+      Is.push_back(round(1000*(4.0/(N*N)*dv+1.0)/d)/1000);  // WHIM-P5.pdf paper 1997  => +7 & NoHydrogens is used!","path":"Code/GraphMol/Descriptors/MolData3Ddescriptors.cpp","position":156,"original_position":156,"commit_id":"0434db7973d6e1bcaa1e3303832759e17a38ac05","original_commit_id":"0434db7973d6e1bcaa1e3303832759e17a38ac05","user":{"login":"thegodone","id":1186658,"avatar_url":"https://avatars.githubusercontent.com/u/1186658?v=3","gravatar_id":"","url":"https://api.github.com/users/thegodone","html_url":"https://github.com/thegodone","followers_url":"https://api.github.com/users/thegodone/followers","following_url":"https://api.github.com/users/thegodone/following{/other_user}","gists_url":"https://api.github.com/users/thegodone/gists{/gist_id}","starred_url":"https://api.github.com/users/thegodone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegodone/subscriptions","organizations_url":"https://api.github.com/users/thegodone/orgs","repos_url":"https://api.github.com/users/thegodone/repos","events_url":"https://api.github.com/users/thegodone/events{/privacy}","received_events_url":"https://api.github.com/users/thegodone/received_events","type":"User","site_admin":false},"body":"not need there","created_at":"2016-11-29T07:11:20Z","updated_at":"2016-11-29T07:35:53Z","html_url":"https://github.com/rdkit/rdkit/pull/1145#discussion_r89951500","pull_request_url":"https://api.github.com/repos/rdkit/rdkit/pulls/1145","_links":{"self":{"href":"https://api.github.com/repos/rdkit/rdkit/pulls/comments/89951500"},"html":{"href":"https://github.com/rdkit/rdkit/pull/1145#discussion_r89951500"},"pull_request":{"href":"https://api.github.com/repos/rdkit/rdkit/pulls/1145"}}},"pull_request":{"url":"https://api.github.com/repos/rdkit/rdkit/pulls/1145","id":92116062,"html_url":"https://github.com/rdkit/rdkit/pull/1145","diff_url":"https://github.com/rdkit/rdkit/pull/1145.diff","patch_url":"https://github.com/rdkit/rdkit/pull/1145.patch","issue_url":"https://api.github.com/repos/rdkit/rdkit/issues/1145","number":1145,"state":"open","locked":false,"title":"adding 5 3D descriptors from Dragon in rdkit","user":{"login":"thegodone","id":1186658,"avatar_url":"https://avatars.githubusercontent.com/u/1186658?v=3","gravatar_id":"","url":"https://api.github.com/users/thegodone","html_url":"https://github.com/thegodone","followers_url":"https://api.github.com/users/thegodone/followers","following_url":"https://api.github.com/users/thegodone/following{/other_user}","gists_url":"https://api.github.com/users/thegodone/gists{/gist_id}","starred_url":"https://api.github.com/users/thegodone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegodone/subscriptions","organizations_url":"https://api.github.com/users/thegodone/orgs","repos_url":"https://api.github.com/users/thegodone/repos","events_url":"https://api.github.com/users/thegodone/events{/privacy}","received_events_url":"https://api.github.com/users/thegodone/received_events","type":"User","site_admin":false},"body":"ready for review","created_at":"2016-11-03T09:16:21Z","updated_at":"2016-11-29T07:35:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0d3c98aa589b8ca763bfc33bdfa6cc8354bb3d05","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rdkit/rdkit/pulls/1145/commits","review_comments_url":"https://api.github.com/repos/rdkit/rdkit/pulls/1145/comments","review_comment_url":"https://api.github.com/repos/rdkit/rdkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rdkit/rdkit/issues/1145/comments","statuses_url":"https://api.github.com/repos/rdkit/rdkit/statuses/0434db7973d6e1bcaa1e3303832759e17a38ac05","head":{"label":"thegodone:3D_Descriptors_Dragon","ref":"3D_Descriptors_Dragon","sha":"0434db7973d6e1bcaa1e3303832759e17a38ac05","user":{"login":"thegodone","id":1186658,"avatar_url":"https://avatars.githubusercontent.com/u/1186658?v=3","gravatar_id":"","url":"https://api.github.com/users/thegodone","html_url":"https://github.com/thegodone","followers_url":"https://api.github.com/users/thegodone/followers","following_url":"https://api.github.com/users/thegodone/following{/other_user}","gists_url":"https://api.github.com/users/thegodone/gists{/gist_id}","starred_url":"https://api.github.com/users/thegodone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegodone/subscriptions","organizations_url":"https://api.github.com/users/thegodone/orgs","repos_url":"https://api.github.com/users/thegodone/repos","events_url":"https://api.github.com/users/thegodone/events{/privacy}","received_events_url":"https://api.github.com/users/thegodone/received_events","type":"User","site_admin":false},"repo":{"id":61820678,"name":"rdkit","full_name":"thegodone/rdkit","owner":{"login":"thegodone","id":1186658,"avatar_url":"https://avatars.githubusercontent.com/u/1186658?v=3","gravatar_id":"","url":"https://api.github.com/users/thegodone","html_url":"https://github.com/thegodone","followers_url":"https://api.github.com/users/thegodone/followers","following_url":"https://api.github.com/users/thegodone/following{/other_user}","gists_url":"https://api.github.com/users/thegodone/gists{/gist_id}","starred_url":"https://api.github.com/users/thegodone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thegodone/subscriptions","organizations_url":"https://api.github.com/users/thegodone/orgs","repos_url":"https://api.github.com/users/thegodone/repos","events_url":"https://api.github.com/users/thegodone/events{/privacy}","received_events_url":"https://api.github.com/users/thegodone/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thegodone/rdkit","description":"The official sources for the RDKit library","fork":true,"url":"https://api.github.com/repos/thegodone/rdkit","forks_url":"https://api.github.com/repos/thegodone/rdkit/forks","keys_url":"https://api.github.com/repos/thegodone/rdkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thegodone/rdkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thegodone/rdkit/teams","hooks_url":"https://api.github.com/repos/thegodone/rdkit/hooks","issue_events_url":"https://api.github.com/repos/thegodone/rdkit/issues/events{/number}","events_url":"https://api.github.com/repos/thegodone/rdkit/events","assignees_url":"https://api.github.com/repos/thegodone/rdkit/assignees{/user}","branches_url":"https://api.github.com/repos/thegodone/rdkit/branches{/branch}","tags_url":"https://api.github.com/repos/thegodone/rdkit/tags","blobs_url":"https://api.github.com/repos/thegodone/rdkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thegodone/rdkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thegodone/rdkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/thegodone/rdkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thegodone/rdkit/statuses/{sha}","languages_url":"https://api.github.com/repos/thegodone/rdkit/languages","stargazers_url":"https://api.github.com/repos/thegodone/rdkit/stargazers","contributors_url":"https://api.github.com/repos/thegodone/rdkit/contributors","subscribers_url":"https://api.github.com/repos/thegodone/rdkit/subscribers","subscription_url":"https://api.github.com/repos/thegodone/rdkit/subscription","commits_url":"https://api.github.com/repos/thegodone/rdkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/thegodone/rdkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/thegodone/rdkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/thegodone/rdkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/thegodone/rdkit/contents/{+path}","compare_url":"https://api.github.com/repos/thegodone/rdkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thegodone/rdkit/merges","archive_url":"https://api.github.com/repos/thegodone/rdkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thegodone/rdkit/downloads","issues_url":"https://api.github.com/repos/thegodone/rdkit/issues{/number}","pulls_url":"https://api.github.com/repos/thegodone/rdkit/pulls{/number}","milestones_url":"https://api.github.com/repos/thegodone/rdkit/milestones{/number}","notifications_url":"https://api.github.com/repos/thegodone/rdkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thegodone/rdkit/labels{/name}","releases_url":"https://api.github.com/repos/thegodone/rdkit/releases{/id}","deployments_url":"https://api.github.com/repos/thegodone/rdkit/deployments","created_at":"2016-06-23T16:35:21Z","updated_at":"2016-06-23T16:35:33Z","pushed_at":"2016-11-10T05:52:22Z","git_url":"git://github.com/thegodone/rdkit.git","ssh_url":"git@github.com:thegodone/rdkit.git","clone_url":"https://github.com/thegodone/rdkit.git","svn_url":"https://github.com/thegodone/rdkit","homepage":"","size":100403,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rdkit:master","ref":"master","sha":"fcda683b87b363ff4b7b6560d920d4bcc3c23840","user":{"login":"rdkit","id":2018047,"avatar_url":"https://avatars.githubusercontent.com/u/2018047?v=3","gravatar_id":"","url":"https://api.github.com/users/rdkit","html_url":"https://github.com/rdkit","followers_url":"https://api.github.com/users/rdkit/followers","following_url":"https://api.github.com/users/rdkit/following{/other_user}","gists_url":"https://api.github.com/users/rdkit/gists{/gist_id}","starred_url":"https://api.github.com/users/rdkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdkit/subscriptions","organizations_url":"https://api.github.com/users/rdkit/orgs","repos_url":"https://api.github.com/users/rdkit/repos","events_url":"https://api.github.com/users/rdkit/events{/privacy}","received_events_url":"https://api.github.com/users/rdkit/received_events","type":"Organization","site_admin":false},"repo":{"id":10009991,"name":"rdkit","full_name":"rdkit/rdkit","owner":{"login":"rdkit","id":2018047,"avatar_url":"https://avatars.githubusercontent.com/u/2018047?v=3","gravatar_id":"","url":"https://api.github.com/users/rdkit","html_url":"https://github.com/rdkit","followers_url":"https://api.github.com/users/rdkit/followers","following_url":"https://api.github.com/users/rdkit/following{/other_user}","gists_url":"https://api.github.com/users/rdkit/gists{/gist_id}","starred_url":"https://api.github.com/users/rdkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdkit/subscriptions","organizations_url":"https://api.github.com/users/rdkit/orgs","repos_url":"https://api.github.com/users/rdkit/repos","events_url":"https://api.github.com/users/rdkit/events{/privacy}","received_events_url":"https://api.github.com/users/rdkit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rdkit/rdkit","description":"The official sources for the RDKit library","fork":false,"url":"https://api.github.com/repos/rdkit/rdkit","forks_url":"https://api.github.com/repos/rdkit/rdkit/forks","keys_url":"https://api.github.com/repos/rdkit/rdkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdkit/rdkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdkit/rdkit/teams","hooks_url":"https://api.github.com/repos/rdkit/rdkit/hooks","issue_events_url":"https://api.github.com/repos/rdkit/rdkit/issues/events{/number}","events_url":"https://api.github.com/repos/rdkit/rdkit/events","assignees_url":"https://api.github.com/repos/rdkit/rdkit/assignees{/user}","branches_url":"https://api.github.com/repos/rdkit/rdkit/branches{/branch}","tags_url":"https://api.github.com/repos/rdkit/rdkit/tags","blobs_url":"https://api.github.com/repos/rdkit/rdkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdkit/rdkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdkit/rdkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdkit/rdkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdkit/rdkit/statuses/{sha}","languages_url":"https://api.github.com/repos/rdkit/rdkit/languages","stargazers_url":"https://api.github.com/repos/rdkit/rdkit/stargazers","contributors_url":"https://api.github.com/repos/rdkit/rdkit/contributors","subscribers_url":"https://api.github.com/repos/rdkit/rdkit/subscribers","subscription_url":"https://api.github.com/repos/rdkit/rdkit/subscription","commits_url":"https://api.github.com/repos/rdkit/rdkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdkit/rdkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdkit/rdkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdkit/rdkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdkit/rdkit/contents/{+path}","compare_url":"https://api.github.com/repos/rdkit/rdkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdkit/rdkit/merges","archive_url":"https://api.github.com/repos/rdkit/rdkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdkit/rdkit/downloads","issues_url":"https://api.github.com/repos/rdkit/rdkit/issues{/number}","pulls_url":"https://api.github.com/repos/rdkit/rdkit/pulls{/number}","milestones_url":"https://api.github.com/repos/rdkit/rdkit/milestones{/number}","notifications_url":"https://api.github.com/repos/rdkit/rdkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdkit/rdkit/labels{/name}","releases_url":"https://api.github.com/repos/rdkit/rdkit/releases{/id}","deployments_url":"https://api.github.com/repos/rdkit/rdkit/deployments","created_at":"2013-05-12T06:19:15Z","updated_at":"2016-11-21T15:04:13Z","pushed_at":"2016-11-28T17:22:50Z","git_url":"git://github.com/rdkit/rdkit.git","ssh_url":"git@github.com:rdkit/rdkit.git","clone_url":"https://github.com/rdkit/rdkit.git","svn_url":"https://github.com/rdkit/rdkit","homepage":"","size":107703,"stargazers_count":185,"watchers_count":185,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":192,"forks":125,"open_issues":192,"watchers":185,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rdkit/rdkit/pulls/1145"},"html":{"href":"https://github.com/rdkit/rdkit/pull/1145"},"issue":{"href":"https://api.github.com/repos/rdkit/rdkit/issues/1145"},"comments":{"href":"https://api.github.com/repos/rdkit/rdkit/issues/1145/comments"},"review_comments":{"href":"https://api.github.com/repos/rdkit/rdkit/pulls/1145/comments"},"review_comment":{"href":"https://api.github.com/repos/rdkit/rdkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rdkit/rdkit/pulls/1145/commits"},"statuses":{"href":"https://api.github.com/repos/rdkit/rdkit/statuses/0434db7973d6e1bcaa1e3303832759e17a38ac05"}}}}
{"actor":{"display_login":"thegodone"}}