Entering edit mode
5.6 years ago
bsmith030465
▴
240
Hi,
How do I filter my plink files so that only indels are kept? I used the following command to keep only snps:
plink --bfile myfile --snps-only --out myfile.snps
Which command/option should I use to retain only indels?
Thanks
Since my variants IDs weren't unique, I did some file processing to my snps output file (myfile.snps above) and got the snp ids that I want to exclude ('snp.pos.txt'):
and then I ran
plink --bfile myfile --exclude snp.pos.txt --out myfile.indels
However, this doesn't seem to exclude the positions. Is the formatting wrong? Each field is separated by whitespace as recommended in PLINK documentation...
Variant IDs cannot contain spaces, so your snp.pos.txt really does not look like it does what you want it to do. plink 2.0's --set-all-var-ids flag provides a way to assign new position-based IDs to all your variants, if it's okay to throw away the old IDs.
You need --make-bed in your last command to generate a new filtered fileset.
I am trying to exclude the 'range' of snps with this file format.
but it says " Note: --range flag deprecated. Use e.g. '--extract range [filename]'."
It also gives an error if I use:
I don't want to use plink2, because I can't seem to do other things (e.g. --mendel )
How should I set my options with plink 1.9?
Many thanks for all your help. I appreciate it!
You can use plink2 for just —set-all-var-ids, and return to plink 1.x for the remaining steps.
The problem with “—exclude range” here is that, when a SNP and an indel start from the same position, it’ll get rid of both; —set-all-var-ids at least makes it possible to get rid of only the indel in this case. With that said, don’t worry about the Note for now.
Thanks for the help and explanation. That worked! Much appreciated.