Unwanted "zeros" when converting from tped+tfam to ped+map or to bin

1,144 views
Skip to first unread message

sleav...@gmail.com

unread,
Feb 23, 2014, 1:48:22 PM2/23/14
to plink2...@googlegroups.com
I try to convert tped+tfam files to ped map files, but, sporadically, I get in one of the alleles "zero" instead of the original genotypes.
As a result , when I call merge , I get an error.
The command lines with which I convert to ped+map:

./plink --tped  chr1.tped --tfam subjects.tfam  --recode --out chr1
./plink --tped  chr2.tped --tfam subjects.tfam  --recode --out chr2

Trying to merge files using the following command :

./plink --file chr1 --merge chr2.ped chr2.map  --out chr_1_2

I get the following messages:

Possibly irregular .ped line.  Restarting scan, assuming multichar alleles.
Rescanning .ped file... 0%
Error: Half-missing call in .ped file at variant 9, indiv 1.

Any Suggestions ?
Shmuel Leavitt

shmuel leavitt

unread,
Feb 23, 2014, 4:57:13 PM2/23/14
to plink2...@googlegroups.com
Good thing I have both plink 1.7 and 1.9 
I copied the tped files to my laptop, where I have 1.7 , not 1.9  and there were no problems.
So this problem appears when using 1.9 only.
Thanks
Shmuel Leavitt

Christopher Chang

unread,
Feb 23, 2014, 6:59:47 PM2/23/14
to plink2...@googlegroups.com
Thanks for reporting this.  This is probably a problem with the tped loader; I'll try to make sure the 24 February builds fix it.

shmuel leavitt

unread,
Feb 24, 2014, 4:00:21 AM2/24/14
to plink2...@googlegroups.com
The last stable release  in   "https://www.cog-genomics.org/plink2/"   is :   "Stable (20 Feb)" .  Should I try that, or  wait untill the 24th ?
Thanks

Christopher Chang

unread,
Feb 24, 2014, 4:03:31 AM2/24/14
to plink2...@googlegroups.com
The fixed build should be posted within 30 minutes.

shmuel....@mail.huji.ac.il

unread,
Feb 24, 2014, 6:51:31 AM2/24/14
to plink2...@googlegroups.com
Hello. Thanks for updating. I have another Q. In plink 1.7, by default,  plink would check for updates, if one wanted to cancel that, one would use --noweb. but in 1.9, it is cancelled by default. How  can one enable it in 1.9 ?
Thanks

Christopher Chang

unread,
Feb 24, 2014, 7:02:07 AM2/24/14
to plink2...@googlegroups.com
The current plan is to enable it with the first official (non-alpha, non-beta) release; hopefully Shaun Purcell will be able to update the phone-home server then.

shmuel....@mail.huji.ac.il

unread,
Feb 24, 2014, 7:39:58 AM2/24/14
to plink2...@googlegroups.com
OK. The last bug was fixed. I am afraid that I  met another one.  :)
When I run :
./plink --noweb --tfam folks.tfam --tped chr1.tped --merge folks.tfam chr2.tped --make-bed --out chr_1_2

I get warnings that arise from the fact that there are some chr  + pos set to zero . This does not bother me at this stage.
But after all the warnings, I get :

Performing single-pass merge (1504 people, 13332 variants).
Pass 1: fileset #1 complete.
Error: File read failure.

This issue does not happen when i firstly convert to .ped .map and then merge..
Any suggestions ?
BTW, the reason why I switched to plink 1.9 from 1.7 is that there was a memory issue with 1.7, that did not allow me to merge many files.
Is there a tested and stable  release with this issue fixed  ?
Thanks

Christopher Chang

unread,
Feb 24, 2014, 9:23:16 AM2/24/14
to plink2...@googlegroups.com
--merge is only supposed to work for .ped/.map, not .tped/.tfam, so that read failure is not a bug.  My recommendation is to convert the .tped/.tfam into PLINK binary format (.bed/.bim/.fam), and then use --bmerge.

The 24 February stable build should be the best so far.  Unless you find another bug, there will probably be no need for you to update it until the next time I post in plink2-announce (that's the low-traffic group for just major announcements, which serves as a sort of substitute for the web check).

Shmuel Leavitt

unread,
Feb 24, 2014, 10:33:34 AM2/24/14
to plink2...@googlegroups.com
OK, Thanks,
Looks as if it is working now :))
Shmuel

naturalrp1

unread,
Jul 7, 2014, 1:49:11 PM7/7/14
to plink2...@googlegroups.com
Attempting to run plink2 resulted in:
-bash-4.2$  ./plink --file /export/home/ldata/trucrypt1/Genotype_Reports_PLINK/NESARC_p108-119_PLINK_Filtered --make-bed
PLINK v1.90b2a 64-bit (4 Jul 2014)          https://www.cog-genomics.org/plink2
(C) 2005-2014 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to plink.log.
64399 MB RAM detected; reserving 32199 MB for main workspace.

