Skip to content

Commit

Permalink
Fixes #352
Browse files Browse the repository at this point in the history
  • Loading branch information
greglandrum committed Oct 20, 2014
1 parent b77d3e9 commit f488122
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Code/GraphMol/Fingerprints/MACCS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ namespace {
RDKit::ROMol *bit_40;
RDKit::ROMol *bit_41;
RDKit::ROMol *bit_43;
RDKit::ROMol *bit_44;
RDKit::ROMol *bit_45;
RDKit::ROMol *bit_47;
RDKit::ROMol *bit_48;
Expand Down Expand Up @@ -182,6 +183,7 @@ namespace {
bit_40(RDKit::SmartsToMol("[#16]-[#8]")),
bit_41(RDKit::SmartsToMol("[#6]#[#7]")),
bit_43(RDKit::SmartsToMol("[!#6!#1!H0]~*~[!#6!#1!H0]")),
bit_44(RDKit::SmartsToMol("[!#1;!#6;!#7;!#8;!#9;!#14;!#15;!#16;!#17;!#35;!#53]")),
bit_45(RDKit::SmartsToMol("[#6]=[#6]~[#7]")),
bit_47(RDKit::SmartsToMol("[#16]~*~[#7]")),
bit_48(RDKit::SmartsToMol("[#8]~[!#6!#1](~[#8])~[#8]")),
Expand Down Expand Up @@ -500,6 +502,8 @@ namespace {
fp.setBit(41);
if (RDKit::SubstructMatch(mol,*pats.bit_43,match,true))
fp.setBit(43);
if (RDKit::SubstructMatch(mol,*pats.bit_44,match,true))
fp.setBit(44);
if (RDKit::SubstructMatch(mol,*pats.bit_45,match,true))
fp.setBit(45);
if (RDKit::SubstructMatch(mol,*pats.bit_47,match,true))
Expand Down
10 changes: 10 additions & 0 deletions Code/GraphMol/Fingerprints/test1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,16 @@ void testMACCS(){
delete m1;
delete fp1;
}
{
// check that bit 44 "OTHER" gets properly set:
std::string smi = "CC[SeH]";
RWMol *m1 = SmilesToMol(smi);
TEST_ASSERT(m1);
ExplicitBitVect *fp1=MACCSFingerprints::getFingerprintAsBitVect(*m1);
TEST_ASSERT((*fp1)[44]);
delete m1;
delete fp1;
}
BOOST_LOG(rdInfoLog) <<"done" << std::endl;
}

Expand Down
2 changes: 1 addition & 1 deletion rdkit/Chem/MACCSkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
41:('[#6]#[#7]',0), # CTN
42:('F',0), # F
43:('[!#6;!#1;!H0]~*~[!#6;!#1;!H0]',0), # QHAQH
44:('?',0), # OTHER
44:('[!#1;!#6;!#7;!#8;!#9;!#14;!#15;!#16;!#17;!#35;!#53]',0), # OTHER
45:('[#6]=[#6]~[#7]',0), # C=CN
46:('Br',0), # BR
47:('[#16]~*~[#7]',0), # SAN
Expand Down

0 comments on commit f488122

Please sign in to comment.