Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync dev with latest #76

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ processor/application_default_credentials.json
processor/.env
processor/helpers/__pycache__/
processor/.DS_Store
processor/samples/
application_default_credentials.json
server/.env
client/yarn.lock
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG NODE_PARENT=node:20

FROM ${NODE_PARENT} as frontend
ARG BUILD_MODE=prod
ENV BUILDDIR=/app

WORKDIR ${BUILDDIR}
COPY client/package.json ${BUILDDIR}
COPY client/package-lock.json ${BUILDDIR}
COPY nginx/default.conf ${BUILDDIR}

RUN npm install --legacy-peer-deps
COPY ./client/ ${BUILDDIR}
RUN npx update-browserslist-db@latest

RUN echo "Build mode is: ${BUILD_MODE}"
RUN npm run build:${BUILD_MODE}

FROM nginx:1.19.3-alpine

RUN cat /etc/nginx/conf.d/default.conf

COPY --from=frontend /app/default.conf /etc/nginx/conf.d/default.conf

COPY --from=frontend /app/build /usr/share/nginx/html/

EXPOSE 80
127 changes: 120 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cd processor
mkdir data
```

Inside the data folder create 2 more folders, one to store all the activity maps (ActivityMap) )and one to store all the atlases (Atlas).
Inside the data folder create 2 more folders, one to store all the activity maps (ActivityMap) and one to store all the atlases (Atlas).

```
cd data
Expand All @@ -32,9 +32,15 @@ cp *atlas.nii.gz ./Atlas/
cp *maps.nii.gz ./ActivityMap/
```

#### Prepare the index.json inside the data folder
For each atlas file copied inside the Atlas folder, copy also the wireframe version being sure to use the same file name followed by a capital W before the dot extension of the atlas.

It is responsability of the user triggering the ingestion also to prepare a file, **named index.json and placed inside the data folder**, that contains the hierarchical structure of the experiments and the data, according to the data model documented for the project.
```Example: if the atlas file is gubra_ano_combined_25um.nii.gz the wireframe file should be called gubra_ano_combined_25umW.nii.gz (capital W before the .nii.gz).```

#### Prepare the index.json and metadata.json inside the data folder

It is responsibility of the user triggering the ingestion also to prepare a file, named **index.json** and a file named **metadata.json**,
both placed inside the data folder, that contains the hierarchical structure of the experiments and the data, according to the data model documented for the project
and experiments metadata respectively.

Below an example of a working index.json file used during development:

Expand Down Expand Up @@ -119,6 +125,115 @@ Below an example of a working index.json file used during development:
}
```

Below an example of a working metadata.json file used during development:

