I ran MACS fro calling Chipseq and bed file showed ch1 -41 256 . Hiow can I convert into positive coordinates as the downstream analysis tools are giving error that it cannot be negative.
Thanks
I ran MACS fro calling Chipseq and bed file showed ch1 -41 256 . Hiow can I convert into positive coordinates as the downstream analysis tools are giving error that it cannot be negative.
Thanks
As Istvan said remove them.
Try this (It gives all the regions that have no negative numbers on the first strand)
awk '{if ($2>=0) print $0}' input.bed >> output.bed
Dont remove the peaks, replace the -ve co-ordinates by 0.
This comes under off end chromosome reads. Either use an established tool like bedclip.
Another post explaining it http://biofeed.tumblr.com/post/16758640444/ngs-chip-seq-bedclip-to-clip-out-off-end-chromosome
or use this awk script, it replaces -ve coordinates in 2nd column by 0
, but doesn't removes them.
awk '{ if( $2 ~ /^-/ ){sub($2,0, $2); print $0;}else{print $0}}' file.bed >out.bed
Cheers
This is most likely a data processing mistake where someone corrected the binding location by shifting the 5' end to indicate midpoints but forgot to account for data on the reverse strand that may have been closer than a half fragment width to the chromosome start. Similarly you may have start sites on the positive strand that are past the chromosome ends but those don't stand out that much.
Filter out this data (remove them).
I would set the -41 to 0 rather than remove the peak. And for those that go beyond the end of the chromosome, set to the end of the chromosome.
The wig file from MACS sometimes has a similar issue. If you convert wig to bigWig (using UCSC's wigToBigWig) then be sure to use the '-clip' flag.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Sukhdeep Could you please check with in above URL link for bedclip is not working
Check again, I was editing it at the same time :)