Skip to content

CIF data incorrect #1116

Closed
Closed

Description

@morellik

I use the following code to read CIF files.

       Structure structure = null;
      AtomCache cache = new AtomCache();
      cache.setPath(workdir);
      cache.setFiletype(StructureFiletype.CIF);
   
      StructureIO.setAtomCache(cache);
  
      structure = StructureIO.getStructure(pdbFile);

and structure.toMMCIF() to convert into a list of strings.

The original CIF has HETATM lines as

HETATM 1049 S S1 . 0KA C 2 . ? -5.639 -7.082 12.045 1.00 17.18 ? 101 0KA B S1 1
HETATM 1051 S S3 . 0KA C 2 . ? -6.031 -7.348 15.700 1.00 16.42 ? 101 0KA B S3 1
HETATM 1052 S S4 . 0KA C 2 . ? -9.120 -7.026 13.781 1.00 13.07 ? 101 0KA B S4 1

But after reading the CIF, I've

HETATM 1049 S S1 . 0KA C 2 101 ? -5.639 -7.082 12.045 1.00 17.18 101 0KA B S1 1
HETATM 1051 S S3 . 0KA C 2 101 ? -6.031 -7.348 15.700 1.00 16.42 101 0KA B S3 1
HETATM 1052 S S4 . 0KA C 2 101 ? -9.120 -7.026 13.781 1.00 13.07 101 0KA B S4 1

The 9th column in the original CIF is a dot; instead, in the structure object is 101 equals the 16th column (the _atom_site.auth_seq_id).

Is there a way to have the same original HETATM lines in the structure object?

Activity

  1. josemduarte commented on Nov 8, 2025

    @josemduarte
    Contributor

    Thanks for reporting. It seems that biojava outputs the residue number to both label_seq_id and auth_seq_id. In principle there's nothing wrong with that, but it is true that traditionally the PDB has not used label_seq_id for non-polymers. I had a quick look and it seems that we could make that the default behaviour with a patch. I'll submit a PR.

  2. added a commit that references this issue on Nov 8, 2025
  3. josemduarte commented on Nov 13, 2025

    @josemduarte
    Contributor

    The fix is now released in BioJava 7.2.3

  4. added a commit that references this issue on May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs and bugfixes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions