public static AbstractMolecule getMoleculeForMonomer ( final Monomer monomer ) throws BuilderMoleculeException , ChemistryException { String input = getInput ( monomer ) ; if ( input != null ) { List < Attachment > listAttachments = monomer . getAttachmentList ( ) ; AttachmentList list = new AttachmentList ( ) ; for ( Attachment attachment : listAttachments ) { list . add ( new org . helm . chemtoolkit . Attachment ( attachment . getAlternateId ( ) , attachment . getLabel ( ) , attachment . getCapGroupName ( ) , attachment . getCapGroupSMILES ( ) ) ) ; } try { return Chemistry . getInstance ( ) . getManipulator ( ) . getMolecule ( input , list ) ; } catch ( IOException | CTKException e ) { throw new BuilderMoleculeException ( "Molecule can't be built for the given monomer" ) ; } } return null ; }
method to build a molecule for a given monomer