How do I transcribe a DNA Sequence to a RNA Sequence?

In BioRuby, DNA and RNA sequences are stored in the same Bio::Sequence::NA class just using different Alphabets, you can convert from DNA to RNA or RNA to DNA using the rna or dna methods, respectively.



#!/usr/bin/env ruby
require 'bio'
# make a DNA sequence
dna = Bio::Sequence::NA.new("atgccgaatcgtaa")
# transcribe it to RNA
rna = dna.rna
# just to prove it worked
puts dna # => "atgccgaatcgtaa"
puts rna # => "augccgaaucguaa"
# revert to the DNA again
puts rna.dna # => "atgccgaatcgtaa"

Share/Bookmark

No comments:

Post a Comment


Powered by  MyPagerank.Net

LinkWithin