Skip to content

Commit

Permalink
readme bump
Browse files Browse the repository at this point in the history
  • Loading branch information
oganm committed Mar 19, 2024
1 parent f8deb6b commit f623d0e
Show file tree
Hide file tree
Showing 13 changed files with 91 additions and 41 deletions.
110 changes: 71 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@

Table of Contents
=================
# Table of Contents

- [allenBrain](#allenbrain)
- [Example usage](#example-usage)
- [Image acquisition](#image-acquisition)
- [Region expression data](#region-expression-data)
- [Incomplete stuff](#incomplete-stuff)
- [allenBrain](#allenbrain)
- [Example usage](#example-usage)
- [Image acquisition](#image-acquisition)
- [Region expression data](#region-expression-data)
- [Incomplete stuff](#incomplete-stuff)

allenBrain
==========
# allenBrain

This R package acquires pictures from Allen Brain Atlas.

Expand All @@ -19,12 +17,12 @@ Install allenBrain to R
devtools::install_github('oganm/allenBrain')
```

Example usage
-------------
## Example usage

### Image acquisition

You can use `downloadImage` and `downloadAtlas` functions to get images. Output of these functions are `magick-image` objects
You can use `downloadImage` and `downloadAtlas` functions to get images.
Output of these functions are `magick-image` objects

``` r
library(dplyr)
Expand Down Expand Up @@ -80,7 +78,8 @@ downloadAtlas(imageID = atlasID$section.image.id,

![](README_files/atlas.jpg)

Images can be centered by providing center coordinates of a brain region. Input is either a file path or a `magick-image` object
Images can be centered by providing center coordinates of a brain
region. Input is either a file path or a `magick-image` object

``` r
# crop the slide so that the desired brain region is in the center
Expand All @@ -107,9 +106,39 @@ centerImage(image = 'README_files/atlas.jpg',

![](README_files/croppedAtlas.jpg)

### Adding a scale to the image

`getSectionImage` function returns all available information about an
image. We can use this to access the resolution information which lists
micron/pixel ratio in a given image.

``` r
(image_res = getSectionImage(imageID$section.image.id)$resolution)
```

## [1] "1.049"

We can then use the `add_scale` function to add a scale

``` r
downloadImage(imageID = imageID$section.image.id,
view = 'projection',
downsample = downsample) %>%
centerImage(x = imageID$x,
y= imageID$y,
xProportions = c(.1,.1),
yProportions =c(.1,.1),
outputFile = 'README_files/cropped.jpg',
downsample = downsample) %>%
add_scale(image_res,downsample)
```

<img src="README_files/figure-gfm/unnamed-chunk-7-1.png" width="596" />

### Image syncronization

You can get closest points of other slides from the same dataset to get other slides depicting the region
You can get closest points of other slides from the same dataset to get
other slides depicting the region

``` r
# gel all images for Prox1 experiment
Expand Down Expand Up @@ -144,7 +173,8 @@ magick::image_write(animation, "README_files/Prox1.gif")

### Region expression data

Region expression can be acquired by datasetID. Data displayed in ABA web portals is expression.energy.
Region expression can be acquired by datasetID. Data displayed in ABA
web portals is expression.energy.

``` r
head(getStructureExpressions(datasetID))
Expand Down Expand Up @@ -185,37 +215,39 @@ head(getStructureExpressions(datasetID))
## 4 3 15567 secondary prosencephalon
## 5 3 15568 rostral secondary prosencephalon
## 6 3 15569 preoptic telencephalon
## structure.ontology.id structure.safe.name
## 1 12 Mus musculus
## 2 12 neural plate
## 3 12 forebrain
## 4 12 secondary prosencephalon
## 5 12 rostral secondary prosencephalon
## 6 12 preoptic telencephalon
## structure.st.level structure.structure.id.path
## 1 -1 /15564/
## 2 0 /15564/15565/
## 3 1 /15564/15565/15566/
## 4 2 /15564/15565/15566/15567/
## 5 3 /15564/15565/15566/15567/15568/
## 6 4 /15564/15565/15566/15567/15568/15569/
## structure.structure.name.facet structure.weight
## 1 3843147059 8390
## 2 3041346888 8390
## 3 2526114016 8390
## 4 333870831 8390
## 5 2675393843 8390
## 6 2617066679 8390

If you want to get all genes, use `listGenes` to get all available genes for the species. Then do `getGeneDatasets`.
## structure.ontology.id structure.safe.name structure.st.level
## 1 12 Mus musculus -1
## 2 12 neural plate 0
## 3 12 forebrain 1
## 4 12 secondary prosencephalon 2
## 5 12 rostral secondary prosencephalon 3
## 6 12 preoptic telencephalon 4
## structure.structure.id.path structure.structure.name.facet
## 1 /15564/ 3843147059
## 2 /15564/15565/ 3041346888
## 3 /15564/15565/15566/ 2526114016
## 4 /15564/15565/15566/15567/ 333870831
## 5 /15564/15565/15566/15567/15568/ 2675393843
## 6 /15564/15565/15566/15567/15568/15569/ 2617066679
## structure.weight
## 1 8390
## 2 8390
## 3 8390
## 4 8390
## 5 8390
## 6 8390

If you want to get all genes, use `listGenes` to get all available genes
for the species. Then do `getGeneDatasets`.

``` r
genes = listGenes()

geneDatasets = genes$acronym[1:10] %>% lapply(getGeneDatasets)
```

You may want to limit your search space as getting the data for all genes is a slow process.
You may want to limit your search space as getting the data for all
genes is a slow process.

### Incomplete stuff

Expand Down
Binary file modified README_files/Prox1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified README_files/Prox1_data.zip
Binary file not shown.
Binary file modified README_files/atlas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified README_files/cropped.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified README_files/croppedAtlas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 20 additions & 2 deletions README_files/data_set.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<rnaseq-design-id nil="true"/>
<section-thickness>25.0</section-thickness>
<specimen-id>68870790</specimen-id>
<sphinx-id>156366</sphinx-id>
<sphinx-id>157167</sphinx-id>
<storage-directory>/external/aibssan/production32/prod327/image_series_69289763/</storage-directory>
<weight>5470</weight>
<products>
Expand Down Expand Up @@ -62,7 +62,7 @@
<pinned-radius type="float" nil="true"/>
<rna-integrity-number type="float" nil="true"/>
<specimen-id-path>/68870790/</specimen-id-path>
<sphinx-id type="integer">20608</sphinx-id>
<sphinx-id type="integer">22495</sphinx-id>
<structure-id type="integer" nil="true"/>
<tissue-ph type="float" nil="true"/>
<treatment-id type="integer" nil="true"/>
Expand Down Expand Up @@ -123,6 +123,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207012100/0207012100_6_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">6705</height>
Expand Down Expand Up @@ -155,6 +156,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207012100/0207012100_14_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">6737</height>
Expand Down Expand Up @@ -187,6 +189,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207012100/0207012100_22_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7217</height>
Expand Down Expand Up @@ -219,6 +222,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207012100/0207012100_30_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7297</height>
Expand Down Expand Up @@ -251,6 +255,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207022023/0207022023_38_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7441</height>
Expand Down Expand Up @@ -283,6 +288,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207022023/0207022023_46_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">6721</height>
Expand Down Expand Up @@ -315,6 +321,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207022023/0207022023_54_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7361</height>
Expand Down Expand Up @@ -347,6 +354,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207022023/0207022023_62_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7201</height>
Expand Down Expand Up @@ -379,6 +387,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207032292/0207032292_70_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7553</height>
Expand Down Expand Up @@ -411,6 +420,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207032292/0207032292_78_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7681</height>
Expand Down Expand Up @@ -443,6 +453,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207032292/0207032292_86_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7825</height>
Expand Down Expand Up @@ -475,6 +486,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207042032/0207042032_102_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7889</height>
Expand Down Expand Up @@ -507,6 +519,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207042032/0207042032_118_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">8337</height>
Expand Down Expand Up @@ -539,6 +552,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207042032/0207042032_126_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">8001</height>
Expand Down Expand Up @@ -571,6 +585,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207052977/0207052977_134_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">9057</height>
Expand Down Expand Up @@ -603,6 +618,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207052977/0207052977_142_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">8129</height>
Expand Down Expand Up @@ -635,6 +651,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207052977/0207052977_150_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7665</height>
Expand Down Expand Up @@ -667,6 +684,7 @@
<axes nil="true"/>
<bits-per-component type="integer">8</bits-per-component>
<data-set-id type="integer">69289763</data-set-id>
<expression type="boolean" nil="true"/>
<expression-path>/external/aibssan/production32/prod91/0207052977/0207052977_158_expression.aff</expression-path>
<failed type="boolean">false</failed>
<height type="integer">7585</height>
Expand Down
Binary file added README_files/figure-gfm/unnamed-chunk-2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added README_files/figure-gfm/unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified README_files/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f623d0e

Please sign in to comment.