class Bio::Sequence

DESCRIPTION

Bio::Sequence objects represent annotated sequences in bioruby. A Bio::Sequence object is a wrapper around the actual sequence, represented as either a Bio::Sequence::NA or a Bio::Sequence::AA object. For most users, this encapsulation will be completely transparent. Bio::Sequence responds to all methods defined for Bio::Sequence::NA/AA objects using the same arguments and returning the same values (even though these methods are not documented specifically for Bio::Sequence).

USAGE

# Create a nucleic or amino acid sequence
dna = Bio::Sequence.auto('atgcatgcATGCATGCAAAA')
rna = Bio::Sequence.auto('augcaugcaugcaugcaaaa')
aa = Bio::Sequence.auto('ACDEFGHIKLMNPQRSTVWYU')

# Print it out
puts dna.to_s
puts aa.to_s

# Get a subsequence, bioinformatics style (first nucleotide is '1')
puts dna.subseq(2,6)

# Get a subsequence, informatics style (first nucleotide is '0')
puts dna[2,6]

# Print in FASTA format
puts dna.output(:fasta)

# Print all codons
dna.window_search(3,3) do |codon|
  puts codon
end

# Splice or otherwise mangle your sequence
puts dna.splicing("complement(join(1..5,16..20))")
puts rna.splicing("complement(join(1..5,16..20))")

# Convert a sequence containing ambiguity codes into a
# regular expression you can use for subsequent searching
puts aa.to_re

# These should speak for themselves
puts dna.complement
puts dna.composition
puts dna.molecular_weight
puts dna.translate
puts dna.gc_percent