Skip to contents

Creates a .txt file from mutation data that can be used for mutational signatures analysis using the SigProfiler Assignment web application. Currently only supports SBS analysis i.e. snvs.

Usage

write_mutation_calling_file(
  mutation_data,
  project_name = "Example",
  project_genome = "GRCm38",
  output_path = NULL
)

Arguments

mutation_data

The object containing the mutation data. The output of import_mut_data() or import_vcf_data().

project_name

The name of the project. Default is "Example".

project_genome

The reference genome to use. (e.g., Human: GRCh38, Mouse mm10: GRCm38)

output_path

The path to save the output file. If NULL, files will be saved in the current working directory. Default is NULL.

Value

a .txt file that can be uploaded to the SigProfiler Assignment web application (https://cancer.sanger.ac.uk/signatures/assignment/) as a "Mutational calling file".

Details

Mutations will be be filtered for SNVs. Mutations flagged in filter_mut will be excluded from the output.

Examples

example_file <- system.file("extdata", "Example_files",
                            "example_mutation_data_filtered.rds",
                            package = "MutSeqR")
example_data <- readRDS(example_file)
temp_output <- tempdir()
write_mutation_calling_file(mutation_data = example_data,
                            project_name = "Example",
                            project_genome = "GRCm38",
                            output_path = temp_output)
list.files(temp_output)
#>  [1] "bslib-2ce9eb5d8d7866b4f2d82a9ef19eb08f"                                                             
#>  [2] "downlit"                                                                                            
#>  [3] "downloaded_packages"                                                                                
#>  [4] "file340d1842e06a"                                                                                   
#>  [5] "file340d25a93e76"                                                                                   
#>  [6] "file340d5cd46615"                                                                                   
#>  [7] "file340d9ca38ff"                                                                                    
#>  [8] "file340da33eb51"                                                                                    
#>  [9] "libloc_177_9a667201821007d.rds"                                                                     
#> [10] "libloc_182_ba3851d8a9100920.rds"                                                                    
#> [11] "libloc_182_d3198563f59e5c50.rds"                                                                    
#> [12] "mutation_calling_file.txt"                                                                          
#> [13] "repos_https%3A%2F%2Fbioconductor.org%2Fpackages%2F3.21%2Fbioc%2Fsrc%2Fcontrib.rds"                  
#> [14] "repos_https%3A%2F%2Fbioconductor.org%2Fpackages%2F3.21%2Fbooks%2Fsrc%2Fcontrib.rds"                 
#> [15] "repos_https%3A%2F%2Fbioconductor.org%2Fpackages%2F3.21%2Fdata%2Fannotation%2Fsrc%2Fcontrib.rds"     
#> [16] "repos_https%3A%2F%2Fbioconductor.org%2Fpackages%2F3.21%2Fdata%2Fexperiment%2Fsrc%2Fcontrib.rds"     
#> [17] "repos_https%3A%2F%2Fbioconductor.org%2Fpackages%2F3.21%2Fworkflows%2Fsrc%2Fcontrib.rds"             
#> [18] "repos_https%3A%2F%2Fcran.rstudio.com%2Fsrc%2Fcontrib.rds"                                           
#> [19] "repos_https%3A%2F%2Fpackagemanager.posit.co%2Fcran%2F__linux__%2Fnoble%2Flatest%2Fsrc%2Fcontrib.rds"
# The file is saved in the temporary directory
# To view the file, use the following code:
## output_file <- file.path(temp_output, "mutation_calling_file.txt")
## file.show(output_file