YouTube video on using Octave in analysis of computational chemistry files

Hi, I put here a link to my latest YouTube video. I have tutorials on Octave, but also have a series of videos on using Octave to analyze computational chemistry results. This one is on retrieving structures from a large trajectory file output by Orca. I use the textscan function. It could be a source of inspiration for reading other file formats.
Comments are welcome! Thank you!


Thank you for sharing your knowledge and your application domain. Glad that Octave is helpful for you in parsing data files from a third party application.

If reading from files is a bottleneck for you, say if you have to process many files in future, reading in binary format (fread or load) is 50+ times faster than reading text. This does need the writing location to write in binary format. Within Octave you can do that with fwrite or save -binary but you’re getting your data from outside. If this not viable or if this is not a bottleneck for you, what you have is very much usable.

1 Like

Thanks! I’m not sure that these types of files are produced in binary also. In this case I believe speed is good enough. I haven’t profiled the script but I asume most of the time is spent inside textscan. I think I could eventually write an oct-file, but that would only be useful if there is a lower level alternative to textscan.
In any case what I’m more interested in is developing other tools to analyze the structural information obtained from these trajectory files. Eventually making a simple toolbox for analysis of computational chemistry data. I will be sharing future updates!
Hope this is useful to the community. Since I’m not skilled enough to actually work on the Octave code itself, at least I like to contribute some niche functionalities.

1 Like

If reading txt files becomes a speed issue, you can have a look in the c++ code for reading/writing obj text files (Wavefront format for triangular meshes), which I’ve implemented for the csg-toolkit. These files are usually in the >20MB range up to hundreds of MB, so my initial m functions were very slow. Implementing readobj/writeobj in oct files, gave a 1000x increase. Hope, you find them useful as a code templates.

1 Like