Possible bug in MSketchPane.setMol (String mol, String fmt)

User ee508a317e

29-11-2010 13:30:57



Hello,


I am using the API call MSketchPane.setmol (String mol, String format) to set the molecule to be displayed by an embedded instance of MSketchPane, But there appears to be a bug specifically when setting the string "H" when the format is "peptide". All of the other 19 standard amino acids and a set of custom amino acids I have defined in my <userhome>/.chemaxon/custom_aminoacids.dict file are all parsed and displayed correctly. But with "H" (histidine) I get:



java.lang.IllegalArgumentException: Invalid substring range

at java.text.StringCharacterIterator.<init>(StringCharacterIterator.java:76)

at chemaxon.marvin.io.formats.peptide.PeptideReader.OrderName(Unknown Source)

at chemaxon.marvin.io.formats.peptide.PeptideReader.convert(Unknown Source)

at chemaxon.marvin.io.formats.peptide.PeptideImport.readMol(Unknown Source)

at chemaxon.marvin.io.MRecordImporter.readStructure(Unknown Source)

at chemaxon.marvin.io.MRecordImporter.readDoc(Unknown Source)

at chemaxon.marvin.io.MRecordImporter.readDoc(Unknown Source)

at chemaxon.marvin.io.MRecordImporter.readDoc0(Unknown Source)

at chemaxon.marvin.io.MRecordImporter.readDoc(Unknown Source)

at chemaxon.marvin.util.MolLoader.loadMol(Unknown Source)

at chemaxon.marvin.util.MolLoader.run(Unknown Source)

at chemaxon.marvin.common.swing.MolPanel.startLoader(Unknown Source)

at chemaxon.marvin.sketch.swing.SketchPanel.setMol(Unknown Source)

at chemaxon.marvin.beans.MSketchPane.setMol(Unknown Source)



Assuming that "peptide" is the correct format specifier for a peptide sequence then this looks like a bug somewhere in the API code. As I mentioned all other standard amino acids work if passed a string of length 1.


Anyone have any ideas? Maybe I am using the call incorrectly?



Thanks,



Tim Mowlem




ChemAxon 5433b8e56b

30-11-2010 23:45:16

Hi Tim,


yes i can confirm this is a bug in the 1-Letter peptide import, but it happens only in the case when the imported structure is only one histidine as i traced it in the code.


I can suggest to use the 3-Letter format in this case when possible, that is working with the current code. (pane.setMol("His","peptide");)


I will file this issue into our bug tracking system, and it is highly possible that we will fix this in the next patch release which is 5.4.1 currently.


Thanks for the report, and sorry for the inconvenience. We will notify you in this topic when the fix is ready.


Best regards,
Istvan

ChemAxon 5433b8e56b

14-12-2010 13:19:23

Hi Tim,


I want to inform you about the fix which is ready. It will be included in the next patch release version 5.4.1. The planned date of the release is end of january.


Thank you for reporting this issue.


Best regards,
Istvan