-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pdb coordinate reader: error: Parsing coordinates for the following line #57
Comments
Probably the issue is the missing space between y- and z-component of
the coordinate. Instead of a manual correction, such an omission may
be corrected on the CLI with openbabel (openbabel.org) in a pattern of
babel -ipdb notworking.pdb -opdb now_working.pdb
where -ipdb defines the input format as .pdb, and similar, -opdb
specifies the output format as .pdb.
Depending on the version of calculate_rmsd.py, the *.pdb generated by
openbabel might not work well. In this case, in case you do not need
crystallographic information like space group symmetry, you may better
work with the least complex file type instead, .xyz. If so a call from
the terminal in pattern of
obabel *.pdb -oxyz -m
will convert in a batch all *.pdb in your directory into .xyz files.
Give this a try, and if not working post again.
Norwid
…On Wed, 05 Jun 2019 08:56:32 -0700 tccyl ***@***.***> wrote:
` if x_column == None:
try:
# look for x column
for i, x in enumerate(tokens):
if "." in x and "." in tokens[i + 1] and
"." in tokens[i + 2]: x_column = i
break
except IndexError:
exit("error: Parsing coordinates for the
following line: \n{0:s}".format(line))` If the pdb line is like
'ATOM 383 C6 C B 122 -2.217 -2.542-103.749' (the value
of x and that of z are connected), the code will exit, and the
coordinates cannot be obtained.
|
Hi @tccyl , Where is the PDB file from? From rcsb.org? I am not a heavy .pdb fileformat user. I've read the http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html#ATOM fileformat documentation and it seems PDB is column width based and not space.split as currently implemented. You are very welcome to make a pull request solving this formatting, including a .pdb file where rmsd fails. |
Dear Jimmy, calculate_rmsd.py is sometimes deployed by mine for data derived from single crystal Converting .cif to .pdb with openbabel yields files generally unsuitable for
Possibly some of the documentation attached may illustrate the experience. |
Hi, nbehrnd, |
|
Hi @tccyl , it seems my reply by email earlier didn't pass through. Anyway, meanwhile, there was For a small test molecules (benzamide) consisting of C, H, N, and O, the addition of some Meanwhile, give it a try; perhaps your (test) data reveal additional keywords should be |
@nbehrnd Thank you so much~ |
Hi @tccyl in short, after passing the The detailed story: I passed your
In both instances, However atom label, (x,y,z) and atom type seem to pass into the newly written The openbabel-written With the
Both model_A as well as the update of model_B (new_alignment_11.xyz) were read by jmol. Their corresponding selection of atoms were connected manually ('connect strut' instruction after selection The labeling in |
if x_column == None: try: # look for x column for i, x in enumerate(tokens): if "." in x and "." in tokens[i + 1] and "." in tokens[i + 2]: x_column = i break except IndexError: exit("error: Parsing coordinates for the following line: \n{0:s}".format(line))
If the pdb line is like 'ATOM 383 C6 C B 122 -2.217 -2.542-103.749' (the value of x and that of z are connected), the code will exit, and the coordinates cannot be obtained.
The text was updated successfully, but these errors were encountered: