phbradley / conga

Clonotype Neighbor Graph Analysis
MIT License
80 stars 18 forks source link

conga.plotting.make_graph_vs_graph_logos() do not have output #21

Closed xiachenrui closed 2 years ago

xiachenrui commented 2 years ago

Hi, I meet a probelm When I run conga.plotting.make_graph_vs_graph_logos() in my BCR dataset I find it run success but without any picture or text output

conga.plotting.make_graph_vs_graph_logos(
    adata,
    outfile_prefix,
    min_cluster_size,
    nbrs_gex,
    nbrs_tcr,
    gex_header_genes = ['clone_sizes','CD79A','MS4A1','CD3D','IGKC','JCHAIN'],
    gex_header_tcr_score_names = ['imhc', 'cdr3len', 'cd8', 'nndists_tcr'],
    logo_genes = ['CD79A','MS4A1','CD3D','IGKC','JCHAIN'],
    gene_logo_width = 6,
)

adata

AnnData object with n_obs × n_vars = 804 × 1942
    obs: 'va', 'ja', 'cdr3a', 'cdr3a_nucseq', 'vb', 'jb', 'cdr3b', 'cdr3b_nucseq', 'n_genes', 'percent_mito', 'n_counts', 'clone_sizes', 'gex_variation', 'louvain_gex', 'clusters_gex', 'louvain_tcr', 'clusters_tcr', 'nndists_gex', 'nndists_tcr', 'is_invariant', 'conga_scores', 'conga_fdr_values'
    var: 'gene_ids', 'n_cells', 'highly_variable', 'means', 'dispersions', 'dispersions_norm', 'mean', 'std'
    uns: 'conga_results', 'conga_stats', 'organism', 'log1p', 'hvg', 'raw_matrix_is_logged', 'pca', 'neighbors', 'umap', 'louvain', 'clusters_tcr_names'
    obsm: 'X_pca_tcr', 'X_pca_gex', 'X_umap_gex', 'X_gex_1d', 'X_gex_2d', 'X_umap_tcr', 'X_tcr_1d', 'X_tcr_2d'
    varm: 'PCs'
    layers: 'scaled'
    obsp: 'distances', 'connectivities'

adata.uns['conga_stats']

OrderedDict([('num_cells_w_gex', 1067),
             ('num_features_start', 20545),
             ('num_cells_w_tcr', 906),
             ('min_genes_per_cell', 500),
             ('max_genes_per_cell', 4000),
             ('max_percent_mito', 0.15),
             ('num_filt_max_genes_per_cell', 0),
             ('num_filt_max_percent_mito', 0),
             ('num_TR_genes', 115),
             ('num_TR_genes_in_hvg_set', 105),
             ('num_highly_variable_genes', 1942),
             ('num_cells_after_filtering', 906),
             ('num_clonotypes', 804),
             ('max_clonotype_size', 24),
             ('num_singleton_clonotypes', 778),
             ('num_gvg_hit_clonotypes', 2),
             ('num_gvg_hit_biclusters', 0)])

Thanks a lot ! Xia

phbradley commented 2 years ago

Hi Xia, Thanks for trying conga! And thanks for including all the stats. It looks to me like there just weren't any graph-vs-graph clusters detected. In the conga_stats dictionary, 'num_gvg_hit_clonotypes' = 2, and 'num_gvg_hit_biclusters' =0; the latter is the number of clusters that would have a logo. So if there are no clusters, then it doesn't make a plot, I'm afraid. The BCR analysis is still relatively new so it may be that there are changes we could make to improve sensitivity. We are starting a new project to look more into that. Did the other analysis modes turn up anything? graph-vs-features, t/bcr clumping, hotspot analysis? If you run from the command line you can use the '--all' flag to get it to run everything and then look at _results_summary.html... Take care, Phil