Skip to content

Tracing UMI trajectory

We recorded the information about UMI identities as soon as there is a merging operation. We can visualise them using methods alone or in bulk.

One method alone

read the statistics

Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from umiche.deduplicate.io.Stat import Stat as dedupstat
scenarios = {
    'pcr_nums': 'PCR cycle',
    # 'pcr_errs': 'PCR error',
    # 'seq_errs': 'Sequencing error',
    # 'ampl_rates': 'Amplification rate',
    # 'umi_lens': 'UMI length',
    # 'seq_deps': 'Sequencing depth',
}
methods = {
    # 'unique': 'Unique',
    # 'cluster': 'Cluster',
    # 'adjacency': 'Adjacency',
    'directional': 'Directional',
    # 'dbscan_seq_onehot': 'DBSCAN',
    # 'birch_seq_onehot': 'Birch',
    # 'aprop_seq_onehot': 'Affinity Propagation',
    # 'mcl': 'MCL',
    # 'mcl_val': 'MCL-val',
    # 'mcl_ed': 'MCL-ed',
}
dedupstat11 = dedupstat(
    scenarios=scenarios,
    methods=methods,
    param_fpn=to('data/params.yml'),
)

draw the plot

Python

1
2
3
4
5
6
import umiche as uc

uc.plot.trace_single(
    df_apv=dedupstat11.df_trace_cnt['apv'],
    df_disapv=dedupstat11.df_trace_cnt['disapv'],
).line_apv_disapv()

Image title
Fig 1. Counts of merged or not merged UMIs derived from the same or different origin using the Directional method.

Multiple methods and panels

read the statistics

Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from umiche.deduplicate.io.Stat import Stat as dedupstat
scenarios = {
    'pcr_nums': 'PCR cycle',
    # 'pcr_errs': 'PCR error',
    # 'seq_errs': 'Sequencing error',
    # 'ampl_rates': 'Amplification rate',
    # 'umi_lens': 'UMI length',
    # 'seq_deps': 'Sequencing depth',
}
methods = {
    'unique': 'Unique',
    'cluster': 'Cluster',
    'adjacency': 'Adjacency',
    'directional': 'Directional',
    'dbscan_seq_onehot': 'DBSCAN',
    'birch_seq_onehot': 'Birch',
    'aprop_seq_onehot': 'Affinity Propagation',
    'mcl': 'MCL',
    'mcl_val': 'MCL-val',
    'mcl_ed': 'MCL-ed',
}
dedupstat22 = dedupstat(
    scenarios=scenarios,
    methods=methods,
    param_fpn=to('data/params.yml'),
)

draw the plot

Python

1
2
3
4
5
6
7
8
import umiche as uc

uc.plot.trace_multiple(
    df_apv=dedupstat22.df_trace_cnt['apv'],
    df_disapv=dedupstat22.df_trace_cnt['disapv'],
    scenarios=scenarios,
    methods=methods,
).line_apv()

Image title
Fig 1. Counts of UMIs derived from the same origin to be merged across multiple PCR cycles with different UMI collapsing methods.