smftools.preprocessing.umi_bipartite_analysis#
Bipartite graph analysis for U1×U2 UMI cluster pairing QC.
Functions
|
Build a bipartite U1×U2 count matrix per (sample, reference) group and annotate reads. |
- smftools.preprocessing.umi_bipartite_analysis.analyze_umi_bipartite_graph(adata, umi_cols=('U1', 'U2'), sample_col='Experiment_name_and_barcode', reference_col='Reference_strand', uns_flag='umi_bipartite_analysis_performed', bypass=False, force_redo=False)#
Build a bipartite U1×U2 count matrix per (sample, reference) group and annotate reads.
For each (sample_col, reference_col) group, constructs a count matrix with U1 clusters as rows and U2 clusters as columns. Per-read annotations are added to
adata.obs: :rtype:AnnDataRX_edge_count– number of reads sharing this (U1_cluster, U2_cluster) pairRX_is_dominant_pair– True when this pair is the dominant partner for both its U1 and U2 clusterRX_U1_fidelity– fraction of reads with this U1_cluster that share this U2_clusterRX_U2_fidelity– fraction of reads with this U2_cluster that share this U1_cluster
Parameters#
- adataAnnData
Must contain
U1_clusterandU2_clustercolumns in.obs.- umi_colsSequence[str]
The two UMI column name prefixes (default
("U1", "U2")).- sample_col, reference_colstr
Columns used to define groups.
- uns_flagstr
Key in
adata.unsto mark completion.- bypassbool
Skip processing entirely.
- force_redobool
Rerun even if
uns_flagis already set.
Returns#
- AnnData
Modified in-place with new
.obscolumns andadata.uns["umi_bipartite_stats"].