PLINK-1.9 - How to control LD format?

262 views
Skip to first unread message

Andy Boughton

unread,
Sep 24, 2021, 3:20:33 PM9/24/21
to plink2-users

Greetings,

I would like to make a LocusZoom plot using PLINK-calculated LD relative to one (or a few) target SNPs.

However, when I run the command below (PLINK v1.90b6.9 64-bit (4 Mar 2019)), it produces a fixed-width / space-delimited output file (plink.ld). Is there a way to make the output tab-delimited instead?
 plink-1.9 --r2 --vcf 1000g_chr22_reformatIDs.vcf.gz --ld-snp 22-37470224-T-C --ld-window 99999 --ld-window-kb 100 --ld-window-r2 0.0

Looking at the docs, it seems that (some??) of the output formats are tab delimited already. There are options to force spaces, but I do not see a similar option to force tabs.

The use case here is that we would like to add a new LocusZoom.js feature to make plots in several regions with user-provided LD (--ld-snp-list) , directly using the output from a widely used program.  To keep queries snappy, it would be nice if users could index the file with tabix.

Any suggestions on controlling the output format would be helpful- we hope to provide usage instructions that can be followed by people with minimal technical experience, and a built-in way to control the output would be ideal.

Thanks in advance,

-Andy Boughton

Senior Applications Programmer/Analyst
Center for Statistical Genetics
University of Michigan

Christopher Chang

unread,
Sep 25, 2021, 1:03:46 PM9/25/21
to plink2-users
PLINK 2.0 does have tab-delimited-everything (except for export of formats with spaces in the specification).

To make a PLINK 1.9 output file tab-delimited, see https://www.cog-genomics.org/plink/1.9/other#tabspace .
Reply all
Reply to author
Forward
0 new messages