Skip to content
Martin Asser Hansen edited this page Oct 2, 2015 · 5 revisions

Biopiece: analyze_bed

Description

analyze_bed analyzes all BED entries in the stream and add the follow keys to each record which is practical for filtering BED records using grab.

  • EXONS - The number of exons in the current record.
  • EXON_LEN_0 - The length of the first exon in the current record.
  • EXON_LEN_1 - The lenght of the second exon (_2,_3, _4 for subsequent exons) in the current record.
  • EXON_LEN_-1 - The length of the last exon in the current record.
  • EXON_MAX_LEN - The maximum exon length in the stream.
  • EXON_MIN_LEN - The minimum exon length in the stream.
  • EXON_MEAN_LEN - The mean exon length in the stream.
  • INTRONS - The number of introns in the current record.
  • INTRON_LEN_0 - The length of the first intron in the current record.
  • INTRON_LEN_-1 - The length of the last intron in the current record.
  • INTRON_MAX_LEN - The maximum intron length in the stream.
  • INTRON_MIN_LEN - The minimum intron length in the stream.
  • INTRON_MEAN_LEN - The mean intron length in the stream._

See read_bed for more information about BED records.

Usage

... | analyze_bed [options]

Options

[-?         | --help]               #  Print full usage description.
[-I <file!> | --stream_in=<file!>]  #  Read input from stream file  -  Default=STDIN
[-O <file>  | --stream_out=<file>]  #  Write output to file         -  Default=STDOUT
[-v         | --verbose]            #  Verbose output.

Examples

Consider the following 5 BED entries in the file `test.bed':

chr4    31176   31602   AA695812        0       -       31176   31602   0       1       426,    0,
chr4    44448   44874   AA695812        0       -       44448   44874   0       1       426,    0,
chr4    50522   50841   AA142091        0       -       50522   50841   0       2       81,237, 0,82,
chr4    57489   57808   AA142091        0       -       57489   57808   0       2       81,237, 0,82,
chr4    59352   59778   AA695812        0       -       59352   59778   0       1       426,    0,

To analyze these entries read the BED file with read_bed:

read_bed -i test.bed | analyze_bed

EXON_MAX_LEN: 426
INTRONS: 0
Q_ID: AA695812
EXON_LEN_-1: 426
BED_LEN: 426
BLOCKCOUNT: 1
CHR: chr4
EXON_MEAN_LEN: 426
THICK_BEG: 31176
BLOCKSIZES: 426,
STRAND: -
CHR_END: 31601
THICK_END: 31601
SCORE: 0
CHR_BEG: 31176
REC_TYPE: BED
EXONS: 1
Q_BEGS: 0,
ITEMRGB: 0
EXON_MIN_LEN: 426
BED_COLS: 12
EXON_LEN_0: 426
---
EXON_MAX_LEN: 426
INTRONS: 0
Q_ID: AA695812
EXON_LEN_-1: 426
BED_LEN: 426
BLOCKCOUNT: 1
CHR: chr4
EXON_MEAN_LEN: 426
THICK_BEG: 44448
BLOCKSIZES: 426,
STRAND: -
CHR_END: 44873
THICK_END: 44873
SCORE: 0
CHR_BEG: 44448
REC_TYPE: BED
EXONS: 1
Q_BEGS: 0,
ITEMRGB: 0
EXON_MIN_LEN: 426
BED_COLS: 12
EXON_LEN_0: 426
---
INTRON_LEN_-1: 1
EXON_MAX_LEN: 237
INTRON_MEAN_LEN: 1
INTRON_MAX_LEN: 1
INTRONS: 1
Q_ID: AA142091
EXON_LEN_1: 237
EXON_LEN_-1: 237
BED_LEN: 319
BLOCKCOUNT: 2
CHR: chr4
EXON_MEAN_LEN: 159
THICK_BEG: 50522
BLOCKSIZES: 81,237,
STRAND: -
CHR_END: 50840
THICK_END: 50840
SCORE: 0
CHR_BEG: 50522
REC_TYPE: BED
INTRON_LEN_0: 1
EXONS: 2
INTRON_MIN_LEN: 1
Q_BEGS: 0,82,
ITEMRGB: 0
EXON_MIN_LEN: 81
BED_COLS: 12
EXON_LEN_0: 81
---
INTRON_LEN_-1: 1
EXON_MAX_LEN: 237
INTRON_MEAN_LEN: 1
INTRON_MAX_LEN: 1
INTRONS: 1
Q_ID: AA142091
EXON_LEN_1: 237
EXON_LEN_-1: 237
BED_LEN: 319
BLOCKCOUNT: 2
CHR: chr4
EXON_MEAN_LEN: 159
THICK_BEG: 57489
BLOCKSIZES: 81,237,
STRAND: -
CHR_END: 57807
THICK_END: 57807
SCORE: 0
CHR_BEG: 57489
REC_TYPE: BED
INTRON_LEN_0: 1
EXONS: 2
INTRON_MIN_LEN: 1
Q_BEGS: 0,82,
ITEMRGB: 0
EXON_MIN_LEN: 81
BED_COLS: 12
EXON_LEN_0: 81
---
EXON_MAX_LEN: 426
INTRONS: 0
Q_ID: AA695812
EXON_LEN_-1: 426
BED_LEN: 426
BLOCKCOUNT: 1
CHR: chr4
EXON_MEAN_LEN: 426
THICK_BEG: 59352
BLOCKSIZES: 426,
STRAND: -
CHR_END: 59777
THICK_END: 59777
SCORE: 0
CHR_BEG: 59352
REC_TYPE: BED
EXONS: 1
Q_BEGS: 0,
ITEMRGB: 0
EXON_MIN_LEN: 426
BED_COLS: 12
EXON_LEN_0: 426
---

See also

read_bed

grab

write_bed

Author

Martin Asser Hansen - Copyright (C) - All rights reserved.

[email protected]

August 2007

License

GNU General Public License version 2

http://www.gnu.org/copyleft/gpl.html

Help

analyze_bed is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally