# Download as CSV in Projection

**URL:** <https://community.brain-map.org/t/download-as-csv-in-projection/1358>\
**Category:** How To\
**Created:** [November 25, 2021, 10:20am UTC](https://community.brain-map.org/t/download-as-csv-in-projection/1358 "2021-11-25T10:20:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![grimwoo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/grimwoo/32/524_2.png) [@grimwoo](https://community.brain-map.org/u/grimwoo)\
**Post date:** [November 25, 2021, 10:20am UTC](https://community.brain-map.org/t/download-as-csv-in-projection/1358/1 "2021-11-25T10:20:48Z")

</div>

Hi, thanks for developing the Allen Brain Atlas.

I am freshman using the [projection](https://connectivity.brain-map.org/) function, and wondering if there is any quick method to calculate the connectivity or directly download the corresponding matrix.

I want to count all possible links from cortex towards hypothalamus. I understand that I could put “cortex” in “Filter Source Structure(s)” and “hypothalamus” (HY) in “Target Structure(s)”. And I found the result could be saved by clicking “Download as CSV”. However, the column does not contain the information of the sub-region of hypothalamus (Target Structure).

Here, in another way, I set the “Target Structure(s)” as “PVH” (a sub-region of PVZ in hypothalamus). I get two results as the attached figure. However, when I download the data, I found there were much more results in this csv file rather than 2 results shown in [website](http://connectivity.brain-map.org/?searchMode=target&sourceDomain=688&primaryStructureOnly=true&isi=false&transgenicLines=0&targetDomain=38&hemisphere=either&targetVolumeThreshold=0.0100). Could any one please tell me what I did wrong?

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/brainobservatory/original/1X/ace60a19e78c745d0921e6e751704506f9a91202.png)

**And my second question is that how could I download all the data containing (1) all projections from cortex towards hypothalamus, (2) the detailed note on the sub-regions of corresponding cortex and hypothalamus, and (3) the “Inj Site Vol” and “Tgt Vol” of the corresponding sub-regions.**

Look forward to your early reply. Best wishes!

---

<div class="post-metadata">

**Author:** ![grimwoo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/grimwoo/32/524_2.png) [@grimwoo](https://community.brain-map.org/u/grimwoo)\
**Post date:** [November 25, 2021, 10:32am UTC](https://community.brain-map.org/t/download-as-csv-in-projection/1358/2 "2021-11-25T10:32:04Z")

</div>

I found that if I chose these two results, I could found these two results marked in the downloaded csv file (where the “selected” collumn were marked as “TRUE”). But I wander what is the rest 138 results in this file marked as “FALSE” in the “selected” collumn, as I only see two results in the [website](http://connectivity.brain-map.org/?searchMode=target&sourceDomain=688&primaryStructureOnly=true&isi=false&transgenicLines=0&targetDomain=38&hemisphere=either&targetVolumeThreshold=0.0100).

---

<div class="post-metadata">

**Author:** ![wayne](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/wayne/32/16_2.png) [@wayne](https://community.brain-map.org/u/wayne)\
**Post date:** [November 30, 2021, 4:15pm UTC](https://community.brain-map.org/t/download-as-csv-in-projection/1358/3 "2021-11-30T16:15:06Z")

</div>

Hello @grimwoo

The website is only showing results with signal volume in the target structures which are above the minimum threshold defined by the slider bar “Min. Target Volume”. The download is not limited by that threshold, but the information is there in the “sum” column if you want to apply the filter yourself.

I’m not sure I understand all of your question 2. What exactly do you want to download?  
“Target Volume” is in the ‘sum’ column of the downloaded csv file.  
“Injection Site Volume” is reported in the ‘injection-volume’ column of the downloaded csv file

The “selected” column just reflects whether the box for that experiment was checked at the time that the data was downloaded.

---

<div class="post-metadata">

**Author:** ![grimwoo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/grimwoo/32/524_2.png) [@grimwoo](https://community.brain-map.org/u/grimwoo)\
**Post date:** [December 3, 2021, 2:18am UTC](https://community.brain-map.org/t/download-as-csv-in-projection/1358/4 "2021-12-03T02:18:12Z")

</div>

> [@grimwoo](#):
>
> the detailed note on the sub-regions of corresponding cort

Thank you for the quick support! My question 2 refered to the possibility of download all data marked as detailed brain region. For example, the cortex (CTX) contains CTXpl and CTXsp, and CTXpl contains isocortex, OLF, and e.t.c.  
I wonder if I could download a table contains the following fomat:

| Inj\_Site\_Maj | Inj\_Site\_Sub | Inj\_Site\_Vol | Tgt\_Site\_Maj | Tgt\_Site\_Sub | Tgt\_Vol |
| --- | --- | --- | --- | --- | --- |
| CTXpl | OLF | 0.315597318 | MEZ | AHN | 0.023985085 |

---

<div class="post-metadata">

**Author:** ![wayne](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/wayne/32/16_2.png) [@wayne](https://community.brain-map.org/u/wayne)\
**Post date:** [December 3, 2021, 3:39pm UTC](https://community.brain-map.org/t/download-as-csv-in-projection/1358/5 "2021-12-03T15:39:06Z")

</div>

Hi @grimwoo

No, there is no built-in functionality to do exactly what you describe. However, you could make use of the underlying API to facilitate the creation of your table.

See the “Target Search” section of the [API help page](http://help.brain-map.org/display/mouseconnectivity/API) for information on creating the API call. For programmatic purposes, you will probably want to return the results from each call in JSON (or XML) format. An example might be:  
[http://api.brain-map.org/api/v2/data/query.json?criteria=service::mouse\_connectivity\_injection\_structure[injection\_structures$eq698][target\_domain$eq88][primary\_structure\_only$eqtrue]](http://api.brain-map.org/api/v2/data/query.json?criteria=service::mouse_connectivity_injection_structure%5Binjection_structures%24eq698%5D%5Btarget_domain%24eq88%5D%5Bprimary_structure_only%24eqtrue%5D)

These queries return the results for individual experiments that meet the specified criteria. You will need to decide how you wish to summarize the results of all experiments to make your summary table (“average”, perhaps?)

You can use [this API call](http://api.brain-map.org/api/v2/structure_graph_download/1.json) to get the id values for each structure ([documented here](http://help.brain-map.org/display/api/Downloading+an+Ontology%27s+Structure+Graph))

---

<div class="post-metadata">

**Author:** ![grimwoo](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/grimwoo/32/524_2.png) [@grimwoo](https://community.brain-map.org/u/grimwoo)\
**Post date:** [December 15, 2021, 5:27am UTC](https://community.brain-map.org/t/download-as-csv-in-projection/1358/6 "2021-12-15T05:27:46Z")

</div>

Thank you for the quick reply! Best wishes!
