Hi PyMOL users
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.
Example format 1 (MOPAC):
C( <LABEL TEXT> ) 1.0 +0 1.0 +0 1.0 +0
Example format 2 (PDB):
ATOM 1 N ALA A 1 32.517 42.012 20.144 1.00 0.00
PROT N
(some whitespace omitted).
In example 1, the coordinates are "1.0", "1.0" and "1.0", the "+0" are
program specific labels to identify the coordinate as fixed or relaxed.
Can this really only be done by hardcoding the positions of the coordinates?
Can this be unittested? I mean, if it indeed is only possible to read
the coordinate by collecting, say
[python]
s="ATOM 1 N ALA A 1 32.517 42.012 20.144 1.00
0.00 PROT N"
def get_x(s):
x=s[32:38]
return x
[/python]
what would a unittest for get_x look like? Would it even make sense to
write such a test?
Looking forward to discussions.
Martin
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 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_122412
_______________________________________________
PyMOL-users mailing list ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]