]> git.donarmstrong.com Git - biopieces.git/blob - code_ruby/Maasha/lib/doc/classes/Seq.src/M000043.html
add dist option to find_adaptor
[biopieces.git] / code_ruby / Maasha / lib / doc / classes / Seq.src / M000043.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5   <title>complement (Seq)</title>
6   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7   <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
8 </head>
9 <body class="standalone-code">
10   <pre><span class="ruby-comment cmt"># File seq.rb, line 58</span>
11   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">complement</span>
12     <span class="ruby-identifier">raise</span> <span class="ruby-constant">SeqError</span>, <span class="ruby-value str">&quot;Cannot complement 0 length sequence&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
13
14     <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">is_dna</span>
15       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">seq</span>.<span class="ruby-identifier">tr!</span>( <span class="ruby-value str">'AGCUTRYWSMKHDVBNagcutrywsmkhdvbn'</span>, <span class="ruby-value str">'TCGAAYRWSKMDHBVNtcgaayrwskmdhbvn'</span> )
16     <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">is_rna</span>
17       <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">seq</span>.<span class="ruby-identifier">tr!</span>( <span class="ruby-value str">'AGCUTRYWSMKHDVBNagcutrywsmkhdvbn'</span>, <span class="ruby-value str">'UCGAAYRWSKMDHBVNucgaayrwskmdhbvn'</span> )
18     <span class="ruby-keyword kw">else</span>
19       <span class="ruby-identifier">raise</span> <span class="ruby-constant">SeqError</span>, <span class="ruby-node">&quot;Cannot complement sequence type: #{self.type}&quot;</span>
20     <span class="ruby-keyword kw">end</span>
21   <span class="ruby-keyword kw">end</span></pre>
22 </body>
23 </html>