Skip to content

Add umap into cisTopic object? #86

Answered by SeppeDeWinter
zhangqc723 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zhangqc723

I migrated your question to the discussions tab.

You can add these as a pandas DataFrame to the projections attribute of the cistopic object.

For example,

import numpy as np
import pandas as pd
your_umap = pd.DataFrame(
    np.zeros((len(cistopic_obj.cell_names), 2)),
    columns = ["UMAP_1", "UMAP_2"], index = cistopic_obj.cell_names)
cistopic_obj.projections["cell"]["your_umap"] = your_umap #it's important to use the "cell" key here, cistopic object can also store dimensionality reductions for regions.

Best,

Seppe

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@zhangqc723
Comment options

@SeppeDeWinter
Comment options

Answer selected by SeppeDeWinter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #85 on August 18, 2023 06:11.