Re: [Jmol-users] Loading MMTF programmatically

2016-08-30 Thread Spencer Bliven
Thanks Bob, that works great. I didn't know that the filename could be null if the reader is supplied. I doubt anyone cares about the details, but if so see https://github.com/biojava/biojava/pull/570 -Spencer On Mon, Aug 29, 2016 at 3:15 PM, Robert Hanson wrote: > > You

Re: [Jmol-users] Loading MMTF programmatically

2016-08-29 Thread Robert Hanson
You can now just use viewer.openReader("filename", reader) where reader is one of byte[] or BufferedInputStream or Reader I'm not catching how Jmol is fitting in there in terms of loading an MMTF file. How does that reading fit into BioJava's writing? Bob On Sun, Aug 28, 2016 at 3:48 PM,

Re: [Jmol-users] Loading MMTF programmatically

2016-08-28 Thread Spencer Bliven
I have a method writeToOutputStream(Structure structure, OutputStream outputStream) that does the mmtf writing. I have flexibility in what type of OutputStream to use. The byte[] is accessible using a ByteArrayOutputStream. If it makes more sense to pass an input stream, I guess this should be

Re: [Jmol-users] Loading MMTF programmatically

2016-08-27 Thread Robert Hanson
Spencer, I've simplified that in what I am releasing today. You can use a byte[] or BufferedInputStream to introduce mmtf files. /** * Opens the file and creates the model set, given the reader. * * not used in Jmol * * @param fullPathName full path name or null * @param

Re: [Jmol-users] Loading MMTF programmatically

2016-08-26 Thread Robert Hanson
The call you will need to make is to this, in org.jmol.viewer.Viewer: public String loadModelFromFile(String fullPathName, String fileName, String[] fileNames, Object reader, boolean isAppend,

Re: [Jmol-users] Loading MMTF programmatically

2016-08-26 Thread Robert Hanson
It would be totally inconvenient to treat the byte[] mmtf data as String data. You can cache the binary data as a byte array and then pass a cache:// protocol. Way better would be to pass the data as a buffered stream, but I don't think that is set up in Jmol. You have the data in what form? Full