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 convert the format of files in Bedtools

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

Share

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

This article is to share with you about how to convert the file format in Bedtools, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

Using Bedtools to convert file format

Bedtools is a set of genome algorithm tools developed by the Quinlan Laboratory of the University of Utah. It can intersect, merge, count and transform widely used genomic data formats such as BAM, BED, GFF, VCF and so on. To learn more about Bedtools, please refer to the official tutorial: bedtools: a powerful toolset for genome arithmetic-bedtools 2.30.0 documentation.

Genomic features can be functional elements (such as genes) and gene polymorphisms (SNP, INDEL, SV). The most basic genomic features are their chromosomes, starting position, terminating position, positive and negative chain characteristics. The widely used genome formats are BED files and GFF files.

The Bedtools bamtobed command converts a BAM file to a BED file:

$bedtools bamtobed-I test.bam

-bedpe parameter, you can convert BAM format to BEDPE format. Only reads in pairs will be output. The default output format is BED format.

-bed12, which can output in BED12 format. The default output format is BED6 format.

-tag. You can use other tag in BAM as BED score. The default BED score value is the MAPQ value in the BAM file.

-cigar, which outputs the cigar value as the seventh column of the BED file.

The Bedtools bedtobam command is used to convert BED files to BAM files:

$bedtools bedtobam-I test.bed-g human.hg18.genome > test.bam

-mapq, sets the mapping quality of the output BAM file. The default mapping quality is 255mm.

-ubam, output the uncompressed BAM file, the default output is the compressed BAM file.

The Bedtools bamtofastq command is used to extract the fastq file from the matched BAM file:

$bedtools bamtofastq-I test.bam-fq test.fastq

-fq2, you can export pairs of fastq files to two files respectively, but the input BAM files need to sort reads by name first. Default-fq outputs fastq files.

The above is how to convert the file format in Bedtools. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please 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