Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDR: libratio fitting bias #2

Closed
Rongtingting opened this issue Jan 6, 2023 · 3 comments
Closed

RDR: libratio fitting bias #2

Rongtingting opened this issue Jan 6, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@Rongtingting
Copy link
Collaborator

Rongtingting commented Jan 6, 2023

Bad libraty ratio fitting raise Nan emm_prob_log

GX109_5400 dataset
xconfig = xclone.XCloneConfig(dataset_name = dataset_name, module = "RDR")
xconfig.set_figure_params(xclone= True, fontsize = 18)
xconfig.outdir = out_dir
xconfig.cell_anno_key = "cell_type"
xconfig.ref_celltype = "unclassified"
xconfig.smart_transform = False
xconfig.top_n_marker = 15
xconfig.marker_group_anno_key = "cell_type"
xconfig.xclone_plot= True
xconfig.plot_cell_anno_key = "cell_type"

xconfig.exclude_XY = True
# xconfig.remove_guide_XY = True
# xconfig.guide_qt_lst = [1e-04, 0.96, 0.9999]

xconfig.display()

RDR_Xdata = xclone.model.run_RDR(RDR_adata,
            config_file = xconfig)

raise an error in CNV_optimazation step because of emm_prob_log with np.nan value, which is related to params in NB prob calculation.
In cell CTACGTCTCGGAAACG-1, library_ratio is extremely low (library_alpha is inf), which causes the badly expected layer generated in extra_preprocess
image

@Rongtingting Rongtingting added the enhancement New feature or request label Jan 6, 2023
@Rongtingting
Copy link
Collaborator Author

Rongtingting commented Jan 6, 2023

Solve the issue by checking the used depth_key (library_ratio_capped by default) before generating the expected layer.

commit

@Rongtingting
Copy link
Collaborator Author

TODO:

  1. use more strict library ratio capping strategy, need to be tested on all datasets.
  2. improve llibrary ratio GLM fitting by adding init params, e.g., counts ratio and specific fixed dispersion.
    add start params
    _RDR_libratio.py
    fit_lib_ratio

@Rongtingting
Copy link
Collaborator Author

set total counts ratio as the default library size ratio is recommended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant