I have a big data file containing different information. I need to select and copy only some rows of this file in another one.
my_file.txt
(Column are separated by "tab"
. I reported only the first column, but after that there is other information)
There are 2543 rows and 22 columns.
4gga_A_001_______________ clust_001 APC-coactivator_clust_001 4GGA-A Q12834 2.04 CDC20 APC-coactivator
4ggc_A_002_______________ clust_001 APC-coactivator_clust_001 4GGC-A Q12834 1.35 CDC20 APC-coactivator
4ggd_A_002_______________ clust_001 APC-coactivator_clust_001 4GGD-A Q12834 2.43 CDC20 APC-coactivator
4n14_A_002_______________ clust_001 APC-coactivator_clust_001 4N14-A Q12834 2.1 CDC20 APC-coactivator
5g04_R_002_______________ clust_001 APC-coactivator_clust_001 5G04-R Q12834 3.9 CDC20 APC-coactivator
5khu_R_006_______________ clust_001 APC-coactivator_clust_001 5KHU-R Q12834 4.8 CDC20 APC-coactivator
5lcw_Q_002_______________ clust_001 APC-coactivator_clust_001 5LCW-Q Q12834 4.2 CDC20 APC-coactivator
6q6g_R_004_______________ clust_001 APC-coactivator_clust_001 6Q6G-R Q12834 3.2 CDC20 APC-coactivator
6q6h_R_003_______________ clust_001 APC-coactivator_clust_001 6Q6H-R Q12834 3.2 CDC20 APC-coactivator
6q6g_R_005_______________ clust_016 APC-coactivator_clust_016 6Q6G-R Q12834 3.2 CDC20 APC-coactivator
6q6h_R_002_______________ clust_017 APC-coactivator_clust_017 6Q6H-R Q12834 3.2 CDC20 APC-coactivator
1u6d_X_001_______________ clust_001 BTB_clust_001 1u6d_X Q14145 1.85 KEAP1 BTB
1zgk_A_001_______________ clust_001 BTB_clust_001 1zgk_A Q14145 1.35 KEAP1 BTB
2vpj_A_001_______________ clust_001 BTB_clust_001 2vpj_A Q53G59 1.85 KLHL12 BTB
2xn4_A_001_______________ clust_001 BTB_clust_001 2xn4_A O95198 1.99 KLHL2 BTB
3vng_A_001_______________ clust_001 BTB_clust_001 3vng_A Q14145 2.1 KEAP1 BTB
3vnh_A_001_______________ clust_001 BTB_clust_001 3vnh_A Q14145 2.1 KEAP1 BTB
3zgc_A_001_______________ clust_001 BTB_clust_001 3zgc_A Q14145 2.2 KEAP1 BTB
3zgd_A_001_______________ clust_001 BTB_clust_001 3zgd_A Q14145 1.98 KEAP1 BTB
4ch9_A_001_______________ clust_001 BTB_clust_001 4ch9_A Q9UH77 1.84 KLHL3 BTB
4chb_A_001_______________ clust_001 BTB_clust_001 4chb_A O95198 1.56 KLHL2 BTB
4ifj_A_001_______________ clust_001 BTB_clust_001 4ifj_A Q14145 1.8 KEAP1 BTB
4ifl_X_001_______________ clust_001 BTB_clust_001 4ifl_X Q14145 1.8 KEAP1 BTB
4ifn_X_001_______________ clust_001 BTB_clust_001 4ifn_X Q14145 2.4 KEAP1 BTB
4in4_A_001_______________ clust_001 BTB_clust_001 4in4_A Q14145 2.59 KEAP1 BTB
4iqk_A_001_______________ clust_001 BTB_clust_001 4iqk_A Q14145 1.97 KEAP1 BTB
4l7b_A_001_______________ clust_001 BTB_clust_001 4l7b_A Q14145 2.41 KEAP1 BTB
4l7b_B_001_______________ clust_001 BTB_clust_001 4l7b_B Q14145 2.41 KEAP1 BTB
4l7c_A_001_______________ clust_001 BTB_clust_001 4l7c_A Q14145 2.4 KEAP1 BTB
4l7d_A_001_______________ clust_001 BTB_clust_001 4l7d_A Q14145 2.25 KEAP1 BTB
4n1b_A_001_______________ clust_001 BTB_clust_001 4n1b_A Q14145 2.55 KEAP1 BTB
4xmb_A_001_______________ clust_001 BTB_clust_001 4xmb_A Q14145 2.43 KEAP1 BTB
5f72_C_001_______________ clust_001 BTB_clust_001 5f72_C Q14145 1.85 KEAP1 BTB
5nkp_A_001_______________ clust_001 BTB_clust_001 5nkp_A Q9UH77 2.8 KLHL3 BTB
5wfl_A_001_______________ clust_001 BTB_clust_001 5wfl_A Q14145 1.93 KEAP1 BTB
5wfv_A_001_______________ clust_001 BTB_clust_001 5wfv_A Q14145 1.91 KEAP1 BTB
5wg1_A_002_______________ clust_001 BTB_clust_001 5wg1_A Q14145 2.02 KEAP1 BTB
5whl_A_002_______________ clust_001 BTB_clust_001 5whl_A Q14145 2.5 KEAP1 BTB
5whl_B_001_______________ clust_001 BTB_clust_001 5whl_B Q14145 2.5 KEAP1 BTB
5who_A_002_______________ clust_001 BTB_clust_001 5who_A Q14145 2.23 KEAP1 BTB
5who_B_001_______________ clust_001 BTB_clust_001 5who_B Q14145 2.23 KEAP1 BTB
5wiy_A_001_______________ clust_001 BTB_clust_001 5wiy_A Q14145 2.23 KEAP1 BTB
5wiy_B_001_______________ clust_001 BTB_clust_001 5wiy_B Q14145 2.23 KEAP1 BTB
5x54_A_001_______________ clust_001 BTB_clust_001 5x54_A Q14145 2.3 KEAP1 BTB
5yq4_A_001_______________ clust_001 BTB_clust_001 5yq4_A Q9Y2M5 1.58 KLHL20 BTB
5yy8_A_001_______________ clust_001 BTB_clust_001 5yy8_A Q9Y6Y0 1.98 IVNS1ABP BTB
6fmp_A_001_______________ clust_001 BTB_clust_001 6fmp_A Q14145 2.92 KEAP1 BTB
6fmq_A_001_______________ clust_001 BTB_clust_001 6fmq_A Q14145 2.1 KEAP1 BTB
6gy5_A_001_______________ clust_001 BTB_clust_001 6gy5_A Q9Y2M5 1.09 KLHL20 BTB
6hws_A_001_______________ clust_001 BTB_clust_001 6hws_A Q14145 1.75 KEAP1 BTB
6n3h_A_001_______________ clust_001 BTB_clust_001 6n3h_A Q9Y6Y0 2.6 IVNS1ABP BTB
6rog_A_001_______________ clust_001 BTB_clust_001 6rog_A Q14145 2.16 KEAP1 BTB
I need to extract rows using the values in 3rd, 5th and 6th column. In details, for equal third column strings (e.g. APC-coactivator_clust_001, or APC-coactivator_clust_016 ...) I must extract the row to which corresponds, for each different fifth column value (e.g. Q12834 ...) the lowest sixth column value. I don’t know if I was clear enough. Anyway I bring you the output file that I should get.
outpout.txt
4ggc_A_002_______________ clust_001 APC-coactivator_clust_001 4GGC-A Q12834 1.35 CDC20 APC-coactivator
6q6g_R_005_______________ clust_016 APC-coactivator_clust_016 6Q6G-R Q12834 3.2 CDC20 APC-coactivator
6q6h_R_002_______________ clust_017 APC-coactivator_clust_017 6Q6H-R Q12834 3.2 CDC20 APC-coactivator
1zgk_A_001_______________ clust_001 BTB_clust_001 1zgk_A Q14145 1.35 KEAP1 BTB
2vpj_A_001_______________ clust_001 BTB_clust_001 2vpj_A Q53G59 1.85 KLHL12 BTB
4chb_A_001_______________ clust_001 BTB_clust_001 4chb_A O95198 1.56 KLHL2 BTB
4ch9_A_001_______________ clust_001 BTB_clust_001 4ch9_A Q9UH77 1.84 KLHL3 BTB
5yy8_A_001_______________ clust_001 BTB_clust_001 5yy8_A Q9Y6Y0 1.98 IVNS1ABP BTB
6gy5_A_001_______________ clust_001 BTB_clust_001 6gy5_A Q9Y2M5 1.09 KLHL20 BTB