substructure match count -allHits

User 17ae043cc4

20-04-2007 05:55:11

Hi,





I was looking for a function that would give me a count of the hits for a structure on a substrate. The closest I found was if you used jcsearch with --allHits it would give a count and the location for each hit.





Two questions


1. With --allHits it only listed the structures when used with a DB input but it list the counts if from a file. Is that the way it is designed to work?





2. --allHits gave lots of extra text description is there a way to just get the count or an array with the structure id and the count?





Thanks,








Darcy

ChemAxon a3d59b832c

20-04-2007 19:40:20

Hi Darcy,
darcy wrote:
1. With --allHits it only listed the structures when used with a DB input but it list the counts if from a file. Is that the way it is designed to work?
Yes, unfortunately the database operation is only prepared to decide if a match is present, but not to enumerate all.
darcy wrote:
2. --allHits gave lots of extra text description is there a way to just get the count or an array with the structure id and the count?
For this I recommend to use Chemical Terms expressions. (Particularly functions field() and matchCount().) For example:


Code:
evaluate -e "field('CdId'); matchCount('CCCC')" file.sdf






produces:
Quote:
101;1


102;2


103;0


104;0


105;0


106;0


107;4
('CCCC' is a SMARTS substructure expression.)





You can also add Chemical Terms columns easily in Instant JChem: http://www.chemaxon.com/instantjchem/webPages/htmlFiles/chemical_terms_fields.html


Which can be easily exported together with the Id column.





Best regards,


Szabolcs