chrchang / plink-ng

A comprehensive update to the PLINK association analysis toolset. Beta testing of the first new version (1.90), focused on speed and memory efficiency improvements, is finishing up. Development is now focused on building out support for multiallelic, phased, and dosage data in PLINK 2.0.
https://www.cog-genomics.org/plink/2.0/
414 stars 127 forks source link

Failed to open .fam #150

Closed Yemch closed 3 years ago

Yemch commented 4 years ago

Hi developers,

I was using PLINK v1.90b6.18 64-bit (16 Jun 2020) on Linux. I was trying to merge phenotype files of UKBiobank data for all chromosomes, since the UKBB genotype files are split by chromosome. And the error raised:

PLINK v1.90b6.18 64-bit (16 Jun 2020)
Options in effect:
  --bed /n/groups/price/UKBiobank/download_500K/ukb_cal_chr1_v2.bed
  --bim /n/groups/price/UKBiobank/download_500K/ukb_snp_chr1_v2.bim
  --fam /n/groups/price/UKBiobank/download_500K/ukb1404_cal_chr1_v2_CURRENT.fixCol6.fam
  --merge-list /n/groups/liang/lab/mye/data/list_beds.txt

Working directory: /n/groups/liang/lab/mye/script
Start time: Wed Aug  5 16:14:16 2020

Random number seed: 1596658456
257564 MB RAM detected; reserving 128782 MB for main workspace.
Error: Failed to open ukb1404_cal_chr1_v2_CURRENT.fixCol6.fam.

However, when I use head to look up the file, I can open it.

$ head /n/groups/price/UKBiobank/download_500K/ukb1404_cal_chr1_v2_CURRENT.fixCol6.fam
5801985 5801985 0 0 1 -9
5577286 5577286 0 0 2 -9
1992118 1992118 0 0 2 -9
2955524 2955524 0 0 2 -9
2923967 2923967 0 0 2 -9
3036644 3036644 0 0 1 -9
2080535 2080535 0 0 2 -9
5872131 5872131 0 0 2 -9
1441025 1441025 0 0 1 -9

Do you have any suggestions about that?

Thanks, Mingchen

chrchang commented 4 years ago

Check the directory.

mwmarkman commented 3 years ago

I am having the same issue. Specifically, an older version of plink is able to open the file but not a newer version.

Old version:

PLINK v1.90b5 64-bit (14 Nov 2017)             www.cog-genomics.org/plink/1.9/
(C) 2005-2017 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to ld_locus_1.log.
Options in effect:
  --bfile /mnt/beegfs/oldhome/lentsn-home-migration/symlinks/beegfs_projects_space/sam_ibd/ibd_chr19
  --ld-snp rs12972156
  --ld-window 99999
  --ld-window-kb 1000
  --ld-window-r2 0
  --out ld_locus_1
  --r2

257671 MB RAM detected; reserving 128835 MB for main workspace.
2087017 variants loaded from .bim file.
5000 people (2008 males, 2992 females) loaded from .fam.
Using up to 19 threads (change this with --threads).
Before main variant filters, 5000 founders and 0 nonfounders present.
Calculating allele frequencies... done.
Total genotyping rate is 0.995574.
2087017 variants and 5000 people pass filters and QC.
Note: No phenotypes present.
--r2 to ld_locus_1.ld ... done.

New version, same command:

PLINK v1.90b6.21 64-bit (19 Oct 2020)          www.cog-genomics.org/plink/1.9/
(C) 2005-2020 Shaun Purcell, Christopher Chang   GNU General Public License v3
Logging to ld_locus_1.log.
Options in effect:
  --bfile /mnt/beegfs/oldhome/lentsn-home-migration/symlinks/beegfs_projects_space/sam_ibd/ibd_chr19
  --ld-snp rs12972156
  --ld-window 99999
  --ld-window-kb 1000
  --ld-window-r2 0
  --out ld_locus_1
  --r2

257671 MB RAM detected; reserving 128835 MB for main workspace.
Error: Failed to open
/mnt/beegfs/oldhome/lentsn-home-migration/symlinks/beegfs_projects_space/sam_ibd/ibd_chr19.bed.
chrchang commented 3 years ago

This seems likely to be a transient filesystem error. I can't think of any changes made to PLINK 1.9 I/O code between those two builds.

(Also note that, if a filesystem error occurs with PLINK 2.0, you should get a more specific error message. Yes, I realize --r2 isn't implemented there yet.)

mwmarkman commented 3 years ago

Thanks, looking forward to using --r2 in PLINK 2.0.