-
-
Save lhatsk/f8abc8174f9a96ccb28999e69e5556b3 to your computer and use it in GitHub Desktop.
Updates the b-factor range of models from 0..1 to 0..100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bio.PDB import * | |
from argparse import ArgumentParser | |
def parse_arguments(): | |
parser = ArgumentParser(description='Fix b-factor range for coloring') | |
parser.add_argument('--pdb', | |
help='Model file', | |
required=True) | |
parser.add_argument('--output', | |
help='Output', | |
required=True) | |
args = parser.parse_args() | |
return args | |
def main(): | |
args = parse_arguments() | |
parser = PDBParser() | |
structure = parser.get_structure('X', args.pdb)[0] | |
for chain in structure: | |
for residue in chain: | |
for atom in residue: | |
atom.set_bfactor(atom.get_bfactor() * 100) | |
io = PDBIO() | |
io.set_structure(structure) | |
io.save(args.output) | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment