-
Notifications
You must be signed in to change notification settings - Fork 0
/
__Main.py
95 lines (65 loc) · 2.74 KB
/
__Main.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import sys
sys.path.append('D2P2Project/')
from D2P2Project._Retrieve_Full_Protein_Set_From_UniProt_D2P2_Check import *
from D2P2Project._Retrieve_Core_Proteins_From_HomoloGene import *
from D2P2Project._Filter_Core_And_NonCore_Proteins import *
from D2P2Project._Retrieve_D2P2_Consensus_Data import *
from D2P2Project._Calculate_Statistics_D2P2 import *
# Path is Universal for all scripts
path = "Data/"
# Functions:
def CreatePaths():
if not os.path.exists('{path}'.format(path=path)):
os.makedirs('{path}'.format(path=path))
if not os.path.exists('{path}{dir}/'.format(path=path, dir="_FullProteinSets")):
os.makedirs('{path}{dir}/'.format(path=path, dir="_FullProteinSets"))
if not os.path.exists('{path}{dir}/'.format(path=path, dir="_HomoloGeneSets")):
os.makedirs('{path}{dir}/'.format(path=path, dir="_HomoloGeneSets"))
if not os.path.exists('{path}{dir}/'.format(path=path, dir="Core")):
os.makedirs('{path}{dir}/'.format(path=path, dir="Core"))
if not os.path.exists('{path}{dir}/'.format(path=path, dir="NonCore")):
os.makedirs('{path}{dir}/'.format(path=path, dir="NonCore"))
def Query():
print("What organelle do you want to query?")
query = input("-> ")
print("Please enter API Key From NCBI: ")
print("API Key can be found by following directions from..", '\n', "https://ncbiinsights.ncbi.nlm.nih.gov/2017/11"
"/02/new-api-keys-for-the-e-utilities/")
api = input("-> ")
api_Key = "&api_key={api}".format(api=api)
print('\n')
query.lower()
return query, api_Key
def UniProt():
RetrieveFullProtSetUniProtD2P2Check(inputQuery, path)
def HomoloGene():
RetrieveCoreProteinsHomoloGene(inputQuery, path, apiKey)
def ConvertCoreHGToUniProt():
print("Coverting HomoloGene to UniProt ID...", end="")
FilterCoreNonCoreProt(inputQuery, path)
print("Done.")
def D2P2():
UniProtD2P2Data(inputQuery, path)
def Statistics():
print('\n')
print("Calculating Statistics...", end="")
CalculateStatisticsD2P2(inputQuery, path)
print("Done.", end="")
print('\n')
print("File is located here: {path}{query}_Statistics_Disorder_Statistics.csv".format(path=path,
query=inputQuery.capitalize()))
##----------- Execution ----------- ##
# Creates paths needed for program #
CreatePaths()
# Input from User
inputQuery, apiKey = Query()
# Retrieves the Full Dataset for query
UniProt()
# Retrieves NCBI HomoloGene Core Proteins
HomoloGene()
# Get Core and NonCore Proteins
ConvertCoreHGToUniProt()
# Get D2P2 Raw Data
D2P2()
# Statistics for Core and NonCore Proteins
Statistics()