antonkulaga commited on
Commit
6efa095
·
verified ·
1 Parent(s): 653afe2

Card: read with polars and polars-bio

Browse files
Files changed (1) hide show
  1. README.md +13 -3
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
- from datasets import load_dataset
50
- species = load_dataset("longevity-genie/mitoage", "species", split="train")
51
- alignments = load_dataset("longevity-genie/mitoage", "alignments", split="train")
 
 
 
 
 
 
 
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