Skip to content

Commit

Permalink
Merge branch 'main' into thuang-5397-next-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
tihuan authored Jan 18, 2024
2 parents b439453 + 0f05229 commit 0ca8504
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 123 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/rdev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
functional-test:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs:
- seed-wmg-cellguide-rdev
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -37,29 +35,6 @@ jobs:
pip3 install -r tests/functional/requirements.txt
DEPLOYMENT_STAGE=rdev STACK_NAME=${{ env.STACK_NAME }} make functional-test
seed-wmg-cellguide-rdev:
runs-on: ubuntu-22.04
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 1800
- name: Checkout Repository
uses: actions/checkout@v2

- name: Grant Execute Permission to Bash Script
run: |
chmod +x ./scripts/populate_rdev_with_cellguide_data.sh ./scripts/populate_rdev_with_wmg_data.sh
- name: Seed cell guide data
run: |
./scripts/populate_rdev_with_cellguide_data.sh ${{ env.STACK_NAME }}
- name: Seed WMG data
run: |
./scripts/populate_rdev_with_wmg_data.sh ${{ env.STACK_NAME }}
seed-database-e2e-tests:
runs-on: ubuntu-22.04
steps:
Expand All @@ -80,7 +55,6 @@ jobs:
run-e2e-tests:
needs:
- seed-wmg-cellguide-rdev
- seed-database-e2e-tests
timeout-minutes: 30
name: e2e-tests ${{ matrix.project }} ${{ matrix.shardCurrent }} of ${{ matrix.shardTotal }}
Expand Down Expand Up @@ -224,7 +198,6 @@ jobs:
run:
working-directory: frontend
needs:
- seed-wmg-cellguide-rdev
- seed-database-e2e-tests
steps:
- uses: actions/setup-node@v2
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/rdev-update-for-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,29 @@ jobs:
group: pr-${{ github.event.number }}-build
cancel-in-progress: true

seed-wmg-cellguide-rdev:
runs-on: ubuntu-22.04
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 1800
- name: Checkout Repository
uses: actions/checkout@v2

- name: Grant Execute Permission to Bash Script
run: |
chmod +x ./scripts/populate_rdev_with_cellguide_data.sh ./scripts/populate_rdev_with_wmg_data.sh
- name: Seed cell guide data
run: |
./scripts/populate_rdev_with_cellguide_data.sh ${{ env.STACK_NAME }}
- name: Seed WMG data
run: |
./scripts/populate_rdev_with_wmg_data.sh ${{ env.STACK_NAME }}
deploy-rdev:
runs-on: ubuntu-22.04
concurrency:
Expand All @@ -68,6 +91,7 @@ jobs:
needs:
- build_images
- get_previous_image_digests
- seed-wmg-cellguide-rdev
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
18 changes: 1 addition & 17 deletions backend/wmg/data/ontology_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
"genes_mus_musculus.csv.gz",
]

SUFFIXES_TO_STRIP = ["organoid", "cell culture"]


def ontology_term_label(ontology_term_id: str) -> Optional[str]:
"""
Expand All @@ -27,21 +25,7 @@ def ontology_term_label(ontology_term_id: str) -> Optional[str]:
"""
global ontology_term_id_labels

# this catches the organoid tissue edge case (e.g. UBERON:0000995 (organoid)) or the cell culture edge case
# (e.g. CL:0000082 (cell culture))
suffix_to_strip = None
for suffix in SUFFIXES_TO_STRIP:
if suffix in ontology_term_id:
suffix_to_strip = suffix
break

if suffix_to_strip:
ontology_term_id = ontology_term_id.split(f"({suffix_to_strip})")[0].strip()
ontology_term_id_label = ontology_term_id_labels.get(ontology_term_id)
if suffix_to_strip:
ontology_term_id_label = ontology_term_id_label + f" ({suffix_to_strip})"

return ontology_term_id_label
return ontology_term_id_labels.get(ontology_term_id)


def gene_term_label(gene_ontology_term_id: str) -> Optional[str]:
Expand Down
3 changes: 0 additions & 3 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ const HUBSPOT_FORMS_URL = "https://forms.hsforms.com";

const CROSS_REF_URL = "https://api.crossref.org";

const DATADOG_URL = "browser-intake-datadoghq.com";

const GOOGLE_FONTS_URL = "https://fonts.gstatic.com";

