Hi I have want to identify the extreme most positions in a bed file from a specific position in a window frame,
E.g. if base position is chrX 154029186 154029187
, and if following are the overlapping positions from another bed file in a specified window frame , then the tool should spit out
chrX 154029165 154029172
and
chrX 154028990 154028999
since they are extreme most positions in the frame
chrX 154029186 154029187 chrX 154029165 154029172
chrX 154029186 154029187 chrX 154028981 154028992
chrX 154029186 154029187 chrX 154028991 154029002
chrX 154029186 154029187 chrX 154028981 154028990
chrX 154029186 154029187 chrX 154028991 154029000
chrX 154029186 154029187 chrX 154028982 154028991
chrX 154029186 154029187 chrX 154028990 154028999
If I understood clearly then you have two bed files (e.g. "A.bed" and "B.bed") and you want to print only those co-ordinates of A.bed which doesn't overlap with B.bed.
If it is so then just do (install bedtools)
Your best bet is to either script something with pybedtools or with R (in GenomicRanges). If the BED files are large, the former is probably more efficient.
Assuming your bedfiles are sorted correctly you can pipe your intersections into
but there should be better way solving this.