Expand secondary gene assignments in a specific category of genes into their underlying genes.
Arguments
- model
A padloc model.
- gene_type
The category of genes to expand, i.e. one of: "core_genes", "secondary_genes", or "prohibited_genes".
- hmm_meta
A padloc-db HMM metadata table.
Value
A base::character() vector containing the expanded gene values.
Examples
# Read data -----------------------------------------------------------------
path <- padlocdev_example("padloc-db/sys/DRT_class_I.yaml")
model <- read_padloc_model(path)
model
#> $force_strand
#> [1] FALSE
#>
#> $maximum_separation
#> [1] 0
#>
#> $minimum_core
#> [1] 2
#>
#> $minimum_total
#> [1] 2
#>
#> $core_genes
#> [1] "Drt_class_I"
#>
#> $secondary_genes
#> [1] "NA"
#>
#> $neutral_genes
#> [1] "NA"
#>
#> $prohibited_genes
#> [1] "Drt_class_II" "Drt_class_III"
#>
path <- padlocdev_example("padloc-db/hmm_meta.txt") # Generate path for example model
hmm_meta <- read_hmm_meta(path)
hmm_meta
#> # A tibble: 43 × 15
#> hmm.acc hmm.name hmm.description protein.name secondary.name author
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 PDLC00150 HamA1_00001 DUF1837 domain HamA1|HamA NA Payne LJ
#> 2 PDLC00151 HamA1_00002 DUF1837 domain HamA1|HamA NA Payne LJ
#> 3 PDLC00174 HamB1_00001 DEAD-box helicase HamB1|HamB NA Payne LJ
#> 4 PDLC00175 HamB1_00002 DEAD-box helicase HamB1|HamB NA Payne LJ
#> 5 PDLC00195 HamA2_00001 DUF1837 domain HamA2|HamA NA Payne LJ
#> 6 PDLC00196 HamA2_00002 DUF1837 domain HamA2|HamA NA Payne LJ
#> 7 PDLC00199 HamB2_00001 DEAD-box helicase HamB2|HamB NA Payne LJ
#> 8 PDLC00200 HamB2_00002 DEAD-box helicase HamB2|HamB NA Payne LJ
#> 9 PDLC00202 HamC2_00001 DUF3223 domain HamC2|HamC NA Payne LJ
#> 10 PDLC00203 HamC2_00002 DUF3223 domain HamC2|HamC NA Payne LJ
#> # ℹ 33 more rows
#> # ℹ 9 more variables: number.seq <dbl>, length.hmm <dbl>,
#> # e.value.threshold <dbl>, hmm.coverage.threshold <dbl>,
#> # target.coverage.threshold <dbl>, system <chr>, literature.ref <chr>,
#> # database.ref <chr>, comments <chr>
# Expand genes --------------------------------------------------------------
# The category "secondary_genes" only contains the gene group "Sya_accessory"
model$secondary_genes
#> [1] "NA"
# After expanding, "Sya_accessory" becomes "SyaB" and "SyaC"
model$secondary_genes <- expand_gene_groups(model, "secondary_genes", hmm_meta)
model$secondary_genes
#> [1] "NA"