5.2 bed
Join bed files: region + mask, union or intersect
bed is a utility task which can join, mask or intersect bed-files. Annotations of positions will be kept unmerged, un-annotated positions will be merged.
5.2.1 Parameters
5.2.1.1 Input
--regions bed-files |
Create a regions-file, joining (union) all bed-files in list. Can bed combined with --mask |
--mask bed-files |
Create a mask-file, joining (intersect) all bed-files in list. Can be combined with --regions |
--union bed-files |
Create the union of all bed-files in list |
--intersect bed-files |
Create the intersection of all bed-files in list |
5.2.2 Output
*_regions.bed |
combined regions-file, generated by --regions or --mask with --flip or --both |
*_mask.bed |
combined mask-file, generated by --mask or regions with --flip or --both |
*_union.bed |
output-file of --union |
*_intersect.bed |
output-file of --intersect |
*Flipped.bed |
flipped output-file of --union and --intersect when --flip or --both is used |
5.2.3 Usage Example
# Create region file
echo "chr1 0 10
chr1 20 50
chr1 100 200
chr1 500 1000" > region.bed
# Create mask file
echo "chr1 8 12
chr1 40 99" > mask.bed
# Create pseudo fasta-fai-file
printf "chr1\t100000\t6\t80\t81\n" > fasta.fai
atlas --task bed --regions region.bed --mask mask.bed --fai fasta.fai
atlas --task bed --union region.bed,mask.bed --fai fasta.fai
atlas --task bed --intersect region.bed,mask.bed --fai fasta.fai