Hi Ayana,
you need to install JChem.NET API and add ChemAxon.NET, ChemAxon.NET.IKVM, ChemAxon.NET.Base assemblies (reference) to your project.
Here I added the sample codes (one for the older version 6.2 and another for the 6.3 brand new API coming soon).
I tried to highlight the flexibility our API provides. You will see some overloads for creating molecules and writing out to file. In 6.3 the the Factory objects around topics will help you more to feel yourself at home in our object library.
- MainFactory
-- Chemistry
-- IO
...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChemAxon.NET.Base.Chemistry.Data;
using ChemAxon.NET.IKVM.IO;
using ChemAxon.NET.IKVM.ExtensionMethods;
using ChemAxon.NET.Base.Chemistry.Formats;
using ChemAxon.NET.API;
namespace Demo {
class Program {
static void Main(string[] args) {
ChemAxonAPI_6_2();
ChemAxonAPI_6_3();
}
static void ChemAxonAPI_6_2() {
var molecules = new List<ChemAxon.NET.IKVM.Chemistry.IJChemMolecule>();
molecules.Add(new MoleculeData("ASD", "peptide:1").ToJChemMolecule());
molecules.Add(new MoleculeData("ADS", "peptide:1").ToJChemMolecule());
IOHelper.SaveAllToFile(molecules, @"C:\users\<USER>\Work\Test.sdf", MoleculeEncoding.Default, MoleculeFormat.SDF);
IOHelper.SaveAllToFile(molecules, @"C:\users\<USER>\Work\Test2.sdf");
}
static void ChemAxonAPI_6_3() {
var molecules = new List<ChemAxon.NET.IKVM.Chemistry.IJChemMolecule>();
molecules.Add(MainFactory.Chemistry.CreateMolecule("ASD", MoleculeFormat.SEQ));
molecules.Add(MainFactory.Chemistry.CreateMolecule(new MoleculeData("ADS", "peptide:1")));
molecules.Add(MainFactory.Chemistry.CreateMolecule("DSA"));
MainFactory.IO.OpenFile(@"C:\users\<USER>\Work\Test.sdf").Write(molecules, MoleculeFormat.SDF, MoleculeEncoding.Default);
MainFactory.IO.OpenFile(@"C:\users\<USER>\Work\Test2.sdf").Write(molecules);
}
}
}
If you would like to read more about the new ChemAxon .NET API projects please visit our web site under resource/documentation.
http://www.chemaxon.com/dotNET/examples.html
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
Viktor