3.1.1.1. obj_tables.bio package¶
3.1.1.1.1. Submodules¶
3.1.1.1.2. obj_tables.bio.seq module¶
Biological attributes
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2017-05-10
- Copyright
2017, Karr Lab
- License
MIT
-
class
obj_tables.bio.seq.
FeatureLocAttribute
(default=None, none_value=None, verbose_name='', description='', primary=False, unique=False)[source]¶ Bases:
obj_tables.core.LiteralAttribute
Bio.SeqFeature.FeatureLocation attribute
- Parameters
default (
Bio.SeqFeature.FeatureLocation
, optional) – default valuenone_value (
object
, optional) – none valueverbose_name (
str
, optional) – verbose namedescription (
str
, optional) – descriptionprimary (
bool
, optional) – indicate if attribute is primary attributeunique (
bool
, optional) – indicate if attribute value must be unique
-
deserialize
(value)[source]¶ Deserialize value
- Parameters
value (
str
) – semantically equivalent representation- Returns
tuple of cleaned value and cleaning error
- Return type
tuple
ofnumpy.array
,core.InvalidAttribute
orNone
-
from_builtin
(json)[source]¶ Decode a simple Python representation (dict, list, str, float, bool, None) of a value of the attribute that is compatible with JSON and YAML
- Parameters
json (
dict
) – simple Python representation of a value of the attribute- Returns
decoded value of the attribute
- Return type
Bio.SeqFeature.FeatureLocation
-
serialize
(value)[source]¶ Serialize string
- Parameters
value (
numpy.array
) – Python representation- Returns
simple Python representation
- Return type
str
-
to_builtin
(value)[source]¶ Encode a value of the attribute using a simple Python representation (dict, list, str, float, bool, None) that is compatible with JSON and YAML
- Parameters
value (
Bio.SeqFeature.FeatureLocation
) – value of the attribute- Returns
simple Python representation of a value of the attribute
- Return type
dict
-
validate
(obj, value)[source]¶ Determine if
value
is a valid value- Parameters
obj (
Model
) – class being validatedvalue (
numpy.array
) – value of attribute to validate
- Returns
- None if attribute is valid, other return
list of errors as an instance of
core.InvalidAttribute
- Return type
core.InvalidAttribute
or None
-
validate_unique
(objects, values)[source]¶ Determine if the attribute values are unique
- Parameters
objects (
list
ofModel
) – list ofModel
objectsvalues (
list
ofBio.SeqFeature.FeatureLocation
) – list of values
- Returns
- None if values are unique, otherwise return
a list of errors as an instance of
core.InvalidAttribute
- Return type
core.InvalidAttribute
or None
-
class
obj_tables.bio.seq.
SeqAttribute
(min_length=0, max_length=inf, default=None, none_value=None, verbose_name='', description='', primary=False, unique=False)[source]¶ Bases:
obj_tables.core.LiteralAttribute
Bio.Seq.Seq attribute
- Parameters
min_length (
int
, optional) – minimum lengthmax_length (
int
, optional) – maximum lengthdefault (
Bio.Seq.Seq
, optional) – default valuenone_value (
object
, optional) – none valueverbose_name (
str
, optional) – verbose namedescription (
str
, optional) – descriptionprimary (
bool
, optional) – indicate if attribute is primary attributeunique (
bool
, optional) – indicate if attribute value must be unique
-
deserialize
(value)[source]¶ Deserialize value
- Parameters
value (
str
) – semantically equivalent representation- Returns
tuple of cleaned value and cleaning error
- Return type
tuple
ofBio.Seq.Seq
,core.InvalidAttribute
orNone
-
from_builtin
(json)[source]¶ Decode a simple Python representation (dict, list, str, float, bool, None) of a value of the attribute that is compatible with JSON and YAML
- Parameters
json (
dict
) – simple Python representation of a value of the attribute- Returns
decoded value of the attribute
- Return type
Bio.Seq.Seq
-
serialize
(value)[source]¶ Serialize string
- Parameters
value (
Bio.Seq.Seq
) – Python representation- Returns
simple Python representation
- Return type
str
-
to_builtin
(value)[source]¶ Encode a value of the attribute using a simple Python representation (dict, list, str, float, bool, None) that is compatible with JSON and YAML
- Parameters
value (
Bio.Seq.Seq
) – value of the attribute- Returns
simple Python representation of a value of the attribute
- Return type
dict
-
validate
(obj, value)[source]¶ Determine if
value
is a valid value- Parameters
obj (
Model
) – class being validatedvalue (
Bio.Seq.Seq
) – value of attribute to validate
- Returns
- None if attribute is valid, other return
list of errors as an instance of
core.InvalidAttribute
- Return type
core.InvalidAttribute
or None
-
validate_unique
(objects, values)[source]¶ Determine if the attribute values are unique
- Parameters
objects (
list
ofModel
) – list ofModel
objectsvalues (
list
ofBio.Seq.Seq
) – list of values
- Returns
- None if values are unique, otherwise return
a list of errors as an instance of
core.InvalidAttribute
- Return type
core.InvalidAttribute
or None
-
class
obj_tables.bio.seq.
DnaSeqAttribute
(min_length=0, max_length=inf, default=None, none_value=None, verbose_name='', description='', primary=False, unique=False)[source]¶ Bases:
obj_tables.bio.seq.SeqAttribute
Bio.Seq.Seq attribute with Bio.Alphabet.DNAAlphabet
- Parameters
min_length (
int
, optional) – minimum lengthmax_length (
int
, optional) – maximum lengthdefault (
Bio.Seq.Seq
, optional) – default valuenone_value (
object
, optional) – none valueverbose_name (
str
, optional) – verbose namedescription (
str
, optional) – descriptionprimary (
bool
, optional) – indicate if attribute is primary attributeunique (
bool
, optional) – indicate if attribute value must be unique
-
class
obj_tables.bio.seq.
RnaSeqAttribute
(min_length=0, max_length=inf, default=None, none_value=None, verbose_name='', description='', primary=False, unique=False)[source]¶ Bases:
obj_tables.bio.seq.SeqAttribute
Bio.Seq.Seq attribute with Bio.Alphabet.RNAAlphabet
- Parameters
min_length (
int
, optional) – minimum lengthmax_length (
int
, optional) – maximum lengthdefault (
Bio.Seq.Seq
, optional) – default valuenone_value (
object
, optional) – none valueverbose_name (
str
, optional) – verbose namedescription (
str
, optional) – descriptionprimary (
bool
, optional) – indicate if attribute is primary attributeunique (
bool
, optional) – indicate if attribute value must be unique
-
class
obj_tables.bio.seq.
ProteinSeqAttribute
(min_length=0, max_length=inf, default=None, none_value=None, verbose_name='', description='', primary=False, unique=False)[source]¶ Bases:
obj_tables.bio.seq.SeqAttribute
Bio.Seq.Seq attribute with Bio.Alphabet.ProteinAlphabet
- Parameters
min_length (
int
, optional) – minimum lengthmax_length (
int
, optional) – maximum lengthdefault (
Bio.Seq.Seq
, optional) – default valuenone_value (
object
, optional) – none valueverbose_name (
str
, optional) – verbose namedescription (
str
, optional) – descriptionprimary (
bool
, optional) – indicate if attribute is primary attributeunique (
bool
, optional) – indicate if attribute value must be unique
-
class
obj_tables.bio.seq.
FreqPosMatrixAttribute
(verbose_name='', description='')[source]¶ Bases:
obj_tables.core.LiteralAttribute
Bio.motifs.matrix.FrequencyPositionMatrix
attributeArgs: init_value (
object
, optional): initial value default (object
, optional): default value default_cleaned_value (object
, optional): value to replaceNone
values with during cleaning, or function which computes the value to replaceNone
valuesnone_value (
object
, optional): none value verbose_name (str
, optional): verbose name description (str
, optional): description primary (bool
, optional): indicate if attribute is primary attribute unique (bool
, optional): indicate if attribute value must be unique unique_case_insensitive (bool
, optional): if true, conduct case-insensitive test of uniqueness-
deserialize
(value)[source]¶ Deserialize value
- Parameters
value (
str
) – string representation- Returns
tuple of cleaned value and cleaning error
- Return type
tuple
ofBio.motifs.matrix.FrequencyPositionMatrix
,core.InvalidAttribute
orNone
-
from_builtin
(json)[source]¶ Decode a simple Python representation (dict, list, str, float, bool, None) of a value of the attribute that is compatible with JSON and YAML
- Parameters
json (
dict
) – simple Python representation of a value of the attribute- Returns
decoded value of the attribute
- Return type
Bio.motifs.matrix.FrequencyPositionMatrix
-
serialize
(value)[source]¶ Serialize value to a string
- Parameters
value (
Bio.motifs.matrix.FrequencyPositionMatrix
) – Python representation- Returns
string representation
- Return type
str
-
to_builtin
(value)[source]¶ Encode a value of the attribute using a simple Python representation (dict, list, str, float, bool, None) that is compatible with JSON and YAML
- Parameters
value (
Bio.motifs.matrix.FrequencyPositionMatrix
) – value of the attribute- Returns
simple Python representation of a value of the attribute
- Return type
dict
-
validate
(obj, value)[source]¶ Determine if
value
is a valid value- Parameters
obj (
Model
) – class being validatedvalue (
Bio.motifs.matrix.FrequencyPositionMatrix
) – value of attribute to validate
- Returns
- None if attribute is valid, otherwise return list
of errors as an instance of
core.InvalidAttribute
- Return type
core.InvalidAttribute
orNone
-