我需要根据数组 B 的一列对数组 A 的列进行排序,但顺序由字符串给出:我希望数组 A 的列像数组 B 的第二列一样排序 ( B[:,1]
)
数组 A
family id mum dad rs1 rs2 rs3 rs4 rs5 rs6 rs7 rs8 rs9 rs10 rs11 rs12
1 1 4 6 A T A A T T C C G G A T A G A A G A T A G G C C
2 2 7 9 T A G A C T C T G A T T A A A C G G T A C C C T
3 3 2 8 T T G G C T C T G G A T A G A C G G T T C C C C
4 4 5 1 A A A A T T C C G A T T A A A A G A T A G C C T
数组 B
1 rs1 2345
1 rs5 2346
2 rs6 2348
4 rs8 2351
4 rs12 2360
3 rs2 2456
2 rs3 2453
3 rs10 5672
1 rs9 78923
5 rs7 5738
2 rs4 3546
6 rs11 6354
期望的输出:
family id mum dad rs1 rs5 rs6 rs8 rs12 rs2 rs3 rs10 rs9 rs7 rs4 rs11
1 1 4 6 A T G G A T A A C C A A T T T A G A A G C C G G
2 2 7 9 T A G A T T A C C T G A C T T A G G A A C T C C
3 3 2 8 T T G G A T A C C C G G C T T T G G A G C T C C
4 4 5 1 A A G A T T A A C T A A T T T A G A A A C C G C
我希望这足够清楚!谢谢!