跳至正文
首页 » Format conversion of XRM

Format conversion of XRM

HIBLUP only accept XRM in binary file format, as some software (e.g. DMU, BLUPF90, ASReml) can not recognize it, moreover, it would be hard for programming beginners to prepare those binary files, we therefore provide a format converter for easily linking HIBLUP with other software.

Binary to text

The following command will output the XRM into a square matrix in text format with names of demo.txt and demo.id.txt:

./hiblup --trans-xrm 
         --xrm demo.GA 
         --out demo
#        --triangle

An example for demo.txt with three individuals is as follows:

1.55755	1.04847	0.64622
1.04847	1.58144	0.66971
0.64622	0.66971	1.56794

If the flag --triangle is detected, HIBLUP will only write the lower triangle of the matrix into text file with format of <i j k>, where i, j, k are the row, column index, and its corresponding value respectively. For sparse matrix, HIBLUP will ignore zero elements when outputting “ijk” format. An example file with the same three individuals above is shown below:

1	1	1.55755
2	1	1.04847
2	2	1.58144
3	1	0.646224
3	2	0.669715
3	3	1.56794

Text to binary

If users have their own prior calculated relationship matrix in text format, HIBLUP can transform it into binary file, which can be used by HIBLUP directly, the script is as following:

./hiblup --trans-xrm 
         --xrm-txt demo.txt
         --xrm-id demo.id.txt
         --out demo

Above command requires demo.txt in square format and demo.id.txt. If the file demo.txt is in “ijk” format, please remember to add flag --triangle.

NOTE

HIBLUP can also convert the relationship matrix calculated by GCTA, LDAK to text format:

./hiblup --trans-xrm --xrm gcta.grm --out hiblup