<commit_before># allen-assistant

python command line utility for querying, downloading, and exporting allen brain observatory data

## Usage

```
$ ./aa.py --help

usage: aa.py [-h] [-r] {download,search} ...
positional arguments:
{download,search}
download         Used for downloading files
search           Used for testing search queries

```

```

$ ./aa.py search --help
usage: aa.py search [-h] [-o] [--detailed] [-t] [-c] [-d] [-s]

optional arguments:
    -h, --help            show this help message and exit
    -o , --outfile        Filepath to save text report
    --detailed            Show a far more detailed report

Experiment Container Params:

    -t , --targeted_structures
                            Target Visual Cortex Structure. Allowed values are:
                            VISal VISl VISp VISpm


    -c , --cre_lines        Transgenic mouse line. Allowed values are
                            Cux2-CreERT2, Emx1-IRES-Cre, Nr5a1-Cre,
                            Rbp4-Cre_KL100, Rorb-IRES2-Cre, Scnn1a-Tg3-Cre

    -d , --imaging_depths
                            Imaging depths. Allowed values are 175, 250, 275, 335,
                            350, 375

Other Experiment Params:

    -s , --stimuli          Visual stimuli type. Allowed values are
                            drifting_gratings, locally_sparse_noise,
                            locally_sparse_noise_4deg, locally_sparse_noise_8deg,
                            natural_movie_one, natural_movie_three,
                            natural_movie_two, natural_scenes, spontaneous,
                            static_gratings

```

### Installing

#### Linux

```
$ git clone https://github.com/jzlab/allen-assistant
$ cd allen-assistant
$ python aa.py --help

usage: aa.py [-h] [-r] {download,search} ...

positional arguments:
    {download,search}
    download         Used for downloading files
    search           Used for testing search queries

    optional arguments:
    -h, --help         show this help message and exit
    -r , --cache_dir   Default: ./boc/


```

### Prerequisites

This project was built on Python 2.7.10, the allensdk requires 2.7x and is not python3 compatible

```
$ pip install -r requirements.txt

```

If everything installs without a hitch it should run

## Built With

* [AllenSDK](http://alleninstitute.github.io/AllenSDK/) - The Allen SDK
*
* ## Contributing
*
* Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
*
* ## Versioning
*
* We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).<commit_msg>added more explanation and reformatted<commit_after># allen-assistant

python command line utility that encapsulates the Allen Brain Observatory allensdk for streamlining querying, downloading, and exporting allen brain observatory data.

## Example Usage

```bash

$ python aa.py search -t VISp -c Cux2-CreERT2 -d 175 -d 250 -s static_gratings

RESULTS

Query parameters:
===============================

{'cache_dir': 'boc/',
'cre_lines': ['Cux2-CreERT2'],
'detailed': False,
'imaging_depths': [175, 250],
'outfile': None,
'stimuli': ['static_gratings'],
'targeted_structures': ['VISp']}
===============================


Number of Experiment Containers (or individual mice?): 11

Number of Experiments returned: 8

```
```
$ ./aa.py download -t VISp -c Cux2-CreERT2 -d 175 -d 250 -s static_gratings

```

## Overview
The utility is split (possibly unnecessarily) into 2 subcommands which allow you to test your queries
before committing to long wait till they finish downloading

```bash
$ ./aa.py --help

usage: aa.py [-h] [-r] {download,search} ...
positional arguments:
{download,search}
download         Used for downloading files
search           Used for testing search queries

```

The Experiment Container and Other Experiment Params consistent across download/search, but search is shown below as an example

```bash

$ ./aa.py search --help
usage: aa.py search [-h] [-o] [--detailed] [-t] [-c] [-d] [-s]

optional arguments:
    -h, --help            show this help message and exit
    -o , --outfile        Filepath to save text report
    --detailed            Show a far more detailed report

Experiment Container Params:

    -t , --targeted_structures
                            Target Visual Cortex Structure. Allowed values are:
                            VISal VISl VISp VISpm


    -c , --cre_lines        Transgenic mouse line. Allowed values are
                            Cux2-CreERT2, Emx1-IRES-Cre, Nr5a1-Cre,
                            Rbp4-Cre_KL100, Rorb-IRES2-Cre, Scnn1a-Tg3-Cre

    -d , --imaging_depths
                            Imaging depths. Allowed values are 175, 250, 275, 335,
                            350, 375

Other Experiment Params:

    -s , --stimuli          Visual stimuli type. Allowed values are
                            drifting_gratings, locally_sparse_noise,
                            locally_sparse_noise_4deg, locally_sparse_noise_8deg,
                            natural_movie_one, natural_movie_three,
                            natural_movie_two, natural_scenes, spontaneous,
                            static_gratings

```

### Installing

Works on linux but I have also gotten it to work on macos

#### Linux


```bash

$ git clone https://github.com/jzlab/allen-assistant

$ cd allen-assistant


```

### Prerequisites

This project was built on Python 2.7.10, the allensdk requires 2.7x and is not python3 compatible
You can use pip to install all dependencies

```bash
$ pip install -r requirements.txt

```

If everything installs without a hitch it should run

```bash
$ python aa.py --help


usage: aa.py [-h] [-r] {download,search} ...

positional arguments:
{download,search}
    download         Used for downloading files
    search           Used for testing search queries

optional arguments:
    -h, --help         show this help message and exit
    -r , --cache_dir   Default: ./boc/
```

## Built With

* [AllenSDK](http://alleninstitute.github.io/AllenSDK/) - The Allen SDK
*
* ## Contributing
*
* Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
*
* ## Versioning
*
* We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
{'fraction_non_alphanumeric': 0.10727795430473597, 'fraction_numerical': 0.02088061733999092, 'mean_word_length': 2.382804503582395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 21, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6375275', 'n_tokens_mistral': 2126, 'n_tokens_neox': 1886, 'n_words': 645}