# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/05_data.ipynb.

# %% auto 0
__all__ = ['GeneInfo']

# %% ../nbs/05_data.ipynb 4
import pandas as pd

# %% ../nbs/05_data.ipynb 5
from .ensc import EnsemblClient

# %% ../nbs/05_data.ipynb 7
class GeneInfo:
    ensc = EnsemblClient()
    
    @classmethod
    def lookup(cls, *genes: str, reterrs: bool = False, species: str = 'human', **kwargs):
        info = []
        errs = []
        for gene in genes:
            data = cls.ensc.lookup(gene, species)
            errs.append(gene) if data is None else info.append(data)
        df = pd.DataFrame(info)
        return (df, errs) if reterrs else df
    
    @classmethod
    def __call__(cls, *genes: str, reterrs: bool = False, species: str = 'human', **kwargs):
        return cls.lookup(*genes, reterrs=reterrs, species=species, **kwargs)
