Skip to content

Commit ad1044b

Browse files
committed
Merge branch 'development'
2 parents 213db74 + 967d8bc commit ad1044b

File tree

1,402 files changed

+222514
-158438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,402 files changed

+222514
-158438
lines changed

data_parser.py

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -111,46 +111,58 @@ def parse_gvf_dir(dir_):
111111
pos = row["#start"]
112112
if pos not in ret[strain]["mutations"]:
113113
ret[strain]["mutations"][pos] = []
114-
mutation_types = row["#type"].split(",")
115-
num_of_mutations = len(mutation_types)
116-
for i in range(num_of_mutations):
117-
mutation_dict = {
118-
"ref": attrs["Reference_seq"],
119-
"alt": attrs["Variant_seq"].split(",")[i],
120-
"gene": attrs["vcf_gene"],
121-
"ao": float(attrs["ao"].split(",")[i]),
122-
"dp": float(attrs["dp"]),
123-
"multi_aa_name": attrs["multi_aa_name"],
124-
"clade_defining":
125-
attrs["clade_defining"] == "True",
126-
"hidden_cell": False,
127-
"mutation_name": attrs["Name"],
128-
"functions": {}
129-
}
130-
alt_freq = mutation_dict["ao"]/mutation_dict["dp"]
131-
mutation_dict["alt_freq"] = str(round(alt_freq, 4))
132-
type = mutation_types[i]
133-
if type == "ins":
134-
mutation_dict["mutation_type"] = "insertion"
135-
elif type == "del":
136-
mutation_dict["mutation_type"] = "deletion"
137-
else:
138-
mutation_dict["mutation_type"] = "snp"
139-
ret[strain]["mutations"][pos].append(mutation_dict)
140114

115+
mutation_name = attrs["Name"]
116+
alt = attrs["Variant_seq"]
117+
118+
mutation_dict = {}
119+
for existing_dict in ret[strain]["mutations"][pos]:
120+
cond1 = existing_dict["mutation_name"] == mutation_name
121+
cond2 = existing_dict["alt"] == alt
122+
if cond1 and cond2:
123+
mutation_dict = existing_dict
124+
break
125+
126+
if not mutation_dict:
127+
mutation_dict = {
128+
"ref": attrs["Reference_seq"],
129+
"alt": alt,
130+
"gene": attrs["vcf_gene"],
131+
"ao": float(attrs["ao"]),
132+
"dp": float(attrs["dp"]),
133+
"multi_aa_name": attrs["multi_aa_name"],
134+
"clade_defining":
135+
attrs["clade_defining"] == "True",
136+
"hidden_cell": False,
137+
"mutation_name": mutation_name,
138+
"functions": {}
139+
}
140+
141+
alt_freq = mutation_dict["ao"]/mutation_dict["dp"]
142+
mutation_dict["alt_freq"] = str(round(alt_freq, 4))
143+
144+
mutation_type = row["#type"]
145+
if mutation_type == "ins":
146+
mutation_dict["mutation_type"] = "insertion"
147+
elif mutation_type == "del":
148+
mutation_dict["mutation_type"] = "deletion"
149+
else:
150+
mutation_dict["mutation_type"] = mutation_type
151+
152+
ret[strain]["mutations"][pos].append(mutation_dict)
153+
154+
fn_dict = mutation_dict["functions"]
141155
fn_category = attrs["function_category"].strip('"')
156+
if not fn_category:
157+
continue
158+
if fn_category not in fn_dict:
159+
fn_dict[fn_category] = {}
160+
142161
fn_desc = attrs["function_description"].strip('"')
143162
fn_source = attrs["source"].strip('"')
144163
fn_citation = attrs["citation"].strip('"')
145-
fn_dict = {}
146-
if fn_category:
147-
if fn_category not in fn_dict:
148-
fn_dict[fn_category] = {}
149-
fn_dict[fn_category][fn_desc] = \
150-
{"source": fn_source, "citation": fn_citation}
151-
for i in range(len(ret[strain]["mutations"][pos])):
152-
parsed_mutation = ret[strain]["mutations"][pos]
153-
parsed_mutation[i]["functions"].update(fn_dict)
164+
fn_dict[fn_category][fn_desc] = \
165+
{"source": fn_source, "citation": fn_citation}
154166

