示例#1
0
WELL_KNOWN_IDS = Recoder((('9861', 'H0351.2001', '178238387', '157722636'),
                          ('10021', 'H0351.2002', '178238373', '157723301'),
                          ('12876', 'H0351.1009', '178238359', '157722290'),
                          ('15496', 'H0351.1015', '178238266', '162021642'),
                          ('14380', 'H0351.1012', '178238316', '157721937'),
                          ('15697', 'H0351.1016', '178236545', '157682966')),
                         fields=(
                             'subj',
                             'uid',
                             'url',
                             't1w',
                         ))

VALID_DONORS = sorted(
    WELL_KNOWN_IDS.value_set('subj') | WELL_KNOWN_IDS.value_set('uid'))


def _get_dataset_dir(dataset_name, data_dir=None, verbose=1):
    """
    Gets path to `dataset_name`

    Parameters
    ----------
    dataset_name : str
        The name of the dataset in question
    data_dir : str, optional
        Path to use as data directory. If not specified, will check for
        environmental variables 'ABAGEN_DATA'; if that is not set, will use
        '~/abagen-data' instead. Default: None
    verbose : int, optional
示例#2
0
from nilearn.datasets.utils import _fetch_files, _get_dataset_dir
import pandas as pd
from sklearn.utils import Bunch
from abagen import io

WELL_KNOWN_IDS = Recoder(
    (('9861', 'H0351.2001', '178238387', '157722636'),
     ('10021', 'H0351.2002', '178238373', '157723301'),
     ('12876', 'H0351.1009', '178238359', '157722290'),
     ('15496', 'H0351.1015', '178238266', '162021642'),
     ('14380', 'H0351.1012', '178238316', '157721937'),
     ('15697', 'H0351.1016', '178236545', '157682966')),
    fields=('subj', 'uid', 'url', 't1w',)
)

VALID_DONORS = sorted(WELL_KNOWN_IDS.value_set('subj') |
                      WELL_KNOWN_IDS.value_set('uid'))


def fetch_microarray(data_dir=None, donors=['9861'], resume=True, verbose=1,
                     convert=True):
    """
    Downloads the Allen Human Brain Atlas microarray expression dataset

    Parameters
    ----------
    data_dir : str, optional
        Directory where data should be downloaded and unpacked. Default:
        current directory
    donors : list, optional
        List of donors to download; can be either donor number or UID. Can also