User be81a47f2f
26-04-2011 15:10:35
Hello everybody,
I have just started working with Instant JChem so my question is very basic:
I would like to count tertiary and quarternary carbon atoms and thought that matchCount("[#6](~[#6])(~[#6])(~[#6])") would do that job. As far as I can tell, it works when there are only tertiary carbons in the molecule but will count querternary atoms as 4.
It would be great if somebody could give me a hint, how to change the formula!
Thanks a lot in advance!
Mieke
Ps: By the way: If I do a query by drawing the structure I am looking for; is there any possibility to translate this query into a SMARTS-string automatically?
ChemAxon a3d59b832c
27-04-2011 08:30:53
Hi Mieke,
Unfortunately, it will not be appropriate, because your query will match substructures in quaternary carbon as well.
So you could subtract the number of quaternary carbons from this:
matchCount("[#6](~[#6])(~[#6])(~[#6])") - matchCount("[#6]~[#6](~[#6])(~[#6])~[#6]")
Ps: By the way: If I do a query by drawing the structure I am
looking for; is there any possibility to translate this query into a
SMARTS-string automatically?
Yes. In Marvin Sketch there are several ways, for example: Edit / Source and then View / SMARTS or Chemaxon Extended SMARTS. Or simply Edit / Copy as smiles (Ctrl-L) will copy SMARTS if the structure has query features.
Best regards,
Szabolcs
User be81a47f2f
27-04-2011 09:22:40
Hi Szabolcs,
thank you for the fast reply!
I was trying to count the sum of tertiary and quarternary atoms. I apologize for not making myself clear in this point. What confused me, was not that
matchCount("[#6](~[#6])(~[#6])(~[#6])")
counts quarternary carbon atoms as well, but that it counts 4 for every quarternary carbon atom and I don't understand why. Anyways, I adjusted your suggestion to substract the number of quarternary atoms to substracting their number thrice:
matchCount("[#6](~[#6])(~[#6])(~[#6])") - (3*matchCount("[#6]~[#6](~[#6])(~[#6])~[#6]"))
So, this is working now!
Thanks again for your help, have a good day!
Mieke
ChemAxon a3d59b832c
27-04-2011 10:17:30
OK, I see.
The 4 times match count comes from the fact that a tertiary carbon has four 3-ligand "tertiary" substructure match. (You can leave out each ligand in turn.)
Anyway - I am glad that you found the solution.
Best regards,
Szabolcs