Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv
- import argparse
- script,infile,outfile, reference = argv
- Ter = []
- res = []
- def get_Ter(reference):
- reference_1 = open(reference,"r")
- for line in reference_1:
- contents = line.split(" ")
- if contents[0] == "TER":
- resnum = line[22:27]
- resname = line[17:20]
- chain = line[21]
- Ter.append(resnum)
- def find_TER(infile,outfile):
- with open(infile, "r") as infile_1:
- content = infile_1.readlines()
- with open(outfile, "w+") as outfile_1:
- outfile_1.write(content)
- if line[0:6] == "ATOM ":
- resnum_1 = line[22:27]
- res.append(resnum_1)
- if resnum_1 in res == resnum in Ter:
- outfile_1.write(line + "nTER")
- find_TER(infile,outfile)
- get_Ter(reference)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement