This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to change alternate conformation occupancy ?

Hi All,

I am very new to BioPython. I am trying to change occupancy value in my PDB for certain alternate conformations.

Unfortunately, the set_occupancy in PDB.Atom module does not work on alternate conformations other than A.

structure = PDBParser().get_structure('x', 'test.pdb')
            if atom.get_occupancy() < 1.0:
                if atom.get_altloc() == 'A':
                    print('before :', atom.get_occupancy())
                    atom.set_occupancy(1.0) 
                    print('after :', atom.get_occupancy())
                else:
                    k.set_occupancy(0.0)
bio.pdb.atom bio.pdb biopython

0 answers

No answers yet.

Log in to answer this question.