Question: Convert matrix in numeric format to genotype format
gravatar for shinken123
19 months ago by
shinken12390 wrote:

Hi All,

I want to convert a matrix in numeric format, 0 for homozygous reference allele, 1 for heterozygous and 2 for homozygous alternative to a genotype matrix, if it is possible to a vcf file. Do you know any tool to do it?

Best Wishes,


snp • 937 views
ADD COMMENTlink modified 19 months ago by chrchang5237.1k • written 19 months ago by shinken12390
gravatar for chrchang523
19 months ago by
United States
chrchang5237.1k wrote:

If your matrix is variant-major (i.e. each line has one variant, each column has one sample), it shouldn't take too much work to manipulate it into a form that plink 2.0 --import-dosage (see for a description of the expected format, and for --import-dosage syntax) can read; adding "--export vcf" to the same command line will then give you your VCF.

If it's sample-major, you'll probably need to transpose it first.

ADD COMMENTlink written 19 months ago by chrchang5237.1k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1090 users visited in the last hour