```json
{
"MDMA (social context) maps": {
"Experiment Name": "Effect of psilocybin on c-Fos-IF in distinct contexts",
"Contributor": "Boris Heifets (Stanford University)",
"Publications": [{
"link": "https://google.com",
"label": "UNRAVELing the synergistic effects of psilocybin and environment on brain-wide immediate early gene expression in mice",
"description": "",
"keywords": "Rijsketic DR*, Casey AB*, Barbosa DA, Zhang X, Hietamies TM, Ramirez-Ovalle G, Pomrenze MB, Halpern CH, Williams LM, Malenka RC, Heifets BD",
"tags": [
"rabbit anti-cfos", "donkey anti-Rabbit Alexa647"
]
}],
"Treatment/Condition(s)": "psilocybin vs. saline; home cage (HC) vs. enriched environment (EE)",
"Dose(s)": "psilocybin (2 mg/kg, i.p.); 4-OHT (50 mg/kg; i.p.)",
"Species, strain, gene(s)": "TRAP2+/-;Ai14+ mice (bred to C57BL/6)",
"Sample sizes(s)": "n=9 for saline (HC); n = 8 for psilocybin (HC); n = 9 for saline (EE); n = 7 for psilocybin EE",
"Clearing method": "iDISCO+",
"Imaging modality": "light sheet fluorescent microscopy (LSFM)",
"Experiment details": "For TRAPing, mice were injected with 4-OHT and psilocybin or saline. Two-weeks later, mice were again injected with psilocybin or saline (crossover design) and placed in their assigned context for 2 hours before fixation for c-Fos mapping. Brains were hemisected, immunostained, cleared, and imaged in 3D with a Zeiss Lightsheet 7 (2.5x objective; 0.52x zoom; 3.5 isotropic resolution; 10.61 µm sheet thickness). 488 nm light excited autofluorescence (8% of 30 mW; 505-530 nm; 50 ms). 638 nm light excited IF (20% of 75 mW; 660 nm long pass; 50 ms). Pivot scanning limited artifacts. Tiled z-stacks (10% overlap) were stitched in Zen Blue.",
"Image analysis": [{
"link": "https://google.com",
"label": "UNRAVEL Github repository",
"description": "We developed UNRAVEL to automate c-Fos mapping. Downsampled autofluorescence images were registered (MIRACL) to an iDISCO+/LSFM version of the Allen brain atlas (CCFv3). c-Fos-IF images were rolling ball background subtracted (4-pixel radius), warped to atlas space, z-scored, and smoothed (50 µm). Voxel-wise analyses were performed with randomise_parallel (FSL) according to a 2x2 ANOVA design (6,000 permutations). False positives in F-contrast maps were limited by false discovery rate (FDR) correction and cluster extent (> 100 voxels). Surviving clusters were warped to full resolution tissue space for post hoc cell density comparisons using cell segmentations from Ilastik.",
"keywords": "",
"tags": []
}],
"Additional links": [{
"link": "https://google.com",
"label": "Antibody registry",
"description": "Documents, documentations and repositories that relates to this experiment.",
"keywords": "",
"tags": []
}]
},
"Psilocybin (HC; EE) maps": {
"Experiment Name": "Effect of psilocybin on c-Fos-IF in distinct contexts",
"Contributor": "Boris Heifets (Stanford University)",
"Publications": [{
"link": "https://google.com",
"label": "UNRAVELing the synergistic effects of psilocybin and environment on brain-wide immediate early gene expression in mice",
"description": "",
"keywords": "Rijsketic DR*, Casey AB*, Barbosa DA, Zhang X, Hietamies TM, Ramirez-Ovalle G, Pomrenze MB, Halpern CH, Williams LM, Malenka RC, Heifets BD",
"tags": [
"rabbit anti-cfos", "donkey anti-Rabbit Alexa647"
]
}],
"Treatment/Condition(s)": "psilocybin vs. saline; home cage (HC) vs. enriched environment (EE)",
"Dose(s)": "psilocybin (2 mg/kg, i.p.); 4-OHT (50 mg/kg; i.p.)",
"Species, strain, gene(s)": "TRAP2+/-;Ai14+ mice (bred to C57BL/6)",
"Sample sizes(s)": "n=9 for saline (HC); n = 8 for psilocybin (HC); n = 9 for saline (EE); n = 7 for psilocybin EE",
"Clearing method": "iDISCO+",
"Imaging modality": "light sheet fluorescent microscopy (LSFM)",
"Experiment details": "For TRAPing, mice were injected with 4-OHT and psilocybin or saline. Two-weeks later, mice were again injected with psilocybin or saline (crossover design) and placed in their assigned context for 2 hours before fixation for c-Fos mapping. Brains were hemisected, immunostained, cleared, and imaged in 3D with a Zeiss Lightsheet 7 (2.5x objective; 0.52x zoom; 3.5 isotropic resolution; 10.61 µm sheet thickness). 488 nm light excited autofluorescence (8% of 30 mW; 505-530 nm; 50 ms). 638 nm light excited IF (20% of 75 mW; 660 nm long pass; 50 ms). Pivot scanning limited artifacts. Tiled z-stacks (10% overlap) were stitched in Zen Blue.",
"Image analysis": [{
"link": "https://google.com",
"label": "UNRAVEL Github repository",
"description": "We developed UNRAVEL to automate c-Fos mapping. Downsampled autofluorescence images were registered (MIRACL) to an iDISCO+/LSFM version of the Allen brain atlas (CCFv3). c-Fos-IF images were rolling ball background subtracted (4-pixel radius), warped to atlas space, z-scored, and smoothed (50 µm). Voxel-wise analyses were performed with randomise_parallel (FSL) according to a 2x2 ANOVA design (6,000 permutations). False positives in F-contrast maps were limited by false discovery rate (FDR) correction and cluster extent (> 100 voxels). Surviving clusters were warped to full resolution tissue space for post hoc cell density comparisons using cell segmentations from Ilastik.",
"keywords": "",
"tags": []
}],
"Additional links": [{
"link": "https://google.com",
"label": "Antibody registry",
"description": "Documents, documentations and repositories that relates to this experiment.",
"keywords": "",
"tags": []
}]
},
"Ketamine v. Naltrexone+Ket maps": {
"Experiment Name": "Effect of psilocybin on c-Fos-IF in distinct contexts",
"Contributor": "Boris Heifets (Stanford University)",
"Publications": [{
"link": "https://google.com",
"label": "UNRAVELing the synergistic effects of psilocybin and environment on brain-wide immediate early gene expression in mice",
"description": "",
"keywords": "Rijsketic DR*, Casey AB*, Barbosa DA, Zhang X, Hietamies TM, Ramirez-Ovalle G, Pomrenze MB, Halpern CH, Williams LM, Malenka RC, Heifets BD",
"tags": [
"rabbit anti-cfos", "donkey anti-Rabbit Alexa647"
]
}],
"Treatment/Condition(s)": "psilocybin vs. saline; home cage (HC) vs. enriched environment (EE)",
"Dose(s)": "psilocybin (2 mg/kg, i.p.); 4-OHT (50 mg/kg; i.p.)",
"Species, strain, gene(s)": "TRAP2+/-;Ai14+ mice (bred to C57BL/6)",
"Sample sizes(s)": "n=9 for saline (HC); n = 8 for psilocybin (HC); n = 9 for saline (EE); n = 7 for psilocybin EE",
"Clearing method": "iDISCO+",
"Imaging modality": "light sheet fluorescent microscopy (LSFM)",
"Experiment details": "For TRAPing, mice were injected with 4-OHT and psilocybin or saline. Two-weeks later, mice were again injected with psilocybin or saline (crossover design) and placed in their assigned context for 2 hours before fixation for c-Fos mapping. Brains were hemisected, immunostained, cleared, and imaged in 3D with a Zeiss Lightsheet 7 (2.5x objective; 0.52x zoom; 3.5 isotropic resolution; 10.61 µm sheet thickness). 488 nm light excited autofluorescence (8% of 30 mW; 505-530 nm; 50 ms). 638 nm light excited IF (20% of 75 mW; 660 nm long pass; 50 ms). Pivot scanning limited artifacts. Tiled z-stacks (10% overlap) were stitched in Zen Blue.",
"Image analysis": [{
"link": "https://google.com",
"label": "UNRAVEL Github repository",
"description": "We developed UNRAVEL to automate c-Fos mapping. Downsampled autofluorescence images were registered (MIRACL) to an iDISCO+/LSFM version of the Allen brain atlas (CCFv3). c-Fos-IF images were rolling ball background subtracted (4-pixel radius), warped to atlas space, z-scored, and smoothed (50 µm). Voxel-wise analyses were performed with randomise_parallel (FSL) according to a 2x2 ANOVA design (6,000 permutations). False positives in F-contrast maps were limited by false discovery rate (FDR) correction and cluster extent (> 100 voxels). Surviving clusters were warped to full resolution tissue space for post hoc cell density comparisons using cell segmentations from Ilastik.",
"keywords": "",
"tags": []
}],
"Additional links": [{
"link": "https://google.com",
"label": "Antibody registry",
"description": "Documents, documentations and repositories that relates to this experiment.",
"keywords": "",
"tags": []
}]
}
}
````

#### Create a conda environment and install the required dependencies

Create a conda environment and install all the required dependencies for the ingestion, using the file all_requirements.txt inside the processor folder.
Expand Down Expand Up @@ -152,16 +267,14 @@ To run this last step ensure to have the conda environment created above activat
```
cd processor/
python main.py

```

The ingestion will take some time, which depends on the host machine running the ingestion and the connection/bandwidth used, since the steps performed are:

- preprocess the nifti files to extract the msgpack equivalent, since it's way faster for the viewer handle these.
- generate the wireframe for each atlas file.
- preprocess the nifti files to extract the msgpack equivalent, since it's way faster for the viewer to handle these.
- upload all the generated files in the bucket that stores the application data.

## Setup development environment
# For developers willing to contribute to the codebase - Setup development environment

### Backend

Expand Down
2 changes: 1 addition & 1 deletion client/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_SERVER_URL=https://storage.googleapis.com/cfos-visualizer-stanford
REACT_APP_SERVER_URL=https://storage.googleapis.com/cfos-visualizer-stanford-dev
1 change: 1 addition & 0 deletions client/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_SERVER_URL=https://storage.googleapis.com/cfos-visualizer-stanford-dev
1 change: 0 additions & 1 deletion client/.env.development.local

This file was deleted.

File renamed without changes.
25 changes: 0 additions & 25 deletions client/deploy/Dockerfile

This file was deleted.

Loading