Re: [PyMOL] Load mmtf data
Hi Gianluca, This is a good find, thanks a lot for the bug report. It took me quite a white to understand what's going wrong here. The solution is: use the "load_raw" function instead of "load". cmd.load_raw(b, "mmtf", "str") Cheers, Thomas > On Jul 25, 2017, at 8:17 AM, Gianluca Tomasello wrote: > > Hi Thomas, something strange happen when I try to load 4v99.mmtf using this > procedure (other PDB files works proprely as far as I know): > > download the file from https://mmtf.rcsb.org/v1.0/full/4V99 > then in script: > > with open(file_path,"rb") as binary: > b = binary.read() > cmd.load(b, "str", 0, cmd.loadable.mmtfstr) > > if i try to load the script with pymol, It gives this result: > > ... > Warning: map key not of type str (type 2). > Warning: map key not of type str (type 2). > Warning: map key not of type str (type 2). > Warning: map key not of type str (type 6). > Warning: map key not of type str (type 2). > Warning: map key not of type str (type 7). > Warning: map key not of type str (type 2). > Error in MMTF_parser_fetch_typed_array: length mismatch 588367 588120 > Warning: map key not of type str (type 2). > Warning: map key not of type str (type 2). > Warning: map key not of type str (type 2). > Warning: map key not of type str (type 2). > MMTF structureId: '4V99', mmtfVersion: '1.0.0' > Segmentation fault (core dumped) > > The strange thing is that if I try to normally load this file in bash doing > pymol 4v99.mmtf the file is correctly loaded. Is there something I am missing? > > 2017-06-22 17:52 GMT+02:00 Gianluca Tomasello : > Thank you very much! > > 2017-06-22 13:11 GMT+02:00 Thomas Holder : > Hi Gianluca, > > Yes this is possible, assuming you're using PyMOL 1.8.6. Use something like > this: > > def read_mmtfstr(contents, oname, state=0): > return cmd.load(contents, oname, state, cmd.loadable.mmtfstr) > > Cheers, > Thomas > > > On Jun 21, 2017, at 12:07 PM, Gianluca Tomasello wrote: > > > > Hi, I am using read_pdbstr function to load a strucutres into pymol. Is > > there a way to do the same for mmtf file formats? (I mean without using > > temporary files) -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Re: [PyMOL] Load mmtf data
Hi Thomas, something strange happen when I try to load 4v99.mmtf using this procedure (other PDB files works proprely as far as I know): download the file from https://mmtf.rcsb.org/v1.0/full/4V99 then in script: with open(file_path,"rb") as binary: b = binary.read() cmd.load(b, "str", 0, cmd.loadable.mmtfstr) if i try to load the script with pymol, It gives this result: ... Warning: map key not of type str (type 2). Warning: map key not of type str (type 2). Warning: map key not of type str (type 2). Warning: map key not of type str (type 6). Warning: map key not of type str (type 2). Warning: map key not of type str (type 7). Warning: map key not of type str (type 2). Error in MMTF_parser_fetch_typed_array: length mismatch 588367 588120 Warning: map key not of type str (type 2). Warning: map key not of type str (type 2). Warning: map key not of type str (type 2). Warning: map key not of type str (type 2). MMTF structureId: '4V99', mmtfVersion: '1.0.0' Segmentation fault (core dumped) The strange thing is that if I try to normally load this file in bash doing pymol 4v99.mmtf the file is correctly loaded. Is there something I am missing? 2017-06-22 17:52 GMT+02:00 Gianluca Tomasello : > Thank you very much! > > 2017-06-22 13:11 GMT+02:00 Thomas Holder : > >> Hi Gianluca, >> >> Yes this is possible, assuming you're using PyMOL 1.8.6. Use something >> like this: >> >> def read_mmtfstr(contents, oname, state=0): >> return cmd.load(contents, oname, state, cmd.loadable.mmtfstr) >> >> Cheers, >> Thomas >> >> > On Jun 21, 2017, at 12:07 PM, Gianluca Tomasello >> wrote: >> > >> > Hi, I am using read_pdbstr function to load a strucutres into pymol. Is >> there a way to do the same for mmtf file formats? (I mean without using >> temporary files) >> >> -- >> Thomas Holder >> PyMOL Principal Developer >> Schrödinger, Inc. >> >> > -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Re: [PyMOL] Load mmtf data
Hi Gianluca, Yes this is possible, assuming you're using PyMOL 1.8.6. Use something like this: def read_mmtfstr(contents, oname, state=0): return cmd.load(contents, oname, state, cmd.loadable.mmtfstr) Cheers, Thomas > On Jun 21, 2017, at 12:07 PM, Gianluca Tomasello wrote: > > Hi, I am using read_pdbstr function to load a strucutres into pymol. Is there > a way to do the same for mmtf file formats? (I mean without using temporary > files) -- Thomas Holder PyMOL Principal Developer Schrödinger, Inc. -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot ___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
[PyMOL] Load mmtf data
Hi, I am using read_pdbstr function to load a strucutres into pymol. Is there a way to do the same for mmtf file formats? (I mean without using temporary files) -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot___ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net