-
Notifications
You must be signed in to change notification settings - Fork 0
/
orthologs.py
59 lines (52 loc) · 2 KB
/
orthologs.py
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
"""
Function: orthologs
Constructs a distribution of differences in small molecule binding
between pairs of orthologs (for now: human-to-rat).
-------------------
Felix Kruger
momo.sander@googlemail.com
"""
def orthologs():
import queryDevice
import mkDict
import queries
import writePairs
import os
import align
import addProperties
import mkHomologTable
import readIds
import yaml
# Read config file.
paramFile = open('gla.yaml')
params = yaml.safe_load(paramFile)
needlepath = params['needlepath']
vsCompara = params['vsCompara']
release = params['release']
comparaOrthologs = "data/orthologs_%s.txt"% params['vsCompara']
comparaHumanIds = "data/humanIds_%s.txt"% params['vsCompara']
comparaRatIds = "data/ratIds_%s.txt"% params['vsCompara']
# Assign output filenames.
dictFile = "data/ortho_compDict_%s.pkl"% params['release']
results = "data/orthologs_%s_%s.tab"%(params['release'], params['vsCompara'])
orthoTab = "data/orthologTable_%s.txt" % params['vsCompara']
# Create output files.
humanLkp = readIds.readIds(comparaHumanIds)
ratLkp = readIds.readIds(comparaRatIds)
mkHomologTable.homologTable(comparaOrthologs, orthoTab, humanLkp, ratLkp)
query = queries.paralogs(orthoTab)
acts= queryDevice.queryDevice(query, params)
mkDict.activities(acts, dictFile)
writePairs.homologMedian(params['homologyTypeOrthologs'], orthoTab, dictFile, results)
# Annotate output files.
align.pfam_a(results, params)
align.bSite(results, params)
addProperties.addMolweight('molregno', results, params)
addProperties.addTargetClass("L1","accession1", results, params)
addProperties.addPrefName("accession1", results, params)
addProperties.addPrefName("accession2", results, params)
if __name__ == '__main__':
import sys
if len(sys.argv) != 1: # the program name and the two arguments
sys.exit("All parameters are passed through gla.yaml")
orthologs()