How I transform column to row in Terminal Linux? But more complex... The following is an example of my data:
SNP_Name ID_Animal Allele Chr Position
rs01 215 AB 1 100
rs02 215 AA 2 200
rs03 215 BA 3 300
rs04 215 AA 4 400
rs01 300 AB 1 100
rs02 300 BB 2 200
rs03 300 AA 3 300
rs04 300 AB 4 400
rs01 666 BB 1 100
rs02 666 AA 2 200
rs03 666 AB 3 300
rs04 666 AB 4 400
I want to transform this into the following:
SNP_Name Chr Position 215(ID_animal) 300(ID_Animal) 666(ID_Animal)
rs01 1 100 AB AB BB
rs02 2 200 AA BB AA
rs03 3 300 BA AA AB
rs04 4 400 AA AB AB
The row ID_animal
change in column with respective allele. How I do this?
But I will work with 55,000 repetition per ID_animal
. So, I want to be only 55,000 row and (animal number
+SNP_Name
+Chr
+Position
) of column.
Thank you.