This is a test version of Biostars. For the public version, visit https://www.biostars.org.
making psam file for plink2

I'm trying to run plink2's --make-king-table command.

However, upon running

~/programs/plink2 --bcf 1000genomes.bcf --make-king-table --out plink2.king --psam .1000g.tsv

I get an error:

Error: Mismatched IDs between --bcf file and condon.1000g.tsv.

so I made a psam file looking like:

NA21127 1
NA21128 1
NA21129 1
NA21130 1
NA21133 1
NA21135 1
NA21137 2
NA21141 2
NA21142 2
NA21143 2

However, this still gives the same errors. I have assured that the IDs are in the same order. I don't understand how this psam file should be put together, nor can I find documentation on it.

How can I make this psam file?

plink2

thank you, that didn't show up on Google searches. Time would've been saved if this error had a helpful error message.

1 answer

SOLUTION, ironically, from Grok:

Example .psam File Here’s an example of a simple .psam file with just the required column:

#IID
SAMPLE1
SAMPLE2
SAMPLE3

Here’s a more detailed example including optional columns:

#FID    IID PAT MAT SEX
FAM1    IND1    0   0   1
FAM1    IND2    IND1    IND3    2
FAM2    IND4    0   0   0

In this example: FID groups individuals into families (FAM1, FAM2). IID is the unique individual ID. PAT and MAT specify parents (0 if unknown). SEX is coded as 1 (male), 2 (female), or 0 (unknown).

since I don't know family IDs, I add a header '#IID SEX' to the psam file, and that was it

Log in to answer this question.