This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract pattern from bfile in Plink

I have a list of SNPs of the type rs17004888. I want to extract the corresponding SNPs from binary plink files and generate a .raw subset of the binary file.

When I ran the command

plink --bfile (path to binary)  --extract (path to SNP list) --recodeA  --out (output name)

I get the following:

0 SNPs failed missingness test ( GENO > 1 )
0 SNPs failed frequency test ( MAF < 0 )
After frequency and genotyping pruning, there are 0 SNPs

I suspect that the SNP names in the binary file are of the type rs17004888_A, and thus it cannot find any matches.

How can I deal with that?

plink

Please use the formatting bar (especially the code option) to present your post better. You can use backticks for inline code (`text` becomes text), or select a chunk of text and use the highlighted button to format it as a code block. I've done it for you this time.
code_formatting

1 answer

I don't think plink supports pattern matching, so instead clean up your SNP list, something like:

cut -f1 -d"_" mySNPlist.txt > mySNPlistClean.txt

Meaning: (-d) delimiter is an underscore "_" and get the first column (-f field).

Log in to answer this question.