Skip to content

Commit

Permalink
Update gtfparse version requirement (#118)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Gregor Sturm <[email protected]>
  • Loading branch information
3 people authored Dec 28, 2023
1 parent 7badb5c commit 527284c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 3 additions & 1 deletion src/infercnvpy/io/_genepos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 527284c

Please sign in to comment.