Skip to content

Commit

Permalink
Migrate to pangolin v3 and other minor dependency upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
yp committed Nov 16, 2021
2 parents 6f8410e + 1fb0e47 commit 6cdd479
Show file tree
Hide file tree
Showing 24 changed files with 4,330 additions and 3,134 deletions.
9 changes: 8 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
frontend/node_modules
frontend/build
frontend/build
frontend/.yarn/*
!frontend/.yarn/patches
!frontend/.yarn/releases
!frontend/.yarn/plugins
!frontend/.yarn/sdks
!frontend/.yarn/versions
frontend/.pnp.*
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++14",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}
24 changes: 9 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.16.1-alpine as build-frontend
FROM node:14.17.6-alpine as build-frontend
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY frontend/package.json ./
Expand All @@ -11,37 +11,31 @@ RUN rm public/help
RUN yarn run build


FROM tiangolo/uwsgi-nginx-flask:python3.7-2020-06-08 as download-jobs
FROM tiangolo/uwsgi-nginx-flask:python3.9-2021-09-18 as download-jobs
RUN apt-get -y update && apt-get -y install ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /jobs
RUN git clone --depth 1 https://github.com/AlgoLab/MALVIRUS-data.git .



FROM tiangolo/uwsgi-nginx-flask:python3.7-2020-06-08
FROM tiangolo/uwsgi-nginx-flask:python3.9-2021-09-18
RUN apt-get -y update && apt-get -y install ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
RUN wget --quiet https://github.com/conda-forge/miniforge/releases/download/4.10.3-7/Mambaforge-4.10.3-7-Linux-x86_64.sh -O ~/mambaforge.sh && \
/bin/bash ~/mambaforge.sh -b -p /opt/conda && \
rm ~/mambaforge.sh && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc


RUN git clone https://github.com/cov-lineages/pangolin.git /pangolin && \
cd /pangolin && \
git checkout v.2.4.2 && \
/opt/conda/bin/conda env create -f environment.yml && \
/opt/conda/bin/conda run --no-capture-output -n pangolin python setup.py install

COPY ./environment-malva.yml environment-malva.yml
COPY ./environment-bcftools.yml environment-bcftools.yml

RUN cd /app && \
/opt/conda/bin/conda env create -f environment-malva.yml && \
/opt/conda/bin/conda env create -f environment-bcftools.yml && \
/opt/conda/bin/conda clean --all
/opt/conda/bin/mamba env create -f environment-malva.yml && \
/opt/conda/bin/mamba env create -f environment-bcftools.yml && \
/opt/conda/bin/mamba clean --all

ENV PATH /opt/conda/bin:$PATH

Expand Down
1 change: 0 additions & 1 deletion environment-bcftools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ name: bcftools
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bcftools=1.11
6 changes: 3 additions & 3 deletions environment-malva.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ name: malva-env
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- snakemake-minimal=5.32.2
- mafft=7.475
- mafft=7.490
- htslib=1.10.2
- sdsl-lite=2.1.1
- kmc=3.1.2rc1
Expand All @@ -14,4 +13,5 @@ dependencies:
- gffutils=0.10.1
- snp-sites=2.5.1
- snpeff=5.0
- csvkit=1.0.5
- csvkit=1.0.5
- pangolin=3.1.16
7 changes: 7 additions & 0 deletions frontend/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
8 changes: 8 additions & 0 deletions frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.js"
}
356 changes: 321 additions & 35 deletions frontend/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

55 changes: 0 additions & 55 deletions frontend/.yarn/releases/yarn-2.4.1.cjs

This file was deleted.

631 changes: 631 additions & 0 deletions frontend/.yarn/releases/yarn-3.0.2.cjs

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions frontend/.yarn/sdks/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/bin/eslint.js
require(absPnpApiPath).setup();
}
}

// Defer to the real eslint/bin/eslint.js your application uses
module.exports = absRequire(`eslint/bin/eslint.js`);
20 changes: 20 additions & 0 deletions frontend/.yarn/sdks/eslint/lib/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/lib/api.js
require(absPnpApiPath).setup();
}
}

// Defer to the real eslint/lib/api.js your application uses
module.exports = absRequire(`eslint/lib/api.js`);
6 changes: 6 additions & 0 deletions frontend/.yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "eslint",
"version": "7.32.0-sdk",
"main": "./lib/api.js",
"type": "commonjs"
}
5 changes: 5 additions & 0 deletions frontend/.yarn/sdks/integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is automatically generated by @yarnpkg/sdks.
# Manual changes might be lost!

integrations:
- vscode
20 changes: 20 additions & 0 deletions frontend/.yarn/sdks/prettier/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/index.js
require(absPnpApiPath).setup();
}
}

// Defer to the real prettier/index.js your application uses
module.exports = absRequire(`prettier/index.js`);
6 changes: 6 additions & 0 deletions frontend/.yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "prettier",
"version": "2.3.2-sdk",
"main": "./index.js",
"type": "commonjs"
}
2 changes: 1 addition & 1 deletion frontend/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-2.4.1.cjs
yarnPath: .yarn/releases/yarn-3.0.2.cjs

packageExtensions:
"antd-dayjs-webpack-plugin@*":
Expand Down
27 changes: 14 additions & 13 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
"private": true,
"dependencies": {
"@2fd/ant-design-icons": "2.4.1",
"@ant-design/icons": "4.6.2",
"antd": "4.16.1",
"core-js": "^3.13.1",
"dayjs": "1.10.5",
"@ant-design/icons": "4.7.0",
"antd": "4.16.13",
"core-js": "^3.19.1",
"dayjs": "1.10.7",
"eslint-config-react-app": "^6.0.0",
"history": "5.0.0",
"history": "5.1.0",
"markdown-to-jsx": "7.1.3",
"react": "^17.0.2",
"react-app-polyfill": "2.0.0",
"react-dom": "^17.0.2",
"react-refetch": "^3.0.1",
"react-router-dom": "6.0.0-beta.0",
"react-router-dom": "6.0.2",
"react-scripts": "4.0.3",
"react-window": "1.8.6",
"xlsx": "^0.17.0"
"xlsx": "^0.17.4"
},
"scripts": {
"start": "craco start",
Expand All @@ -38,13 +38,14 @@
]
},
"devDependencies": {
"@craco/craco": "6.1.2",
"@craco/craco": "6.4.0",
"antd-dayjs-webpack-plugin": "1.0.6",
"babel-plugin-import": "1.13.3",
"craco-less": "1.17.1",
"eslint": "^7.27.0",
"craco-less": "1.20.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"prettier": "2.3.0"
}
"eslint-plugin-prettier": "3.4.1",
"prettier": "2.4.1"
},
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions frontend/src/components/PangolinOutput/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ function PangolinOutputDescription({ pred, labelClassName }) {
)}
Lineage assignment is performed with PANGOLIN. See{' '}
<a
href="https://cov-lineages.org/"
href="https://cov-lineages.org/resources/pangolin/output.html"
target="_blank"
rel="noopener noreferrer"
>
https://cov-lineages.org/
https://cov-lineages.org/resources/pangolin/output.html
</a>{' '}
for details.
</>
Expand Down
35 changes: 26 additions & 9 deletions frontend/src/components/PangolinOutput/utils.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,47 @@
const render = (x) => <kbd>{x}</kbd>;

export const FIELDS = [
{
name: 'lineage',
label: 'Lineage',
render: (x, pred) => <b>{pred['Lineage name'] || x}</b>,
},
{ name: 'probability', label: 'Assignment probability' },
{ name: 'conflict', label: 'Assignment conflict', extra: '0 = no conflicts' },
{
name: 'conflict',
label: 'Assignment conflict',
extra:
'0 = no conflicts, otherwise the number of categories the sequence could fit into',
},
{
name: 'ambiguity_score',
label: 'Ambiguity score',
extra:
'A score of 1 indicates that no sites were imputed, while a score of 0 indicates that more sites were imputed than were not imputed.',
},
{ name: 'Date range' },
{ name: 'Days since last sampling' },
{ name: 'Most common countries' },
{ name: 'Number of taxa' },
{ name: 'status', label: 'Status' },
{ name: 'scorpio_call', label: 'Scorpio call' },
{ name: 'scorpio_support', label: 'Scorpio support' },
{ name: 'scorpio_conflict', label: 'Scorpio conflict' },
{ name: 'version', label: 'Version', render },
{
name: 'pangolin_version',
label: 'Pangolin version',
render,
},
{
name: 'pangoLEARN_version',
label: 'pangoLEARN version',
render: (x) => <kbd>{x}</kbd>,
render,
},
{
name: 'pango_version',
label: 'Pango version',
render: (x) => <kbd>{x}</kbd>,
},
{
name: 'pangolin_version',
label: 'Pangolin version',
render: (x) => <kbd>{x}</kbd>,
render,
},
{ name: 'status', label: 'Status' },
{ name: 'note', label: 'Note' },
];
9 changes: 8 additions & 1 deletion frontend/src/pages/Call/Call.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, useCallback } from 'react';
import { Fragment, useCallback, useEffect } from 'react';

import { Button, Descriptions } from 'antd';
import { SyncOutlined } from '@ant-design/icons';
Expand Down Expand Up @@ -126,6 +126,13 @@ function Call({ id, call, reloadCall }) {
call.value.log &&
JOB_STATUSES[call.value.log.status] &&
JOB_STATUSES[call.value.log.status].final;
useEffect(() => {
if (noRefresh) return;
const interval = window.setInterval(() => {
reloadCall();
}, 5000);
return () => window.clearInterval(interval);
});
return (
<>
<h1>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/CallNew/CallNew.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function CallNew({ createCall, vcfs }) {
(call) => {
setLoading(false);
message.success('Job submission successful!');
navigate(`../${call.id}`);
navigate(`/calls/${call.id}`);
},
(error) => {
setLoading(false);
Expand Down
Loading

0 comments on commit 6cdd479

Please sign in to comment.