Error: Line 1 of .fam file has fewer tokens than expected.

6,676 views
Skip to first unread message

kde...@gmail.com

unread,
May 22, 2015, 2:55:33 PM5/22/15
to plink2...@googlegroups.com
Hi.  I am trying to run plink.  I was just putting it through the process of making a binary set of input files in order to check the files were in order. 


plink --file filename --make-bed  --chr-set 38 --no-parents --no-sex --allow-no-sex

I got this error:
Error: Line 1 of .ped file has fewer tokens than expected.

I worried that there was an error in the ped file as there were so many genotypes.  So, I made transposed files and tried to run that:
plink --tfile transposed_filename --make-bed  --chr-set 38 --no-parents --no-sex --allow-no-sex

Error: Line 1 of .fam file has fewer tokens than expected.

I have a file with only fid and individual id (same number).  All individuals are considered founders with no gender info.

I'm not sure what the token is referring to at this point.  any input would be appreciated.

Thanks

Christopher Chang

unread,
May 22, 2015, 4:04:22 PM5/22/15
to plink2...@googlegroups.com, kde...@gmail.com
You need to add the --no-parents, --no-sex, and --no-pheno flags to your command line; see https://www.cog-genomics.org/plink2/input#plink_irreg .

Hao-Xun Chang

unread,
Aug 26, 2015, 5:41:15 PM8/26/15
to plink2-users
Dr. Chang and other helpers,

   I have a similar issue that the error is: 

$plink --file my_filename
LINK v1.90b3v 64-bit (15 Jul 2015)        https://www.cog-genomics.org/plink2
(C) 2005-2015 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to plink.log.
Options in effect:
  --file my_filename

96730 MB RAM detected; reserving 48365 MB for main workspace.
Allocated 36273 MB successfully, after larger attempt(s) failed.
Scanning .ped file... 0%
Error: Line 1 of .ped file has fewer tokens than expected.

and my .ped file looks like:

0 PI594418B 0 0 0 1 G T G G T C G A T A G G 
0 PI399004 0 0 0 1 A C A G C C A G C C A T 
0 PI437207 0 0 0 1 G T G G T C G A T A G G 
0 PI507709 0 0 0 1 A C A G C C A G C C A T 
0 PI594635B 0 0 0 1 A C A G C C A G C C A

When I deleted FamilyID, PaternalID, MaternalID, and Sex, the problem still exists:

$plink --file GWAS_FvNIS1 --no-fid --no-parents --no-sex
PLINK v1.90b3v 64-bit (15 Jul 2015)        https://www.cog-genomics.org/plink2
(C) 2005-2015 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to plink.log.
Options in effect:
  --file GWAS_FvNIS1
  --no-fid
  --no-parents
  --no-sex

96730 MB RAM detected; reserving 48365 MB for main workspace.
Allocated 36273 MB successfully, after larger attempt(s) failed.
Scanning .ped file... 0%
Error: Line 1 of .ped file has fewer tokens than expected.

This time the .ped file looks like:
PI594418B 1 G T G G T C G A T A G G G 
PI399004 1 A C A G C C A G C C A T A
PI437207 1 G T G G T C G A T A G G G 
PI507709 1 A C A G C C A G C C A T A 
PI594635B 1 A C A G C C A G C C A T A 

I appreciate if any one could provide me some suggestions.

BEST,

Christopher Chang

unread,
Aug 26, 2015, 6:32:39 PM8/26/15
to plink2-users
How many lines are in your .map file?  There should be 2 genotype columns in the .ped for each line in your .map file; if there aren't, there's something wrong with your files.

Hao-Xun Chang

unread,
Aug 26, 2015, 10:38:53 PM8/26/15
to plink2-users
Dr. Chang,

   I have the same number of SNPs(column) in .ped and SNPs(row or line) in .map. Based on your feedback, I assume I should have double column in the .ped file. However, what's the way to code heterozygous SNPs in .ped file? Is it split into two column, like C T, instead of H in one column? 

    If I use 1,2,3 to code for instance CC, CT, TT, would it work? Or do I need to code as 1 1 (C C) 1 2 (C T) 2 2 (T T) to make column in .ped file twice of rows in .map file? 
Reply all
Reply to author
Forward
0 new messages