-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresidue_atom_pull.py
More file actions
executable file
·30 lines (27 loc) · 953 Bytes
/
residue_atom_pull.py
File metadata and controls
executable file
·30 lines (27 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Requires Python2.7
import subprocess
import sys
import os
import math
# This script takes the amino acid side chain atoms (or those not listed in aainterest) for each residue of interest in list residueinterest and writes them into their own file
# Can add other atoms to exlude
aainterest = ["CA","C","N","O","HN","HA"]
# Residues wanted to target
residueinterest = ["71","72","73","75","76","89","93","99","101","104","107","108","111","135","138","142","146",]
# Pdb file being read
pdbread = str(sys.argv[1])
# Identifier of molecule
molid = "MB"
emptynumbers = []
# Collection of atoms selected into this file
file = open('proteinsidechain.txt','w')
thestring = ""
with open(pdbread+".pdb") as f:
for line in f:
splitline = line.split()
if len(splitline) > 5:
if splitline[2] not in aainterest:
if splitline[4] in residueinterest:
if splitline[10] == molid:
thestring = thestring+splitline[1] + " "
file.write(thestring)