Thursday, July 24, 2014

PLINK file formats: .bim and .fam

Generate test files

Content of test1.ped:
fabu peter 0 0                                        1  0    G G    2 2    C C
fabu mary 0 0                                         1  0    A A    0 0    A C
fabu jane peter mary                                  1  2    0 0    1 2    A C
awesome davidson 0 0                                  1  0    A A    2 2    0 0
awesome lisalistanovlivasa 0 0                        1  2    A A    2 2    0 0
awesome james-liang davidson lisalistanovlivasa       1  2    A A    2 2    A A
Contentof test1.map:
1 snp1 0 1
1 snp2 0 2
1 snp3 0 3
Generate .bed .bim and .fam files:
plink --file test1 --make-bed --out test1

BIM files

Tab delimited. The fields in a BIM file are:

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

  • Content of generated (tab delimited) bim file:
    1 snp1 0 1 G A
    1 snp2 0 2 1 2
    1 snp3 0 3 A C
    

    FAM files

    Space delimited. The fields in a FAM file are:
        Family ID
        Sample ID
        Paternal ID
        Maternal ID
        Sex (1=male; 2=female; other=unknown)
        Affection (0=unknown; 1=unaffected; 2=affected)
    
    Content of generated (space delimited) fam file:
    fabu peter 0 0 1 -9
    fabu mary 0 0 1 -9
    fabu jane peter mary 1 2
    awesome davidson 0 0 1 -9
    awesome lisalistanovlivasa 0 0 1 2
    awesome james-liang davidson lisalistanovlivasa 1 2
    

    0 comments: