File: create_titration_output.py

package info (click to toggle)
pdb2pqr 2.1.1%2Bdfsg-7%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 47,044 kB
  • sloc: python: 44,152; cpp: 9,847; xml: 9,092; sh: 79; makefile: 55; ansic: 36
file content (11 lines) | stat: -rw-r--r-- 375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import os.path

def create_output(path, curves):
    file_name_template = "{}_{}_{}.csv"
    for key, curve in list(curves.items()):
        file_name = file_name_template.format(*key)
        file_path = os.path.join(path, file_name)

        with open(file_path, "w") as f:
            for pH, value in curve:
                f.write(str(pH)+', '+str(value)+'\n')