Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
A new design for core functionality of the Bioruby project | ||
|
||
Pjotr Prins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# Nucleotides (abreviated nt) are molecules that, when joined together, make | ||
# up the structural units of RNA and DNA. In addition, nucleotides play | ||
# central roles in metabolism. | ||
# | ||
# The purines are adenine (A) and guanine (G). | ||
# The (complementary) pyrimidines are thymine (T) and cytosine (C). | ||
# In RNA uracil (U) is the complementary pyrimidine of adenine. | ||
# | ||
# >> Bio2::DNA::A.to_s | ||
# => "a" | ||
|
||
module Bio2 | ||
|
||
class Nucleotide | ||
end | ||
class Purine < Nucleotide | ||
end | ||
class Pyrimidine <Nucleotide | ||
end | ||
|
||
module DNA | ||
class A < Purine | ||
def to_s() | ||
"a" | ||
end | ||
end | ||
class G < Purine | ||
def to_s() | ||
"g" | ||
end | ||
end | ||
class T < Pyrimidine | ||
def to_s() | ||
"t" | ||
end | ||
end | ||
class C < Pyrimidine | ||
def to_s() | ||
"c" | ||
end | ||
end | ||
end # DNA | ||
|
||
module RNA | ||
class A < Purine | ||
def to_s() | ||
"a" | ||
end | ||
end | ||
class G < Purine | ||
def to_s() | ||
"g" | ||
end | ||
end | ||
class U < Pyrimidine | ||
def to_s() | ||
"u" | ||
end | ||
end | ||
class C < Pyrimidine | ||
def to_s() | ||
"c" | ||
end | ||
end | ||
end # RNA | ||
|
||
end # Bio2 |