GTF¶
scan(path)
¶
Scan a GFF or GTF file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
The path to the GTF file. |
required |
Returns:
| Type | Description |
|---|---|
LazyFrame
|
A lazy frame with columns: seqname, source, feature, start, end, score, strand, frame, attribute. |
Source code in python/seqpro/gtf.py
attr(attr)
¶
Extract a column from the attribute field. In general, GTF/GFF attributes can be any
type, so this always returns a Utf8 column. If an explicit cast is necessary, it can be
done by e.g. seqpro.gtf.attr(attr).cast(pl.Int32).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attr
|
str
|
The attribute to extract. |
required |
Returns:
| Type | Description |
|---|---|
Expr
|
A Polars expression that extracts the named attribute as a Utf8 column. |