annotate configuration.py @ 6:6dcecbe81d78 draft

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