PhenotypingProtocol#
- class pybrops.breed.prot.pt.PhenotypingProtocol.PhenotypingProtocol[source]#
Bases:
Copyable
,HDF5InputOutput
Abstract class defining interfaces for phenotyping protocols.
- The purpose of this abstract class is to provide functionality for:
Genomic model metadata.
Phenotype simulation.
Manipulation and setting of environmental variance metadata.
Methods
Make a shallow copy of the
Copyable
object.Make a deep copy of the
Copyable
object.Read an object from an HDF5 file.
Phenotype a set of genotypes using a genomic prediction model.
Set the broad sense heritability for environments.
Set the narrow sense heritability for environments.
Write an object to an HDF5 file.
Attributes
Genomic prediction model.
Pure error variance for each trait
- abstract copy()#
Make a shallow copy of the
Copyable
object.- Returns:
out – A shallow copy of the
Copyable
object.- Return type:
- abstract deepcopy(memo)#
Make a deep copy of the
Copyable
object.- Parameters:
memo (dict, None) – An optional dictionary of memo metadata.
- Returns:
out – A deep copy of the
Copyable
object.- Return type:
- abstract classmethod from_hdf5(filename, groupname)#
Read an object from an HDF5 file.
- Parameters:
filename (str, Path, h5py.File) – If
str
, an HDF5 file name from which to read. IfPath
, an HDF5 file name from which to read. Ifh5py.File
, an opened HDF5 file from which to read.groupname (str, None) – If
str
, an HDF5 group name under which object data is stored. IfNone
, object is read from base HDF5 group.
- Returns:
out – An object read from an HDF5 file.
- Return type:
- abstract property gpmod: GenomicModel#
Genomic prediction model.
- abstract phenotype(pgmat, miscout, **kwargs)[source]#
Phenotype a set of genotypes using a genomic prediction model.
- Parameters:
pgmat (PhasedGenotypeMatrix) – Genomes of the individuals to phenotype.
miscout (dict, None) – Pointer to a dictionary for miscellaneous user defined output. If
dict
, write to dict (may overwrite previously defined fields). IfNone
, user defined output is not calculated or stored.kwargs (dict) – Additional keyword arguments.
- Returns:
out – A pandas.DataFrame containing phenotypes for individuals.
- Return type:
pandas.DataFrame
- abstract set_H2(H2, pgmat, **kwargs)[source]#
Set the broad sense heritability for environments.
- Parameters:
H2 (Real, numpy.ndarray) – Broad sense heritability.
pgmat (PhasedGenotypeMatrix) – Founder genotypes.
kwargs (dict) – Additional keyword arguments
- Return type:
None
- abstract set_h2(h2, pgmat, **kwargs)[source]#
Set the narrow sense heritability for environments.
- Parameters:
h2 (Real, numpy.ndarray) – Narrow sense heritability.
pgmat (PhasedGenotypeMatrix) – Founder genotypes.
kwargs (dict) – Additional keyword arguments
- Return type:
None
- abstract to_hdf5(filename, groupname, overwrite)#
Write an object to an HDF5 file.
- Parameters:
filename (str, Path, h5py.File) – If
str
, an HDF5 file name to which to write. IfPath
, an HDF5 file path to which to write. Ifh5py.File
, an opened HDF5 file to which to write.groupname (str, None) – If
str
, an HDF5 group name under which object data is stored. IfNone
, object is written to the base HDF5 group.overwrite (bool) – Whether to overwrite values in an HDF5 file if a field already exists.
- Return type:
None
- abstract property var_err: object#
Pure error variance for each trait