.Net dll version 6.0

User eda6f877b4

13-08-2013 07:40:00

Hi,


I have a asp.net application that is using both jchem base and marvin beans for structure-work.


I am currently upgrading from version 5.x to the latest 6.0.4.221.


My current solution is referencing the dll's listed in your setup guide for .net applications. I can see that this procedure has changed over time, and was wondering if you have a updated guide telling what dll's to include when using the latest version.


BR


Dann

ChemAxon bd13b5bd77

13-08-2013 09:36:22

Hi Dan,


 


from 5.11 we have changed the strategy of the referenced dlls.


In the past there was only 1 robust dll JChem.dll, this is what we have broken away and managed to introduce the new approach, which means as many dlls as jars the Java API produces. We changed this for the following reasons:


1. Third party users might not want to inlcude all dlls in their projects


2. Loading time can be decreased


The reference of these dlls are tottaly the same with what you find in the Java/.net documentation.


Now the rule is that Java jars = the corresponding .net dlls .


http://www.chemaxon.com/jchem/doc/dev/java/api/index.html


https://www.chemaxon.com/jchem/doc/dev/dotnet/api/index.html


 


We have been releasing a new dotnet API that hides and icludes the most commonly used functionalities. The plan is to simplify the usage of the main functionalities of our underlying java API with .NET synthax.


 


Uploading a material for that here, please check, maybe you are interested ...


 The sample codes can be found  in the last slide and also avilable in the installer package.


 


 Viktor


 

User eda6f877b4

14-08-2013 05:42:30

Hi Viktor,


Thanks for this, I will give it a try.


Just an additional question. In the sample asp.net project in the .net package you are referencing the following dll's:


 


ChemAxon.NET.Base.dll
ChemAxon.NET.dll
ChemAxon.NET.IKVM.dll 


Is these all-in-ones that will allow me to not reference alle the individual dll's..?


 


BR

Dann 

ChemAxon bd13b5bd77

14-08-2013 07:12:26

Dear Dann,


If you need only a  set of functionalities than these 3 dlls are enough.


Functionalities:



http://www.chemaxon.com/download.php?d=/data/download/jchem/devel/2013_Developer_training.pptx />http://www.chemaxon.com/download.php?d=/data/download/jchem/devel/2013_Developer_training.zip


If you would like to go into the details, like manipulating the molecule on the level of atoms you need to use the low level API library (java dotnet compilation => many smaller dlls) with the help I sent via links.


Viktor

User eda6f877b4

14-08-2013 08:57:54

Hi Viktor,


The app I am creating don't do low-level maipulating og molecules/atoms but does use search/update/insert actions (database)


I will have a go and keep you updated


BR

Dann 

ChemAxon bd13b5bd77

14-08-2013 09:46:18

Dann,


at the moment the ChemAxon.NET API (3 dlls) does not contain a matured database access layer,


our plan is to fix this by middle of next year.


For the time being you can use either JChem .NET API or Web Services.


 


Viktor


 

User eda6f877b4

14-08-2013 09:47:54

OK, Thanks

User eda6f877b4

16-08-2013 09:54:20

Hi Viktor Thanks for all you help in this matter, I managed to make it work and can search/read/write/update my structures in the database using the latest version.


I am struggelig with one point, which is most likely the most asked question: Rendering structure images.


I can create images from my structures, but they all seem to end up with a black background, even though I am specifically setting the back-color to a different one.


Code snippet:


        public void SavetStructureImage(int width, int heigth, string backcolor, string savepath, string savename) {


            Image img = null;


            MoleculeData molData = new MoleculeData(this.molFile, ChemAxon.NET.Base.Chemistry.Formats.MoleculeFormat.SMILES);


            JChemMolecule molecule = new JChemMolecule(molData);


            bool isempty = molecule.IsEmpty;


            if (molecule != null && !molecule.IsEmpty) {


                molecule.Renderer.Settings.DrawingInfo.BackgroundColor = Color.White;


                molecule.Renderer.Settings.DrawingInfo.Size = new Size(width, heigth);


                try {


                    DirectoryInfo dir = new DirectoryInfo(savepath);


                    if (!dir.Exists)


                        dir.Create();


                    //Save to disk.


                    molecule.Renderer.RenderToFile(savepath + savename, ImageFormat.Jpeg);


                }
              catch {


                }


            }
       }


this.molfile: This is the value from the cd_smiles col in the db. Example:


O.Cc1ccc(cc1)S(O)(=O)=O


Any suggestions about what I am doing wrong..?

ChemAxon 2e7d8629fa

16-08-2013 10:39:09

 Hi Dann,


 


When you set the background color of the image you need to set the transparency to false (by default it is true).


molecule.Renderer.Settings.DrawingInfo.Transparent = false;
molecule.Renderer.Settings.DrawingInfo.BackgroundColor = Color.White;


 


Best regards,


Gergely

User eda6f877b4

16-08-2013 10:48:02

Hi Gergely


Added the line as suggested by without any luck, still the black background.


MoleculeData molData = new MoleculeData(this.molFile, ChemAxon.NET.Base.Chemistry.Formats.MoleculeFormat.SMILES);


I was looking at the line above, is the SMILES format the correct..? I have tried with Unknown.. but same result

ChemAxon 2e7d8629fa

16-08-2013 13:58:02

 Hi Dann,


 


I have attached a zip file to this topic which contains an ASP.NET web application demo. That shows a jpeg image in a browser. Does this demo help you?


Anyway, molecule format 'SMILES' is correct for the molecule string what you use.


 


Best regards,


Gergely

User eda6f877b4

16-08-2013 14:14:14

Hi,


Well, it helpes in the way that it produces the same situation with a black background.


The attached image is produced by the  solution you posted.


I have tested this on both windows 7 + windows 8 machine both in are 64 bit.


Dann

User eda6f877b4

20-08-2013 08:48:39

Hi, 


Still no luck on this issue, will you have a chance to take another look..?


BR


Dann

ChemAxon bd13b5bd77

21-08-2013 07:31:03

Hi Dann,


I think if you use 6.0 release line then it was a missing functionality I am afraid.


We will upload a fix for that soon.


Viktor


 


 


 

ChemAxon bd13b5bd77

21-08-2013 07:37:15

Quick question to you:


Recently we will upload a 6.0.5 patch for .NET within 2 weeks, and also we would like to roll out the 6.1 early September.


Would you like to get a development version from which release line?


Viktor

User eda6f877b4

21-08-2013 07:39:50

Hi Victor,


If you have a build of the 6.1 I would like to try that one.


Dann

ChemAxon bd13b5bd77

21-08-2013 07:41:53

We have alpha 3 from 6.1, is that okay for you?


Viktor

User eda6f877b4

21-08-2013 07:43:05

Sure, I asume it is stable engough..?


/Dann

ChemAxon bd13b5bd77

21-08-2013 07:45:38

Yes, from prealpha we did not get too many bugs.


We are testing the library through Jchem for Excel....

User eda6f877b4

21-08-2013 08:03:26

OK, sounds fine. Will you post a download link..?

ChemAxon bd13b5bd77

21-08-2013 08:46:42

Hi Dann,


 


tha material is available for download from the Development folder:


https://www.chemaxon.com/download.php?d=/data/download/jchem/devel/


Please leet us know how it works.


Viktor

User eda6f877b4

21-08-2013 08:53:15

Hi Viktor


I will test and get back to you ASAP


Dann

User eda6f877b4

22-08-2013 06:10:46

Hi Viktor,


Thanks for the update, this has solved the problem about rendering images from structures.


... but only to leave me with another issue. The ability to search has gone since this new package requires a recalculation (.. I think it is called) of the structure table. I have searched your release folders for a 6.1 of the JChem java interface but without any luck.


Is the a 6.1 available that I can use to rebuild my table..?


Dann

ChemAxon bd13b5bd77

22-08-2013 06:30:56

Our 6.1 is in alpha phase.

User eda6f877b4

22-08-2013 06:32:29

OK, you mentioned earlier that it would be available 'early september'. That is in not far away, do you think you will be able to keep this deadline..?

ChemAxon bd13b5bd77

22-08-2013 06:34:44

I think yes, since this is an important release for our US UGM coming at end of September.


Or the other solution is to merge this feature onto the 6.0 branch.


 

User eda6f877b4

22-08-2013 06:36:45

OK.


Can you let me know when you know, what the final solution will be??


Dann

ChemAxon bd13b5bd77

23-08-2013 18:12:37

Hi Dann,


 


have you checked the 6.1 backend and front end API with your ASP.NET application finally?


My ballpark estimate for 6.1 is between Sept 6-13.


 


Viktor

User eda6f877b4

18-09-2013 07:59:11

Hi,


Sorry for the late feedback :-(


I am now running on the 6.1 (beta..?) release, and everything is working just as expected.


The primary issue here was the creation of images from structures and this works fine.


BR


Dann

User 7f33ec9a5c

18-10-2013 18:47:52










hamoriviktor wrote:

 


The reference of these dlls are tottaly the same with what you find in the Java/.net documentation.


Now the rule is that Java jars = the corresponding .net dlls .


http://www.chemaxon.com/jchem/doc/dev/java/api/index.html


https://www.chemaxon.com/jchem/doc/dev/dotnet/api/index.html


 



Viktor,


I don't see any similarity between platform, or identical naming convention.


In order to use the .NET class: chemaxon.marvin.io.formats.MolImporter, I need to refrence a .NET .dll named ChemAxon.IKVM.MarvinBeans.formats.dll, but if I look in the Java Docs for this class, it appears to be in chemaxon.formats.MolImporter.


For me this looks like three different naming conventions across two languages.  If there is an easy way to translate between the Java documentaton, the .net documentation and which .net dll to refrerence in order to find an object, I would love to hear about it.


For now, I'm still looking for .net dll that contains 6.1 version of chemaxon.struc.Molecule.  I know it was located in JChem.dll in version 5.5, but I can't figure out where it would be now....


~mike richards


 

ChemAxon bd13b5bd77

18-10-2013 19:04:10

If you insist on the dll hell maybe the best to include all dlls as references and use agile tool in Visual Studio, right mouse click over the class name and resolve.


I do not think that it is too complicated. Yes sometimes the dlls and classes can be on different places because under the hood there is a modularization is taking place inside chemaxon.


If you concentrate on what I wrote and suggested to Dann to use our new library which breaks away from the java synthax and settle a new library concept we also use in our applciations. The benefit of using it is that you do not need to keep in mind what classes are in what dlls/jars.


That is ChemAxon .NET and  its JChemMolecule could serve you as well. Please see the training materials above.


 

User 7f33ec9a5c

18-10-2013 19:38:04










hamoriviktor wrote:

Yes sometimes the dlls and classes can be on different places because under the hood there is a modularization is taking place inside chemaxon.



Ok, thank you for making it clear that there are multiple naming strategies.  


Your earlier comment that "The reference of these dlls are tottaly the same with what you find in the Java/.net documentation." really had me confused, because I was not seeing anything close to "totally the same".



ChemAxon bd13b5bd77

18-10-2013 19:46:30

Maybe I was wrong.


Or the documentation is not in synch. We will check that. However what we want to achieve is to have a more .net - like library making the low level java based API transparent for you and for us.


Especially because whenever you use and load JChemMoleculeData and JChemMolecule the underlying jars/dll are loaded autoamtically from the GAC so you do not need to refer them from Visual Studio. 

User 7f33ec9a5c

18-10-2013 20:14:16

Hi Viktor,


I looked at the training documents you provided, and the samples provided with the 6.1 release, and I am still confused.  I am sure I am missing something really simple, but I just don't know where to look for the answer.


I am trying to reference the two following objects and I can't find them.


(from the .NET api v5.5)



            chemaxon.struc.Molecule oMol = chemaxon.formats.MolImporter.importMol(sMolString);


 


I was previously referencing the two following libraries



     //IKVM.OpenJDK.Core  - for MolImporter


            //C:\Program Files\ChemAxon\JChem .NET API 5.5.0.1510\IKVM.OpenJDK.Core.dll


            //JChem -for chemaxon.struc.Molecule


            //C:\Program Files\ChemAxon\JChem .NET API 5.5.0.1510\JChem.dll



In 6.1 I think?  I should be using:


C:\Program Files\ChemAxon\ChemAxon .NET 6.1.0.369\ChemAxon.NET.Base.dll

C:\Program Files\ChemAxon\ChemAxon .NET 6.1.0.369\ChemAxon.NET.dll

C:\Program Files\ChemAxon\ChemAxon .NET 6.1.0.369\ChemAxon.NET.IKVM.dll



...which I think you are trying to tell me is the easier way to do it rather than referencing individual .dll's?  Correct?

But I can't find the correct objects in these files.


Could you please point me in the right direction, I am really lost.


Thank you,
~mike 


ChemAxon bd13b5bd77

18-10-2013 20:24:17

I thought about this molecule instantiation:


var benzene = new JChemMolecule( new MoleculeData("C1=CC=CC=C1", MoleculeFormat.SMILES));
var benzene = new JChemMolecule(new MoleculeData("C1=CC=CC=C1", MoleculeFormat.Unknown));

what would you like to do with the molecule afterwards?


 

User 7f33ec9a5c

18-10-2013 20:50:27

Viktor,


Thank you! Yes, once I saw your example below, I found your sample code that explains how to render a molecule, Having all the enumerations for image types and input formats is very helpful, and I like that it integrates so well with the .NET framework.  I am looking forward to doing things this way moving forward.


Unfortunately, I am re-writing a structure depiction service on a webserver, that relies blindly on the format string used in version 5.5, and I don't see how to implement this in 6.0.


 Previously, the entire molecule format was encoded in a format string, eg:


 


private const string MC_DEFAULT_FORMAT = "png:-a,H_hetero,chiral_all,h200,w200";




so all of our applications pass the format on the querystring:



string sFormat = Request.QueryString["format"] != null ? Request.QueryString["format"].ToString() : MC_DEFAULT_FORMAT;




...then the depiction service just blindly returns the image based on the format string:

 


byte[] bPNGout = oMol.toBinFormat(sFormat);


 


With the new API, is there a way to use the old format string to set the output format?  This would be essential to upgrade our application, as we can't predict what format parameters are going to occur on the format string now,  so breaking the whole thing apart into parameters would be really hard.


 


 




 

ChemAxon bd13b5bd77

18-10-2013 21:08:04


Molecule: Assembly ChemAxon.IKVM.com.chemaxon.core.dll,


MolIMporter:  Assembly ChemAxon.IKVM.com.chemaxon.io.dll