From 00cf4322785a3cfe7a66c7f10fee861575197b21 Mon Sep 17 00:00:00 2001 From: martinahansen Date: Fri, 6 Aug 2010 13:50:06 +0000 Subject: [PATCH] added rdoc git-svn-id: http://biopieces.googlecode.com/svn/trunk@1045 74ccb610-7750-0410-82ae-013aeee3265d --- .../Maasha/lib/doc/classes/Biopieces.html | 301 +++++++++ .../doc/classes/Biopieces.src/M000001.html | 19 + .../doc/classes/Biopieces.src/M000002.html | 17 + .../doc/classes/Biopieces.src/M000003.html | 33 + .../doc/classes/Biopieces.src/M000005.html | 21 + .../doc/classes/Biopieces.src/M000006.html | 21 + .../Maasha/lib/doc/classes/CastError.html | 117 ++++ code_ruby/Maasha/lib/doc/classes/Casts.html | 187 ++++++ .../lib/doc/classes/Casts.src/M000007.html | 18 + .../Maasha/lib/doc/classes/OptionHandler.html | 615 ++++++++++++++++++ .../classes/OptionHandler.src/M000008.html | 18 + .../classes/OptionHandler.src/M000009.html | 57 ++ .../classes/OptionHandler.src/M000010.html | 17 + .../classes/OptionHandler.src/M000011.html | 15 + .../classes/OptionHandler.src/M000012.html | 25 + .../classes/OptionHandler.src/M000013.html | 27 + .../classes/OptionHandler.src/M000014.html | 19 + .../classes/OptionHandler.src/M000015.html | 33 + .../classes/OptionHandler.src/M000016.html | 24 + .../classes/OptionHandler.src/M000017.html | 17 + .../classes/OptionHandler.src/M000018.html | 19 + .../classes/OptionHandler.src/M000019.html | 19 + .../classes/OptionHandler.src/M000020.html | 17 + .../classes/OptionHandler.src/M000021.html | 19 + .../classes/OptionHandler.src/M000022.html | 17 + .../classes/OptionHandler.src/M000023.html | 20 + .../classes/OptionHandler.src/M000024.html | 19 + code_ruby/Maasha/lib/doc/classes/Seq.html | 275 ++++++++ .../lib/doc/classes/Seq.src/M000031.html | 25 + .../lib/doc/classes/Seq.src/M000032.html | 18 + .../lib/doc/classes/Seq.src/M000033.html | 15 + .../lib/doc/classes/Seq.src/M000034.html | 18 + .../lib/doc/classes/Seq.src/M000035.html | 15 + code_ruby/Maasha/lib/doc/classes/Seq/AA.html | 193 ++++++ .../lib/doc/classes/Seq/AA.src/M000036.html | 15 + .../lib/doc/classes/Seq/AA.src/M000037.html | 44 ++ code_ruby/Maasha/lib/doc/classes/Seq/NA.html | 130 ++++ .../Maasha/lib/doc/classes/Seq/NA/DNA.html | 217 ++++++ .../doc/classes/Seq/NA/DNA.src/M000038.html | 15 + .../doc/classes/Seq/NA/DNA.src/M000039.html | 15 + .../doc/classes/Seq/NA/DNA.src/M000040.html | 15 + .../Maasha/lib/doc/classes/Seq/NA/RNA.html | 217 ++++++ .../doc/classes/Seq/NA/RNA.src/M000041.html | 15 + .../doc/classes/Seq/NA/RNA.src/M000042.html | 15 + .../doc/classes/Seq/NA/RNA.src/M000043.html | 15 + code_ruby/Maasha/lib/doc/classes/Status.html | 268 ++++++++ .../lib/doc/classes/Status.src/M000025.html | 17 + .../lib/doc/classes/Status.src/M000026.html | 19 + .../lib/doc/classes/Status.src/M000027.html | 17 + .../lib/doc/classes/Status.src/M000028.html | 27 + .../lib/doc/classes/Status.src/M000029.html | 15 + code_ruby/Maasha/lib/doc/classes/Stream.html | 154 +++++ .../lib/doc/classes/Stream.src/M000030.html | 21 + code_ruby/Maasha/lib/doc/created.rid | 1 + .../Maasha/lib/doc/files/biopieces_rb.html | 108 +++ code_ruby/Maasha/lib/doc/files/seq_rb.html | 98 +++ code_ruby/Maasha/lib/doc/fr_class_index.html | 45 ++ code_ruby/Maasha/lib/doc/fr_file_index.html | 27 + code_ruby/Maasha/lib/doc/fr_method_index.html | 109 ++++ code_ruby/Maasha/lib/doc/index.html | 21 + code_ruby/Maasha/lib/doc/rdoc-style.css | 299 +++++++++ 61 files changed, 4249 insertions(+) create mode 100644 code_ruby/Maasha/lib/doc/classes/Biopieces.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000001.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000002.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000003.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000005.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000006.html create mode 100644 code_ruby/Maasha/lib/doc/classes/CastError.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Casts.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Casts.src/M000007.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000008.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000009.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000010.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000011.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000012.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000013.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000014.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000015.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000016.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000017.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000018.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000019.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000020.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000021.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000022.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000023.html create mode 100644 code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000024.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq.src/M000031.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq.src/M000032.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq.src/M000033.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq.src/M000034.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq.src/M000035.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/AA.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000036.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000037.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000038.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000039.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000040.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000041.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000042.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000043.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Status.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Status.src/M000025.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Status.src/M000026.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Status.src/M000027.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Status.src/M000028.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Status.src/M000029.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Stream.html create mode 100644 code_ruby/Maasha/lib/doc/classes/Stream.src/M000030.html create mode 100644 code_ruby/Maasha/lib/doc/created.rid create mode 100644 code_ruby/Maasha/lib/doc/files/biopieces_rb.html create mode 100644 code_ruby/Maasha/lib/doc/files/seq_rb.html create mode 100644 code_ruby/Maasha/lib/doc/fr_class_index.html create mode 100644 code_ruby/Maasha/lib/doc/fr_file_index.html create mode 100644 code_ruby/Maasha/lib/doc/fr_method_index.html create mode 100644 code_ruby/Maasha/lib/doc/index.html create mode 100644 code_ruby/Maasha/lib/doc/rdoc-style.css diff --git a/code_ruby/Maasha/lib/doc/classes/Biopieces.html b/code_ruby/Maasha/lib/doc/classes/Biopieces.html new file mode 100644 index 0000000..b5ad0f7 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Biopieces.html @@ -0,0 +1,301 @@ + + + + Class: Biopieces [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassBiopieces
In: + + + + + biopieces.rb + + + + +
+ +
Parent: + + Object + +
+
+ + +
+ +
+ +
+

