>>># Iterate over models >>>for model in structure: >>> print(f"Model ID: {model.id}") >>> # Iterate over chains in the model >>> for chain in model: ... print(f" Chain ID: {chain.id}") >>> # Check if residue 100 exists in this chain >>> if 100 in chain: ... residue = chain ... print(f" Coordinates of atoms in residue 100:") ... # Print coordinates of each atom in residue 100 ... for atom in residue: ... print(atom.coord) ... else: ... print(" Residue 100 not found in this chain.") ... break
Model ID: 0 Chain ID: A Coordinates of atoms in residue 100: [ 9.837 18.218 81.24 ] [ 9.644 18.809 79.938] [ 8.772 20.066 80.01 ] [ 7.572 19.996 80.27 ] [ 9.07 17.788 78.962] [ 8.989 18.261 77.529] [10.352 18.647 76.938] [11.281 17.832 76.922] [10.486 19.917 76.503] Chain ID: B Coordinates of atoms in residue 100: [23.712 13.531 36.955] [23.197 12.95 35.746] [23.961 11.693 35.339] [25.138 11.757 34.935] [23.183 13.97 34.623] [22.49 13.49 33.361] [21.022 13.13 33.571] [20.22 13.96 34.039] [20.66 11.867 33.253]
Genetyka populacyjna Moduł Bio.PopGen dodaje do