Skip to content
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

Error reading structures generated with extract_from_pdb #70

Open
diegozea opened this issue Mar 31, 2023 · 0 comments
Open

Error reading structures generated with extract_from_pdb #70

diegozea opened this issue Mar 31, 2023 · 0 comments

Comments

@diegozea
Copy link
Owner

Reading a pdb file created using extract_from_pdb (from T-Coffee) with MIToS throw errors, as the ATOM lines have only 66 characters. However, BioStructures' read function works fine. So, the following function uses BioStructures to save an intermediate file that MIToS can read.

"""
This function reads a PDB file created with extract_from_pdb and returns a MIToS' PDB object.
"""
function read_pdb(pdb_file::String)
    # Read the PDB file with BioStructures
    tmp = BioStructures.read(pdb_file, BioStructures.PDB)
    # Save the BioStructures' PDB object into a temporary file
    tmp_file = tempname()
    BioStructures.writepdb(tmp_file, tmp)
    # Read the temporary file with MIToS
    pdb = read(tmp_file, PDBFile)
    # Delete the temporary file
    rm(tmp_file)
    return pdb
end

From one of those PDB files:

REMARK Output of the program extract_from_pdb (Version 2.43)
REMARK Legal PDB format not Guaranteed
REMARK This format is not meant to be used in place of the PDB format
REMARK The header refers to the original entry
REMARK The sequence from the original file has been taken in the field: ATOM
REMARK extract_from_pdb, 2001, 2002, 2003, 2004, 2005 2006 (c) CNRS and Cedric Notredame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant