User 1ccd233681
09-02-2014 22:46:08
Hello,
I am trying to use JChemRGroupDecomposition in some vb.net code and I keep getting an error thrown. I'm trying to instantiate a new Rgroupdecomp, set the core and target molecules, and then run the decomposition. However everything I run this I get an "Object reference not set to an instance of an object" error thrown when I try to call result.First(). My code and the stack trace are shown below for reference.
My guess is that I'm not setting this up correctly, however I can't find any documentation to help me. Does anyone know where to documentation for the JChem* classes (e.g. JChemMolecule, JChemRGroupDecomposition) can be found?
Thanks!
StackTrace:
at ChemAxon.NET.IKVM.RGroupDecomposition.JChemRGroupDecomposition.†††
†††Š†š(Object )
at ChemAxon.NET.IKVM.RGroupDecomposition.JChemRGroupDecomposition.GetAdditionalColumns()
at ChemAxon.NET.IKVM.RGroupDecomposition.JChemRGroupDecomposition.<GetResults>d__0.†††
†††ŒŒ(Object )
at ChemAxon.NET.IKVM.RGroupDecomposition.JChemRGroupDecomposition.<GetResults>d__0.MoveNext()
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
Public Sub loadRGroups(ByVal core As JChemMolecule, ByVal molecule as JChemMolecule)
If (core IsNot Nothing AndAlso molecule IsNot Nothing) Then
Dim rgDecomp As New chemaxon.NET.IKVM.RGroupDecomposition.JChemRGroupDecomposition()
rgDecomp.QueryMolecule = core
rgDecomp.Targets = New BasicJChemMoleculeEnumerator(New List(Of IJChemMolecule) From {molecule})
Dim result = rgDecomp.GetResults()
If (result IsNot Nothing AndAlso result.Count() > 0) Then ' <--error thrown here
rGroups = result.First()
End If
End If
End Sub