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_PySequenceCollection
classmethod
from_PySequenceCollection(gtars_seq_col)
Given a PySequenceCollection object (from Rust bindings), create a SequenceCollection object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gtars_seq_col
|
PySequenceCollection
|
PySequenceCollection object from Rust bindings. |
required |
Returns:
Type | Description |
---|---|
SequenceCollection
|
The SequenceCollection object. |
Source code in refget/models.py
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
|
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
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 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
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
174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
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
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
itemwise
itemwise(limit=None)
Converts object into a list of dictionaries, one for each sequence in the collection.
Source code in refget/models.py
392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 |
|
level1
level1()
Converts object into dict of level 2 representation of the SequenceCollection.
Source code in refget/models.py
366 367 368 369 370 371 372 373 374 375 376 377 |
|
level2
level2()
Converts object into dict of level 2 representation of the SequenceCollection.
Source code in refget/models.py
379 380 381 382 383 384 385 386 387 388 389 390 |
|