Skip to content

Commit

Permalink
Eliminated need for temporary file in main.py
Browse files Browse the repository at this point in the history
replaced temp file in run_propka() with StringIO()
  • Loading branch information
mimminou committed May 7, 2022
1 parent 811b444 commit f47407f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pdb2pqr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,13 @@ def run_propka(args, biomolecule):
atomlist=biomolecule.atoms, chainflag=args.keep_chain, pdbfile=True
)

pdb_path = "input.pdb"
with StringIO() as fpdb:
fpdb.writelines(lines)
parameters = pk_in.read_parameter_file(args.parameters, Parameters())
molecule = MolecularContainer(parameters, args)
molecule = pk_in.read_molecule_file(pdb_path, molecule, fpdb)
# needs a mock name with .pdb extension to work with stream data, hence the "input.pdb"
molecule = pk_in.read_molecule_file("input.pdb", molecule, fpdb)



molecule.calculate_pka()
Expand Down

0 comments on commit f47407f

Please sign in to comment.