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

missing value where TRUE/FALSE needed #6

Open
melop opened this issue Nov 18, 2023 · 4 comments
Open

missing value where TRUE/FALSE needed #6

melop opened this issue Nov 18, 2023 · 4 comments

Comments

@melop
Copy link

melop commented Nov 18, 2023

We are running R 4.3.0 and we encountered the following error. It is kind of difficult to interpret. Any ideas why this might have happened?


> X <- BEDMatrix("converted.bed")
Extracting number of samples and rownames from converted.fam...
Extracting number of variants and colnames from converted.bim...
> dim(X)
[1]      31 2846611
> kinship <- popkin(X)
Error in if (any(!indexes_not_fixed)) { : 
  missing value where TRUE/FALSE needed
@alexviiia
Copy link
Collaborator

On R 4.3.2, all my unit tests passed. My guess is that there's something pathological about your data that our code isn't considering (though it's usually robust to common edge cases). Perhaps you have a SNP with all of its values missing? I'm happy to look at your data if you're able to share it. Otherwise, try more QC before applying popkin? Let me know if you figured out the issue after trying these suggestions, perhaps I can improve our code as a consequence.

@melop
Copy link
Author

melop commented Nov 22, 2023

Hi Alex, yes it must be the data. I previously ran popkin with no problem but after adding more individuals the error appears. The file is pretty big for online transfer. Is there a way to quickly figure out what's throwing off the code? The current error message isn't very helpful for pinpointing the cause. I will try filtering out any SNP with completely missing genotypes.

1 similar comment
@melop
Copy link
Author

melop commented Nov 22, 2023

Hi Alex, yes it must be the data. I previously ran popkin with no problem but after adding more individuals the error appears. The file is pretty big for online transfer. Is there a way to quickly figure out what's throwing off the code? The current error message isn't very helpful for pinpointing the cause. I will try filtering out any SNP with completely missing genotypes.

@melop
Copy link
Author

melop commented Nov 22, 2023

Ok, filtering the data with F_MISSING<0.1 using bcftools solved the problem. Must be due to missing data.

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