remove duplicated gene pair using awk

cat input.txt

TRINITY_DN106621_c0_g1_i1       TRINITY_DN129833_c0_g1_i2
TRINITY_DN106621_c0_g1_i1 TRINITY_DN140628_c4_g2_i2
TRINITY_DN106621_c0_g1_i1 TRINITY_DN135041_c0_g1_i1
TRINITY_DN135041_c0_g1_i1 TRINITY_DN106621_c0_g1_i1
TRINITY_DN140628_c4_g2_i2 TRINITY_DN106621_c0_g1_i1
TRINITY_DN129833_c0_g1_i2 TRINITY_DN106621_c0_g1_i1
awk '{printf("%s\t%s\n",($1<$2?$1:$2),($1<$2?$2:$1));}' input.txt | sort | uniq > output.txt
cat output.txt

TRINITY_DN106621_c0_g1_i1       TRINITY_DN129833_c0_g1_i2
TRINITY_DN106621_c0_g1_i1 TRINITY_DN140628_c4_g2_i2
TRINITY_DN106621_c0_g1_i1 TRINITY_DN135041_c0_g1_i1
上一篇:win7中python3.4下安装scrapy爬虫框架(亲测可用)


下一篇:list,set,map,数组之间的相互转换详细解析