List of models

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

Subjects

_images/subjects_ERD.png
class subjects.models.Project(id, json, name, description)

Bases: alyx.base.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Subject(*args, **kwargs)

Bases: alyx.base.BaseModel

Metadata about an experimental subject (animal or human).

is_negative()

Genotype is -/- for all genes.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.SubjectRequest(id, name, json, user, line, count, date_time, due_date, description)

Bases: alyx.base.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

subjects.models.send_subject_request_mail_new(sender, instance=None, **kwargs)

Send en email when a subject request is created.

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

Send en email when a subject’s request changes.

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

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

class subjects.models.Litter(*args, **kwargs)

Bases: alyx.base.BaseModel

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

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.BreedingPair(id, name, json, line, start_date, end_date, father, mother1, mother2, description)

Bases: alyx.base.BaseModel

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Line(id, name, json, description, target_phenotype, nickname, strain, source, source_identifier, source_url, expression_data_url, species, subject_autoname_index, breeding_pair_autoname_index, litter_autoname_index, is_active)

Bases: alyx.base.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Species(id, name, json, nickname)

Bases: alyx.base.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Strain(*args, **kwargs)

Bases: alyx.base.BaseModel

A strain with a standardised name.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Source(*args, **kwargs)

Bases: alyx.base.BaseModel

A supplier / source of subjects.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.ZygosityRule(id, name, json, line, allele, sequence0, sequence0_result, sequence1, sequence1_result, zygosity)

Bases: alyx.base.BaseModel

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Allele(*args, **kwargs)

Bases: alyx.base.BaseModel

A single allele.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Zygosity(*args, **kwargs)

Bases: alyx.base.BaseModel

A junction table between Subject and Allele.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.Sequence(*args, **kwargs)

Bases: alyx.base.BaseModel

A genetic sequence that you run a genotyping test for.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class subjects.models.GenotypeTest(*args, **kwargs)

Bases: alyx.base.BaseModel

A junction table between Subject and Sequence.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Actions

_images/actions_ERD.png
class actions.models.ProcedureType(*args, **kwargs)

Bases: alyx.base.BaseModel

A procedure to be performed on a subject.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.Weighing(*args, **kwargs)

Bases: alyx.base.BaseModel

A weighing of a subject.

expected()

Expected weighing.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.WaterType(id, json, name)

Bases: alyx.base.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.WaterAdministration(*args, **kwargs)

Bases: alyx.base.BaseModel

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.BaseAction(*args, **kwargs)

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.

class actions.models.VirusInjection(*args, **kwargs)

Bases: actions.models.BaseAction

A virus injection.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.Surgery(*args, **kwargs)

Bases: actions.models.BaseAction

Surgery performed on a subject.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.TaskProtocol(id, json, subject, location, lab, narrative, start_time, end_time, name)

Bases: actions.models.BaseAction

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.Session(*args, **kwargs)

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.

save(*args, **kwargs)

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.WaterRestriction(*args, **kwargs)

Bases: actions.models.BaseAction

Water restriction.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class actions.models.OtherAction(*args, **kwargs)

Bases: actions.models.BaseAction

Another type of action.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Data

_images/data_ERD.png
class data.models.DataRepositoryType(*args, **kwargs)

Bases: alyx.base.BaseModel

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class data.models.DataRepository(*args, **kwargs)

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 root as 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)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class data.models.DataFormat(*args, **kwargs)

Bases: alyx.base.BaseModel

A descriptor to accompany a Dataset or DataCollection, saying what sort of information is contained in it. E.g. “Neuropixels raw data, formatted as flat binary file” “eye camera movie as mj2”, etc. Normally each DatasetType will correspond to a specific 3-part alf name (for individual files) or the first word of the alf names (for DataCollections)

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class data.models.DatasetType(*args, **kwargs)

Bases: alyx.base.BaseModel

A descriptor to accompany a Dataset or DataCollection, saying what sort of information is contained in it. E.g. “Neuropixels raw data, formatted as flat binary file” “eye camera movie as mj2”, etc. Normally each DatasetType will correspond to a specific 3-part alf name (for individual files) or the first word of the alf names (for DataCollections)

clean()

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class data.models.BaseExperimentalData(*args, **kwargs)

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

class data.models.Dataset(*args, **kwargs)

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class data.models.FileRecord(*args, **kwargs)

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Coordinate transforms

_images/misc_ERD.png
class misc.models.LabMember(password, last_login, is_superuser, username, first_name, last_name, email, is_staff, is_active, date_joined, id, is_stock_manager)

Bases: django.contrib.auth.models.AbstractUser

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class misc.models.Lab(id, json, name, institution, address, timezone)

Bases: alyx.base.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class misc.models.LabMembership(id, name, json, user, lab, role, start_date, end_date)

Bases: alyx.base.BaseModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class misc.models.LabLocation(*args, **kwargs)

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.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

class misc.models.Note(id, name, json, user, date_time, text, image, content_type, object_id)

Bases: alyx.base.BaseModel

save()

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned