Skip to content

Commit

Permalink
Merge pull request #249 from sigven/mutsig_patch
Browse files Browse the repository at this point in the history
fix bug for fits with > 25 sigs
  • Loading branch information
sigven authored Aug 5, 2024
2 parents 2e223ac + 99babe2 commit c3eca60
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pcgrr/R/mutational_signatures.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ generate_report_data_signatures <-
sample_names = settings$sample_id,
type = "all",
genome = ref_data$assembly$bsg,
predefined_dbs_mbs = T)
)
predefined_dbs_mbs = T))
)
if(class(grl)[1] == "CompressedGRangesList"){

Expand Down Expand Up @@ -326,7 +325,8 @@ generate_report_data_signatures <-
gof <- list()
gof[['ci_lower']] <- ci_data_gof$conf.int[1]
gof[['ci_upper']] <- ci_data_gof$conf.int[2]
gof[['estimate']] <- mean(bootstrap_data[['goodness_of_fit']]$cosine_sim)
gof[['estimate']] <-
mean(bootstrap_data[['goodness_of_fit']]$cosine_sim)

contributions_per_signature <-
sig_prop_data |>
Expand Down Expand Up @@ -371,7 +371,7 @@ generate_report_data_signatures <-
dplyr::arrange(
dplyr::desc(.data$prop_group)) |>
dplyr::mutate(group = dplyr::if_else(
.data$prop_group > 0.05,
.data$prop_group > 0.03,
.data$group,
"Other")) |>
dplyr::group_by(.data$group) |>
Expand Down Expand Up @@ -419,11 +419,11 @@ generate_report_data_signatures <-
contributions_per_group <- as.data.frame(
contributions_per_group |>
tidyr::separate_rows(
.data$signature_id_group, sep = ", ") |>
"signature_id_group", sep = ", ") |>
dplyr::anti_join(missing_signatures,
by = c("signature_id_group" = "signature_id")) |>
dplyr::group_by(
c("group","prop_group")
group, prop_group
) |>
dplyr::summarise(
signature_id_group = paste(
Expand Down

0 comments on commit c3eca60

Please sign in to comment.