155167
return ret
156168

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3'
2+
3+
services:
4+
app:
5+
tty: true
6+
build:
7+
context: .
8+
dockerfile: ./dockerConf/Dockerfile
9+
image: covid_mvp_app
10+
ports:
11+
- "8050:8050"
12+
volumes:
13+
- .:/app

dockerConf/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM continuumio/miniconda3
2+
3+
WORKDIR /app
4+
5+
COPY ./dockerConf/environment.yml /environment.yml
6+
COPY ./dockerConf/start.sh /start.sh
7+
8+
RUN apt-get update -y \
9+
&& apt-get install default-jre -y \
10+
&& wget -qO- https://get.nextflow.io | bash \
11+
&& chmod +x nextflow \
12+
&& mv /app/nextflow /usr/local/bin \
13+
&& conda env create -f /environment.yml \
14+
&& sed -i 's/\r$//g' /start.sh \
15+
&& chmod +x /start.sh
16+
17+
# https://pythonspeed.com/articles/activate-conda-dockerfile/
18+
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "COVID-MVP", "/start.sh"]
19+
EXPOSE 8050

dockerConf/app/Dockerfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

dockerConf/app/condaEnviroment.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

dockerConf/environment.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: COVID-MVP
2+
channels:
3+
- conda-forge
4+
- bioconda
5+
- defaults
6+
dependencies:
7+
- _libgcc_mutex=0.1=conda_forge
8+
- _openmp_mutex=4.5=2_gnu
9+
- bzip2=1.0.8=h7f98852_4
10+
- ca-certificates=2023.01.10=h06a4308_0
11+
- ld_impl_linux-64=2.40=h41732ed_0
12+
- libffi=3.4.2=h7f98852_5
13+
- libgcc-ng=12.2.0=h65d4601_19
14+
- libgomp=12.2.0=h65d4601_19
15+
- libnsl=2.0.0=h7f98852_0
16+
- libsqlite=3.40.0=h753d276_0
17+
- libuuid=2.32.1=h7f98852_1000
18+
- libzlib=1.2.13=h166bdaf_4
19+
- ncurses=6.4=h6a678d5_0
20+
- openssl=3.0.8=h0b41bf4_0
21+
- pip=23.0.1=pyhd8ed1ab_0
22+
- python=3.9.16=h2782a2a_0_cpython
23+
- readline=8.2=h5eee18b_0
24+
- setuptools=67.5.1=pyhd8ed1ab_0
25+
- tk=8.6.12=h27826a3_0
26+
- tzdata=2022g=h191b570_0
27+
- wheel=0.38.4=pyhd8ed1ab_0
28+
- xz=5.2.10=h5eee18b_1
29+
- pip:
30+
- brotli==1.0.9
31+
- click==8.1.3
32+
- dash==1.20.0
33+
- dash-bootstrap-components==0.11.3
34+
- dash-core-components==1.16.0
35+
- dash-html-components==1.1.3
36+
- dash-renderer==1.9.1
37+
- dash-table==4.11.3
38+
- flask==2.1.3
39+
- flask-caching==1.10.1
40+
- flask-compress==1.13
41+
- future==0.18.3
42+
- gunicorn==20.1.0
43+
- importlib-metadata==6.0.0
44+
- itsdangerous==2.1.2
45+
- jinja2==3.1.2
46+
- markupsafe==2.1.2
47+
- numpy==1.24.2
48+
- pandas==1.2.0
49+
- plotly==5.13.1
50+
- python-dateutil==2.8.2
51+
- pytz==2022.7.1
52+
- six==1.16.0
53+
- tenacity==8.2.2
54+
- werkzeug==2.0.2
55+
- zipp==3.15.0

dockerConf/nginx/Dockerfile

Lines changed: 0 additions & 4 deletions
This file was deleted.

dockerConf/nginx/nginx.conf

Lines changed: 0 additions & 59 deletions
This file was deleted.
File renamed without changes.

local.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)