From 22be2e3a8996a6eecc7f4d8453b66c08d194db76 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Tue, 1 Jul 2008 08:34:15 +0000 Subject: [PATCH] more wikis git-svn-id: http://biopieces.googlecode.com/svn/trunk@97 74ccb610-7750-0410-82ae-013aeee3265d --- bp_usage/extract_seq | 21 ------ bp_usage/extract_seq.wiki | 143 +++++++++++++++++++++++++++++++++++++ bp_usage/sort_records | 21 ------ bp_usage/sort_records.wiki | 68 ++++++++++++++++++ 4 files changed, 211 insertions(+), 42 deletions(-) delete mode 100644 bp_usage/extract_seq create mode 100644 bp_usage/extract_seq.wiki delete mode 100644 bp_usage/sort_records create mode 100644 bp_usage/sort_records.wiki diff --git a/bp_usage/extract_seq b/bp_usage/extract_seq deleted file mode 100644 index 78e0887..0000000 --- a/bp_usage/extract_seq +++ /dev/null @@ -1,21 +0,0 @@ -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 | --beg=] - Begin position of subsequence (first residue=1) -Options: [-e | --end=] - End position of subsequence -Options: [-l | --len=] - Length of subsequence -Options: [-I | --stream_in=] - Read input from stream file - Default=STDIN -Options: [-O | --stream_out=] - 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. - diff --git a/bp_usage/extract_seq.wiki b/bp_usage/extract_seq.wiki new file mode 100644 index 0000000..349fb17 --- /dev/null +++ b/bp_usage/extract_seq.wiki @@ -0,0 +1,143 @@ +=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 | --beg=] - Begin position of subsequence (first residue=1) +[-e | --end=] - End position of subsequence +[-l | --len=] - Length of subsequence +[-I | --stream_in=] - Read input from stream file - Default=STDIN +[-O | --stream_out=] - 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/ diff --git a/bp_usage/sort_records b/bp_usage/sort_records deleted file mode 100644 index 8cdce35..0000000 --- a/bp_usage/sort_records +++ /dev/null @@ -1,21 +0,0 @@ -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 | --keys=] - Comma separated list of keys to sort by. Append n for numeric sorting instead of alphabetic. -Options: [-r | --reverse] - Reverse sort order. -Options: [-I | --stream_in=] - Read input from stream file - Default=STDIN -Options: [-O | --stream_out=] - 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. - diff --git a/bp_usage/sort_records.wiki b/bp_usage/sort_records.wiki new file mode 100644 index 0000000..3164204 --- /dev/null +++ b/bp_usage/sort_records.wiki @@ -0,0 +1,68 @@ +=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 | --keys=] - Comma separated list of keys to sort by. Append n for numeric sorting instead of alphabetic. +[-r | --reverse] - Reverse sort order. +[-I | --stream_in=] - Read input from stream file - Default=STDIN +[-O | --stream_out=] - 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/ -- 2.39.5