Package refget
documentation
SequenceCollection
Bases: SQLModel
A SQLModel/pydantic model that represents a refget sequence collection.
digest
class-attribute
instance-attribute
digest = Field(primary_key=True)
Top-level digest of the SequenceCollection.
lengths
class-attribute
instance-attribute
lengths = Relationship(back_populates='collection')
Array of sequence lengths.
name_length_pairs
class-attribute
instance-attribute
name_length_pairs = Relationship(back_populates='collection')
Array of name-length pairs, representing the coordinate system of the collection.
names
class-attribute
instance-attribute
names = Relationship(back_populates='collection')
Array of sequence names.
sequences
class-attribute
instance-attribute
sequences = Relationship(back_populates='collection')
Array of sequence digests.
sorted_name_length_pairs_digest
class-attribute
instance-attribute
sorted_name_length_pairs_digest = Field()
Digest of the sorted name-length pairs, representing a unique digest of sort-invariant coordinate system.
sorted_sequences
class-attribute
instance-attribute
sorted_sequences = Relationship(back_populates='collection')
Array of sorted sequence digests.
from_dict
classmethod
from_dict(seqcol_dict, inherent_attrs=['names', 'sequences'])
Given a dict representation of a sequence collection, create a SequenceCollection object. This is the primary way to create a SequenceCollection object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seqcol_dict
|
dict
|
Dictionary representation of a canonical sequence collection object |
required |
schema
|
dict
|
Schema defining the inherent attributes to digest |
required |
Returns:
Type | Description |
---|---|
SequenceCollection
|
The SequenceCollection object |
Source code in refget/models.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
from_fasta_file
classmethod
from_fasta_file(fasta_file)
Given a FASTA file, create a SequenceCollection object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fasta_file
|
str
|
Path to a FASTA file |
required |
Returns:
Type | Description |
---|---|
SequenceCollection
|
The SequenceCollection object |
Source code in refget/models.py
145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
input_validate
classmethod
input_validate(seqcol_obj)
Given a dict representation of a sequence collection, validate it against the input schema.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seqcol_obj
|
dict
|
Dictionary representation of a canonical sequence collection object |
required |
Returns:
Type | Description |
---|---|
bool
|
True if the object is valid, False otherwise |
Source code in refget/models.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
itemwise
itemwise(limit=None)
Converts object into a list of dictionaries, one for each sequence in the collection.
Source code in refget/models.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
level1
level1()
Converts object into dict of level 2 representation of the SequenceCollection.
Source code in refget/models.py
238 239 240 241 242 243 244 245 246 247 248 249 |
|
level2
level2()
Converts object into dict of level 2 representation of the SequenceCollection.
Source code in refget/models.py
251 252 253 254 255 256 257 258 259 260 261 262 |
|