Hi Martin, > I wonder, what is a most meaningful way of programmatically determining > that a line of text in an arbitrary file contains atomic coordinates? > The context of this question is that I plan to write a program that > reads two files containing coordinates and has to perform operations on > pairs of coordinates r1 and r2, where ri is the coordinate value from > file i. > > [snip]
You ask about reading and testing coordinate data from files in various formats. There are two things I can think of to consider. First, each file format will have a different definition and therefore properties for extracting data. Some, like the PDB will be column-based, so you'll need to focus on getting your columns exactly right. Others might be binary (MTZ) or dictionaries (CIF) in which higher-order parsing might be necessary. Thus, for each format, you'd need a specific test which will be defined by that format. Second, and this happens all the time, many application writers will produce files that are nearly properly formatted--read incorrectly formatted--and will break a strict parser. If you're working on a large set of files, I suggest you write a "scrubber" that you can apply across your files to ensure they're properly formatted before use. If you're lucky, your format will come with a nicely defined BNF grammar. Good luck. Cheers, -- Jason -- Jason Vertrees, PhD Director of Core Modeling Product Management Schrödinger, Inc. (e) jason.vertr...@schrodinger.com (o) +1 (603) 374-7120 ------------------------------------------------------------------------------ Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 _______________________________________________ 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