+++ /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: Extract subsequence from sequences in stream.
-
-Usage: ... | extract_seq [options]
-
-Options: [-b <int> | --beg=<int>] - Begin position of subsequence (first residue=1)
-Options: [-e <int> | --end=<int>] - End position of subsequence
-Options: [-l <int> | --len=<int>] - Length of subsequence
-Options: [-I <file> | --stream_in=<file>] - Read input from stream file - Default=STDIN
-Options: [-O <file> | --stream_out=<file>] - Write output to stream file - Default=STDOUT
-
-Examples: ... | extract_seq -b 1 -e 10 - Get the first 10 nucleotides of all sequences.
-Examples: ... | extract_seq -b 1 -l 10 - Get the first 10 nucleotides of all sequences.
-
--- /dev/null
+=Biopiece: extract_seq=
+
+==Synopsis==
+
+Extract subsequence from sequences in stream.
+
+==Description==
+
+[extract_seq] extracts a subsequence from a sequence in all records in the stream.
+The sequence is then _replaced_ with this subsequence.
+
+==Usage==
+
+{{{
+... | extract_seq [options]
+}}}
+
+==Options==
+
+{{{
+[-b <int> | --beg=<int>] - Begin position of subsequence (first residue=1)
+[-e <int> | --end=<int>] - End position of subsequence
+[-l <int> | --len=<int>] - Length of subsequence
+[-I <file> | --stream_in=<file>] - Read input from stream file - Default=STDIN
+[-O <file> | --stream_out=<file>] - Write output to stream file - Default=STDOUT
+}}}
+
+==Examples==
+
+Consider the following FASTA entry in the file `test.fna`:
+
+{{{
+>test
+ACGACGCATNNNNNNactgatcga
+}}}
+
+To obtains the subsequence from position 5 (first residue is 1) to postion 10 we
+first read in the sequence using [read_fasta] and then we pipe the stream to
+[extract_seq]:
+
+{{{
+read_fasta -i test.fna | extract_seq -b 5 -e 10
+
+SEQ: CGCATN
+SEQ_LEN: 6
+SEQ_NAME: test
+---
+}}}
+
+Note the positions (first position is 1 ) and the returned sequence:
+
+{{{
+1 10 20
+| | |
+123456789012345678901234
+ACGACGCATNNNNNNactgatcga
+}}}
+
+We could also have specified a length with `-l` instead of end postion with `-e`:
+
+{{{
+read_fasta -i test.fna | extract_seq -b 5 -l 5
+
+SEQ: CGCAT
+SEQ_LEN: 5
+SEQ_NAME: test
+---
+}}}
+
+Now, if we only specify the begin position, what happens?
+
+{{{
+read_fasta -i test.fna | extract_seq -b 5
+
+SEQ: CGCATNNNNNNactgatcga
+SEQ_LEN: 20
+SEQ_NAME: test
+---
+}}}
+
+Or if we only speficy the end postion?
+
+{{{
+read_fasta -i test.fna | extract_seq -b 5 -e 10
+
+SEQ: ACGACGCATN
+SEQ_LEN: 10
+SEQ_NAME: test
+---
+}}}
+
+Or what about if we only specify the length?
+
+{{{
+read_fasta -i test.fna | extract_seq -l 5
+
+SEQ: ACGAC
+SEQ_LEN: 5
+SEQ_NAME: test
+---
+}}}
+
+That is quite practical if we want the first five residues of all the sequences,
+but what if we want the five _last_ residues? Easy! We use [reverse_seq] to reverse
+the sequences, and then we get the first 5 residues (which in fact are the last
+five residues), and the we reverse the sequence again with [reverse_seq]:
+
+{{{
+read_fasta -i test.fna | reverse_seq | extract_seq -l 5 | reverse_seq
+
+SEQ: atcga
+SEQ_LEN: 5
+SEQ_NAME: test
+---
+}}}
+
+==See also==
+
+[read_fasta]
+
+[reverse_seq]
+
+[get_genome_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==
+
+[extract_seq] is part of the Biopieces framework.
+
+http://code.google.com/p/biopieces/
+++ /dev/null
-Author: Martin Asser Hansen - Copyright (C) - All rights reserved
-
-Contact: mail@maasha.dk
-
-Date: December 2007
-
-License: GNU General Public License version 2 (http://www.gnu.org/copyleft/gpl.html)
-
-Description: Sort records in the stream.
-
-Usage: ... | sort_records [options]
-
-Options: [-k <string> | --keys=<string>] - Comma separated list of keys to sort by. Append n for numeric sorting instead of alphabetic.
-Options: [-r | --reverse] - Reverse sort order.
-Options: [-I <file> | --stream_in=<file>] - Read input from stream file - Default=STDIN
-Options: [-O <file> | --stream_out=<file>] - Write output to stream file - Default=STDOUT
-
-Examples: ... | sort_records -k SEQ - Output records sorted alphabetically according to SEQ.
-Examples: ... | sort_records -k SEQ_LENn - Output records sorted numerically according to SEQ_LEN.
-Examples: ... | sort_records -k SEQ_LENn,SEQ -r - Output records in reverse order sorted according to SEQ_LEN and SEQ.
-
--- /dev/null
+=Biopiece: sort_records=
+
+==Synopsis==
+
+Sort records in the stream.
+
+==Description==
+
+[sort_records] sort records in the data stream using the values of a list of given keys.
+If values from the first key collides, then the next key's value is used, and so on.
+
+==Usage==
+
+{{{
+... | sort_records [options]
+}}}
+
+==Options==
+
+{{{
+[-k <string> | --keys=<string>] - Comma separated list of keys to sort by. Append n for numeric sorting instead of alphabetic.
+[-r | --reverse] - Reverse sort order.
+[-I <file> | --stream_in=<file>] - Read input from stream file - Default=STDIN
+[-O <file> | --stream_out=<file>] - Write output to stream file - Default=STDOUT
+}}}
+
+==Examples==
+
+Sort records alphabetically according to SEQ:
+
+{{{
+... | sort_records -k SEQ
+}}}
+
+Sort records numerically according to SEQ_LEN:
+
+{{{
+... | sort_records -k SEQ_LENn
+}}}
+
+Output records in reverse order sorted according to SEQ_LEN and SEQ:
+
+{{{
+... | sort_records -k SEQ_LENn,SEQ -r
+}}}
+
+==See also==
+
+
+==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==
+
+[sort_records] is part of the Biopieces framework.
+
+http://code.google.com/p/biopieces/