Plink recode option to get genomic position?
1
0
Entering edit mode
5.0 years ago
RNAseqer ▴ 260

Is there a command to pull SNPs IDs and loci out of a bfile using plink? maybe something along the lines of the --recode option?

plink SNP locus • 1.7k views
ADD COMMENT
0
Entering edit mode

Is it not possible with plain awk? Is the bfile a binary file?

ADD REPLY
0
Entering edit mode

It is a binary file yes.

ADD REPLY
2
Entering edit mode
5.0 years ago
zx8754 11k

Plink binary format output has 3 files:

  • bed - binary for genotypes
  • bim - plain text map file for SNPs
  • fam - plain text for samples.

2nd column of bim file is SNP id:

  1. Chromosome code (either an integer, or 'X'/'Y'/'XY'/'MT'; '0' indicates unknown) or name
  2. Variant identifier
  3. Position in morgans or centimorgans (safe to use dummy value of '0')
  4. Base-pair coordinate (1-based; limited to 231-2)
  5. Allele 1 (corresponding to clear bits in .bed; usually minor)
  6. Allele 2 (corresponding to set bits in .bed; usually major)

So we can get the second column, for example, using cut as:

cut -f2 myBim.bim > mySNPs.txt
ADD COMMENT

Login before adding your answer.

Traffic: 2636 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6