Skip to content

Commit

Permalink
fix edge case where two types of alterations affected the same length…
Browse files Browse the repository at this point in the history
… of an arm
  • Loading branch information
Liam Flinn Spurr authored and Liam Flinn Spurr committed Jan 25, 2024
1 parent b499f5c commit da88754
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ascets_resources.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ make_arm_call <- function(df, thresh) {
max_alt_type <- df[df$alt_frac == max_alt,]$alt

# assign call based on alteration threshold
if(length(max_alt_type) > 1 & ("DEL" %in% max_alt_type & "AMP" %in% max_alt_type)) { # edge case where two types affect exactly the same fraction of an arm
return(data.frame(sample = as.character(df$sample[1]), ARM = as.character(df$arm[1]), CALL = "NC"))
} else if (length(max_alt_type) > 1) {
max_alt_type <- max_alt_type[max_alt_type != "NEUTRAL"]
}

if(max_alt_type == "NEUTRAL") {
if(max_alt >= thresh) call <- max_alt_type
else call <- "NC"
Expand Down

0 comments on commit da88754

Please sign in to comment.