pinellolab / STREAM

STREAM: Single-cell Trajectories Reconstruction, Exploration And Mapping of single-cell data
http://stream.pinellolab.org
GNU Affero General Public License v3.0
173 stars 46 forks source link

Add new data matrix to AnnData and visualize it with stream plot #52

Open liaojinyue opened 4 years ago

liaojinyue commented 4 years ago

Hi, Thank you for providing this nice tool! I'm using STREAM for my scATAC-Seq analysis and it works quite well using the k-mer mode. I've also calculated the gene activity score using Cicero. Can you please suggest how I can visualize this additional data matrix using stream plot?

Thanks, Jason

huidongchen commented 4 years ago

I think you can try something like:

adata.obsm['cicero_genescores'] = cells_by_genes
adata_tmp = ad.AnnData(pd.DataFrame(adata.obsm['cicero_genescores'],columns=your_genes,index=adata.obs_names))
adata_raw_backup = adata.raw
adata.raw = adata_tmp

It should work if you run the above code snippet before st.stream_plot_gene although i haven't really tested it myself yet.