Storage space for a sequence file
SequenceFile
(id)[source]¶Bases: conkit.core.Entity.Entity
A sequence file object representing a single sequence file
The SequenceFile
class represents a data structure to hold
Sequence
instances in a single sequence file. It contains
functions to store and analyze sequences.
Examples
>>> from conkit.core import Sequence, SequenceFile
>>> sequence_file = SequenceFile("example")
>>> sequence_file.add(Sequence("foo", "ABCDEF"))
>>> sequence_file.add(Sequence("bar", "ZYXWVU"))
>>> print(sequence_file)
SequenceFile(id="example" nseqs=2)
Attributes
id |
The ID of the selected entity |
is_alignment |
A boolean status for the alignment |
nseqs |
The number of Sequence instances |
remark |
The SequenceFile -specific remarks |
status |
An indication of the residue status, i.e true positive, false positive, or unknown |
top_sequence |
The first Sequence entry in SequenceFile |
Methods
add (entity) |
Add a child to the Entity |
calculate_freq () |
Calculate the gap frequency in each alignment column |
calculate_meff ([identity]) |
Calculate the number of effective sequences |
copy () |
Create a shallow copy of Entity |
deepcopy () |
Create a deep copy of Entity |
remove (id) |
Remove a child |
sort (kword[, reverse, inplace]) |
Sort the SequenceFile |
trim (start, end[, inplace]) |
Trim the SequenceFile |
calculate_freq
()[source]¶Calculate the gap frequency in each alignment column
This function calculates the frequency of gaps at each position in the Multiple Sequence Alignment.
Returns: | list
|
---|---|
Raises: | MemoryError
RuntimeError
|
calculate_meff
(identity=0.7)[source]¶Calculate the number of effective sequences
This function calculates the number of effective sequences (Meff) in the Multiple Sequence Alignment.
The mathematical function used to calculate Meff is
Parameters: | identity : float, optional
|
---|---|
Returns: | int
|
Raises: | MemoryError
RuntimeError
ValueError
ValueError
|
is_alignment
¶A boolean status for the alignment
Returns: | bool
|
---|
nseqs
¶The number of Sequence
instances
in the SequenceFile
Returns: | int
|
---|
remark
¶The SequenceFile
-specific remarks
sort
(kword, reverse=False, inplace=False)[source]¶Sort the SequenceFile
Parameters: | kword : str
reverse : bool, optional
inplace : bool, optional
|
---|---|
Returns: |
|
Raises: | ValueError
|
status
¶An indication of the residue status, i.e true positive, false positive, or unknown
top_sequence
¶The first Sequence
entry in SequenceFile
Returns: |
|
---|
trim
(start, end, inplace=False)[source]¶Trim the SequenceFile
Parameters: | start : int
end : int
inplace : bool, optional
|
---|---|
Returns: |
|