-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbat_main.py
More file actions
65 lines (48 loc) · 1.43 KB
/
bat_main.py
File metadata and controls
65 lines (48 loc) · 1.43 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Python 2.7
#
# v. 1.0
#
# BAT
# Bfactor Alignment Tool
#
# Joe Bemister
# 07/17/2015
#
#
# last modified:
# 07/17/2015
#
# ################
# DESCRIPTION
# ################
#
# Program reads in a pdb file with bfactor values (originally intended for
# Proflex flexibility indeces) and aligns them based on a DALI alignment file.
import sys
import os
#importing own python files from same dir
import bat_optparse
import bat_read_align_file
import bat_print_align
import bat_read_pdb
#load menu
bat_optparse
#Writing to File at the same time (From Sebastian Raschka's HETHER)
#######################################################
if '.txt' in bat_optparse.salign:
output_file = bat_optparse.salign[:-4] + '_bat.csv'
else:
output_file = bat_optparse.salign + '_bat.csv'
print('Results written to {}'.format(output_file))
#######################################################
def main():
# opens, reads, and closes the input files. returns dictionary of c alphas.
d_target = bat_read_pdb.read(bat_optparse.starget)
d_query = bat_read_pdb.read(bat_optparse.squery)
# opens, reads, and closes the input file. returns a dictionary query alignment
# and a pdb code for the target and query.
d_query_align, target, query = bat_read_align_file.read(bat_optparse.salign)
# prints the alignment to the output file
bat_print_align.print_align(d_target, d_query, d_query_align, target, query, output_file)
main()