# Path: scib/utils.py
# def check_adata(adata):
#     if type(adata) is not anndata.AnnData:
#         raise TypeError('Input is not a valid AnnData object')
# 
# def check_batch(batch, obs, verbose=False):
#     if batch not in obs:
#         raise ValueError(f'column {batch} is not in obs')
#     elif verbose:
#         print(f'Object contains {obs[batch].nunique()} batches.')


import numpy as np
import pandas as pd
import scanpy as sc
from scipy import sparse
from sklearn.linear_model import LinearRegression
from ..utils import check_adata, check_batch



def pcr_comparison(
        adata_pre,
        adata_post,
        covariate,

# Path: scib/utils.py
# def check_adata(adata):
#     if type(adata) is not anndata.AnnData:
#         raise TypeError('Input is not a valid AnnData object')
# 
# def check_batch(batch, obs, verbose=False):
#     if batch not in obs:
#         raise ValueError(f'column {batch} is not in obs')
#     elif verbose:
#         print(f'Object contains {obs[batch].nunique()} batches.')


# Path: scib/metrics/pcr.py
import numpy as np
import pandas as pd
import scanpy as sc
from scipy import sparse
from sklearn.linear_model import LinearRegression
from ..utils import check_adata, check_batch




def pcr_comparison(
        adata_pre,
        adata_post,
        covariate,

        embed=None,