Convert peptide sequence into 2D structure

User 55ffa2f197

18-10-2013 16:58:39

Hi,


Say i have a peptide sequence coded using amino acid single letter notation as KCN, when i paste this into Marvin VIew, it correctly expanded into 3-letter notation as H-Lyn-Cyc-Asn-OH. Is there an API function that can exand the sequence at atomic level, so i can save the structure to a sd file.


Thanks


Dong

ChemAxon d26931946c

21-10-2013 14:12:31

Hi,


One-letter peptide sequences can be converted to mol files with the following console command:


molconvert mol -s "ACN{peptide:1}" -o out.mol


This will create a file that contains a contracted peptide sequence.


To expand it you have to write a simple java code like:


    Molecule m = MolImporter.importMol("ASD", "peptide:1"); // MolImporter.importMol("ASD") also works
// only one of the following two calls is needed
m.expandSgroups(); // expand S-groups but keep S-group information
    m.ungroupSgroups(); // completely remove S-groups from the molecule
    System.out.println(MolExporter.exportToFormat(m, "mol"));

 


Regards,


Peter

User 55ffa2f197

21-10-2013 14:15:32

Hi Peter,


Thanks for the help, the three line codes is what i am looking for.


Dong

User 0d44f06f91

19-03-2014 11:09:51

Hi,


I  wonder if it is also possible to use the .NET API for this task.


(I have a list of short peptides and I want to save SDF file of them)


Thanks!

ChemAxon bd13b5bd77

19-03-2014 23:57:39

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

User 41205dacf3

24-03-2014 23:21:51

Hi,


I am a bit confused about how this works. The original poster asked how he would convert KCN. Should this "ACN{peptide:1}" actually be this "KCN{peptide:1}" ? If not what does ACN mean in that command? I couldn't figure out from molconvert's help. 


Also, how does the below code run on out.mol to show the structure image. ...Or am I really confused about this solution to turn one letter peptides into structure images?


    Molecule m = MolImporter.importMol("ASD", "peptide:1"); // MolImporter.importMol("ASD") also works
// only one of the following two calls is needed
m.expandSgroups(); // expand S-groups but keep S-group information
    m.ungroupSgroups(); // completely remove S-groups from the molecule
    System.out.println(MolExporter.exportToFormat(m, "mol"));

ChemAxon d26931946c

25-03-2014 09:16:45

Hi,


 


Yes, the "ACN{peptide:1}" could be "KCN{peptide:1}" in the first answer, but it could be any peptide. The difference was probably a typo. The string itself is the input followed by the format definition. It's described at the -s option on the MolConverter help page.


The code in your comment generates a molfile to the standard output. The generated file can be set to a MarvinSketch Applet or a MarvinJS editor. To generate an image file you simply have to specify one of the supported image formats.



    Molecule m = MolImporter.importMol("ASD", "peptide:1"); // MolImporter.importMol("ASD") also works
// only one of the following two calls is needed
m.expandSgroups(); // expand S-groups but keep S-group information
    m.ungroupSgroups(); // completely remove S-groups from the molecule
    MolExporter me = new MolExporter("outfile.png", "png");
me.write(m);
me.close();


The code above will generate a png file with the image of the structure.


BRs,


Peter