Skip to content

AttributeError: module 'bionty' has no attribute 'Gene' #26

@zhang0730

Description

@zhang0730

I am running the bench_perturbseq_genie3_transp.ipynb in benGRN tutorial. when I used the "Preprocessor" function,
the error:


File ~/mambaforge/envs/benGRN/lib/python3.10/site-packages/scdataloader/utils.py:387, in load_genes(organisms)
385 organisms = [organisms]
386 for organism in organisms:
--> 387 genesdf = bt.Gene.filter(
388 organism_id=bt.Organism.filter(ontology_id=organism).first().id
...
391 genesdf.ensembl_gene_id.isna(), "stable_id"
392 ]
393 genesdf = genesdf.drop_duplicates(subset="ensembl_gene_id")

AttributeError: module 'bionty' has no attribute 'Gene'


and I found that the internal struture of bionty changed

import bionty as bt
print(dir(bt))
['__builtins__', '__cached__', '__doc__', '__file__', '__getattr__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_check_instance_setup', '_load_bionty_sources', 'base', 'ids']
print(dir(bt.base))
['BFXPipeline', 'BioSample', 'CellLine', 'CellMarker', 'CellType', 'DevelopmentalStage', 'Disease', 'Drug', 'Ethnicity', 'ExperimentalFactor', 'Gene', 'Ontology', 'Organism', 'Pathway', 'Phenotype', 'Protein', 'PublicOntology', 'PublicOntologyField', 'Tissue', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_display_sources', '_ontology', '_public_ontology', '_settings', '_sync_sources', 'dev', 'display_available_sources', 'display_currently_used_sources', 'entities', 'reset_sources', 'settings', 'sync_sources']

and my package version:
scdataloader 2.0.0
bionty 1.0.0
lamindb 1.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions