Skip to content

Commit da88754

Browse files
Liam Flinn SpurrLiam Flinn Spurr
authored andcommitted
fix edge case where two types of alterations affected the same length of an arm
1 parent b499f5c commit da88754

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ascets_resources.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ make_arm_call <- function(df, thresh) {
8585
max_alt_type <- df[df$alt_frac == max_alt,]$alt
8686

8787
# assign call based on alteration threshold
88+
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
89+
return(data.frame(sample = as.character(df$sample[1]), ARM = as.character(df$arm[1]), CALL = "NC"))
90+
} else if (length(max_alt_type) > 1) {
91+
max_alt_type <- max_alt_type[max_alt_type != "NEUTRAL"]
92+
}
93+
8894
if(max_alt_type == "NEUTRAL") {
8995
if(max_alt >= thresh) call <- max_alt_type
9096
else call <- "NC"

0 commit comments

Comments
 (0)