Question: (Closed) Match the three columns in 2 annotation files and print those lines to a new output file
gravatar for saamar.rajput
5.2 years ago by
saamar.rajput60 wrote:

I have 2 files, file 1 and file 2 with the same column numbers, column one has the chromosome number, column two has the promoter start site and column three has the promoter stop site.I want to match both files, if a match to all the three columns in file 1 is found in file 2, i want to generate an output file showing the exact three columns with a fourth one.the fourth one would show a match with a score 1 and a mismatch with a score 0.


i found the answer to match the files and output a new file at the same forum, 

awk 'FNR==NR{a[$1,$2,$3]=$0;next}{if(b=a[$1,$2,$3]){print b}}' file1 file2

but i want to include the match and mismatch score column in the output file too.


linux column • 1.9k views
ADD COMMENTlink modified 5.2 years ago by _r_am32k • written 5.2 years ago by saamar.rajput60

Hello saamar.rajput!

We believe that this post does not fit the main topic of this site.

This is plain text processing, not bioinformatics. Please ask stack overflow.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.


ADD REPLYlink written 5.2 years ago by _r_am32k
Please log in to add an answer.
The thread is closed. No new answers may be added.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1179 users visited in the last hour