annotate configuration.py @ 5:ad3bbf392135 draft

Uploaded
author petr-novak
date Wed, 26 Jun 2019 11:14:05 -0400
parents a5f1638b73be
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
1 #!/usr/bin/env python3
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
2 import os
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
3 ''' configuration file to set up the paths and constants '''
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
4
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
5 ######## PROFREP #######################################################
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
6 ## Constansts
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
7 N_segment = 50
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
8 MAX_FILES_SUBPROFILES = 1000
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
9 MAX_PIC_NUM = 50
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
10 IMAGE_RES = 300
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
11 FASTA_LINE = 60
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
12 SEQ_LEN_VIZ = 200000
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
13 FORBIDDEN_CHARS = "\\/"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
14 HTML_STR = '''
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
15 <!DOCTYPE html>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
16 <html>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
17 <body>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
18 <h2>PROFREP OUTPUT</h2>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
19 <h4> Sequences processed: </h4>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
20 {}
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
21 <h4> Total length: </h4>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
22 <pre> {} bp </pre>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
23 <h4> Database: </h4>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
24 <pre> {} </pre>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
25 <hr>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
26 <h3> Repetitive profile(s)</h3> </br>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
27 {} <br/>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
28 <h4>References: </h4>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
29 {}
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
30 </h6>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
31 </body>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
32 </html>
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
33 '''
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
34
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
35 ## IO
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
36 DOMAINS_GFF = "output_domains.gff"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
37 N_GFF = "N_regions.gff"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
38 REPEATS_GFF = "output_repeats.gff"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
39 HTML = "output.html"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
40 LOG_FILE = "log.txt"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
41 PROFREP_DATA = "tool_data/profrep"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
42 PROFREP_TBL = "prepared_datasets.txt"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
43 PROFREP_OUTPUT_DIR = "profrep_output_dir"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
44 ## JBrowse and Tracks Conf
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
45 jbrowse_data_dir = "data"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
46 JSON_CONF_R = """{"hooks" : {"modify": "function( track, f, fdiv ) {fdiv.style.backgroundColor = '#278ECF'}"}}"""
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
47 JSON_CONF_N = """{"hooks" : {"modify": "function( track, f, fdiv ) {fdiv.style.background = '#474747'}"}}"""
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
48 COLORS_HEX = ["#7F7F7F", "#00FF00", "#0000FF", "#FF0000", "#01FFFE", "#FFA6FE",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
49 "#FFDB66", "#006401", "#010067", "#95003A", "#007DB5", "#FF00F6",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
50 "#774D00", "#90FB92", "#0076FF", "#D5FF00", "#FF937E", "#6A826C",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
51 "#FF029D", "#FE8900", "#7A4782", "#7E2DD2", "#85A900", "#FF0056",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
52 "#A42400", "#00AE7E", "#683D3B", "#BDC6FF", "#263400", "#BDD393",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
53 "#00B917", "#9E008E", "#001544", "#C28C9F", "#FF74A3", "#01D0FF",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
54 "#004754", "#E56FFE", "#788231", "#0E4CA1", "#91D0CB", "#BE9970",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
55 "#968AE8", "#BB8800", "#43002C", "#DEFF74", "#00FFC6", "#FFE502",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
56 "#620E00", "#008F9C", "#98FF52", "#7544B1", "#B500FF", "#00FF78",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
57 "#FF6E41", "#005F39", "#6B6882", "#5FAD4E", "#A75740", "#A5FFD2",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
58 "#FFB167", "#009BFF", "#E85EBE"]
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
59 COLORS_RGB = ["127,127,127", "0,255,0", "0,0,255", "255,0,0", "1,255,254",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
60 "255,166,254", "255,219,102", "0,100,1", "1,0,103", "149,0,58",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
61 "0,125,181", "255,0,246", "119,77,0", "144,251,146", "0,118,255",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
62 "213,255,0", "255,147,126", "106,130,108", "255,2,157",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
63 "254,137,0", "122,71,130", "126,45,210", "133,169,0", "255,0,86",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
64 "164,36,0", "0,174,126", "104,61,59", "189,198,255", "38,52,0",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
65 "189,211,147", "0,185,23", "158,0,142", "0,21,68", "194,140,159",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
66 "255,116,163", "1,208,255", "0,71,84", "229,111,254",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
67 "120,130,49", "14,76,161", "145,208,203", "190,153,112",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
68 "150,138,232", "187,136,0", "67,0,44", "222,255,116",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
69 "0,255,198", "255,229,2", "98,14,0", "0,143,156", "152,255,82",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
70 "117,68,177", "181,0,255", "0,255,120", "255,110,65", "0,95,57",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
71 "107,104,130", "95,173,78", "167,87,64", "165,255,210",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
72 "255,177,103", "0,155,255", "232,94,190"]
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
73 TRACK_LIST = '''
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
74 \t,{}\n
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
75 \t"storeClass" : "JBrowse/Store/SeqFeature/BigWig",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
76 \t"urlTemplate" : "{}",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
77 \t"type" : "JBrowse/View/Track/Wiggle/XYPlot",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
78 \t"label" : "{}",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
79 \t"key" : "{}",
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
80 \t"style": {}
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
81 \t\t"pos_color": "{}"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
82 \t {},
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
83 \t"scale" : "log"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
84 \t{}\n
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
85 '''
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
86
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
87 ## GFF tracks
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
88 HEADER_GFF = "##gff-version 3"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
89 SOURCE_PROFREP = "profrep"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
90 SOURCE_DANTE = "dante"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
91 PHASE = "."
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
92 DOMAINS_FEATURE = "protein_domain"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
93 REPEATS_FEATURE = "repeat"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
94 N_NAME = "N"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
95 N_FEATURE = "N_region"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
96 HEADER_WIG = "variableStep\tchrom="
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
97 GFF_EMPTY = "."
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
98
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
99 ######### BIG WIG ######################################################
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
100 CHROM_SIZES_FILE = "chrom_sizes.txt"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
101
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
102 ######### EXTRACT_DATA_DOR_PROFREP #####################################
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
103 HITSORT_CLS = "seqclust/clustering/hitsort.cls"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
104 READS_ALL = "seqclust/sequences/sequences.fasta"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
105 ANNOTATION = "PROFREP_CLASSIFICATION_TEMPLATE.csv"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
106
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
107 ######### PROFREP_DB_REDUCING ##########################################
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
108 MEM_LIM = 1500 # MB
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
109 CLS_REDUCED = "hitsort_reduced.cls"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
110 READS_ALL_REDUCED = "reads_all_reduced"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
111
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
112 ######### PROFREP_REFINING #############################################
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
113 WITH_DOMAINS = "mobile_element"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
114 QUALITY_DIFF_TO_REMOVE = 0.05 # 5% tolerance of PID
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
115
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
116 ######### DANTE ##############################################
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
117 MAIN_GIT_DIR = os.path.dirname(os.path.realpath(__file__))
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
118 DOMAINS_DATA = os.path.join(MAIN_GIT_DIR, "domains_data")
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
119 TMP = "tmp"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
120 SC_MATRIX = os.path.join(DOMAINS_DATA, "blosum80.txt")
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
121 AMBIGUOUS_TAG = "Ambiguous_domain"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
122 ## IO
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
123 CLASS_FILE = "ALL.classification-new"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
124 LAST_DB_FILE = "ALL_protein-domains_05.fasta"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
125 DOM_PROT_SEQ = "dom_prot_seq.fa"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
126 FILT_DOM_GFF = "domains_filtered.gff"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
127 EXTRACT_DOM_STAT = "domains_counts.txt"
a5f1638b73be Uploaded
petr-novak
parents:
diff changeset
128 EXTRACT_OUT_DIR = "extracted_domains"