Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to find intersection in bedtools

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to find the intersection of bedtools, the introduction in the article is very detailed, has a certain reference value, interested friends must read!

Bedtools intersection its usage: bedtools intersect [OPTIONS] [- a |-abam]-b BED input file is in bed format, at least three columns, respectively.

Bedtools is a set of powerful tools to deal with genome information analysis, in which the intersect function can find the intersection between regions.

Its usage:

Bedtools intersect [OPTIONS] [- a |-abam]-b BED

The input file is in bed format, with at least three columns, namely the chromosome, the starting position (0-based, including), and the ending position (1-based, excluding). The fourth column is generally the name of the region

Case 1: two files containing the location of chromosomes, recorded as A file and B file respectively. What is the intersection of chromosome positions from different documents?

$cat A.bed

Chr1 10 20

Chr1 30 40

$cat B.bed

Chr1 15 25

$bedtools intersect-an A.bed-b B.bed

Chr1 15 20

Case 2: two files containing the location of chromosomes, recorded as A file and B file respectively. Find out which chromosome positions in file A have overlap with those in file B.

$cat A.bed

Chr1 10 20

Chr1 30 40

$cat B.bed

Chr1 15 25

$bedtools intersect-an A.bed-b B.bed-wa

Chr1 10 20

Case 3: two files containing the location of chromosomes, recorded as A file and B file respectively. To find out whether the chromosome position of file An intersects with the position of chromosome in file B. If there is an intersection, enter the chromosome location of A file and the chromosome location of B file respectively; if there is no intersection, output the chromosome location of A file and use'. -1-1 'make up the file.

$cat A.bed

Chr1 10 20

Chr1 30 40

$cat B.bed

Chr1 15 25

$bedtools intersect-an A.bed-b B.bed-loj

Chr1 10 20 chr1 15 25

Chr1 30 40. -1-1

Case 4: two files containing the location of chromosomes, recorded as A file and B file respectively. For the chromosome position in A file, if there is overlap in the chromosome position in file An and file B, the chromosome position in file An and the chromosome position in file B, as well as the length of overlap are output.

$cat A.bed chr1 10 20 chr1 30 40

$cat B.bed chr1 15 20 chr1 18 25

$bedtools intersect-an A.bed-b B.bed-wo

Chr1 10 20 chr1 15 20 5

Chr1 10 20 chr1 18 25 2

The above is all the content of the article "how to intersect bedtools". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report