mercredi 17 juillet 2019

devide two numbers in X column from two different file, if column Y and Z in first file = to column Y and Z in the second file

I am very beginner scripting in bash or R. I am trying to think of how to write a bash commandline, but I don't have the logic and knowledge to start writing a code

I have two files that look like this but with different numbers of course

CHROM BIN_START BIN_END N_VARIANTS PI Dexi_CM05836_chr01A 20001 70000 1 1.20063e-07 Dexi_CM05836_chr01A 30001 80000 1 1.20063e-07 Dexi_CM05836_chr01A 40001 90000 1 1.20063e-07 Dexi_CM05836_chr01A 50001 100000 1 1.20063e-07 Dexi_CM05836_chr01A 60001 110000 1 1.20063e-07 Dexi_CM05836_chr01A 120001 170000 17 2.30029e-05 Dexi_CM05836_chr01A 130001 180000 51 9.37882e-05

I want to have the ratio of Pi from the two files (divide Pi in file 1 over Pi in file 2) if the CHROM and BIN_start columns in file 1 = to CHROM and BIN_start in file 2

I think the best is to use for loop and awk command line

Aucun commentaire:

Enregistrer un commentaire