Skip to contents

This function calculates the clonal distribution per a set of intervals in all the samples within the dataset.

The column titled "Distribution" calculates the proportion of each interval in the whole repertoire, whereas the one titled "Cumulative frequency" shows the cumulative frequency of the sequences within each interval.

This could allow a global view of the repertoire fraction contributing the most to the repertoire. For instance, top sequences belonging to the highest interval often constitute a low fraction of the whole repertoire but contribute more significantly in terms of cumulative frequency in view of their high occurrence.

Usage

Intervals(
  x,
  level = c("aaClone", "ntClone", "ntCDR3", "aaCDR3"),
  interval_scale = c("count", "frequency")
)

Arguments

x

an object of class RepSeqExperiment

level

a character specifying the level of the repertoire to be taken into account when calculating the clonal distribution. Should be one of "aaClone","ntClone", "ntCDR3" or "aaCDR3".

interval_scale

whether intervals should be determined in count or frequency

Examples


data(RepSeqData)

Intervals(x = RepSeqData, level="aaCDR3",  interval_scale="count")
#> Key: <interval, sample_id>
#>          interval      sample_id cumulative_frequency distribution
#>            <char>         <char>                <num>        <num>
#>  1:             1  tripod-30-813          0.032142515 2.816291e-01
#>  2:             1  tripod-30-815          0.026025773 2.165462e-01
#>  3:             1  tripod-31-846          0.012486036 1.901232e-01
#>  4:             1  tripod-31-848          0.025593745 2.195010e-01
#>  5:             1  tripod-35-970          0.004007402 1.215035e-01
#>  6:             1  tripod-35-972          0.009549873 1.348806e-01
#>  7:             1 tripod-36-1003          0.002785737 9.942236e-02
#>  8:             1 tripod-36-1005          0.001627905 8.973861e-02
#>  9:       ]1, 10]  tripod-30-813          0.262880688 5.532576e-01
#> 10:       ]1, 10]  tripod-30-815          0.331110991 6.157322e-01
#> 11:       ]1, 10]  tripod-31-846          0.169449311 5.458566e-01
#> 12:       ]1, 10]  tripod-31-848          0.315700372 6.036205e-01
#> 13:       ]1, 10]  tripod-35-970          0.067115410 3.441734e-01
#> 14:       ]1, 10]  tripod-35-972          0.195239389 5.546083e-01
#> 15:       ]1, 10] tripod-36-1003          0.027484292 1.843059e-01
#> 16:       ]1, 10] tripod-36-1005          0.015337740 1.673793e-01
#> 17:     ]10, 100]  tripod-30-813          0.464136987 1.550219e-01
#> 18:     ]10, 100]  tripod-30-815          0.476022205 1.603783e-01
#> 19:     ]10, 100]  tripod-31-846          0.439794682 2.403130e-01
#> 20:     ]10, 100]  tripod-31-848          0.485571430 1.690793e-01
#> 21:     ]10, 100]  tripod-35-970          0.457990320 4.824405e-01
#> 22:     ]10, 100]  tripod-35-972          0.541043597 2.932530e-01
#> 23:     ]10, 100] tripod-36-1003          0.671988051 6.590954e-01
#> 24:     ]10, 100] tripod-36-1005          0.436849708 6.252551e-01
#> 25:   ]100, 1000]  tripod-30-813          0.227342490 1.002336e-02
#> 26:   ]100, 1000]  tripod-30-815          0.160403782 7.299799e-03
#> 27:   ]100, 1000]  tripod-31-846          0.331085737 2.320584e-02
#> 28:   ]100, 1000]  tripod-31-848          0.165559014 7.741676e-03
#> 29:   ]100, 1000]  tripod-35-970          0.374017035 5.019330e-02
#> 30:   ]100, 1000]  tripod-35-972          0.242928712 1.715391e-02
#> 31:   ]100, 1000] tripod-36-1003          0.289180340 5.698061e-02
#> 32:   ]100, 1000] tripod-36-1005          0.467035141 1.151977e-01
#> 33: ]1000, 10000]  tripod-30-813          0.013497320 6.803184e-05
#> 34: ]1000, 10000]  tripod-30-815          0.006437249 4.345118e-05
#> 35: ]1000, 10000]  tripod-31-846          0.047184233 5.013608e-04
#> 36: ]1000, 10000]  tripod-31-848          0.007575440 5.755893e-05
#> 37: ]1000, 10000]  tripod-35-970          0.096869833 1.689354e-03
#> 38: ]1000, 10000]  tripod-35-972          0.011238429 1.041434e-04
#> 39: ]1000, 10000] tripod-36-1003          0.008561580 1.958097e-04
#> 40: ]1000, 10000] tripod-36-1005          0.079149506 2.429307e-03
#>          interval      sample_id cumulative_frequency distribution