Entering edit mode
7.0 years ago
Ming Lu
▴
30
I use HOMER to call peaks getting peaks.txt file. Then I use pos2bed.pl to transform peaks.txt to peaks.bed However, the column 6 loss after the transform, which showed the normalized tag count (equal to RPKM reflecting peak density).
Thank you, I use these code, and the column 6 will be kept after bedtools intersect
but still 1 questions: "#" mean any pattern I can input, is that right? I didnot use it
yes, within double quote, you can use any pattern. in this case, line with comment in peak file i.e "#" is not required, so to filter it, "grep -v "#" has been used.
why we have to clear lines with #, which didnot impact the intersect manipulation and result? even in homer's pos2bed.pl .txt >.bed, the new .bed file keeps the lines with #
you can further shorten the code:
cut will take range and awk can take delimiter to all columns. IMO, that much code is not necessary. Please try the following:
OP:
New code if you have lines with #:
New code if you do not have lines with #:
Actually, using this code, order of column will not be changed. So, yes below shorter code which you mentioned will solve the purpose.
oops...I didn't see 5th column missing.
should be