This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plink: Losing FAM file data when merging multiple BED files

I have multiple BED/BIM/FAM files (one for each chromosome) and I'm creating a master set of files for downstream analysis (extracting SNPS).

I am using the command: plink --bfile myfile1 --merge-list all_my_files.txt --make-bed --out mymerged

my_files.txt has the format:

file2.bed file2.bim file2.fam 
 ... 
fileK.bed fileK.bim fileK.fam

The problem is the resulting mymerged.fam file has the following information:

-1 -1 0 0 0 -9
-2 -2 0 0 0 -9
-3 -3 0 0 0 -9
-4 -4 0 0 0 -9
...

Each of the fam files in all_my_files.txt have real fid and iid values, etc.

What is wrong with my merge such that the fid and iid values from the individual FAM files are not propogating to the merged FAM file?

I also tried a --bmerge of just the CHR1 and CHR2 files and I had the same issue.

Any thoughts? Thanks!

plink software error snp

2 answers

Look more carefully at your input .fam files. You’ll find a -1 -1 row, a -2 -2 row, etc.

—merge-list sorts .fam IDs in “natural sorted” order.

oops! That was it. Thanks @chrchang523

Log in to answer this question.