Entering edit mode
                    7.8 years ago
        BalderNGS
        
    
        •
    
    0
    I am creating per base depth files samtools depth. I want to collapse to a proper BED file for regions with similar depth:
Chr_01  140     10
Chr_01  141     10
Chr_01  142     10
Chr_01  143     30
Chr_01  144     30
Chr_01  145     30
Chr_01  146     30
Chr_01  147     20
Chr_01  148     20
Chr_01  149     20
Chr_01  150     20
Chr_01  151     20
Chr_01  152     10
Chr_01  153     10
Chr_01  154     10
Which should become (with trivial chosen names):
Chr_01  140     142    normal 10
Chr_01  143     146    high 30
Chr_01  147     151    medium  20
Chr_01  152     154    normal 10
Is this possible with bedtools or other existing tools?
Thanks Pierre, I knew a single commandline would be out there. Thanks for the +1 on the end of the 'feature'. i missed that