+Biopieces are command line scripts and uses +OptionParser to parse command line options according to a list of casts. +Each cast prescribes the long and short name of the option, the type, if it +is mandatory, the default value, and allowed and disallowed values. An +optional list of extra casts can be supplied, and the integrity of the +casts are checked. Following the command line parsing, the options are +checked according to the casts. Methods are also included for handling the +parsing and emitting of Biopiece records, which are ASCII text records +consisting of lines with a key/value pair seperated by a colon and a white +space ’: ’. Each record is separated by a line with three +dashes ’—’. +

+ +
+ +
+ + +
+

Methods

+ +
+ + each   + + each_record   + + mktmpdir   + + new   + + parse   + + puts   + +
+
+ +
+ + + +
+ + + + + + +
+ +

Public Class methods

+ + +
+ + + + +
+ +

+Initialize a Biopiece and write the status to file. Options are for testing +purposes only. +

+ +
+
+ + +

Public Instance methods

+ + +
+ + +
+ + each() + +
+ +
+ +

+Alias for each_record +

+ +
+
+ + +
+ + + + +
+ +

+Open Biopiece input stream if not open and iterate over all Biopiece +records in the stream. +

+ +
+
+ + +
+ + + + +
+ +

+Create a temporary directory inside the ENV[“BP_TMP“] dir. +

+ +
+
+ + +
+ + + + +
+ +

+Check the integrity of a list of casts, followed by parsion options from +argv and finally checking the options according to the casts. Returns nil +if argv is empty, otherwise an options hash. +

+ +
+
+ + +
+ + + + +
+ +

