From 527284ca0d0d9a723f9cecdef559053cdd5bd69a Mon Sep 17 00:00:00 2001 From: Jura Pintar Date: Thu, 28 Dec 2023 15:55:03 -0500 Subject: [PATCH] Update gtfparse version requirement (#118) * Update gtfparse version requirement In 00ece88, gtfparse version was pinned to <2 because of conflicts between gtfparse and recent versions of polars. Since 12/21/23, with gtfparse v. 2.1.0, the conflicts have been eliminated, so there is no need to keep older versions pinned. * Convert polars GTF to pandas --------- Co-authored-by: Gregor Sturm Co-authored-by: Gregor Sturm --- pyproject.toml | 2 +- src/infercnvpy/io/_genepos.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ff0152b..afd54be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ dependencies = [ 'numpy>=1.20', # includes type annotations 'tqdm>=4.63.0', # fixes tqdm.auto 'pytoml', - 'gtfparse<2', + 'gtfparse>=2.1', 'pycairo>=1.20; sys_platform == "win32"', 'leidenalg', 'pyreadr', diff --git a/src/infercnvpy/io/_genepos.py b/src/infercnvpy/io/_genepos.py index c3907f7..4814de3 100644 --- a/src/infercnvpy/io/_genepos.py +++ b/src/infercnvpy/io/_genepos.py @@ -38,7 +38,9 @@ def genomic_position_from_gtf( inplace If True, add the annotations directly to adata, otherwise return a dataframe. """ - gtf = gtfparse.read_gtf(gtf_file, usecols=["seqname", "feature", "start", "end", "gene_id", "gene_name"]) + gtf = gtfparse.read_gtf( + gtf_file, usecols=["seqname", "feature", "start", "end", "gene_id", "gene_name"] + ).to_pandas() gtf = ( gtf.loc[ gtf["feature"] == "gene",