Skip to content

Commit

Permalink
bug fix: handling of noncoding variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Kdreval committed Jul 3, 2024
1 parent b30e2e9 commit 174793b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions R/prettyOncoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,24 @@ prettyOncoplot = function(maf_df,
colnames(tsb.include) = tsbs[!tsbs %in% colnames(mat_origin)]
rownames(tsb.include) = rownames(mat_origin)
mat_origin = cbind(mat_origin, tsb.include)
}else if(length(include_noncoding) > 0){
print(
"You requested to include noncoding mutations and remove non-mutated patients ..."
)
these_have_noncoding <- maf_df %>%
filter(
Tumor_Sample_Barcode %in% patients,
Hugo_Symbol %in% names(include_noncoding),
Variant_Classification %in% unname(include_noncoding)
) %>%
distinct(
Tumor_Sample_Barcode, Hugo_Symbol, Variant_Classification, Start_Position, End_Position
) %>%
pull(Tumor_Sample_Barcode)
tsb.include = matrix(data = 0, nrow = nrow(mat_origin), ncol = length(these_have_noncoding[!these_have_noncoding %in% colnames(mat_origin)]))
colnames(tsb.include) = these_have_noncoding[!these_have_noncoding %in% colnames(mat_origin)]
rownames(tsb.include) = rownames(mat_origin)
mat_origin = cbind(mat_origin, tsb.include)
}
write.table(mat_origin, file = onco_matrix_path, quote = F, sep = "\t")
}
Expand Down

0 comments on commit 174793b

Please sign in to comment.