Summarize alleles per locus from an allele table
Source:R/allele_per_locus_summary.R
allele_per_locus_summary.RdFor each target_name, computes total allele count, unique allele count,
and the number of alleles that appear only once (singlets).
Value
A tibble with columns target_name, total_allele_count,
unique_allele_count, and allele_singlets.
Details
Inputs
allele_table: Allele table (specimen_name,target_name,seq). Seevignette("input-formats", package = "PGEcore").
Outputs
output(optional): TSV with columnstarget_name,total_allele_count,unique_allele_count, andallele_singlets. Defaults to"allele_summary_by_target.tsv". IfNULL, results are returned without writing a file.
Running
allele_per_locus_summary(
allele_table = "allele_table.tsv",
output = "allele_summary_by_target.tsv"
)Examples
allele_path <- system.file(
"extdata", "example_allele_table.tsv",
package = "PGEcore"
)
allele_per_locus_summary(allele_path, output = NULL)
#> [1] "Reading input data"
#> [1] "Validating input format"
#> [1] "Confronting input data with validation rules"
#> [1] "Returning Locus data"
#> # A tibble: 5 × 4
#> target_name total_allele_count unique_allele_count allele_singlets
#> <chr> <int> <int> <int>
#> 1 Pf3D7_01_v3-145388-145… 11 3 0
#> 2 Pf3D7_01_v3-162867-163… 12 3 0
#> 3 Pf3D7_01_v3-181512-181… 11 3 0
#> 4 Pf3D7_01_v3-194742-194… 10 3 0
#> 5 Pf3D7_01_v3-455794-456… 6 2 1