Skip to content

Commit

Permalink
Fixed indexing from 1 vs 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitbiscuit authored and GarrettNg committed Jul 15, 2023
1 parent 38c403e commit 00d0ae4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dask_ngs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _read_bam_query_from_path(
) -> pd.DataFrame:
stream = BytesIO(ox.read_bam(path, f"{chrom}:{start}-{end}"))
ipc = pyarrow.ipc.open_file(stream)
return ipc.to_pandas()
return ipc.read_pandas()


def read_bam(path: str, chunksize: int = 10_000_000) -> dd.DataFrame:
Expand All @@ -41,7 +41,7 @@ def read_bam(path: str, chunksize: int = 10_000_000) -> dd.DataFrame:
chromsizes = bioframe.fetch_chromsizes("hg38")
chunk_spans = bioframe.binnify(chromsizes, chunksize)
chunks = [
dask.delayed(_read_bam_query_from_path)(path, chrom, start, end)
dask.delayed(_read_bam_query_from_path)(path, chrom, start + 1, end)
for chrom, start, end in chunk_spans.to_numpy()
]
return dd.from_delayed(chunks)

0 comments on commit 00d0ae4

Please sign in to comment.