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

Biopiece: write_bed

Description

write_bed outputs BED (Browser Extensible Data) records from the stream. The BED format consists of up to 12 columns, where the first three are mandatory.

  1. CHR - the name of the chromosome.
  2. CHR_BEG - the chromosome begin position.
  3. CHR_END - the chromosome end position.
  4. Q_ID - the name of the feature.
  5. SCORE - a score between 0 and 1000.
  6. STRAND - the orientation of the feature.
  7. THICK_BEG - begin position of 'thick' drawing used for UTRs.
  8. THICK_END - end position of 'thick' drawing used for UTRs.
  9. ITEMRGB - RGB color code for feature.
  10. BLOCKCOUNT - number of exon blocks.
  11. BLOCKSIZES - list of block sizes.
  12. Q_BEGS - list of block begins.

Records can be written to BED format if the REC_TYPE is either:

... and if S_ID key begins with 'chr'.

Also, generic records may be output as BED format if the record contains CHR, CHR_BEG, and CHR_END keys and if the CHR value begins with 'chr'.

The number of columns output can be specified with the -c switch. For more about the BED format:

http://genome.ucsc.edu/FAQ/FAQformat#format1

Usage

... | write_bed [options]

Options

[-?         | --help]               #  Print full usage description.
[-c <uint>  | --cols=<uint!>]       #  Number of columns to output.
[-C         | --check]              #  Check integrety of BED entries.
[-x         | --no_stream]          #  Do not emit records.
[-o <file>  | --data_out=<file>]    #  Write result to file.
[-I <file!> | --stream_in=<file!>]  #  Read input from stream file  -  Default=STDIN
[-O <file>  | --stream_out=<file>]  #  Write output to stream file  -  Default=STDOUT
[-Z         | --compress]           #  Compress output using gzip.
[-v         | --verbose]            #  Verbose output.

Examples

... | write_bed -xo test.bed

To write a 3 column BED file:

... | write_bed -c 3 -xo test.bed

To check the integrity of the BED entries use the -C switch, which will raise an error if the BED record is malformatted. This is useful if the Biopiece records have been modified:

... | write_bed -xCo test.bed

See also

read_bed

read_psl

blat_seq

patscan_seq

read_blast_tab

blast_seq

vmatch_seq

Author

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

mail@maasha.dk

August 2007

License

GNU General Public License version 2

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

Help

write_bed is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally