SigMA icon indicating copy to clipboard operation
SigMA copied to clipboard

Error when running quick_simulation

Open EmMaKaa opened this issue 3 years ago • 3 comments

Hi,

I'd like to run SigMA on a novel gene panel, have I understood correctly that it can be done by following the example in test_determine_cutoff.R and in the Wiki page Optimization? I have tried to do that, but when running quick_simulation, I get the following error:

Error in $<-.data.frame(*tmp*, "pass", value = logical(0)) : replacement has 0 rows, data has 1

Here's how I have done it:

data_dir <- 'directory to the folder containing the vcf file'

genomes_matrix <- make_matrix(data_dir, file_type = 'vcf', ref_genome_name = 'hg38') genomes <- conv_snv_matrix_to_df(genomes_matrix) genome_file = 'output directory'

write.table(genomes, genome_file, sep = ',', row.names = F, col.names = T , quote = F)

tumor_type <- 'ovary' remove_msi_pole <- T

data_val <- find_data_setting(genome_file, tumor_type,
remove_msi_pole = remove_msi_pole) data_val ##[1] "seqcap_probe"

simul_file <- quick_simulation(input_file = genome_file, tumor_type = tumor_type, data = data_val, remove_msi_pole = remove_msi_pole, catalog_name = 'cosmic_v3p2')

I haven't been able to solve this issue, am I missing something important here? Also, could you explain the difference between catalog_name options?

EmMaKaa avatar Oct 20 '22 10:10 EmMaKaa

Is there any chance run_SigMA was set to F in the quick_simulation function? It is not shown above, and by default, it should be T, but that would explain the error you get. I made some updates adding new error messages that might help resolve the issue. Would you mind rerunning and sending the error message? I also updated the test_determine_cutoff.R.

You can also try test_tune_example.R which should provide a better performance than using an existing classifier and just adjusting the cutoff. In test_tune_example.R you are generating a new classifier suitable for your data.

For obtaining the data frame that contains catalog signatures you can do: get_catalog('cosmic_v3p2') I also added further information on the wiki.

dgulhan-bio avatar Nov 13 '22 22:11 dgulhan-bio

I forgot to mention to please check out the dev branch.

dgulhan-bio avatar Nov 13 '22 22:11 dgulhan-bio

I was able to solve this, the problem was that I was testing the method only with one test sample, which obviously didn't work (tip for other newbies here...). I will now try retuning as you recommend, thank you for the additions in the wiki, I found them really helpful.

EmMaKaa avatar Nov 21 '22 06:11 EmMaKaa