Skip to content

Commit

Permalink
Release fixes (#380)
Browse files Browse the repository at this point in the history
* disable metadata downloads for alpha site

* Move group report styles to separate file

* Set B.1.617.2 to default active group

* move model code into own function

* Fix tree legend overflows

* bump to beta3

* Add environment file for cloudsql version, update instructions in docker files

* Default to connection pool of size 20, if not defined

* Order residues for proper residue querying in structural viewer. Closes #378

* bump to v2.2.1
  • Loading branch information
atc3 authored Aug 15, 2021
1 parent f939a71 commit 2990512
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 65 deletions.
7 changes: 7 additions & 0 deletions .cloudsql_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
POSTGRES_USER=...
POSTGRES_PASSWORD=...
POSTGRES_HOST=/cloudsql/[PROJECT ID]:us-central1:[SQL INSTANCE ID]
POSTGRES_DB=[DB_NAME]
GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials
CLOUDSQL_CONNECTION_NAME=[PROJECT ID]:us-central1:[SQL INSTANCE ID]
CONFIGFILE=config/[CONFIGFILE.yml]
4 changes: 3 additions & 1 deletion docker-compose.cloudsql.prod.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# docker-compose -f docker-compose.cloudsql.prod.yml -p cgprod
# docker compose --env-file .cloudsql_env -f docker-compose.cloudsql.yml -p cgcloudsql build
# docker compose --env-file .cloudsql_env -f docker-compose.cloudsql.yml -p cgcloudsql up -d

version: "3.7"

Expand All @@ -18,6 +19,7 @@ services:
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_HOST
- POSTGRES_MAX_CONN=20
command: "gunicorn --bind :8080 --workers 1 --threads 8 --timeout 0 cg_server.main:app"
# command: "flask run --host 0.0.0.0 --port=8080"
ports:
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.cloudsql.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# docker-compose -f docker-compose.cloudsql.yml -p cgcloudsql
# docker compose --env-file .cloudsql_env -f docker-compose.cloudsql.yml -p cgcloudsql build
# docker compose --env-file .cloudsql_env -f docker-compose.cloudsql.yml -p cgcloudsql up -d

version: "3.7"

Expand All @@ -19,6 +20,7 @@ services:
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_HOST
- POSTGRES_MAX_CONN=20
# command: "gunicorn --bind :5000 --workers 1 --threads 8 --timeout 0 cg_server.main:app"
command: "flask run --host 0.0.0.0 --port=5000"
ports:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "covidcg",
"version": "2.2.0-beta2",
"version": "2.2.1",
"description": "",
"engines": {
"node": ">=8",
Expand Down
2 changes: 1 addition & 1 deletion services/server/cg_server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def verify_password(username, password):
connection_options["port"] = port

conn_pool = psycopg2.pool.SimpleConnectionPool(
1, os.environ["POSTGRES_MAX_CONN"], **connection_options
1, os.getenv("POSTGRES_MAX_CONN", 20), **connection_options
)

# Quickly check if our database has been initialized yet
Expand Down
9 changes: 7 additions & 2 deletions src/components/GroupReport/GroupStructuralViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ const StructuralViewer = observer(() => {
.map((snv) => {
snv.colorInd = Math.floor((snv.fraction - 0.001) * numColors);
return snv;
});
})
.sort((a, b) => a.pos - b.pos);

// For each color level, build a list of residues
const heatmapEntries = [];
Expand All @@ -136,7 +137,7 @@ const StructuralViewer = observer(() => {
colorHeatmap({ plugin, entries: heatmapEntries, ref });
};

useEffect(() => {
const loadModel = () => {
if (!plugin) {
return;
}
Expand Down Expand Up @@ -236,6 +237,10 @@ const StructuralViewer = observer(() => {
});

modelAction;
};

useEffect(() => {
loadModel();
}, [
plugin,
plotSettingsStore.reportStructurePdbId,
Expand Down
60 changes: 7 additions & 53 deletions src/components/Pages/GroupReportTab.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect } from 'react';
import { observer } from 'mobx-react';
import styled from 'styled-components';
import { useStores } from '../../stores/connect';

import ReactTooltip from 'react-tooltip';
Expand All @@ -12,58 +11,13 @@ import GroupReportHeader from '../GroupReport/GroupReportHeader';
import MutationList from '../GroupReport/MutationList';
import StructuralViewer from '../GroupReport/GroupStructuralViewer';

const MEDIAWIDTH = '1475px';

const GroupReportTabContainer = styled.div`
display: grid;
grid-template-rows: auto;
grid-template-columns: 250px repeat(2, minmax(100px, 1fr));
max-height: 100vh;
@media (max-width: ${MEDIAWIDTH}) {
grid-template-rows: auto;
grid-template-columns: 250px minmax(100px, 1fr);
overflow-y: auto;
}
`;

const GroupTreePlotContainer = styled.div`
grid-row: 1 / 3;
grid-column: 1;
@media (max-width: ${MEDIAWIDTH}) {
grid-row: 1 / 4;
}
`;

const MutationsContainer = styled.div`
grid-column: 2;
grid-row: 1 / 3;
@media (max-width: ${MEDIAWIDTH}) {
grid-row: 2;
}
`;

const VOCContainer = styled.div`
grid-column: 3;
grid-row: 1;
@media (max-width: ${MEDIAWIDTH}) {
grid-column: 2;
grid-row: 1;
}
`;

const StructuralViewerContainer = styled.div`
grid-column: 3;
grid-row: 2;
@media (max-width: ${MEDIAWIDTH}) {
grid-column: 2;
grid-row: 3;
}
`;
import {
GroupReportTabContainer,
GroupTreePlotContainer,
MutationsContainer,
VOCContainer,
StructuralViewerContainer,
} from './GroupReportTab.styles';

const GroupReportTab = observer(() => {
const { groupDataStore } = useStores();
Expand Down
54 changes: 54 additions & 0 deletions src/components/Pages/GroupReportTab.styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import styled from 'styled-components';

const MEDIAWIDTH = '1475px';

export const GroupReportTabContainer = styled.div`
display: grid;
grid-template-rows: auto;
grid-template-columns: 250px repeat(2, minmax(100px, 1fr));
max-height: 100vh;
@media (max-width: ${MEDIAWIDTH}) {
grid-template-rows: auto;
grid-template-columns: 250px minmax(100px, 1fr);
overflow-y: auto;
}
`;

export const GroupTreePlotContainer = styled.div`
grid-row: 1 / 3;
grid-column: 1;
@media (max-width: ${MEDIAWIDTH}) {
grid-row: 1 / 4;
}
`;

export const MutationsContainer = styled.div`
grid-column: 2;
grid-row: 1 / 3;
@media (max-width: ${MEDIAWIDTH}) {
grid-row: 2;
}
`;

export const VOCContainer = styled.div`
grid-column: 3;
grid-row: 1;
@media (max-width: ${MEDIAWIDTH}) {
grid-column: 2;
grid-row: 1;
}
`;

export const StructuralViewerContainer = styled.div`
grid-column: 3;
grid-row: 2;
@media (max-width: ${MEDIAWIDTH}) {
grid-column: 2;
grid-row: 3;
}
`;
1 change: 1 addition & 0 deletions src/components/Vega/GradientLegend.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const LegendContainer = styled.div`
display: flex;
flex-direction: column;
align-items: stretch;
padding-right: 40px;
`;
export const LegendTitle = styled.div``;
export const LegendGradientBar = styled.div`
Expand Down
4 changes: 1 addition & 3 deletions src/components/Vega/GroupTreePlot.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,7 @@ const GroupTreePlot = observer(({ width }) => {
let tickLocs = ticks.map((tick) => {
return (ISOToInt(tick) - startDate) / rangeMS;
});
let tickLabels = ticks.map((tick) => {
return tick.substr(0, 7);
});
let tickLabels = ['2020-01', '07', '2021-01', '07'];

return (
<GradientLegend
Expand Down
2 changes: 1 addition & 1 deletion src/stores/plotSettingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const initialValues = {
reportMutationListHidden: ['ORF1a'], // By default, hide ORF1a
reportStructureActiveProtein: 'S',
reportStructurePdbId: '6ZGG',
reportStructureActiveGroup: 'B.1.1.7',
reportStructureActiveGroup: 'B.1.617.2',
};

export class PlotSettingsStore {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '2.2.0-beta2';
export const version = '2.2.1';

0 comments on commit 2990512

Please sign in to comment.