Skip to contents

This method adds a mutant specification to the mutation engine.

Arguments

mutant_name

The mutant name.

passenger_rates

The list of the passenger rates whose names are the epigenetic states of the species or a single rate, if the mutant does not have an epigenetic state.

drivers

The list of the driver SNVs, indels, CNAs, and the whole genome doubling events (WGD) characterizing the mutant (optional).

Details

The users must use it to specify the name and the genomic characterization (i.e., SNVs, indels, CNAs, and whole genome doubling events (WGD)) of all the simulated mutants together with the mutation rates of its species. The driver mutations are applied to the mutant progenitor's genome respecting the specification order.

Examples

# create a demostrative mutation engine
m_engine <- MutationEngine(setup_code = "demo")
#> 
 [█---------------------------------------] 0% [00m:00s] Loading context index                                    

 [████████████████████████████████████████] 100% [00m:00s] Context index loaded                                   

#> 
 [█---------------------------------------] 0% [00m:00s] Loading RS index                                         

 [█████████████---------------------------] 31% [00m:01s] Loading RS index                                        

 [████████████████████████████------------] 68% [00m:02s] Loading RS index                                        

 [████████████████████████████████████████] 100% [00m:02s] RS index loaded                                        

#> 
 [█---------------------------------------] 0% [00m:00s] Loading germline                                         

 [████████████████████████████████████████] 100% [00m:00s] Germline loaded                                        


# add the mutant "A" characterized by one driver SNV on chromosome 22, an
# indel on the same chromosome, a whole genome doubling event, and finally
# two CNAs: an amplification and a deletion. The mutant has two epigenetic
# states and its species "A+" and "A-" have passenger SNV rates 1e-9 and
# 3e-8, respectively, and passenger CNA rates 0 and 1e-11, respectively.
m_engine$add_mutant("A", list("+" = c(SNV = 1e-9, indel = 1e-10),
                              "-" = c(SNV = 3e-8, CNA = 1e-11)),
                    drivers = list(SNV("22", 23657587, "C"),
                                   Mutation("22", 15220157, "GTTTTTTTT",
                                            "G"),
                                   WGD,
                                   CNA(type = "A", chr = "22",
                                       chr_pos = 10303470,
                                       len = 200000),
                                   CNA("D", "22", 5010000, 200000)))
#> 
 [█---------------------------------------] 0% [00m:00s] Retrieving "A" SNVs                                      

 [█---------------------------------------] 0% [00m:00s] Found 22                                                 

 [█---------------------------------------] 0% [00m:00s] Reading 22                                               

 [█---------------------------------------] 0% [00m:01s] Reading 22                                               

 [████████████████████████████████████████] 100% [00m:01s] "A" SNVs retrieved                                     


m_engine
#> MutationEngine
#>  Passenger rates
#>    "A+": {SNV: 1e-09, indel: 1e-10}
#>    "A-": {SNV: 3e-08, CNA: 1e-11}
#> 
#>  Driver mutations
#>    "A":
#>        chr22(23657587)[G>C](allele: random)
#>        chr22(15220157)[GTTTTTTTT>G](allele: random)
#>        Whole genome duplication
#>        CNA("A",chr22(10303470), len: 200000)
#>        CNA("D",chr22(5010000), len: 200000)
#> 
#>  Timed Exposure
#>    SBS Timed Exposures
#> 
#>    indel Timed Exposures
#>