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

converting genotypes to missing in different samples in different site #1850

Closed
mgrzy opened this issue Jan 17, 2023 · 3 comments
Closed

converting genotypes to missing in different samples in different site #1850

mgrzy opened this issue Jan 17, 2023 · 3 comments

Comments

@mgrzy
Copy link

mgrzy commented Jan 17, 2023

Hi,

I am trying to calculate imputation accuracy. For that purpose I want to mask some small fraction of know genotypes, impute and then compare imputed set with true values. For example, suppose I have 5 samples: A, B, C, D and E and I would like to mask (convert to missing) first site (variant) in sample A and B, then fifth site in D and E, and so on... I would like to keep genotypes for rest sample in given site, so if in site one A and B will be masked, I would like to keep genotypes for C,D,E.

Is there any clever way to do it with bcftools?

Best,
Marcin

@pd3
Copy link
Member

pd3 commented Jan 18, 2023

Currently there is no such clever way. However, it would be straightforward to extend the +setGT plugin to support a new mode that randomly selects a proportion of genotypes. It could work like this

# set 10% of genotypes to missing
bcftools +setGT in.vcf -- -t r:0.1 -n .

@mgrzy
Copy link
Author

mgrzy commented Jan 19, 2023

Thank you for quick response. I will deal with it in other way in that case.
It will be great if it will be possible to add such option in future build of bcftools.

@pd3 pd3 closed this as completed in 5202e44 Jan 24, 2023
@pd3
Copy link
Member

pd3 commented Jan 26, 2023

This is now supported

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

No branches or pull requests

2 participants