Skip to content
Snippets Groups Projects
Commit 4c95ce49 authored by Sascha Meiers's avatar Sascha Meiers
Browse files

Added check of input data

parent 63fb96e2
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,26 @@ library(data.table)
library(assertthat)
source("utils/mosaiClassifier/mosaiClassifier.R")
# delete: probs = readRDS("sv_probabilities/simulation1-50000/50000_fixed.medium/probabilities.Rdata")
#' Derives SV type with highest probability according in each cell and segment.
#' Output is a table with columns "sv_call_name" and "llr_to_ref"
#'
#' @author Sascha Meiers
#' @export
#'
makeSVCallSimple <- function(probs, llr_thr = 1) {
assert_that(is.data.table(probs),
"sample" %in% colnames(probs),
"cell" %in% colnames(probs),
"chrom" %in% colnames(probs),
"start" %in% colnames(probs),
"end" %in% colnames(probs),
"haplo_name" %in% colnames(probs),
"haplotype" %in% colnames(probs),
"nb_hap_ll" %in% colnames(probs))
assert_that(!("nb_hap_pp" %in% colnames(probs)))
# Do post-processing incl. priors + normalization + regularization
probs = mosaiClassifierPostProcessing(probs)
setkey(probs, chrom, start, end, sample, cell)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment