Hello,

New to using the CCDC and was currently using reduced cell search with just passing unit cell parameters. I now wish to search on extra information. Such as Chemical formula, space group etc

My original idea was too just create my own Crystal class and instantiate what I need from that.

Then run the searcher on that instantiated Crystal.

I saw in the documentation however that it is unlikely I will be needed to create a crystal directly...

Is there a proper way I should be manipulating a Crystal class for searching? or is there alternatives to searching on unit cell values and additionally restricting in the search?


Let me know if my efforts are misguided!

Thanks,
Dean

Hi Dean,

I'm not entirely clear what you are trying to do here.  Let me know if I've got the wrong end of the stick:

You run a reduced cell search on the CSD, or another database of structures, retrieving some hits.  You then wish to filter these results according to further criteria, e.g. chemical formula, or space groups.

You can do a simple filter of the hits, assuming there are not too many of them, simply by iterating over the hits:

for h in hits:

    c = h.crystal

    if c.spacegroup_symbol == ...

 

Alternatively you can use any of the search classes except TextNumericSearch on an individual crystal structure.

 

Hope this is helpful; if not please ask again.

Richard

 

   

 

Hi Richard,

Thanks for the reply!

To better explain the problem is I wish to configure a crystal to have the criteria of some lattice parameters, chemical formulae, spacegroup or some to none of these at all. Then search based on this new crystal configuration. 

Is there a way to be searching only on a spacegroup and/or chemical formulae?

A really good question to be sure is when searching with a crystal does the structure compare all similarity with crystal values? or does it only compare against the ReducedCell values...

I can just filter nicely like you mentioned on these extra parameters for now, as it is unlikely I would not have done a lattice parameters search already.

Thanks,
Dean

Hi Dean,

we don't have any methods to search by spacegroup symbol or formula, so iterating over hit structures would be the only way to do it.  If you have to do many of these searches it would be fairly simple to make an SQLite database containing terms of interest, then to join the results of a ReducedCellSearch with a query of this database.

If you like I can provide a prototype of how to go about this.

Best wishes

Richard

Hi Richard,

Understood, I can see that now. I came up with a little hack of just setting the tolerances to max when searching on a crystal to just find on formula and/or spacegroup. I am not proud of that so maybe some proper method would be nice!

I have not done any SQL in a while. If you could send over a prototype of a procedure that would be very helpful.

Thanks,
Dean

Okey-doke, Dean, I'll rustle something up.  Might take me a couple of days, so please be patient.

Best wishes

Richard

 Dear Dean,

thinking about your search requests I realise that an SQL derived database really is overengineering.a solution to the problem.  Since the ReducedCellSearch is very fast, and the number of hits returned is very small a simple filtering of the hits is more than fast enough.  I've attached a simple example script which performs a couple of queries of the sort you are describing.

I'm sure you'll have no difficulty adjusting the script for your purposes, but if you do, please raise the issue here.

Best wishes

Richard

Hi Richard,

Neat, I made up a similar filter after a search with a crystal before.

The only problem with this is a crystal is needed to be searched before a filter can be done...

To be able to do this would I need to setup a specific SQL query if I just wanted to just get all on formula or crystal system?

Might be more a functionality request but allowing the crystal base search to not need defined reduced cell values. Just queries and compares based on what is instantiated inside a crystal on the search.

Thanks,
Dean

You must be signed in to post in this forum.