Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in returnAllowedChromsBaf -> returnBAlleleFreqs #48

Open
sunyihong opened this issue May 14, 2024 · 8 comments
Open

Error in returnAllowedChromsBaf -> returnBAlleleFreqs #48

sunyihong opened this issue May 14, 2024 · 8 comments
Assignees

Comments

@sunyihong
Copy link

Hello, when I run somatic CNV, I got this error:

[1] "We are reading BAF files. It may take time - especially if you have a lot of SNV positions. 2024-05-14 10:40:39"
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.4007 0.4545 0.4841 0.4856 0.5141 0.5988
Error in if (!is.na(potentiallyHeterozygous)) { :
the condition has length > 1
Calls: returnAllowedChromsBaf -> returnBAlleleFreqs
Execution halted

any suggestions? thank you

@sunyihong sunyihong reopened this May 14, 2024
@GermanDemidov GermanDemidov self-assigned this May 14, 2024
@GermanDemidov
Copy link
Collaborator

Hi, could you put a piece of code

print(potentiallyHeterozygous)

at the line 119 in this file

https://github.com/imgag/ClinCNV/blob/master/somatic/bafSegmentation.R

and send me the output?

It should be a simple vector and its summary seems to be sensible, but R somehow thinks it is not a simple vector, I guess...

@GermanDemidov
Copy link
Collaborator

No, don't do this, replace

!is.na(potentiallyHeterozygous)

with length(potentiallyHeterozygous ) > 0

and let me know if it works!

@sunyihong
Copy link
Author

Hi, then I got the new error:
[1] "We have found sample with name A1_1_n in our normal.cov file! We will try to analyse it. Remember - we still have to calculate all the parameters (the most time consuming step)..."
[1] "We are reading BAF files. It may take time - especially if you have a lot of SNV positions. 2024-05-14 15:55:11"
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.4007 0.4545 0.4841 0.4856 0.5141 0.5988
[1] "Heterozygous allele shift for particular sample 0.484142"
Error in if (is.na(prob)) { : the condition has length > 1
Calls: returnAllowedChromsBaf ... apply -> FUN -> determineHeterozygousPositionsOverdispersed
Execution halted

@GermanDemidov
Copy link
Collaborator

GermanDemidov commented May 14, 2024

in old R versions it was an acceptable code style but I think it fails with the newer ones...

is.na(prob) in https://github.com/imgag/ClinCNV/blob/master/somatic/helpersBalleleFreq.R has to be replaced any(is.na(prob)), in two places. Could you do it and tell me the next error, if any?

Which R version do you use? Because if it is the new one I probably have to adapt the rest of the script and make a new release.

@sunyihong
Copy link
Author

The R version I used is 4.2.2, and I changed the code following your advice, got below error:

1] "We are reading BAF files. It may take time - especially if you have a lot of SNV positions. 2024-05-14 16:47:41"
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.4007 0.4545 0.4841 0.4856 0.5141 0.5988
[1] "Heterozygous allele shift for particular sample 0.484142"
Error in if ((prob > 0.05)) { : the condition has length > 1
Calls: returnAllowedChromsBaf ... apply -> FUN -> determineHeterozygousPositionsOverdispersed
Execution halted

@sunyihong
Copy link
Author

But I use R version 4.1.2 without any code change, it works!

@GermanDemidov
Copy link
Collaborator

Hi @sunyihong - so it works for you now?

I will debug the tool for the newest version, seems that something fundamentally changed in the language (so many conditions failed, damn), so I'll try to hunt it down, but probably not today

@sunyihong
Copy link
Author

Yes! Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants