Count specimens by complexity of infection (COI)
Source:R/count_samples_by_coi.R
count_samples_by_coi.RdReads per-specimen COI values, rounds them to integers, and returns the count and proportion of specimens at each COI level.
Details
Inputs
coi_table: COI table (specimen_name,coi), as a file path or data frame. Seevignette("input-formats", package = "PGEcore").
Outputs
output(optional): TSV with columnscoi,n, andproportion. IfNULL, results are returned without writing a file.
Running
count_samples_by_coi(
coi_table = "coi_table.tsv",
output = "coi_distribution.tsv"
)Examples
coi_path <- system.file("extdata", "example_coi_table.tsv", package = "PGEcore")
count_samples_by_coi(coi_path)
#> # A tibble: 3 × 3
#> coi n proportion
#> <dbl> <int> <dbl>
#> 1 1 0 0
#> 2 2 1 0.2
#> 3 3 4 0.8