Finding doublets & finding salts

User 9df74a15a4

06-11-2014 09:48:02

Probably straightforward, but right now I can't see the forest from all the trees.


How do I find doublets/multiplets in IJchem ? And will that include (different) salt forms of same neutral compound?


Also, how can one find a salt (with a simple extra calculation column)? E.g. in a text file I would probably search the smiles for "." (dot).

User 8a7878ec6d

06-11-2014 14:45:33

Hi,


to address your last issue, you could add a smiles column as a Chemical Term, and then query on this for the dot.


Good luck,


Evert

ChemAxon 26d92e5dcd

10-11-2014 10:03:21

Hello,


all the possible options for search are described here in the documentation. Plus I am forwarding the issue to JChem team.


Best 


David

ChemAxon d4fff15f08

10-11-2014 11:31:39

Hi Alexander,


 


There are a few possibilities to do so.


One is to strip the salts with standardizer


https://docs.chemaxon.com/display/standardizer/Strip+Salts


https://www.chemaxon.com/jchem/doc/dev/java/api/chemaxon/standardizer/advancedactions/StripSaltsAction.html 


and compare the stripped molecules.


 


The other way is to search with the ionic molecule (no counterion added) against salts with the following options:


t:ff


stereoSearchType:e


charge:e


isotope:e


radical:e


exactQueryAtomMatching:y


exactBondMatching:y


transformMonomer:n


 


I hope it helps,


Norbert

User 9df74a15a4

11-11-2014 08:29:01

Thanks for the replies.


It helps and it doesn't help. For example searching for salt is for me faster to export to excel or knime and search for the dot in the string, flag and re-import. I guess I need more time to get into the details, but when learning multiple software suites at once... might be just an excuse of course. Sorry for blabbering.

User 247c00dc1d

21-11-2014 15:36:54

For finding of duplicates by any field (i.e. for Smiles, if you need find same structures) you can use the script:


import java.awt.Dimension
import java.awt.BorderLayout
import javax.swing.*
import javax.swing.border.*
import org.openide.*
import com.im.ijc.core.api.lists.TemporaryListsAndQueries
import com.im.df.util.ui.DFObjectListCellRenderer

def ety = dataTree.rootVertex.entity
def edp = ety.schema.dataProvider.getEntityDataProvider(ety)
def field = selectFromList(ety.fields.items)
if (field == null) {
return
}

sort = SortDirective.create(field, true)
ids = edp.queryForIds(DFTermExpression.ALL_DATA, sort, env)

List duplicates = []
List buffer = []
lastValue = null
ids.each { rowId ->
value = edp.getData([ rowId ], env).get(rowId).get(field.id)
if (lastValue != value) {
if (buffer.size() > 1) {
duplicates.addAll(buffer)
}
buffer.clear()
lastValue = value
}
buffer.add(rowId)
}
println "Found " + duplicates.size() + " duplicates"
if (!duplicates.empty) {
TemporaryListsAndQueries.getListsFor(ety).addList(duplicates, "Duplicates in " + field.name + " field")
}

Object selectFromList(List values) {
JList list = new JList(values.toArray())
list.cellRenderer = new DFObjectListCellRenderer()
list.selectionModel.selectionMode = ListSelectionModel.SINGLE_SELECTION
list.visibleRowCount = 15
panel = new JPanel()
panel.layout = new BorderLayout()
panel.add(new JScrollPane(list), BorderLayout.CENTER)
panel.border = new EmptyBorder(5,5,5,5)
panel.preferredSize = new Dimension(250, 300)
DialogDescriptor dd = new DialogDescriptor(panel, "Select field")
if (DialogDisplayer.getDefault().notify(dd) != DialogDescriptor.OK_OPTION) {
println " Cancel pressed => exit"
return null
}
selected = list.selectedValue
println " Selected field: $selected"
if (selected == null) {
println " No field selected => exit"
return null
}
return selected
}


all duplicates will be recorded in a temporary list.

User 9df74a15a4

24-11-2014 10:32:58

Thanks!


Though... how do I use a java script within IJChem...

ChemAxon 26d92e5dcd

24-11-2014 10:38:45

Thanks to Igorlab for this nice script. It is a Groovy Script that uses Instant JChem's API. We support possibility to script your own functionality and tricks into IJC that you can run on Schema level, Data Tree level, View level and even custom buttons. 


How to use Groovy in Instant JChem is described in the documentation.


 


I hope this helps


David

User 247c00dc1d

24-11-2014 11:07:31

Actually, I have found this script in some topic, but I'm not author of this script :)

User 9df74a15a4

24-11-2014 11:24:15

Awesome! Thanks a million!