List of models

These models generally correspond one-to-one with tables in the database.

Coordinate transforms

class misc.models.OrderedUser(id, password, last_login, is_superuser, username, first_name, last_name, email, is_staff, is_active, date_joined)[source]

Bases: django.contrib.auth.models.User

Parameters:
  • id (AutoField) – Id
  • password (CharField) – Password
  • last_login (DateTimeField) – Last login
  • is_superuser (BooleanField) – Designates that this user has all permissions without explicitly assigning them.
  • username (CharField) – Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.
  • first_name (CharField) – First name
  • last_name (CharField) – Last name
  • email (EmailField) – Email address
  • is_staff (BooleanField) – Designates whether the user can log into this admin site.
  • is_active (BooleanField) – Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
  • date_joined (DateTimeField) – Date joined
  • groups (ManyToManyField to Group) – The groups this user belongs to. A user will get all permissions granted to each of their groups.
  • user_permissions (ManyToManyField to Permission) – Specific permissions for this user.
class misc.models.Note(id, json, user, date_time, text, content_type, object_id)[source]

Bases: alyx.base.BaseModel

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • user_id (ForeignKey to OrderedUser) – User
  • date_time (DateTimeField) – Date time
  • text (TextField) – Text
  • content_type_id (ForeignKey to ContentType) – Content type
  • object_id (UUIDField) – Object id
class misc.models.BrainLocation(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

Gives a brain location in stereotaxic coordinates, plus other information about location.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Name
  • stereotaxic_coordinates (ArrayField) – Stereotaxic coordinates
  • description (TextField) – Description
  • allen_location_ontology (CharField) – Allen location ontology
class misc.models.CoordinateTransformation(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

This defines how to convert from a local coordinate system (e.g. of a silicon probe) to stereotaxic coordinates. It is an affine transformation: stereotaxic_coordinates = origin + transformation_matrix*local_coordinates. The decription and allen_location_ontology apply to the coordinate origin (e.g. electrode tip).

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Name
  • description (TextField) – Description
  • allen_location_ontology (CharField) – Allen location ontology
  • origin (ArrayField) – Origin
  • transformation_matrix (ArrayField) – Transformation matrix

Subjects

class subjects.models.Subject(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

Metadata about an experimental subject (animal or human).

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • nickname (CharField) – Easy-to-remember, unique name (e.g. ‘Hercules’).
  • species_id (ForeignKey to Species) – Species
  • litter_id (ForeignKey to Litter) – Litter
  • sex (CharField with choices: ((‘M’, ‘Male’), (‘F’, ‘Female’), (‘U’, ‘Unknown’))) – Sex
  • strain_id (ForeignKey to Strain) – Strain
  • source_id (ForeignKey to Source) – Source
  • line_id (ForeignKey to Line) – Line
  • birth_date (DateField) – Birth date
  • death_date (DateField) – Death date
  • wean_date (DateField) – Wean date
  • genotype_date (DateField) – Genotype date
  • responsible_user_id (ForeignKey to OrderedUser) – Who has primary or legal responsibility for the subject.
  • lamis_cage (IntegerField) – Lamis cage
  • request_id (ForeignKey to SubjectRequest) – Request
  • implant_weight (FloatField) – Implant weight in grams
  • ear_mark (CharField) – Ear mark
  • protocol_number (CharField with choices: ((‘1’, ‘1’), (‘2’, ‘2’), (‘3’, ‘3’), (‘4’, ‘4’))) – Protocol number
  • description (TextField) – Description
  • cull_method (TextField) – Cull method
  • adverse_effects (TextField) – Adverse effects
  • actual_severity (IntegerField with choices: ((None, ‘’), (1, ‘Sub-threshold’), (2, ‘Mild’), (3, ‘Moderate’), (4, ‘Severe’), (5, ‘Non-recovery’))) – Actual severity
  • to_be_genotyped (BooleanField) – To be genotyped
  • to_be_culled (BooleanField) – To be culled
  • reduced (BooleanField) – Reduced
  • reduced_date (DateField) – Reduced date
  • genotype (ManyToManyField to Allele) – Genotype
  • genotype_test (ManyToManyField to Sequence) – Genotype test
class subjects.models.SubjectRequest(id, json, user, line, count, date_time, due_date, description)[source]

Bases: alyx.base.BaseModel

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • user_id (ForeignKey to OrderedUser) – Who requested this subject.
  • line_id (ForeignKey to Line) – Line
  • count (IntegerField) – Count
  • date_time (DateField) – Date time
  • due_date (DateField) – Due date
  • description (TextField) – Description
subjects.models.send_subject_request_mail_new(sender, instance=None, **kwargs)[source]

Send en email when a subject request is created.

subjects.models.send_subject_request_mail_change(sender, instance=None, **kwargs)[source]

Send en email when a subject’s request changes.

subjects.models.send_subject_responsible_user_mail_change(sender, instance=None, **kwargs)[source]

Send en email when a subject’s responsible user changes.

class subjects.models.Litter(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A litter, containing a mother, father, and children with a shared date of birth.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • descriptive_name (CharField) – Descriptive name
  • line_id (ForeignKey to Line) – Line
  • breeding_pair_id (ForeignKey to BreedingPair) – Breeding pair
  • description (TextField) – Description
  • birth_date (DateField) – Birth date
class subjects.models.BreedingPair(id, json, name, line, start_date, end_date, father, mother1, mother2, description)[source]

Bases: alyx.base.BaseModel

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Leave to “-” to autofill.
  • line_id (ForeignKey to Line) – Line
  • start_date (DateField) – Start date
  • end_date (DateField) – End date
  • father_id (ForeignKey to Subject) – Father
  • mother1_id (ForeignKey to Subject) – Mother1
  • mother2_id (ForeignKey to Subject) – Mother2
  • description (TextField) – Description
class subjects.models.Line(id, json, name, description, target_phenotype, auto_name, strain, species, subject_autoname_index, breeding_pair_autoname_index, litter_autoname_index, is_active)[source]

Bases: alyx.base.BaseModel

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Name
  • description (TextField) – Description
  • target_phenotype (CharField) – Target phenotype
  • auto_name (CharField) – Auto name
  • strain_id (ForeignKey to Strain) – Strain
  • species_id (ForeignKey to Species) – Species
  • subject_autoname_index (IntegerField) – Subject autoname index
  • breeding_pair_autoname_index (IntegerField) – Breeding pair autoname index
  • litter_autoname_index (IntegerField) – Litter autoname index
  • is_active (BooleanField) – Is active
  • sequences (ManyToManyField to Sequence) – Sequences
class subjects.models.Species(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A single species, identified uniquely by its binomial name.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • binomial (CharField) – Binomial name, e.g. “mus musculus”
  • display_name (CharField) – common name, e.g. “mouse”
class subjects.models.Strain(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A strain with a standardised name.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • descriptive_name (CharField) – Standard descriptive name E.g. “C57BL/6J”, http://www.informatics.jax.org/mgihome/nomen/
  • description (TextField) – Description
class subjects.models.Source(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A supplier / source of subjects.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Name
  • description (TextField) – Description
class subjects.models.StockManager(id, json, user)[source]

Bases: alyx.base.BaseModel

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • user_id (OneToOneField to User) – User
class subjects.models.Allele(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A single allele.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • standard_name (CharField) – MGNC-standard genotype name e.g. Pvalb, http://www.informatics.jax.org/mgihome/nomen/
  • informal_name (CharField) – informal name in lab, e.g. Pvalb-Cre
class subjects.models.Zygosity(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A junction table between Subject and Allele.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – Subject
  • allele_id (ForeignKey to Allele) – Allele
  • zygosity (IntegerField with choices: ((0, ‘Absent’), (1, ‘Heterozygous’), (2, ‘Homozygous’), (3, ‘Present’))) – Zygosity
class subjects.models.Sequence(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A genetic sequence that you run a genotyping test for.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • base_pairs (TextField) – the actual sequence of base pairs in the test
  • description (CharField) – any other relevant information about this test
  • informal_name (CharField) – informal name in lab, e.g. ROSA-WT
class subjects.models.GenotypeTest(id, json, subject, sequence, test_result)[source]

Bases: alyx.base.BaseModel

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – Subject
  • sequence_id (ForeignKey to Sequence) – Sequence
  • test_result (IntegerField with choices: ((0, ‘Absent’), (1, ‘Present’))) – Test result
TEST_RESULTS = ((0, 'Absent'), (1, 'Present'))

A junction table between Subject and Sequence.

Actions

class actions.models.ProcedureType(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A procedure to be performed on a subject.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Short procedure name
  • description (TextField) – Detailed description of the procedure
class actions.models.Weighing(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A weighing of a subject.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • user_id (ForeignKey to OrderedUser) – The user who weighed the subject
  • subject_id (ForeignKey to Subject) – The subject which was weighed
  • date_time (DateTimeField) – Date time
  • weight (FloatField) – Weight in grams
  • weighing_scale_id (ForeignKey to WeighingScale) – The scale record that was used to weigh the subject
expected()[source]

Expected weighing.

class actions.models.WaterAdministration(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

For keeping track of water for subjects not on free water.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • user_id (ForeignKey to OrderedUser) – The user who administered water
  • subject_id (ForeignKey to Subject) – The subject to which water was administered
  • date_time (DateTimeField) – Date time
  • water_administered (FloatField) – Water administered, in millilitres
  • hydrogel (NullBooleanField) – Hydrogel
class actions.models.BaseAction(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

Base class for an action performed on a subject, such as a recording; surgery; etc. This should always be accessed through one of its subclasses.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – The subject on which this action was performed
  • location_id (ForeignKey to LabLocation) – The physical location at which the action was performed
  • narrative (TextField) – Narrative
  • start_time (DateTimeField) – Start time
  • end_time (DateTimeField) – End time
  • users (ManyToManyField to OrderedUser) – The user(s) involved in this action
  • procedures (ManyToManyField to ProcedureType) – The procedure(s) performed
class actions.models.VirusInjection(*args, **kwargs)[source]

Bases: actions.models.BaseAction

A virus injection.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – The subject on which this action was performed
  • location_id (ForeignKey to LabLocation) – The physical location at which the action was performed
  • narrative (TextField) – Narrative
  • start_time (DateTimeField) – Start time
  • end_time (DateTimeField) – End time
  • virus_batch_id (ForeignKey to VirusBatch) – Virus batch
  • injection_volume (FloatField) – Volume in nanoliters
  • rate_of_injection (FloatField) – TODO: Nanoliters per second / per minute?
  • injection_type (CharField with choices: ((‘I’, ‘Iontophoresis’), (‘P’, ‘Pressure’))) – Whether the injection was through iontophoresis or pressure
  • users (ManyToManyField to OrderedUser) – The user(s) involved in this action
  • procedures (ManyToManyField to ProcedureType) – The procedure(s) performed
class actions.models.Surgery(*args, **kwargs)[source]

Bases: actions.models.BaseAction

Surgery performed on a subject.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – The subject on which this action was performed
  • narrative (TextField) – Narrative
  • start_time (DateTimeField) – Start time
  • end_time (DateTimeField) – End time
  • brain_location_id (ForeignKey to BrainLocation) – Brain location
  • outcome_type (CharField with choices: ((‘a’, ‘Acute’), (‘r’, ‘Recovery’))) – Outcome type
  • location_id (ForeignKey to LabLocation) – The physical location at which the surgery was performed
  • users (ManyToManyField to OrderedUser) – The user(s) involved in this action
  • procedures (ManyToManyField to ProcedureType) – The procedure(s) performed
class actions.models.Session(*args, **kwargs)[source]

Bases: actions.models.BaseAction

A recording or training session performed on a subject. There is normally only one of these per day, for example corresponding to a period of uninterrupted head fixation.

Note that you can organize sessions hierarchically by assigning a parent_session. Sub-sessions could for example corresponding to periods of time in which the same neurons were recorded, or a particular set of stimuli were presented. Top-level sessions should have parent_session set to null.

If the fields (e.g. users) of a subsession are null, they should inherited from the parent.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – The subject on which this action was performed
  • location_id (ForeignKey to LabLocation) – The physical location at which the action was performed
  • narrative (TextField) – Narrative
  • start_time (DateTimeField) – Start time
  • end_time (DateTimeField) – End time
  • parent_session_id (ForeignKey to Session) – Hierarchical parent to this session
  • type (CharField) – User-defined session type (e.g. Base, Experiment)
  • number (IntegerField) – Optional session number for this level
  • users (ManyToManyField to OrderedUser) – The user(s) involved in this action
  • procedures (ManyToManyField to ProcedureType) – The procedure(s) performed
class actions.models.WaterRestriction(*args, **kwargs)[source]

Bases: actions.models.BaseAction

Water restriction.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – The subject on which this action was performed
  • location_id (ForeignKey to LabLocation) – The physical location at which the action was performed
  • narrative (TextField) – Narrative
  • start_time (DateTimeField) – Start time
  • end_time (DateTimeField) – End time
  • users (ManyToManyField to OrderedUser) – The user(s) involved in this action
  • procedures (ManyToManyField to ProcedureType) – The procedure(s) performed
class actions.models.OtherAction(*args, **kwargs)[source]

Bases: actions.models.BaseAction

Another type of action.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • subject_id (ForeignKey to Subject) – The subject on which this action was performed
  • location_id (ForeignKey to LabLocation) – The physical location at which the action was performed
  • narrative (TextField) – Narrative
  • start_time (DateTimeField) – Start time
  • end_time (DateTimeField) – End time
  • users (ManyToManyField to OrderedUser) – The user(s) involved in this action
  • procedures (ManyToManyField to ProcedureType) – The procedure(s) performed

Equipment

class equipment.models.LabLocation(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

The physical location at which an session is performed or appliances are located. This could be a room, a bench, a rig, etc.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Name
class equipment.models.Supplier(*args, **kwargs)[source]

Bases: alyx.base.BasePolymorphicModel

A company or individual that provides lab equipment or supplies. This is a base class, to be accessed by subclasses

Parameters:
  • polymorphic_ctype_id (ForeignKey to ContentType) – Polymorphic ctype
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – i.e. ‘NeuroNexus’
  • description (TextField) – Description
class equipment.models.EquipmentModel(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

An equipment model. i.e. “BrainScanner 4X”

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • manufacturer_id (ForeignKey to Supplier) – Manufacturer
  • model_name (CharField) – e.g. ‘BrainScanner 4X’
  • description (CharField) – Description
class equipment.models.VirusBatch(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A virus batch

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • virus_type (CharField) – UPenn ID or equivalent
  • description (CharField) – Description
  • virus_source_id (ForeignKey to Supplier) – Who supplied the virus
  • date_time_made (DateTimeField) – Date time made
  • nominal_titer (FloatField) – TODO: What unit?
class equipment.models.Appliance(*args, **kwargs)[source]

Bases: alyx.base.BasePolymorphicModel

An appliance, provided by a specific manufacturer. This class is only accessed through its subclasses.

Parameters:
  • polymorphic_ctype_id (ForeignKey to ContentType) – Polymorphic ctype
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • location_id (ForeignKey to LabLocation) – The physical location of the appliance.
  • equipment_model_id (ForeignKey to EquipmentModel) – Equipment model
  • serial (CharField) – The serial number of the appliance.
  • description (TextField) – Description
  • descriptive_name (CharField) – Descriptive name
class equipment.models.WeighingScale(*args, **kwargs)[source]

Bases: equipment.models.Appliance

A weighing scale.

Parameters:appliance_ptr_id (OneToOneField to Appliance) – Appliance ptr
class equipment.models.LightSource(*args, **kwargs)[source]

Bases: equipment.models.Appliance

A light source (e.g. for use in optogenetics.

Parameters:appliance_ptr_id (OneToOneField to Appliance) – Appliance ptr
class equipment.models.Amplifier(*args, **kwargs)[source]

Bases: equipment.models.Appliance

An amplifier used in electrophysiology sessions.

Parameters:appliance_ptr_id (OneToOneField to Appliance) – Appliance ptr
class equipment.models.PipettePuller(*args, **kwargs)[source]

Bases: equipment.models.Appliance

A pipette puller for intracellular electrophysiology.

Parameters:appliance_ptr_id (OneToOneField to Appliance) – Appliance ptr
class equipment.models.DAQ(*args, **kwargs)[source]

Bases: equipment.models.Appliance

A DAQ for extracellular electrophysiology.

Parameters:appliance_ptr_id (OneToOneField to Appliance) – Appliance ptr

Data

class data.models.DataRepositoryType(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A type of data repository, e.g. local SAMBA file server; web archive; LTO tape

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Name
class data.models.DataRepository(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A data repository e.g. a particular local drive, specific cloud storage location, or a specific tape.

Stores an absolute path to the repository rootas a URI (e.g. for SMB file://myserver.mylab.net/Data/ALF/; for web https://www.neurocloud.edu/Data/). Additional information about the repository can stored in JSON in a type-specific manner (e.g. which cardboard box to find a tape in)

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – Name
  • repository_type_id (ForeignKey to DataRepositoryType) – Repository type
  • path (CharField) – absolute URI path to the repository
class data.models.DatasetType(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A descriptor to accompany a dataset, saying what sort of information is contained in it E.g. “Neuropixels raw data” “eye camera movie”, etc.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – description of data type
class data.models.BaseExperimentalData(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

Abstract base class for all data acquisition models. Never used directly.

Contains an Session link, to provide information about who did the experiment etc. Note that sessions can be organized hierarchically, and this can point to any level of the hierarchy

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
class data.models.Dataset(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

A chunk of data that is stored outside the database, most often a rectangular binary array. There can be multiple FileRecords for one Dataset, which will be different physical files, all containing identical data, with the same MD5.

Note that by convention, binary arrays are stored as .npy and text arrays as .tsv

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • name (CharField) – Name
  • md5 (UUIDField) – MD5 hash of the data buffer
  • dataset_type_id (ForeignKey to DatasetType) – Dataset type
class data.models.FileRecord(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A single file on disk or tape. Normally specified by a path within an archive. If required, more details can be in the JSON

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • dataset_id (ForeignKey to Dataset) – Dataset
  • data_repository_id (ForeignKey to DataRepository) – Data repository
  • relative_path (CharField) – path name within repository
class data.models.DataCollection(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

A collection of datasets that all describe different aspects of the same objects. For example, the filtered and unfiltered waveforms of a set of spike clusters. Each file in the collection must have the same number of rows (or the same leading dimension for higher-dim arrays). The timeseries classes will inherit from this.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • name (CharField) – description of the data in this collection (e.g. cluster information)
  • data (ManyToManyField to Dataset) – Datasets, each of which should have their own descriptions and DatasetTypes
class data.models.Timescale(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

A timescale that is used to align recordings on multiple devices. There could be multiple timescales for a single experiment, which could be used for example if some information could only be aligned with poor temporal resolution.

However there can only be one timescale with the flag “final” set to True at any moment. This should reflect a final, accurate time alignement, that can be used by data analysts who do not need to understand how time alignment was performed. It should have a sample rate of 1.

When users search for data, they will normally search for a timescale that is linked to timeseries of the appropriate kind.

A timescale is always associated with a session, and can also optionally be associated with a series or experiment.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • name (CharField) – informal name describing this field
  • nominal_start (DateTimeField) – Approximate date and time corresponding to 0 samples
  • nominal_time_unit (FloatField) – Nominal time unit for this timescale (in seconds)
  • final (BooleanField) – set to true for the final results of time alignment, in seconds
  • info (CharField) – any information, e.g. length of break around 300s inferred approximately from computer clock
class data.models.TimeSeries(*args, **kwargs)[source]

Bases: data.models.DataCollection

A collection of Datasets that were all sampled together, associated with a single set of timestamps, relative to specified timescale. This is a DataCollection together with a timescale ID and a timestamps file.

In principle, you could store multiple TimeSeries with the same data but different Timescales. To avoid confusing data users, however, this is not recommended - only register the final timescale into the database, and don’t register intermediate timescales unless there is a good reason to.

Parameters:
  • datacollection_ptr_id (OneToOneField to DataCollection) – Datacollection ptr
  • timestamps_id (ForeignKey to Dataset) – N*2 array containing sample numbers and their timestamps on associated timescale
  • timescale_id (ForeignKey to Timescale) – which timescale this is on
class data.models.EventSeries(*args, **kwargs)[source]

Bases: data.models.DataCollection

Links to a file containing a set of event times, and other files with further information, such as behavioral events or sensory stimuli. This is a DataCollection together with a times file and a timestamp ID.

Parameters:
  • datacollection_ptr_id (OneToOneField to DataCollection) – Datacollection ptr
  • timescale_id (ForeignKey to Timescale) – which timescale this is on
  • times_id (ForeignKey to Dataset) – n*1 array of times on specified timescale
class data.models.IntervalSeries(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

Links to a file containing a set of event times, and other files with further information, such as behavioral events or sensory stimuli. This is a DataCollection together with a times file and a timestamp ID.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • timescale_id (ForeignKey to Timescale) – which timescale this is on
  • intervals_id (ForeignKey to Dataset) – n*2 array of start and end times

Behavior

class behavior.models.PupilTracking(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

Describes the results of a pupil tracking algorithm.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • x_y_d_id (ForeignKey to TimeSeries) – n*3 timeseries giving x and y coordinates of center plus diameter
  • movie_id (ForeignKey to TimeSeries) – Link to raw data
  • eye (CharField with choices: ((‘L’, ‘Left’), (‘R’, ‘Right’))) – Which eye was tracked; left or right
  • description (TextField) – misc. narrative e.g. (‘unit: mm’ or ‘unknown scale factor’)
  • generating_software (CharField) – e.g. ‘PupilTracka 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
class behavior.models.HeadTracking(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

Describes the results of a head tracking algorithm.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • x_y_theta_id (ForeignKey to TimeSeries) – 3*n timeseries giving x and y coordinates of head plus angle
  • movie_id (ForeignKey to TimeSeries) – Link to raw data
  • description (TextField) – misc. narrative e.g. (‘unit: cm’ or ‘unknown scale factor’)
  • generating_software (CharField) – e.g. ‘HeadTracka 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
class behavior.models.EventSeries(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

Links to a file containing a set of event times and descriptions, such as behavioral events or sensory stimuli.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • event_times_id (ForeignKey to Dataset) – n*1 array of times in seconds (universal timescale)
  • type_descriptions_id_id (ForeignKey to Dataset) – Type descriptions id
  • event_types_id_id (ForeignKey to Dataset) – n*1 array listing the type of each event
  • description (TextField) – misc. narrative e.g. ‘drifting gratings of different orientations’, ‘ChoiceWorld behavior events’
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
class behavior.models.IntervalSeries(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

Links to a file containing a set of start/end pairs and descriptions, such as behavioral intervals or extended sensory stimuli.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • interval_times_id (ForeignKey to Dataset) – n*2 array, with associated array of row labels.
  • interval_types_id (ForeignKey to Dataset) – n*1 array listing the type of each interval
  • type_descriptions_id (ForeignKey to Dataset) – Type descriptions
  • description (TextField) – misc. narrative e.g. ‘drifting gratings of different orientations’, ‘ChoiceWorld behavior intervals’
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
class behavior.models.OptogeneticStimulus(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

This is a special type of interval series, to deal with optogenetic stimuli.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • apparatus_id (ForeignKey to Appliance) – e.g. Laser that was used for stimulation.
  • light_delivery (CharField) – e.g. ‘fiber pointed at craniotomy’
  • description (CharField) – e.g. ‘square pulses’, ‘ramps’
  • wavelength (FloatField) – in nm
  • brain_location_id (ForeignKey to BrainLocation) – of fiber tip, craniotomy, etc.
  • stimulus_times_id (ForeignKey to Dataset) – link to an n*2 array of start and stop of each pulse (sec)
  • stimulus_positions_id (ForeignKey to Dataset) – link to an n*3 array of stimulus positions
  • power_id (ForeignKey to Dataset) – link to an n*1 array giving each pulse power
  • power_calculation_method (CharField) – TODO: normalize? measured, nominal
  • waveform_id (ForeignKey to Dataset) – link to a file giving the waveform of each stimulus.?
class behavior.models.Pharmacology(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

Describes a drug application during the session.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • drug (CharField) – TODO: normalize? Also say what it is dissolved in (DMSO etc)
  • administration_route (CharField) – TODO: normalize? IP, IV, IM, surface etc…
  • start_time (FloatField) – in seconds relative to session start. TODO: not DateTimeField? / TimeDifference
  • end_time (FloatField) – equals start time if single application. TODO: should this be an offset? Or DateTimeField? Or TimeDifference?
  • concentration (CharField) – TODO: not FloatField? include unit (e.g. g/kg; mM; %)
  • volume (CharField) – TODO: not FloatField? include unit (e.g. µL)

Electrophysiology

class electrophysiology.models.ProbeInsertion(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

Contains info about the geometry and probe model of a single probe insertion.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • extracellular_recording_id (ForeignKey to ExtracellularRecording) – id of extracellular recording
  • entry_point_rl (FloatField) – mediolateral position of probe entry point relative to midline (microns). Positive means right
  • entry_point_ap (FloatField) – anteroposterior position of probe entry point relative to bregma (microns). Positive means anterior
  • vertical_angle (FloatField) – vertical angle of probe (degrees). Zero means horizontal. Positive means pointing down.
  • horizontal_angle (FloatField) – horizontal angle of probe (degrees), after vertical rotation. Zero means anterior. Positive means counterclockwise (i.e. left).
  • axial_angle (FloatField) – axial angle of probe (degrees). Zero means that without vertical and horizontal rotations, the probe contacts would be pointint up. Positive means counterclockwise.
  • distance_advanced (FloatField) – How far the probe was moved forward from its entry point. (microns).
  • probe_model_id (ForeignKey to ProbeModel) – model of probe used
  • channel_mapping_id (ForeignKey to Dataset) – numerical array of size nSites x 1 giving the row of the raw data file for each contact site. You will have one of these files per probe, including if you record multiple probes through the same amplifier. Sites that were not recorded should have NaN or -1.
class electrophysiology.models.ProbeModel(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

Metadata describing each probe model

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • probe_manufacturer_id (ForeignKey to Supplier) – Probe manufacturer
  • probe_model (CharField) – manufacturer’s part number e.g. A4x8-5mm-100-200-177
  • description (CharField) – optional informal description e.g. ‘Michigan 4x4 tetrode’; ‘Neuropixels phase 2 option 1’
  • site_positions_id (ForeignKey to Dataset) – numerical array of size nSites x 2 giving locations of each contact site in local coordinates. Probe tip is at the origin.
class electrophysiology.models.BaseBrainLocation(*args, **kwargs)[source]

Bases: alyx.base.BaseModel

Abstract base class for brain location. Never used directly.

Contains curated anatomical location in Allen CCG with an acronym. This is usually figured out using histology, so should override what you might compute from ProbeInsertion.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • ccf_ap (FloatField) – Allen CCF antero-posterior coordinate (microns)
  • ccf_dv (FloatField) – Allen CCF dorso-ventral coordinate (microns)
  • ccf_lr (FloatField) – Allen CCF left-right coordinate (microns)
  • allen_ontology (CharField) – Manually curated site location. Use Allen’s acronyms to represent the appropriate hierarchical level, e.g. SS, SSp, or SSp6a
class electrophysiology.models.RecordingSite(*args, **kwargs)[source]

Bases: electrophysiology.models.BaseBrainLocation

Contains estimated anatomical location of each recording site in each probe insertion. This is usually figured out using histology, so should override what you might compute from ProbeInsertion. Location a

Parameters:
  • basebrainlocation_ptr_id (OneToOneField to BaseBrainLocation) – Basebrainlocation ptr
  • probe_insertion_id (ForeignKey to ProbeInsertion) – id of probe insertion
  • site_no (IntegerField) – which site on the probe
class electrophysiology.models.ExtracellularRecording(*args, **kwargs)[source]

Bases: data.models.TimeSeries

Superclass of TimeSeries to describe raw data when you make an electrophys recording. There should a Dataset of DatasetType “ephys.raw” corresponding to this.

You can also link to a lfp timeseries, that contains low-pass data at a lower sample rate with the same channel mapping

Parameters:
  • timeseries_ptr_id (OneToOneField to TimeSeries) – Timeseries ptr
  • lfp_id (ForeignKey to TimeSeries) – lfp: low-pass filtered and downsampled
  • impedances_id (ForeignKey to Dataset) – dataset containing measured impedance of each channel (ohms).
  • gains_id (ForeignKey to Dataset) – dataset containing gain of each channel microvolts/bit
  • filter_info (CharField) – Details of hardware corner frequencies, filter type, order.
  • recording_type (CharField with choices: ((‘C’, ‘Chronic’), (‘A’, ‘Acute’))) – Whether the recording is chronic or acute
  • ground_electrode (CharField) – e.g. ‘screw above cerebellum’
  • reference_electrode (CharField) – e.g. ‘shorted to ground’
  • amplifier_id (ForeignKey to Amplifier) – The amplifier used in this recording.
  • daq_description_id (ForeignKey to DAQ) – The DAQ used.
class electrophysiology.models.SpikeSorting(*args, **kwargs)[source]

Bases: data.models.EventSeries

An entry in the spike_sorting table contains the output of a single spike sorting run of an extracellular recording. There will usually be only one of these per recording, but there could be several if you want to store multiple alternative clusterings.

This inherits from EventSeries, so is stored in the same format. As well as the spike times there should be an associated Dataset containing cluster IDs of each spike. Optionally, you can also have other datasets with implementation-specific information such as feature vectors but these are not standardized. Like all models derived from BaseExperimentalData, it also contain a provenance_directory that can contain these intermediate steps, in a non-standardized format.

Sometimes people do sortings per probe, sometimes per recording. The probe_insertion field should be null if it is a sorting for the whole recording. NOTE: to be strictly relational, if the probe_insertion is not null, the extracellular_recording ought to be.

Parameters:
class electrophysiology.models.SpikeSortedUnit(*args, **kwargs)[source]

Bases: electrophysiology.models.BaseBrainLocation

This is going to be the biggest table, containing anatomical and other information on every unit resulting from spike sorting. (There is a separate table for units resulting from 2-photon).

Parameters:
  • basebrainlocation_ptr_id (OneToOneField to BaseBrainLocation) – Basebrainlocation ptr
  • cluster_number (IntegerField) – Cluster number
  • spike_sorting_id (ForeignKey to SpikeSorting) – The spike sorting this unit came from
  • channel_group (IntegerField) – which shank this unit came from (an integer not a link)
  • trough_to_peak_width (FloatField) – ms, computed from unfiltered mean spike waveform.
  • half_width (FloatField) – ms, half width of negative peak in unfiltered spike waveform.
  • trough_to_peak_amplitude (FloatField) – µV, from filtered spike waveform.
  • refractory_violation_rate (FloatField) – fraction of spikes occurring < 2ms.
  • isolation_distance (FloatField) – A measure of isolation quality
  • l_ratio (FloatField) – A measure of isolation quality
  • mean_firing_rate (FloatField) – spikes/s
  • cluster_group (CharField with choices: ((‘0’, ‘Noise’), (‘1’, ‘Multi-unit activity’), (‘2’, ‘Single-unit activity’), (‘3’, ‘Unsorted’))) – Human decision on cluster group
  • spike_width_class (CharField with choices: ((‘N’, ‘Narrow’), (‘W’, ‘Wide’))) – Human decision on spike width
  • optogenetic_response (CharField) – e.g. ‘Short latency’ (only if applicable)
  • putative_cell_type (CharField) – e.g. ‘Sst interneuron’, ‘PT cell’.
class electrophysiology.models.IntracellularRecording(*args, **kwargs)[source]

Bases: data.models.BaseExperimentalData

This describes a single intracellular electrode used in one recording.

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • tip_location_id (ForeignKey to BrainLocation) – Estimated location of probe tip
  • electrode_type (CharField with choices: ((‘W’, ‘Whole-cell’), (‘S’, ‘Sharp’))) – Electrode type
  • pipette_puller_id (ForeignKey to PipettePuller) – Pipette puller
  • inner_diameter (FloatField) – mm – before pulling
  • outer_diameter (FloatField) – mm – before pulling
  • electrode_solution (TextField) – Solution details.
  • cp_fast (FloatField) – (pF)
  • cp_slow (FloatField) – (pF)
  • whole_cell_cap_comp (FloatField) – (pF)
  • whole_cell_series_resistance (FloatField) – (Mohm)
  • series_resistance_compensation_bandwidth (FloatField) – (kHz)
  • series_resistance_compensation_correction (FloatField) – (%)
  • series_resistance_compensation_prediction (FloatField) – (%)
  • recorded_current_id (ForeignKey to Dataset) – nA. TODO: time series? flat file? sample rate?
  • voltage_command_id (ForeignKey to Dataset) – mV
  • pipette_cap_comp (FloatField) – (pF)
  • bridge_balance (FloatField) – (M Ohm)
  • recorded_voltage_id (ForeignKey to Dataset) – mV
  • current_command_id (ForeignKey to Dataset) – nA
  • gain (FloatField) – (V/V) – for info only; not required to convert raw data to volts

Imaging

class imaging.models.SVDCompressedMovie(id, json, session, created_by, created_datetime, generating_software, provenance_directory, compressed_data_U, compressed_data_V)[source]

Bases: data.models.BaseExperimentalData

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • compressed_data_U_id (ForeignKey to Dataset) – nSVs*nY*nX binary array giving normalized eigenframesSVD-compression eigenframes
  • compressed_data_V_id (ForeignKey to TimeSeries) – nSamples*nSVs binary array SVD-compression timecourses
class imaging.models.WidefieldImaging(id, json, session, created_by, created_datetime, generating_software, provenance_directory, raw_data, compressed_data, nominal_start_time, nominal_end_time, imaging_indicator, preprocessing, description, image_position, excitation_nominal_wavelength, recording_nominal_wavelength, excitation_device, recording_device)[source]

Bases: data.models.BaseExperimentalData

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • raw_data_id (ForeignKey to TimeSeries) – pointer to nT by nX by nY by nC (colors) binary file
  • compressed_data_id (ForeignKey to SVDCompressedMovie) – Link to SVD compressed movie, if compression was run
  • nominal_start_time (DateTimeField) – in seconds relative to session start. TODO: not DateTimeField? / TimeDifference
  • nominal_end_time (DateTimeField) – Equals start time if single application. TODO: should this be an offset? Or DateTimeField? Or TimeDifference?
  • imaging_indicator (CharField) – . TODO: normalize!
  • preprocessing (CharField) – e.g. ‘computed (F-F0) / F0, estimating F0 as running min’
  • description (CharField) – e.g. ‘field of view includes V1, S1, retrosplenial’
  • image_position_id (ForeignKey to CoordinateTransformation) – Image position
  • excitation_nominal_wavelength (FloatField) – in nm. Can be array for multispectral
  • recording_nominal_wavelength (FloatField) – in nm. Can be array for multispectral
  • excitation_device_id (ForeignKey to LightSource) – Excitation device
  • recording_device (CharField) – e.g. camera manufacturer, plus filter description etc. TODO: Appliance subclass - what name?
class imaging.models.TwoPhotonImaging(id, json, session, created_by, created_datetime, generating_software, provenance_directory, raw_data, compressed_data, description, image_position, excitation_wavelength, recording_wavelength, reference_stack)[source]

Bases: data.models.BaseExperimentalData

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • raw_data_id (ForeignKey to TimeSeries) – array of size nT by nX by nY by nZ by nC
  • compressed_data_id (ForeignKey to SVDCompressedMovie) – to Compressed_movie, if compression was run
  • description (CharField) – e.g. ‘V1 layers 2-4’
  • image_position_id (ForeignKey to CoordinateTransformation) – Note if different planes have different alignment (e.g. flyback plane), this can’t be done in a single 3x3 transformation matrix, instead you would have an array of 3x2 matrices. TODO: how do we deal with this?
  • excitation_wavelength (FloatField) – in nm
  • recording_wavelength (FloatField) – in nm. Can be array for multispectral imaging. TODO: deal with arrays?
  • reference_stack_id (ForeignKey to Dataset) – TODO: reference stack / BrainImage
class imaging.models.ROIDetection(id, json, session, created_by, created_datetime, generating_software, provenance_directory, masks, plane, preprocessing, f, f0, two_photon_imaging_id)[source]

Bases: data.models.BaseExperimentalData

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • masks_id (ForeignKey to Dataset) – array of size nROIs by nY by nX
  • plane_id (ForeignKey to Dataset) – array saying which plane each roi is found in. TODO: is this an ArrayField? JSON?
  • preprocessing (CharField) – computed (F-F0) / F0, estimating F0 as running min’
  • f_id (ForeignKey to TimeSeries) – array of size nT by nROIs giving raw fluorescence
  • f0_id (ForeignKey to TimeSeries) – array of size nT by nROIs giving resting fluorescence
  • two_photon_imaging_id_id (ForeignKey to TwoPhotonImaging) – 2P imaging stack.
class imaging.models.ROI(id, json, session, created_by, created_datetime, generating_software, provenance_directory, roi_type, optogenetic_response, putative_cell_type, estimated_layer, roi_detection_id)[source]

Bases: data.models.BaseExperimentalData

Parameters:
  • id (UUIDField) – Id
  • json (JSONField) – Structured data, formatted in a user-defined way
  • session_id (ForeignKey to Session) – The Session to which this data belongs
  • created_by_id (ForeignKey to User) – The creator of the data.
  • created_datetime (DateTimeField) – The creation datetime.
  • generating_software (CharField) – e.g. ‘ChoiceWorld 0.8.3’
  • provenance_directory_id (ForeignKey to Dataset) – link to directory containing intermediate results
  • roi_type (CharField) – soma, dendrite, neuropil, …> TODO: normalize?
  • optogenetic_response (CharField) – e.g. ‘Short latency’ (only if applicable)
  • putative_cell_type (CharField) – e.g. ‘Sst interneuron’, ‘PT cell’
  • estimated_layer (CharField) – e.g. ‘Layer 5b’
  • roi_detection_id_id (ForeignKey to ROIDetection) – link to detection entry