forked from ryanmcgreevy/ModelMaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalign2d.py
More file actions
executable file
·32 lines (26 loc) · 1.09 KB
/
align2d.py
File metadata and controls
executable file
·32 lines (26 loc) · 1.09 KB
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
31
32
from modeller import *
#import sys
import os.path
import argparse
parser = argparse.ArgumentParser(description=("This script performs a 2d alignment based on " +
"a given structure and sequence using MODELLER."))
parser.add_argument("-template", action="store", dest="TEMPLATE", required=True,
help='Template structure (.pdb) - required')
parser.add_argument("-sequence", action="store", dest="SEQ", required=True,
help='Sequence file (.seq) - required')
parser.add_argument("-chain", action="store", dest="CHAIN", required=True,
help='Chain ID - required')
args = parser.parse_args()
inmodel = args.TEMPLATE
chain = args.CHAIN
sequence = args.SEQ
model_name = os.path.splitext(inmodel)[0]
sequence_name = os.path.splitext(sequence)[0]
env = environ()
aln = alignment(env)
mdl = model(env, file=inmodel, model_segment=('FIRST:%s' % chain,'LAST:%s' % chain))
aln.append_model(mdl, align_codes=model_name, atom_files=inmodel)
aln.append(file=sequence, align_codes=sequence_name)
aln.align2d()
aln.write(file='alignment.aln', alignment_format='PIR')
aln.write(file='alignment.pap', alignment_format='PAP')