Skip to content

Commit

Permalink
Merge branch 'development' into no_upload_master
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansg44 committed Mar 8, 2023
2 parents 1f7fe5f + 967d8bc commit 2d7b37c
Show file tree
Hide file tree
Showing 1,402 changed files with 222,514 additions and 158,438 deletions.
82 changes: 47 additions & 35 deletions data_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,46 +111,58 @@ def parse_gvf_dir(dir_):
pos = row["#start"]
if pos not in ret[strain]["mutations"]:
ret[strain]["mutations"][pos] = []
mutation_types = row["#type"].split(",")
num_of_mutations = len(mutation_types)
for i in range(num_of_mutations):
mutation_dict = {
"ref": attrs["Reference_seq"],
"alt": attrs["Variant_seq"].split(",")[i],
"gene": attrs["vcf_gene"],
"ao": float(attrs["ao"].split(",")[i]),
"dp": float(attrs["dp"]),
"multi_aa_name": attrs["multi_aa_name"],
"clade_defining":
attrs["clade_defining"] == "True",
"hidden_cell": False,
"mutation_name": attrs["Name"],
"functions": {}
}
alt_freq = mutation_dict["ao"]/mutation_dict["dp"]
mutation_dict["alt_freq"] = str(round(alt_freq, 4))
type = mutation_types[i]
if type == "ins":
mutation_dict["mutation_type"] = "insertion"
elif type == "del":
mutation_dict["mutation_type"] = "deletion"
else:
mutation_dict["mutation_type"] = "snp"
ret[strain]["mutations"][pos].append(mutation_dict)

mutation_name = attrs["Name"]
alt = attrs["Variant_seq"]

mutation_dict = {}
for existing_dict in ret[strain]["mutations"][pos]:
cond1 = existing_dict["mutation_name"] == mutation_name
cond2 = existing_dict["alt"] == alt
if cond1 and cond2:
mutation_dict = existing_dict
break

if not mutation_dict:
mutation_dict = {
"ref": attrs["Reference_seq"],
"alt": alt,
"gene": attrs["vcf_gene"],
"ao": float(attrs["ao"]),
"dp": float(attrs["dp"]),
"multi_aa_name": attrs["multi_aa_name"],
"clade_defining":
attrs["clade_defining"] == "True",
"hidden_cell": False,
"mutation_name": mutation_name,
"functions": {}
}

alt_freq = mutation_dict["ao"]/mutation_dict["dp"]
mutation_dict["alt_freq"] = str(round(alt_freq, 4))

mutation_type = row["#type"]
if mutation_type == "ins":
mutation_dict["mutation_type"] = "insertion"
elif mutation_type == "del":
mutation_dict["mutation_type"] = "deletion"
else:
mutation_dict["mutation_type"] = mutation_type

ret[strain]["mutations"][pos].append(mutation_dict)

fn_dict = mutation_dict["functions"]
fn_category = attrs["function_category"].strip('"')
if not fn_category:
continue
if fn_category not in fn_dict:
fn_dict[fn_category] = {}

fn_desc = attrs["function_description"].strip('"')
fn_source = attrs["source"].strip('"')
fn_citation = attrs["citation"].strip('"')
fn_dict = {}
if fn_category:
if fn_category not in fn_dict:
fn_dict[fn_category] = {}
fn_dict[fn_category][fn_desc] = \
{"source": fn_source, "citation": fn_citation}
for i in range(len(ret[strain]["mutations"][pos])):
parsed_mutation = ret[strain]["mutations"][pos]
parsed_mutation[i]["functions"].update(fn_dict)
fn_dict[fn_category][fn_desc] = \
{"source": fn_source, "citation": fn_citation}

return ret

Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'

services:
app:
tty: true
build:
context: .
dockerfile: ./dockerConf/Dockerfile
image: covid_mvp_app
ports:
- "8050:8050"
volumes:
- .:/app
19 changes: 19 additions & 0 deletions dockerConf/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM continuumio/miniconda3

WORKDIR /app

COPY ./dockerConf/environment.yml /environment.yml
COPY ./dockerConf/start.sh /start.sh

RUN apt-get update -y \
&& apt-get install default-jre -y \
&& wget -qO- https://get.nextflow.io | bash \
&& chmod +x nextflow \
&& mv /app/nextflow /usr/local/bin \
&& conda env create -f /environment.yml \
&& sed -i 's/\r$//g' /start.sh \
&& chmod +x /start.sh

# https://pythonspeed.com/articles/activate-conda-dockerfile/
ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "COVID-MVP", "/start.sh"]
EXPOSE 8050
33 changes: 0 additions & 33 deletions dockerConf/app/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions dockerConf/app/condaEnviroment.yml

This file was deleted.

55 changes: 55 additions & 0 deletions dockerConf/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: COVID-MVP
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- _libgcc_mutex=0.1=conda_forge
- _openmp_mutex=4.5=2_gnu
- bzip2=1.0.8=h7f98852_4
- ca-certificates=2023.01.10=h06a4308_0
- ld_impl_linux-64=2.40=h41732ed_0
- libffi=3.4.2=h7f98852_5
- libgcc-ng=12.2.0=h65d4601_19
- libgomp=12.2.0=h65d4601_19
- libnsl=2.0.0=h7f98852_0
- libsqlite=3.40.0=h753d276_0
- libuuid=2.32.1=h7f98852_1000
- libzlib=1.2.13=h166bdaf_4
- ncurses=6.4=h6a678d5_0
- openssl=3.0.8=h0b41bf4_0
- pip=23.0.1=pyhd8ed1ab_0
- python=3.9.16=h2782a2a_0_cpython
- readline=8.2=h5eee18b_0
- setuptools=67.5.1=pyhd8ed1ab_0
- tk=8.6.12=h27826a3_0
- tzdata=2022g=h191b570_0
- wheel=0.38.4=pyhd8ed1ab_0
- xz=5.2.10=h5eee18b_1
- pip:
- brotli==1.0.9
- click==8.1.3
- dash==1.20.0
- dash-bootstrap-components==0.11.3
- dash-core-components==1.16.0
- dash-html-components==1.1.3
- dash-renderer==1.9.1
- dash-table==4.11.3
- flask==2.1.3
- flask-caching==1.10.1
- flask-compress==1.13
- future==0.18.3
- gunicorn==20.1.0
- importlib-metadata==6.0.0
- itsdangerous==2.1.2
- jinja2==3.1.2
- markupsafe==2.1.2
- numpy==1.24.2
- pandas==1.2.0
- plotly==5.13.1
- python-dateutil==2.8.2
- pytz==2022.7.1
- six==1.16.0
- tenacity==8.2.2
- werkzeug==2.0.2
- zipp==3.15.0
4 changes: 0 additions & 4 deletions dockerConf/nginx/Dockerfile

This file was deleted.

59 changes: 0 additions & 59 deletions dockerConf/nginx/nginx.conf

This file was deleted.

File renamed without changes.
27 changes: 0 additions & 27 deletions local.yml

This file was deleted.

2 changes: 1 addition & 1 deletion nf-ncov-voc
Submodule nf-ncov-voc updated 1 files
+9 −6 bin/functions.py
25 changes: 0 additions & 25 deletions production.yml

This file was deleted.

Loading

0 comments on commit 2d7b37c

Please sign in to comment.