Possibly irregular .ped line.  Restarting scan, assuming multichar alleles.
Rescanning .ped file... 0%Segmentation fault (core dumped)

Whereas plink 1.7:

-bash-4.2$ !330 --noweb
 ./plink --file /export/home/ldata/trucrypt1/Genotype_Reports_PLINK/NESARC_p108-119_PLINK_Filtered --make-bed --noweb

@----------------------------------------------------------@
|        PLINK!       |     v1.07      |   10/Aug/2009     |
|----------------------------------------------------------|
|  (C) 2009 Shaun Purcell, GNU General Public License, v2  |
|----------------------------------------------------------|
|  For documentation, citation & bug-report instructions:  |
|        http://pngu.mgh.harvard.edu/purcell/plink/        |
@----------------------------------------------------------@

Skipping web check... [ --noweb ]
Writing this text to log file [ plink.log ]
Analysis started: Mon Jul  7 08:43:47 2014

Options in effect:
        --file /export/home/ldata/trucrypt1/Genotype_Reports_PLINK/NESARC_p108-119_PLINK_Filtered
        --make-bed
        --noweb

390669 (of 390669) markers to be included from [ /export/home/ldata/trucrypt1/Genotype_Reports_PLINK/NESARC_p108-119_PLINK_Filtered.map ]Warning, found 1092 individuals with ambiguous sex codes
Writing list of these individuals to [ plink.nosex ]
1092 individuals read from [ /export/home/ldata/trucrypt1/Genotype_Reports_PLINK/NESARC_p108-119_PLINK_Filtered.ped ]
0 individuals with nonmissing phenotypes
Assuming a disease phenotype (1=unaff, 2=aff, 0=miss)
Missing phenotype value is also -9
0 cases, 0 controls and 1092 missing
0 males, 0 females, and 1092 of unspecified sex
Before frequency and genotyping pruning, there are 390669 SNPs
0 founders and 1092 non-founders found
390669 SNPs with no founder genotypes observed
Warning, MAF set to 0 for these SNPs (see --nonfounders)
Writing list of these SNPs to [ plink.nof ]
Total genotyping rate in remaining individuals is 0.998561
0 SNPs failed missingness test ( GENO > 1 )
0 SNPs failed frequency test ( MAF < 0 )
After frequency and genotyping pruning, there are 390669 SNPs
After filtering, 0 cases, 0 controls and 1092 missing
After filtering, 0 males, 0 females, and 1092 of unspecified sex
Writing pedigree information to [ plink.fam ]
Writing map (extended format) information to [ plink.bim ]
Writing genotype bitfile to [ plink.bed ]
Using (default) SNP-major mode

Analysis finished: Mon Jul  7 08:49:33 2014


Why did the 1.7 version work and not the newest plink not?

Roger

naturalrp1

unread,
Jul 7, 2014, 2:02:02 PM7/7/14
to plink2...@googlegroups.com
Actually, it did not create a bed file.

Christopher Chang

unread,
Jul 7, 2014, 8:55:38 PM7/7/14
to plink2...@googlegroups.com
Hi,

Can you send me a .ped/.map fileset I can replicate this bug with?

naturalrp1

unread,
Jul 8, 2014, 9:28:12 AM7/8/14
to plink2...@googlegroups.com
The .ped fileset is 1.7 gb, so I am not sure how.  And there are privacy concerns.

roger

Christopher Chang

unread,
Jul 8, 2014, 12:13:46 PM7/8/14
to plink2...@googlegroups.com
Can you use PLINK 1.07 to filter out most of the file, while keeping a subset that still causes PLINK 1.9 to segfault during loading?

Christopher Chang

unread,
Jul 8, 2014, 2:15:59 PM7/8/14
to plink2...@googlegroups.com
If that's not practical, I will post a debug build later today with extra logging in the .ped loader; hopefully that'll be enough for me to isolate the problematic code.

Christopher Chang

unread,
Jul 9, 2014, 2:19:07 AM7/9/14
to plink2...@googlegroups.com
Add --debug to the segfaulting PLINK 1.9 command and try it with the 8 Jul development build; the .log file should be a lot more informative now.


On Tuesday, July 8, 2014 6:28:12 AM UTC-7, naturalrp1 wrote:

Christopher Chang

unread,
Jul 18, 2014, 4:47:04 PM7/18/14
to plink2...@googlegroups.com
This bug should be fixed in the 18 Jul builds.  (It only occurred when the .map file was unsorted; that's why it took awhile to reproduce.)


On Tuesday, July 8, 2014 6:28:12 AM UTC-7, naturalrp1 wrote:
Reply all
Reply to author
Forward
0 new messages