allensdk.brain_observatory.behavior.data_objects.metadata.subject_metadata.subject_metadata module

class allensdk.brain_observatory.behavior.data_objects.metadata.subject_metadata.subject_metadata.SubjectMetadata(sex: Sex, age: Age, reporter_line: ReporterLine, full_genotype: FullGenotype, driver_line: DriverLine, mouse_id: MouseId, death_on: datetime | None = None)[source]

Bases: DataObject, LimsReadableInterface, NwbReadableInterface, NwbWritableInterface, JsonReadableInterface

Subject metadata

property age_in_days: int | None
property cre_line: str | None
property driver_line: List[str]
classmethod from_json(dict_repr: dict) SubjectMetadata[source]

Populates a DataFile from a JSON compatible dict (likely parsed by argschema)

Returns:
DataObject:

An instantiated DataObject which has name and value properties

classmethod from_lims(behavior_session_id: BehaviorSessionId, lims_db: PostgresQueryMixin) SubjectMetadata[source]

Populate a DataObject from an internal database (likely LIMS)

Returns:
DataObject:

An instantiated DataObject which has name and value properties

classmethod from_nwb(nwbfile: NWBFile) SubjectMetadata[source]

Populate a DataObject from a pyNWB file object.

Parameters:
nwbfile:

The file object (NWBFile) of a pynwb dataset file.

Returns:
DataObject:

An instantiated DataObject which has name and value properties

property full_genotype: str
get_death_date() datetime | None[source]

Notes

Optional since we don’t store this field when reading from NWB

property mouse_id: int
property reporter_line: str | None
property sex: str
to_nwb(nwbfile: NWBFile) NWBFile[source]

Given an already populated DataObject, return an pyNWB file object that had had DataObject data added.

Parameters:
nwbfileNWBFile

An NWB file object

Returns:
NWBFile

An NWB file object that has had data from the DataObject added to it.