+++ /dev/null
-Author: Martin Asser Hansen - Copyright (C) - All rights reserved
-
-Contact: mail@maasha.dk
-
-Date: August 2007
-
-License: GNU General Public License version 2 (http://www.gnu.org/copyleft/gpl.html)
-
-Description: Read BED data (Browser Extensible Data).
-
-Usage: read_bed [options] -i <BED file(s)>
-
-Options: [-i <file(s)> | --data_in=<file(s)>] - Read input data from file.
-Options: [-n <int> | --num=<int>] - Limit number of records to read.
-Options: [-I <file> | --stream_in=<file>] - Read input stream from file - Default=STDIN
-Options: [-O <file> | --stream_out=<file>] - Write output stream to file - Default=STDOUT
-
-Examples: read_bed -i test1.bed,test2.bed
-Examples: read_bed -i '*.bed'
-
-Keys out: CHR - Chromosome name.
-Keys out: CHR_BEG - Chromosome begin position.
-Keys out: CHR_END - Chromoeoms end position.
-Keys out: Q_ID - Query ID (feature name).
-Keys out: SCORE - Score.
-Keys out: STRAND - Strand.
-Keys out: THICK_BEG - The starting position at which the feature is drawn thickly.
-Keys out: THICK_END - The ending position at which the feature is drawn thickly.
-Keys out: ITEMRGB - An RGB value of the form R,G,B (e.g. 255,0,0).
-Keys out: BLOCKCOUNT - The number of blocks (exons) in the BED entry.
-Keys out: BLOCKSIZES - A comma separated list of the block sizes.
-Keys out: Q_BEGS - A comma separated list of block starts.
-Keys out: REC_TYPE - Record type.
-Keys out: BED_LEN - Length of BED entry.
-Keys out: BED_COLS - Number of columns in BED line.
--- /dev/null
+=Biopiece: read_bed=
+
+==Synopsis==
+
+Read BED data (Browser Extensible Data).
+
+==Description==
+
+The BED (Browser Extensible Data) format is a tabular format for data pertaining to one of the Eukaryotic genomes in the UCSC genome brower. The BED format consists
+of up to 12 columns, where the first three are mandatory.
+
+ # CHR - the name of the chromosome.
+ # CHR_BEG - the chromosome begin position.
+ # CHR_END - the chromosome end position.
+ # Q_ID - the name of the feature.
+ # SCORE - a score between 0 and 1000.
+ # STRAND - the orientation of the feature.
+ # THICK_BEG - begin position of 'thick' drawing used for UTRs.
+ # THICK_END - end position of 'thick' drawing used for UTRs.
+ # ITEMRGB - RGB color code for feature.
+ # BLOCKCOUNT - number of exon blocks.
+ # BLOCKSIZES - list of block sizes.
+ # Q_BEGS - list of block begins.
+
+Furthermore, an extra three helper columns are added to the record by [read_bed]:
+
+ # REC_TYPE - the type of record, here BED.
+ # BED_LEN - the length of the entire feature.
+ # BED_COLS - the number of BED columns (for speed).
+
+So a typical 12 column BED record looks like this:
+
+{{{
+STRAND: -
+Q_ID: AA695812
+CHR_END: 31601
+THICK_END: 31601
+SCORE: 0
+CHR_BEG: 31176
+BED_LEN: 426
+REC_TYPE: BED
+BLOCKCOUNT: 1
+CHR: chr4
+THICK_BEG: 31176
+Q_BEGS: 0,
+BLOCKSIZES: 426,
+ITEMRGB: 0
+BED_COLS: 12
+---
+}}}
+
+For more about the BED format:
+
+http://genome.ucsc.edu/FAQ/FAQformat#format1
+
+==Usage==
+
+{{{
+read_bed [options] -i <BED file(s)>
+}}}
+
+==Options==
+
+{{{
+[-i <file(s)> | --data_in=<file(s)>] - Comma separated list of files or glob expression to read.
+[-n <int> | --num=<int>] - Limit number of records to read.
+[-I <file> | --stream_in=<file>] - Read input stream from file - Default=STDIN
+[-O <file> | --stream_out=<file>] - Write output stream to file - Default=STDOUT
+}}}
+
+==Examples==
+
+To read all BED entries from a file:
+
+{{{
+read_bed -i test.bed
+}}}
+
+To read in only 10 records from a BED file:
+
+{{{
+read_bed -n 10 -i test.bed
+}}}
+
+To read all BED entries from multiple files:
+
+{{{
+read_bed -i test1.bed,test2.bed
+}}}
+
+To read BED entries from multiple files using a glob expression:
+
+{{{
+read_bed -i '*.bed'
+}}}
+
+
+==See also==
+
+[write_bed]
+
+==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==
+
+[read_bed] is part of the Biopieces framework.
+
+http://code.google.com/p/biopieces/
+