Skip to content

Basic CLI Usage

neuromorphopy provides a simple command-line interface for downloading neuron morphologies.

Commands

Explore Search Fields (fields)

View available query fields:

neuromorpho fields

View valid values for a specific field:

neuromorpho fields brain_region

Preview Download (preview)

Validate a query file and see what would be downloaded without actually downloading anything:

neuromorpho preview query.yaml

Options:

  • -o, --output-dir: Specify the target output directory (for preview display)
  • -m, --metadata-filename: Specify the target metadata filename (for preview display)
  • --verbose: Show detailed validation output
  • --quiet: Suppress validation output except errors

Download Neurons (download)

Download neurons matching your query:

neuromorpho download query.yaml -o ./output

Options:

  • -o, --output-dir: Output directory (default: ./neurons)
  • -m, --metadata-filename: Metadata filename (default: metadata.csv)
  • -c, --concurrent: Max concurrent downloads (default: 20)
  • --group-by: Comma-separated fields to group downloads (e.g., species,brain_region)
  • --verbose: Show detailed progress
  • --quiet: Suppress all output except errors
  • --no-log: Disable automatic log file creation

Query File Format

Create YAML files with your search criteria:

filters:
  species: ["mouse"]
  brain_region: ["neocortex"]
  cell_type: ["pyramidal"]
sort:  # optional
  field: "brain_region"
  ascending: true

Examples

  1. Download mouse pyramidal neurons:

    # mouse_pyramidal.yaml
    filters:
      species: ["mouse"]
      cell_type: ["pyramidal"]
    
    neuromorpho download mouse_pyramidal.yaml -o ./mouse_neurons
    
  2. Find available brain regions:

    neuromorpho fields brain_region
    
  3. Preview a download with custom metadata filename:

    neuromorpho preview query.yaml -o ./data -m neuron_metadata.csv
    
  4. Download with grouping:

    neuromorpho download query.yaml -g species
    

Next Steps