const SCRIPT_SRC = [
Expand All @@ -47,7 +45,6 @@ const defaultSecureHeaders = {
configs.CELLGUIDE_DATA_URL,
configs.CENSUS_MODELS_DATA_URL,
CROSS_REF_URL,
DATADOG_URL,
GOOGLE_FONTS_URL,
],
defaultSrc: ["'self'", HUBSPOT_FORMS_URL],
Expand Down
53 changes: 0 additions & 53 deletions frontend/package-lock.json

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

1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@blueprintjs/select": "^5.0.23",
"@czi-sds/components": "^18.1.2",
"@czi-sds/data-viz": "^0.3.0",
"@datadog/browser-rum": "^5.1.0",
"@emotion/css": "^11.11.2",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
Expand Down
15 changes: 0 additions & 15 deletions frontend/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
import { StyledEngineProvider, ThemeProvider } from "@mui/material/styles";
import { datadogRum } from "@datadog/browser-rum";
import { NextPage } from "next";
import { AppProps } from "next/app";
import Head from "next/head";
Expand Down Expand Up @@ -42,20 +41,6 @@ type AppPropsWithLayout = AppProps & {
Component: NextPageWithLayout;
};

datadogRum.init({
applicationId: "44f77ca2-1482-404a-ad38-23499bb925e5",
clientToken: "pub55d4baaac2091f9656a83da732732a89",
site: "datadoghq.com",
service: "single-cell-data-portal",
env: process.env.NODE_ENV,
sessionSampleRate: 100,
sessionReplaySampleRate: 20,
trackUserInteractions: true,
trackResources: true,
trackLongTasks: true,
defaultPrivacyLevel: "mask-user-input",
});

function App({ Component, pageProps }: AppPropsWithLayout): JSX.Element {
const Layout = Component.Layout || DefaultLayout;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ interface DescriptionProps {
cellTypeName: string;
cellTypeId: string;
skinnyMode: boolean;
setTooltipContent: Dispatch<
setTooltipContent?: Dispatch<
SetStateAction<{
title: string;
element: JSX.Element;
Expand Down Expand Up @@ -209,17 +209,19 @@ export default function Description({
}}
onClick={() => {
skinnyMode &&
setTooltipContent &&
setTooltipContent({
title: "ChatGPT Descriptions",
element: tooltipContent,
});
}}
// only setting mobile Tooltip View on touch and not click
onTouchEnd={() => {
setTooltipContent({
title: "ChatGPT Descriptions",
element: tooltipContent,
});
setTooltipContent &&
setTooltipContent({
title: "ChatGPT Descriptions",
element: tooltipContent,
});
}}
>
<StyledIconImage alt="question mark" src={questionMarkIcon} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
DivTableHead,
DivTableRow,
} from "../../common/styles";
import Description from "src/views/CellGuide/components/CellGuideCard/components/Description";

function CellInfoSideBar({
cellInfoCellType,
Expand Down Expand Up @@ -91,6 +92,12 @@ function CellInfoSideBar({
return (
<>
<TissueName>{tissueInfo.name}</TissueName>
<Description
cellTypeId={cellInfoCellType.cellType.id}
cellTypeName={cellInfoCellType.cellType.name}
skinnyMode={true}
inSideBar
/>
<Link
href={`${ROUTES.CELL_GUIDE}/${cellInfoCellType.cellType.id}`}
onClick={() =>
Expand All @@ -103,6 +110,7 @@ function CellInfoSideBar({
>
{MARKER_SCORE_CELLGUIDE_LINK_TEXT}
</Link>

<ButtonContainer>
<ButtonWrapper>
<StyledMarkerGeneHeader>{MARKER_GENE_LABEL}</StyledMarkerGeneHeader>
Expand Down
13 changes: 13 additions & 0 deletions frontend/tests/features/wheresMyGene/wheresMyGene.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import {
SPECIFICITY_TOOLTIP_CONTENT_SECOND_HALF,
SPECIFICITY_TOOLTIP_TEST_ID,
} from "src/common/constants/markerGenes";
import { CELL_GUIDE_CARD_GPT_DESCRIPTION } from "src/views/CellGuide/components/CellGuideCard/components/Description/constants";

const HOMO_SAPIENS_TERM_ID = "NCBITaxon:9606";

Expand Down Expand Up @@ -335,6 +336,18 @@ describe("Where's My Gene", () => {
expect(numGenes).toBeGreaterThan(0);
});

test("Marker gene panel displays cell type description", async ({
page,
}) => {
await goToWMG(page);

await expandTissue(page, "lung");

await getCellTypeFmgButtonAndClick(page, "memory B cell");

await waitForElement(page, CELL_GUIDE_CARD_GPT_DESCRIPTION);
});

// need to find a tissue, cell type with no marker genes
test.skip("Cell types with no marker genes display warning", async ({
page,
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/wmg_processing/test_ontology_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ def test__ontology_term_label(self):
"MmusDv:0000000": "mouse life cycle stage",
"MONDO:0000001": "disease",
"UBERON:0002539": "pharyngeal arch",
"UBERON:0000995 (organoid)": "uterus (organoid)",
"CL:0000082 (cell culture)": "epithelial cell of lung (cell culture)",
}
for ontology_term_id, expected_ontology_term_label in test_cases.items():
with self.subTest(ontology_term_id):
Expand Down

0 comments on commit 0ca8504

Please sign in to comment.