Skip to content

Commit

Permalink
Modifying SuperRecall threshold if additional (stringent) iterations …
Browse files Browse the repository at this point in the history
…are needed
  • Loading branch information
GermanDemidov committed Feb 28, 2020
1 parent 73e796b commit 0fed81a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions germline/germlineSolver.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ if (!is.null(polymorphicRegions)) {
}
}
}
superRecallThreshold = opt$superRecall

print(paste("Calling started", Sys.time()))
for (sam_no in 1:ncol(coverage.normalised)) {
Expand Down Expand Up @@ -240,15 +241,15 @@ for (sam_no in 1:ncol(coverage.normalised)) {
armFinalized = T
}
found_CNVs_recall = NULL
if (opt$superRecall < opt$scoreG) {
if (superRecallThreshold < opt$scoreG) {
if (nrow(found_CNVs) > 0) {
for (z in 1:nrow(found_CNVs)) {
startOfCNV = found_CNVs[z,2]
endOfCNV = found_CNVs[z,3]
toyMatrixOfLikeliks[max(1, startOfCNV - 1):min(endOfCNV + 1, nrow(toyMatrixOfLikeliks)),] = 0
}
}
found_CNVs_recall <- as.matrix(find_all_CNVs(0, opt$superRecall, 0, initial_state, toyMatrixOfLikeliks, initial_state))
found_CNVs_recall <- as.matrix(find_all_CNVs(0, superRecallThreshold, 0, initial_state, toyMatrixOfLikeliks, initial_state))
}
if (!is.null(found_CNVs_recall)) {
found_CNVs = rbind(found_CNVs, found_CNVs_recall)
Expand Down Expand Up @@ -406,6 +407,7 @@ for (sam_no in 1:ncol(coverage.normalised)) {
} else {
if (iterations < maxIteration) {
print("Sample had too many CNVs. We re-analyse it with stricter thresholds")
superRecallThreshold = superRecallThreshold + opt$superRecall
threshold = threshold + 20
minimum_length_of_CNV = minimum_length_of_CNV + 1
unlink(paste0(folder_name, sample_name), recursive = T)
Expand Down

0 comments on commit 0fed81a

Please sign in to comment.