Card: read with polars and polars-bio
Browse files
README.md
CHANGED
|
@@ -45,10 +45,20 @@ the site's downloads, unchanged, plus `alignments/alignments.parquet`.
|
|
| 45 |
`SeaLifeBase` are CC BY-NC 4.0. Every row of `species` carries its `lifespan_license`; filter on it for
|
| 46 |
a set free of that limit. The terms of each source are under "Sources".
|
| 47 |
|
|
|
|
|
|
|
|
|
|
| 48 |
```python
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
```
|
| 53 |
|
| 54 |
```sql
|
|
|
|
| 45 |
`SeaLifeBase` are CC BY-NC 4.0. Every row of `species` carries its `lifespan_license`; filter on it for
|
| 46 |
a set free of that limit. The terms of each source are under "Sources".
|
| 47 |
|
| 48 |
+
In Python the tables read with polars, and the FASTA files with polars-bio (checked with polars-bio on
|
| 49 |
+
`ATP8.aa.fasta.gz`: columns `name`, the slug; `description`; `sequence`):
|
| 50 |
+
|
| 51 |
```python
|
| 52 |
+
import polars as pl
|
| 53 |
+
import polars_bio as pb
|
| 54 |
+
|
| 55 |
+
base = "hf://datasets/longevity-genie/mitoage/"
|
| 56 |
+
species = pl.read_parquet(base + "species.parquet")
|
| 57 |
+
alignments = pl.read_parquet(base + "alignments/alignments.parquet")
|
| 58 |
+
cox1 = alignments.filter((pl.col("gene") == "COX1") & (pl.col("kind") == "protein")).join(species, on="slug")
|
| 59 |
+
|
| 60 |
+
# one downloaded FASTA file, as a table
|
| 61 |
+
atp8 = pb.read_fasta("ATP8.aa.fasta.gz")
|
| 62 |
```
|
| 63 |
|
| 64 |
```sql
|