Hi,

I'm having some trouble with some code I'm using in Unity with C#.


Simply put, the code attempts to display a ligand and the surrounding protein 
residues within 5 angstroms.


Unfortunately, I'm getting very strange errors and inconsistent ones at that. 
When I take a gander at my debug log, the stack trace shows the last functions 
attempted before crash; either GetAtoms() or GetResidue(). Also, when I ran an 
assembly debug, the error was an access violation from openbabel_csharp at 
0x........


The hex didn't indicate that it might have been a null pointer exception issue 
and I confirmed through some print statements that it really couldn't be 
possible.


Below is the code:

/**********************************************************************************************************************/

        //ligandVec and proteinVec are lists of Vector3s taken during the main 
loop so I could do this analysis

        if (ligandVec.Count != 0 & proteinVec.Count != 0)// simple check for 
list size ensure no bound issues
        {
           for (int i = 0; i < ligandVec.Count; i++)
            {
                for (int k = 0; k < proteinVec.Count; k++)
                {
                                        float dis = 5;
                                        if (Vector3.Distance (ligandVec [i], 
proteinVec [k]) <= dis & proteinResAt[k] == true)
                                          {
                                          //Add all atoms in residue to a 
tempList to be used later in the toggle section
                                                //This is where most of my 
issues show up where if I were to store the atoms from the residue like so:
                                                test = 
proteinAtom[k].GetResidue().GetAtoms(); //test being a VectorpAtom
                                                for(int j = 0; j < test.Count; 
j ++)
                                                     tempList.Add(test[j]);
}
                    }
              }
           }
 
/*********************************************************************************************************************/

I apologize for my code formatting; Outlook hasn't been very accommodating for 
my code. :/

If anyone has any suggestions or possible solutions I would be very grateful. 
:) Also, if you have any further questions to explain a bit more feel free.


Brian Adams
B.A. in Computer Science
Duquesne University
Phone: 412-926-0430
e-mail: adam...@duq.edu
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to