+Open Biopiece output stream if not open and puts record to the stream. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000001.html b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000001.html new file mode 100644 index 0000000..5da85bc --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000001.html @@ -0,0 +1,19 @@ + + + + new (Biopieces) + + + + +
# File biopieces.rb, line 19
+  def initialize(test=nil, input=STDIN, output=STDOUT)
+    @test   = test
+    @input  = input
+    @output = output
+    @status = Status.new
+    @status.set unless @test
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000002.html b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000002.html new file mode 100644 index 0000000..38f8dca --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000002.html @@ -0,0 +1,17 @@ + + + + parse (Biopieces) + + + + +
# File biopieces.rb, line 30
+  def parse(argv, cast_list=[], script_path=$0)
+    casts          = Casts.new(cast_list)
+    option_handler = OptionHandler.new(argv, casts, script_path, @test)
+    @options       = option_handler.options_parse
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000003.html b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000003.html new file mode 100644 index 0000000..c1a10dd --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000003.html @@ -0,0 +1,33 @@ + + + + each_record (Biopieces) + + + + +
# File biopieces.rb, line 38
+  def each_record
+    @in = Stream::open(@options, mode="r", @input) unless @in.is_a? IO
+
+    record = {}
+
+    @in.each_line do |line|
+      case line
+      when /^([^:]+): (.*)$/
+        record[$1] = $2
+      when /^---$/
+        yield record unless record.empty?
+        record = {}
+      else
+        raise "Bad record format: #{line}"
+      end
+    end
+
+    yield record unless record.empty?
+
+    self # conventionally
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000005.html b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000005.html new file mode 100644 index 0000000..441f0ea --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000005.html @@ -0,0 +1,21 @@ + + + + puts (Biopieces) + + + + +
# File biopieces.rb, line 63
+  def puts(record)
+    @out = Stream::open(@options, mode="w", @output) unless @out.is_a? IO
+
+    record.each do |key,value|
+      @out.print "#{key}: #{value}\n"
+    end
+
+    @out.print "---\n"
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000006.html b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000006.html new file mode 100644 index 0000000..8c7cf6f --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Biopieces.src/M000006.html @@ -0,0 +1,21 @@ + + + + mktmpdir (Biopieces) + + + + +
# File biopieces.rb, line 74
+  def mktmpdir
+    time = Time.now.to_i
+    user = ENV["USER"]
+    pid  = $$
+    path = ENV["BP_TMP"] + "/" + [user, time + pid, pid, "bp_tmp"].join("_")
+    Dir.mkdir(path)
+    @status.set_tmpdir(path)
+    path
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/CastError.html b/code_ruby/Maasha/lib/doc/classes/CastError.html new file mode 100644 index 0000000..bec2260 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/CastError.html @@ -0,0 +1,117 @@ + + + + Class: CastError [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassCastError
In: + + + + + biopieces.rb + + + + +
+ +
Parent: + + StandardError + +
+
+ + +
+ +
+ +
+

+Error class for all exceptions to do with option casts. +

+ +
+ +
+ + +
+ + + +
+ + + + + + + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Casts.html b/code_ruby/Maasha/lib/doc/classes/Casts.html new file mode 100644 index 0000000..b0a6e48 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Casts.html @@ -0,0 +1,187 @@ + + + + Class: Casts [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassCasts
In: + + + + + biopieces.rb + + + + +
+ +
Parent: + + Array + +
+
+ + +
+ +
+ +
+

+Class to handle casts of command line options. Each cast prescribes the +long and short name of the option, the type, if it is mandatory, the +default value, and allowed and disallowed values. An optional list of extra +casts can be supplied, and the integrity of the casts are checked. +

+ +
+ +
+ + +
+

Methods

+ +
+ + new   + +
+
+ +
+ + + +
+ +
+

Constants

+ +
+ + + + + + + + + + + + + + + + +
TYPES=%w[flag string list int uint float file file! files files! dir dir! genome]
MANDATORY=%w[long short type mandatory default allowed disallowed]
+
+
+ + + + + + +
+ +

Public Class methods

+ + +
+ + + + +
+ +

+Initialize cast object with an optional options cast list to which +ubiquitous casts are added after which all casts are checked. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Casts.src/M000007.html b/code_ruby/Maasha/lib/doc/classes/Casts.src/M000007.html new file mode 100644 index 0000000..163a6aa --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Casts.src/M000007.html @@ -0,0 +1,18 @@ + + + + new (Casts) + + + + +
# File biopieces.rb, line 100
+  def initialize(cast_list=[])
+    @cast_list = cast_list
+    ubiquitous
+    check
+    self.push *@cast_list
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.html new file mode 100644 index 0000000..177aca6 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.html @@ -0,0 +1,615 @@ + + + + Class: OptionHandler [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassOptionHandler
In: + + + + + biopieces.rb + + + + +
+ +
Parent: + + Object + +
+
+ + +
+ +
+ +
+

+Class for parsing argv using OptionParser according to given casts. Default +options are set, file glob expressions expanded, and options are checked +according to the casts. Usage information is printed and exit called if +required. +

+ +
+ +
+ + + + +
+ + + +
+ +
+

Constants

+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
REGEX_LIST=/^(list|files|files!)$/
REGEX_INT=/^(int|uint)$/
REGEX_STRING=/^(string|file|file!|dir|dir!|genome)$/
+
+
+ + + + + + +
+ +

Public Class methods

+ + + + + +

Public Instance methods

+ + +
+ + + + +
+ +

+Check all options according to casts. +

+ +
+
+ + +
+ + + + +
+ +

+Check options and raise unless allowed. +

+ +
+
+ + +
+ + + + +
+ +

+Check dir! type argument and raise if directory don’t exist. +

+ +
+
+ + +
+ + + + +
+ +

+Check disallowed argument values and raise if disallowed. +

+ +
+
+ + +
+ + + + +
+ +

+Check file! type argument and raise if file don’t exists. +

+ +
+
+ + +
+ + + + +
+ +

+Check files! type argument and raise if files don’t exists. +

+ +
+
+ + +
+ + + + +
+ +

+Check int type option and raise if not an integer. +

+ +
+
+ + +
+ + + + +
+ +

+Check if a mandatory option is set and raise if it isn’t. +

+ +
+
+ + +
+ + + + +
+ +

+Check uint type option and raise if not an unsinged integer. +

+ +
+
+ + +
+ + + + +
+ +

+Set default options value from cast unless a value is set. +

+ +
+
+ + +
+ + + + +
+ +

+Expands glob expressions to a full list of paths. Examples: +“*.fna” or “foo.fna,*.fna” or +“foo.fna,/bar/*.fna“ +

+ +
+
+ + +
+ + + + +
+ +

+Parse options from argv using OptionParser and casts denoting long and +short option names. Usage information is printed and exit called. A hash +with options is returned. +

+ +
+
+ + +
+ + + + +
+ +

+Print usage info by Calling an external script ‘print_wiki’ +using a system() call and exit. An optional ‘full’ flag outputs +the full usage info. +

+ +
+
+ + +
+ + + + +
+ +

+Check if full “usage info” should be printed. +

+ +
+
+ + +
+ + + + +
+ +

+Check if short “usage info” should be printed. +

+ +
+
+ + +
+ + + + +
+ +

+Given the script name determine the path of the wiki file with the usage +info. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000008.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000008.html new file mode 100644 index 0000000..5a62bc6 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000008.html @@ -0,0 +1,18 @@ + + + + new (OptionHandler) + + + + +
# File biopieces.rb, line 225
+  def initialize(argv, casts, script_path, test=nil)
+    @argv        = argv
+    @casts       = casts
+    @script_path = script_path
+    @test        = test
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000009.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000009.html new file mode 100644 index 0000000..07ba638 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000009.html @@ -0,0 +1,57 @@ + + + + options_parse (OptionHandler) + + + + +
# File biopieces.rb, line 235
+  def options_parse
+    @options = {}
+
+    option_parser = OptionParser.new do |option|
+      @casts.each do |cast|
+        if cast[:type] == 'flag'
+          option.on("-#{cast[:short]}", "--#{cast[:long]}") do |o|
+            @options[cast[:long]] = o
+          end
+        elsif cast[:type] =~ REGEX_LIST
+          option.on( "-#{cast[:short]}", "--#{cast[:long]} A", Array) do |a|
+            @options[cast[:long]] = a
+          end
+        elsif cast[:type] =~ REGEX_INT
+          option.on("-#{cast[:short]}", "--#{cast[:long]} I", Integer) do |i|
+            @options[cast[:long]] = i
+          end
+        elsif cast[:type] =~ REGEX_STRING
+          option.on("-#{cast[:short]}", "--#{cast[:long]} S", String) do |s|
+            @options[cast[:long]] = s
+          end
+        elsif cast[:type] == 'float'
+          option.on("-#{cast[:short]}", "--#{cast[:long]} F", Float) do |f|
+            @options[cast[:long]] = f
+          end
+        else
+          raise ArgumentError, "Unknown option type: '#{cast[:type]}'"
+        end
+      end
+    end
+
+    option_parser.parse!(@argv)
+
+    if print_usage_full?
+      print_usage_and_exit(true)
+    elsif print_usage_short?
+      print_usage_and_exit
+    end
+
+    options_default
+    options_glob
+    options_check
+
+    @options
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000010.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000010.html new file mode 100644 index 0000000..92efe29 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000010.html @@ -0,0 +1,17 @@ + + + + wiki_path (OptionHandler) + + + + +
# File biopieces.rb, line 282
+  def wiki_path
+    path = ENV["BP_DIR"] + "/bp_usage/" + File.basename(@script_path) + ".wiki"
+    raise "No such wiki file: #{path}" unless File.file? path
+    path
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000011.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000011.html new file mode 100644 index 0000000..9ce7ab3 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000011.html @@ -0,0 +1,15 @@ + + + + print_usage_full? (OptionHandler) + + + + +
# File biopieces.rb, line 289
+  def print_usage_full?
+    @options["help"]
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000012.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000012.html new file mode 100644 index 0000000..f8d892f --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000012.html @@ -0,0 +1,25 @@ + + + + print_usage_short? (OptionHandler) + + + + +
# File biopieces.rb, line 294
+  def print_usage_short?
+    if not $stdin.tty?
+      return false
+    elsif @options["stream_in"]
+      return false
+    elsif @options["data_in"]
+      return false
+    elsif wiki_path =~ /^(list_biopieces|list_genomes|list_mysql_databases|biostat)$/  # TODO get rid of this!
+      return false
+    else
+      return true
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000013.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000013.html new file mode 100644 index 0000000..9da1eed --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000013.html @@ -0,0 +1,27 @@ + + + + print_usage_and_exit (OptionHandler) + + + + +
# File biopieces.rb, line 311
+  def print_usage_and_exit(full=nil)
+    if @test
+      return
+    else
+      if full
+        system("print_wiki --data_in #{wiki_path} --help")
+      else
+        system("print_wiki --data_in #{wiki_path}")
+      end
+
+      raise "Failed printing wiki: #{wiki_path}" unless $?.success?
+
+      exit
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000014.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000014.html new file mode 100644 index 0000000..e1c0dfb --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000014.html @@ -0,0 +1,19 @@ + + + + options_default (OptionHandler) + + + + +
# File biopieces.rb, line 328
+  def options_default
+    @casts.each do |cast|
+      if cast[:default]
+        @options[cast[:long]] = cast[:default] unless @options.has_key? cast[:long]
+      end
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000015.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000015.html new file mode 100644 index 0000000..d7730e8 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000015.html @@ -0,0 +1,33 @@ + + + + options_glob (OptionHandler) + + + + +
# File biopieces.rb, line 338
+  def options_glob
+    @casts.each do |cast|
+      if cast[:type] == 'files' or cast[:type] == 'files!'
+        if @options.has_key? cast[:long]
+          files = []
+        
+          @options[cast[:long]].each do |path|
+            if path.include? "*"
+              Dir.glob(path).each do |file|
+                files << file if File.file? file
+              end
+            else
+              files << path
+            end
+          end
+
+          @options[cast[:long]] = files
+        end
+      end
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000016.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000016.html new file mode 100644 index 0000000..b8bcc88 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000016.html @@ -0,0 +1,24 @@ + + + + options_check (OptionHandler) + + + + +
# File biopieces.rb, line 361
+  def options_check
+    @casts.each do |cast|
+      options_check_mandatory(cast)
+      options_check_int(cast)
+      options_check_uint(cast)
+      options_check_file(cast)
+      options_check_files(cast)
+      options_check_dir(cast)
+      options_check_allowed(cast)
+      options_check_disallowed(cast)
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000017.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000017.html new file mode 100644 index 0000000..10fb109 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000017.html @@ -0,0 +1,17 @@ + + + + options_check_mandatory (OptionHandler) + + + + +
# File biopieces.rb, line 375
+  def options_check_mandatory(cast)
+    if cast[:mandatory]
+      raise ArgumentError, "Mandatory argument: --#{cast[:long]}" unless @options.has_key? cast[:long]
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000018.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000018.html new file mode 100644 index 0000000..dfd342b --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000018.html @@ -0,0 +1,19 @@ + + + + options_check_int (OptionHandler) + + + + +
# File biopieces.rb, line 382
+  def options_check_int(cast)
+    if cast[:type] == 'int' and @options.has_key? cast[:long]
+      unless @options[cast[:long]].is_a? Integer
+        raise ArgumentError, "Argument to --#{cast[:long]} must be an integer, not '#{@options[cast[:long]]}'"
+      end
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000019.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000019.html new file mode 100644 index 0000000..601ea2c --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000019.html @@ -0,0 +1,19 @@ + + + + options_check_uint (OptionHandler) + + + + +
# File biopieces.rb, line 391
+  def options_check_uint(cast)
+    if cast[:type] == 'uint' and @options.has_key? cast[:long]
+      unless @options[cast[:long]].is_a? Integer and @options[cast[:long]] >= 0
+        raise ArgumentError, "Argument to --#{cast[:long]} must be an unsigned integer, not '#{@options[cast[:long]]}'"
+      end
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000020.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000020.html new file mode 100644 index 0000000..76b9b83 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000020.html @@ -0,0 +1,17 @@ + + + + options_check_file (OptionHandler) + + + + +
# File biopieces.rb, line 400
+  def options_check_file(cast)
+    if cast[:type] == 'file!' and @options.has_key? cast[:long]
+      raise ArgumentError, "No such file: '#{@options[cast[:long]]}'" unless File.file? @options[cast[:long]]
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000021.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000021.html new file mode 100644 index 0000000..500f639 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000021.html @@ -0,0 +1,19 @@ + + + + options_check_files (OptionHandler) + + + + +
# File biopieces.rb, line 407
+  def options_check_files(cast)
+    if cast[:type] == 'files!' and @options.has_key? cast[:long]
+      @options[cast[:long]].each do |path|
+        raise ArgumentError, "No such file: '#{path}'" unless File.file? path
+      end
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000022.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000022.html new file mode 100644 index 0000000..7ffff36 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000022.html @@ -0,0 +1,17 @@ + + + + options_check_dir (OptionHandler) + + + + +
# File biopieces.rb, line 416
+  def options_check_dir(cast)
+    if cast[:type] == 'dir!' and @options.has_key? cast[:long]
+      raise ArgumentError, "No such directory: '#{@options[cast[:long]]}'" unless File.directory? @options[cast[:long]]
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000023.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000023.html new file mode 100644 index 0000000..0ffe185 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000023.html @@ -0,0 +1,20 @@ + + + + options_check_allowed (OptionHandler) + + + + +
# File biopieces.rb, line 423
+  def options_check_allowed(cast)
+    if cast[:allowed] and @options.has_key? cast[:long]
+      allowed_hash = {}
+      cast[:allowed].split(',').each { |a| allowed_hash[a] = 1 }
+  
+      raise ArgumentError, "Argument '#{@options[cast[:long]]}' to --#{cast[:long]} not allowed" unless allowed_hash.has_key? @options[cast[:long]]
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000024.html b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000024.html new file mode 100644 index 0000000..db4ee6b --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/OptionHandler.src/M000024.html @@ -0,0 +1,19 @@ + + + + options_check_disallowed (OptionHandler) + + + + +
# File biopieces.rb, line 433
+  def options_check_disallowed(cast)
+    if cast[:disallowed] and @options.has_key? cast[:long]
+      cast[:disallowed].split(',').each do |val|
+        raise ArgumentError, "Argument '#{@options[cast[:long]]}' to --#{cast[:long]} is disallowed" if val == @options[cast[:long]]
+      end
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq.html b/code_ruby/Maasha/lib/doc/classes/Seq.html new file mode 100644 index 0000000..3f9c2ae --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq.html @@ -0,0 +1,275 @@ + + + + Class: Seq [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassSeq
In: + + + + + seq.rb + + + + +
+ +
Parent: + + String + +
+
+ + +
+ +
+ +
+

+Class containing generic sequence methods and nucleic acid and amino acid +subclasses. +

+ +
+ +
+ + +
+

Methods

+ +
+ + generate   + + generate!   + + guess_type   + + wrap   + + wrap!   + +
+
+ +
+ + + +
+ +
+

Classes and Modules

+ + Class Seq::AA
+Class Seq::NA
+ +
+ + + + + + +
+ +

Public Instance methods

+ + +
+ + + + +
+ +

+Method that generates a random sequence of a given length. +

+ +
+
+ + +
+ + + + +
+ +

+Method that replaces sequence with a randomly generated sequence of a given +length. +

+ +
+
+ + +
+ + + + +
+ +

+Guess the sequence type by analyzing the first 100 residues allowing for +ambiguity codes. +

+ +
+
+ + +
+ + + + +
+ +

+Method to wrap a sequence to a given width using a given delimiter. +

+ +
+
+ + +
+ + + + +
+ +

+Method to wrap and replace a sequence to a given width using a given +delimiter. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq.src/M000031.html b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000031.html new file mode 100644 index 0000000..1a623c0 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000031.html @@ -0,0 +1,25 @@ + + + + guess_type (Seq) + + + + +
# File seq.rb, line 4
+        def guess_type
+                raise ArgumentError, "No sequence." if self.empty?
+
+                seq_beg = self[ 0, 100 ].upcase
+
+                if seq_beg.count( "FLPQIE" ) > 0
+                        Seq::AA.new( self )
+                elsif seq_beg.count( "U" ) > 0
+                        Seq::NA::RNA.new( self )
+                else
+                        Seq::NA::DNA.new( self )
+                end
+        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq.src/M000032.html b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000032.html new file mode 100644 index 0000000..a03cc80 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000032.html @@ -0,0 +1,18 @@ + + + + wrap (Seq) + + + + +
# File seq.rb, line 19
+        def wrap( width = 80, delimit = "\n" )
+                raise ArgumentError, "Cannot wrap sequence to negative width: #{ width }." if width <= 0
+
+                self.delete!( " \t\n\r" )
+                self.gsub( /.{#{ width }}(?!$)/, "\\0#{ delimit }" )
+        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq.src/M000033.html b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000033.html new file mode 100644 index 0000000..a6e505c --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000033.html @@ -0,0 +1,15 @@ + + + + wrap! (Seq) + + + + +
# File seq.rb, line 27
+        def wrap!( width = 80, delimit = "\n" )
+                self.replace( self.wrap( width, delimit ) )
+        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq.src/M000034.html b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000034.html new file mode 100644 index 0000000..e50a92b --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000034.html @@ -0,0 +1,18 @@ + + + + generate (Seq) + + + + +
# File seq.rb, line 32
+        def generate( length )
+                raise ArgumentError, "Cannot generate negative sequence length: #{ length }." if length <= 0
+
+                alph = self.residues
+                Array.new( length ) { alph[ rand( alph.size ) ] }.join( "" )
+        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq.src/M000035.html b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000035.html new file mode 100644 index 0000000..8340c9a --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq.src/M000035.html @@ -0,0 +1,15 @@ + + + + generate! (Seq) + + + + +
# File seq.rb, line 40
+        def generate!( length )
+                self.replace( self.generate( length ) )
+        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/AA.html b/code_ruby/Maasha/lib/doc/classes/Seq/AA.html new file mode 100644 index 0000000..985ba72 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/AA.html @@ -0,0 +1,193 @@ + + + + Class: Seq::AA [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassSeq::AA
In: + + + + + seq.rb + + + + +
+ +
Parent: + + + + Seq + + + +
+
+ + +
+ +
+ +
+

+Class containing methods specific for amino acid (AA) +sequences. +

+ +
+ +
+ + +
+

Methods

+ +
+ + mol_weight   + + residues   + +
+
+ +
+ + + +
+ + + + + + +
+ +

Public Instance methods

+ + +
+ + + + +
+ +

+Calculate the molecular weight of an amino acid seuqunce. The caluculation +is only approximate since there is no correction for amino bond formation +and the MW used are somewhat imprecise: www.expasy.ch/tools/pscale/Molecularweight.html +

+ +
+
+ + +
+ + + + +
+ +

+Method that returns an array of amino acid residues. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000036.html b/code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000036.html new file mode 100644 index 0000000..db8e35b --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000036.html @@ -0,0 +1,15 @@ + + + + residues (Seq::AA) + + + + +
# File seq.rb, line 47
+                def residues
+                        %w{ F L S Y C W P H Q R I M T N K V A D E G }
+                end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000037.html b/code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000037.html new file mode 100644 index 0000000..6bf454b --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/AA.src/M000037.html @@ -0,0 +1,44 @@ + + + + mol_weight (Seq::AA) + + + + +
# File seq.rb, line 55
+                def mol_weight
+                        raise ArgumentError, "invalid residues found: #{self.delete("#{residues.join( "" )}")}" if self.upcase =~ /[^#{residues.join( "" )}]/
+
+                        mol_weight_aa = {
+                                "A" => 89.000,    # Ala
+                                "R" => 174.000,   # Arg
+                                "N" => 132.000,   # Asn
+                                "D" => 133.000,   # Asp
+                                "C" => 121.000,   # Cys
+                                "Q" => 146.000,   # Gln
+                                "E" => 147.000,   # Glu
+                                "G" => 75.000,    # Gly
+                                "H" => 155.000,   # His
+                                "I" => 131.000,   # Ile
+                                "L" => 131.000,   # Leu
+                                "K" => 146.000,   # Lys
+                                "M" => 149.000,   # Met
+                                "F" => 165.000,   # Phe
+                                "P" => 115.000,   # Pro
+                                "S" => 105.000,   # Ser
+                                "T" => 119.000,   # Thr
+                                "W" => 204.000,   # Trp
+                                "Y" => 181.000,   # Tyr
+                                "V" => 117.000,   # Val
+                        }
+
+                        mw = 0.0
+
+                        self.upcase.each_char { |c| mw += mol_weight_aa[ c ] }
+
+                        mw
+                end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA.html new file mode 100644 index 0000000..97c8ec4 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA.html @@ -0,0 +1,130 @@ + + + + Class: Seq::NA [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassSeq::NA
In: + + + + + seq.rb + + + + +
+ +
Parent: + + + + Seq + + + +
+
+ + +
+ +
+ +
+

+Class containing methods specific for nucleic acid (NA) sequences. +

+ +
+ +
+ + +
+ + + +
+ +
+

Classes and Modules

+ + Class Seq::NA::DNA
+Class Seq::NA::RNA
+ +
+ + + + + + + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.html new file mode 100644 index 0000000..778adf2 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.html @@ -0,0 +1,217 @@ + + + + Class: Seq::NA::DNA [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassSeq::NA::DNA
In: + + + + + seq.rb + + + + +
+ +
Parent: + + + + Seq::NA + + + +
+
+ + +
+ +
+ +
+

+Class containing methods specific for DNA sequences. +

+ +
+ +
+ + +
+

Methods

+ +
+ + complement   + + residues   + + to_RNA   + +
+
+ +
+ + + +
+ + + + + + +
+ +

Public Instance methods

+ + +
+ + + + +
+ +

+Method that complements DNA sequence including +ambiguity codes. +

+ +
+
+ + +
+ + + + +
+ +

+Method that returns an array of DNA residues. +

+ +
+
+ + +
+ + + + +
+ +

+Method to transcribe DNA to RNA. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000038.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000038.html new file mode 100644 index 0000000..cf7df44 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000038.html @@ -0,0 +1,15 @@ + + + + residues (Seq::NA::DNA) + + + + +
# File seq.rb, line 94
+                        def residues
+                                %w{ A T C G }
+                        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000039.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000039.html new file mode 100644 index 0000000..60835d9 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000039.html @@ -0,0 +1,15 @@ + + + + to_RNA (Seq::NA::DNA) + + + + +
# File seq.rb, line 99
+                        def to_RNA
+                                Seq::NA::RNA.new( self.tr( 'Tt', 'Uu' ) )
+                        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000040.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000040.html new file mode 100644 index 0000000..6e79d17 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/DNA.src/M000040.html @@ -0,0 +1,15 @@ + + + + complement (Seq::NA::DNA) + + + + +
# File seq.rb, line 104
+                        def complement
+                                self.tr!( 'AGCUTRYWSMKHDVBNagcutrywsmkhdvbn', 'TCGAAYRWSKMDHBVNtcgaayrwskmdhbvn' )
+                        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.html new file mode 100644 index 0000000..2345f3f --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.html @@ -0,0 +1,217 @@ + + + + Class: Seq::NA::RNA [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassSeq::NA::RNA
In: + + + + + seq.rb + + + + +
+ +
Parent: + + + + Seq::NA + + + +
+
+ + +
+ +
+ +
+

+Class containing methods specific for RNA sequences. +

+ +
+ +
+ + +
+

Methods

+ +
+ + complement   + + residues   + + to_DNA   + +
+
+ +
+ + + +
+ + + + + + +
+ +

Public Instance methods

+ + +
+ + + + +
+ +

+Method that complements RNA sequence including +ambiguity codes. +

+ +
+
+ + +
+ + + + +
+ +

+Method that returns an array of RNA residues. +

+ +
+
+ + +
+ + + + +
+ +

+Method to reverse transcribe RNA to DNA. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000041.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000041.html new file mode 100644 index 0000000..92655b3 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000041.html @@ -0,0 +1,15 @@ + + + + residues (Seq::NA::RNA) + + + + +
# File seq.rb, line 112
+                        def residues
+                                %w{ A U C G }
+                        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000042.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000042.html new file mode 100644 index 0000000..7307861 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000042.html @@ -0,0 +1,15 @@ + + + + to_DNA (Seq::NA::RNA) + + + + +
# File seq.rb, line 117
+                        def to_DNA
+                                Seq::NA::DNA.new( self.tr( 'Uu', 'Tt' ) )
+                        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000043.html b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000043.html new file mode 100644 index 0000000..7f5d3f2 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Seq/NA/RNA.src/M000043.html @@ -0,0 +1,15 @@ + + + + complement (Seq::NA::RNA) + + + + +
# File seq.rb, line 122
+                        def complement
+                                self.tr!( 'AGCUTRYWSMKHDVBNagcutrywsmkhdvbn', 'UCGAAYRWSKMDHBVNucgaayrwskmdhbvn' )
+                        end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Status.html b/code_ruby/Maasha/lib/doc/classes/Status.html new file mode 100644 index 0000000..2ca780f --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Status.html @@ -0,0 +1,268 @@ + + + + Class: Status [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassStatus
In: + + + + + biopieces.rb + + + + +
+ +
Parent: + + Object + +
+
+ + +
+ +
+ +
+

+Class for manipulating the execution status of Biopieces by setting a status file with a time +stamp, process id, and command arguments. The status file is used for +creating log entries and for displaying the runtime status of Biopieces. +

+ +
+ +
+ + +
+

Methods

+ +
+ + delete   + + get_tmpdir   + + log   + + set   + + set_tmpdir   + +
+
+ +
+ + + +
+ + + + + + +
+ +

Public Instance methods

+ + +
+ + + + +
+ +

+Delete status file. +

+ +
+
+ + +
+ + + + +
+ +

+Extract the temporary directory path from the status file, and return this +or nil if not found. +

+ +
+
+ + +
+ + + + +
+ +

+Write the Biopiece status to the log file. +

+ +
+
+ + +
+ + + + +
+ +

+Write the status to a status file. +

+ +
+
+ + +
+ + + + +
+ +

+Append the a temporary directory path to the status file. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Status.src/M000025.html b/code_ruby/Maasha/lib/doc/classes/Status.src/M000025.html new file mode 100644 index 0000000..5b625be --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Status.src/M000025.html @@ -0,0 +1,17 @@ + + + + set (Status) + + + + +
# File biopieces.rb, line 448
+  def set
+    time0  = Time.new.strftime("%Y-%m-%d %X")
+
+    File.open(path, mode="w") { |file| file.puts [time0, ARGV.join(" ")].join(";") }
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Status.src/M000026.html b/code_ruby/Maasha/lib/doc/classes/Status.src/M000026.html new file mode 100644 index 0000000..2951cbb --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Status.src/M000026.html @@ -0,0 +1,19 @@ + + + + set_tmpdir (Status) + + + + +
# File biopieces.rb, line 455
+  def set_tmpdir(tmp_path)
+    status = File.open(path, mode="r").read.chomp
+
+    File.open(path, mode="w") do |fh|
+      fh << [status, tmp_path].join(";") + "\n"
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Status.src/M000027.html b/code_ruby/Maasha/lib/doc/classes/Status.src/M000027.html new file mode 100644 index 0000000..cf79dfc --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Status.src/M000027.html @@ -0,0 +1,17 @@ + + + + get_tmpdir (Status) + + + + +
# File biopieces.rb, line 465
+  def get_tmpdir
+    tmp_path = File.open(path, mode="r").read.chomp.split(";").last
+
+    File.directory?(tmp_path) ? tmp_path : nil
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Status.src/M000028.html b/code_ruby/Maasha/lib/doc/classes/Status.src/M000028.html new file mode 100644 index 0000000..fea2bcb --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Status.src/M000028.html @@ -0,0 +1,27 @@ + + + + log (Status) + + + + +
# File biopieces.rb, line 472
+  def log(exit_status)
+    time1   = Time.new.strftime("%Y-%m-%d %X")
+    user    = ENV["USER"]
+    script  = File.basename($0)
+
+    stream = File.open(path)
+    time0, args, tmp_dir = stream.first.split(";")
+    stream.close
+
+    elap     = time_diff(time0, time1)
+    command  = [script, args].join(" ") 
+    log_file = ENV["BP_LOG"] + "/biopieces.log"
+
+    File.open(log_file, mode="a") { |file| file.puts [time0, time1, elap, user, exit_status, command].join("\t") }
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Status.src/M000029.html b/code_ruby/Maasha/lib/doc/classes/Status.src/M000029.html new file mode 100644 index 0000000..397c4bd --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Status.src/M000029.html @@ -0,0 +1,15 @@ + + + + delete (Status) + + + + +
# File biopieces.rb, line 489
+  def delete
+    File.delete(path)
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/classes/Stream.html b/code_ruby/Maasha/lib/doc/classes/Stream.html new file mode 100644 index 0000000..a1db5ee --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Stream.html @@ -0,0 +1,154 @@ + + + + Class: Stream [RDoc Documentation] + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
ClassStream
In: + + + + + biopieces.rb + + + + +
+ +
Parent: + + IO + +
+
+ + +
+ +
+ +
+ + +
+

Methods

+ +
+ + open   + +
+
+ +
+ + + +
+ + + + + + +
+ +

Public Class methods

+ + +
+ + + + +
+ +

+Open Biopieces output data stream for reading +from stdin or a file specified in options[“stream_in“] OR +writing to stdout or a file specified in options[“stream_out“]. +

+ +
+
+ + + +
+ + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/classes/Stream.src/M000030.html b/code_ruby/Maasha/lib/doc/classes/Stream.src/M000030.html new file mode 100644 index 0000000..55b2a87 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/classes/Stream.src/M000030.html @@ -0,0 +1,21 @@ + + + + open (Stream) + + + + +
# File biopieces.rb, line 514
+  def self.open(options, mode, stdio)
+    if mode == "r"
+      $stdin.tty? ? read(options["stream_in"]) : stdio
+    elsif mode == "w"
+      options["stream_out"] ? self.write(options["stream_out"], options["compress"]) : stdio
+    else
+      raise "Bad mode #{mode}"
+    end
+  end
+ + diff --git a/code_ruby/Maasha/lib/doc/created.rid b/code_ruby/Maasha/lib/doc/created.rid new file mode 100644 index 0000000..b6664bf --- /dev/null +++ b/code_ruby/Maasha/lib/doc/created.rid @@ -0,0 +1 @@ +Fri, 06 Aug 2010 15:47:42 +0200 diff --git a/code_ruby/Maasha/lib/doc/files/biopieces_rb.html b/code_ruby/Maasha/lib/doc/files/biopieces_rb.html new file mode 100644 index 0000000..e396f11 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/files/biopieces_rb.html @@ -0,0 +1,108 @@ + + + + File: biopieces.rb [RDoc Documentation] + + + + + + + + + +
+

biopieces.rb

+ + + + + + + + + +
Path:biopieces.rb + +
Last Update:2010-08-06 13:58:09 +0200
+
+ + +
+ +
+ +
+

Required files

+ +
+ + fileutils   + + date   + + optparse   + + open3   + + pp   + +
+
+ +
+ + +
+ + + +
+ + + + + + + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/files/seq_rb.html b/code_ruby/Maasha/lib/doc/files/seq_rb.html new file mode 100644 index 0000000..2d6aa87 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/files/seq_rb.html @@ -0,0 +1,98 @@ + + + + File: seq.rb [RDoc Documentation] + + + + + + + + + +
+

seq.rb

+ + + + + + + + + +
Path:seq.rb + +
Last Update:2009-08-10 09:00:55 +0200
+
+ + +
+ +
+ +
+

+Class containing generic sequence methods and nucleic acid and amino acid +subclasses. +

+ +
+ +
+ + +
+ + + +
+ + + + + + + + + +
+ +
+

[Validate]

+
+ + + diff --git a/code_ruby/Maasha/lib/doc/fr_class_index.html b/code_ruby/Maasha/lib/doc/fr_class_index.html new file mode 100644 index 0000000..6cdfd54 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/fr_class_index.html @@ -0,0 +1,45 @@ + + + + + Classes [RDoc Documentation] + + + + + +
+

Classes

+
+ + Biopieces
+ + CastError
+ + Casts
+ + OptionHandler
+ + Seq
+ + Seq::AA
+ + Seq::NA
+ + Seq::NA::DNA
+ + Seq::NA::RNA
+ + Status
+ + Stream
+ +
+
+ + diff --git a/code_ruby/Maasha/lib/doc/fr_file_index.html b/code_ruby/Maasha/lib/doc/fr_file_index.html new file mode 100644 index 0000000..e78e9be --- /dev/null +++ b/code_ruby/Maasha/lib/doc/fr_file_index.html @@ -0,0 +1,27 @@ + + + + + Files [RDoc Documentation] + + + + + +
+

Files

+
+ + biopieces.rb
+ + seq.rb
+ +
+
+ + diff --git a/code_ruby/Maasha/lib/doc/fr_method_index.html b/code_ruby/Maasha/lib/doc/fr_method_index.html new file mode 100644 index 0000000..3834175 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/fr_method_index.html @@ -0,0 +1,109 @@ + + + + + Methods [RDoc Documentation] + + + + + +
+

Methods

+ +
+ + diff --git a/code_ruby/Maasha/lib/doc/index.html b/code_ruby/Maasha/lib/doc/index.html new file mode 100644 index 0000000..b40cde7 --- /dev/null +++ b/code_ruby/Maasha/lib/doc/index.html @@ -0,0 +1,21 @@ + + + + + RDoc Documentation + + + + + + + + + + + diff --git a/code_ruby/Maasha/lib/doc/rdoc-style.css b/code_ruby/Maasha/lib/doc/rdoc-style.css new file mode 100644 index 0000000..cf8367d --- /dev/null +++ b/code_ruby/Maasha/lib/doc/rdoc-style.css @@ -0,0 +1,299 @@ +body { + font-family: Verdana,Arial,Helvetica,sans-serif; + font-size: 90%; + margin: 0; + margin-left: 40px; + padding: 0; + background: white; + color: black; +} + +h1, h2, h3, h4 { + margin: 0; + background: transparent; +} + +h1 { + font-size: 150%; +} + +h2,h3,h4 { + margin-top: 1em; +} + +:link, :visited { + background: #eef; + color: #039; + text-decoration: none; +} + +:link:hover, :visited:hover { + background: #039; + color: #eef; +} + +/* Override the base stylesheet's Anchor inside a table cell */ +td > :link, td > :visited { + background: transparent; + color: #039; + text-decoration: none; +} + +/* and inside a section title */ +.section-title > :link, .section-title > :visited { + background: transparent; + color: #eee; + text-decoration: none; +} + +/* === Structural elements =================================== */ + +.index { + margin: 0; + margin-left: -40px; + padding: 0; + font-size: 90%; +} + +.index :link, .index :visited { + margin-left: 0.7em; +} + +.index .section-bar { + margin-left: 0px; + padding-left: 0.7em; + background: #ccc; + font-size: small; +} + +#classHeader, #fileHeader { + width: auto; + color: white; + padding: 0.5em 1.5em 0.5em 1.5em; + margin: 0; + margin-left: -40px; + border-bottom: 3px solid #006; +} + +#classHeader :link, #fileHeader :link, +#classHeader :visited, #fileHeader :visited { + background: inherit; + color: white; +} + +#classHeader td, #fileHeader td { + background: inherit; + color: white; +} + +#fileHeader { + background: #057; +} + +#classHeader { + background: #048; +} + +.class-name-in-header { + font-size: 180%; + font-weight: bold; +} + +#bodyContent { + padding: 0 1.5em 0 1.5em; +} + +#description { + padding: 0.5em 1.5em; + background: #efefef; + border: 1px dotted #999; +} + +#description h1, #description h2, #description h3, +#description h4, #description h5, #description h6 { + color: #125; + background: transparent; +} + +#validator-badges { + text-align: center; +} + +#validator-badges img { + border: 0; +} + +#copyright { + color: #333; + background: #efefef; + font: 0.75em sans-serif; + margin-top: 5em; + margin-bottom: 0; + padding: 0.5em 2em; +} + +/* === Classes =================================== */ + +table.header-table { + color: white; + font-size: small; +} + +.type-note { + font-size: small; + color: #dedede; +} + +.section-bar { + color: #333; + border-bottom: 1px solid #999; + margin-left: -20px; +} + +.section-title { + background: #79a; + color: #eee; + padding: 3px; + margin-top: 2em; + margin-left: -30px; + border: 1px solid #999; +} + +.top-aligned-row { + vertical-align: top +} + +.bottom-aligned-row { + vertical-align: bottom +} + +#diagram img { + border: 0; +} + +/* --- Context section classes ----------------------- */ + +.context-row { } + +.context-item-name { + font-family: monospace; + font-weight: bold; + color: black; +} + +.context-item-value { + font-size: small; + color: #448; +} + +.context-item-desc { + color: #333; + padding-left: 2em; +} + +/* --- Method classes -------------------------- */ + +.method-detail { + background: #efefef; + padding: 0; + margin-top: 0.5em; + margin-bottom: 1em; + border: 1px dotted #ccc; +} + +.method-heading { + color: black; + background: #ccc; + border-bottom: 1px solid #666; + padding: 0.2em 0.5em 0 0.5em; +} + +.method-signature { + color: black; + background: inherit; +} + +.method-name { + font-weight: bold; +} + +.method-args { + font-style: italic; +} + +.method-description { + padding: 0 0.5em 0 0.5em; +} + +/* --- Source code sections -------------------- */ + +:link.source-toggle, :visited.source-toggle { + font-size: 90%; +} + +div.method-source-code { + background: #262626; + color: #ffdead; + margin: 1em; + padding: 0.5em; + border: 1px dashed #999; + overflow: auto; +} + +div.method-source-code pre { + color: #ffdead; +} + +/* --- Ruby keyword styles --------------------- */ + +.standalone-code { + background: #221111; + color: #ffdead; + overflow: auto; +} + +.ruby-constant { + color: #7fffd4; + background: transparent; +} + +.ruby-keyword { + color: #00ffff; + background: transparent; +} + +.ruby-ivar { + color: #eedd82; + background: transparent; +} + +.ruby-operator { + color: #00ffee; + background: transparent; +} + +.ruby-identifier { + color: #ffdead; + background: transparent; +} + +.ruby-node { + color: #ffa07a; + background: transparent; +} + +.ruby-comment { + color: #b22222; + font-weight: bold; + background: transparent; +} + +.ruby-regexp { + color: #ffa07a; + background: transparent; +} + +.ruby-value { + color: #7fffd4; + background: transparent; +} -- 2.39.5