Skip to content

Commit

Permalink
revert: revert genbank update
Browse files Browse the repository at this point in the history
  • Loading branch information
tshauck committed Feb 5, 2024
1 parent cae32fd commit 624f1c7
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions python/biobear/genbank_reader.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"""Genbank file reader."""
import os

import pyarrow as pa
import pyarrow.dataset as ds

from biobear.reader import Reader
from biobear.compression import Compression

Expand All @@ -30,26 +27,6 @@ def __init__(
else:
self._reader = _ExonReader(str(path), "GENBANK", None)

def to_polars(self):
"""Read the GFF file and return a polars DataFrame."""
try:
import polars as pl
except ImportError as import_error:
raise ImportError(
"The polars library is required to convert a GFF file "
"to a polars DataFrame."
) from import_error

return pl.from_arrow(self.to_arrow().read_all())

def to_arrow(self) -> pa.RecordBatchReader:
"""Convert the GFF reader to an arrow batch reader."""
return self._reader.to_pyarrow()

def to_arrow_scanner(self) -> ds.Scanner:
"""Convert the GFF reader to an arrow scanner."""
return ds.Scanner.from_batches(self.to_arrow())

@property
def inner(self):
"""Return the inner reader."""
Expand Down

0 comments on commit 624f1c7

Please sign in to comment.