Skip to content

Commit

Permalink
Tiny bug fixed: ClinCNV does not crash when baseline is copied from t…
Browse files Browse the repository at this point in the history
…he IGV
  • Loading branch information
AHDemiG1 authored and AHDemiG1 committed Dec 9, 2022
1 parent 721a258 commit 94c271d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clinCNV.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env Rscript
set.seed(100)
options(warn=-1)
clincnvVersion = paste0("ClinCNV version: v1.18.1")
clincnvVersion = paste0("ClinCNV version: v1.18.2")

## CHECK R VERSION
if (!( (as.numeric(version$major) >= 3 & as.numeric(version$minor) > 2.0) | as.numeric(version$major) >= 4) ) {
Expand Down
4 changes: 1 addition & 3 deletions germline/helpersGermline.R
Original file line number Diff line number Diff line change
Expand Up @@ -732,12 +732,10 @@ calculateLocationAndScale <- function(bedFile, coverage, genderOfSamples, autoso
print(chrom)
coveragesToDealWith = coverage[which(bedFile[,1] == chrom),,drop=F]
if (chrom == "chrX") {
if (length(which(genderOfSamples == "F")) > 0.4 * length(which(genderOfSamples == "M"))) {
print("The number of females is too few for accurate PAR estimation, we use males for chrX which leads to wrong PAR calling.")
}
if (length(which(genderOfSamples == "F")) > 0.4 * length(which(genderOfSamples == "M"))) {
whichSamplesUsed = which(genderOfSamples == "F")
} else {
print("The number of females is too few for accurate PAR estimation, we use males for chrX which leads to wrong PAR calling.")
whichSamplesUsed = which(genderOfSamples == "M")
}
} else if (chrom == "chrY") {
Expand Down
2 changes: 1 addition & 1 deletion germline/mCNVhelpers.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ likelihoodOfGaussianMixture <- function(location, value , sd_to_start, robustPer
locationTmp[l] = sum(weights[,l] * value) / cluster_weights[l]
}
multiplierForLocation = locationTmp[which.max(cluster_weights[l])] / location[which.max(cluster_weights[l])]
if (abs(log2(initLocation / (location * multiplierForLocation))) < 0.1) {
if (abs(log2(initLocation / (location * multiplierForLocation)))[1] < 0.1) {
location = location * multiplierForLocation
}
sd_counter_tmp = sqrt(sum(sapply(1:length(location),
Expand Down
2 changes: 1 addition & 1 deletion somatic/helpersSomatic.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ determine_potential_states = function(sampleLogFold, local_cn_states, sampleLogF

find_baseline_level <- function(allowedChromsBafSample, matrixOfLogFoldSample, bedFileForCluster, matrixOfLogFoldOffSample=NULL, bedFileForClusterOff=NULL) {
if (!is.null(opt$guideBaseline)) {
splitted = strsplit(opt$guideBaseline, ":")
splitted = strsplit(gsub(",","",opt$guideBaseline), ":")
chrom = splitted[[1]][1]
splitted = strsplit(splitted[[1]][2], "-")
start = as.numeric(splitted[[1]][1])
Expand Down

0 comments on commit 94c271d

Please sign in to comment.