### Home Classes Methods

### In Files

- lib/bio/alignment.rb

### Parent

Object

### Methods

- ::new
- ::new2
- ::readfiles
- #<<
- #==
- #[]
- #__store__
- #add_seq
- #add_sequences
- #alignment_collect
- #collect!
- #collect_align
- #compact
- #compact!
- #concat
- #delete
- #do_align
- #dup
- #each
- #each_pair
- #each_seq
- #has_key?
- #index
- #isolate
- #lstrip
- #merge
- #merge!
- #new
- #normalize
- #number_of_sequences
- #order
- #purge
- #rehash
- #remove_all_gaps
- #remove_seq
- #replace_slice
- #rstrip
- #select
- #shift
- #size
- #store
- #strip
- #to_fasta
- #to_fasta_array
- #to_fastaformat_array
- #to_hash
- #unshift
- #values

### Included Modules

- Enumerable
- Bio::Alignment::HashExtension
- Bio::Alignment::OriginalPrivate

### Files

- ChangeLog
- KNOWN_ISSUES.rdoc
- LEGAL
- README.rdoc
- README_DEV.rdoc
- RELEASE_NOTES.rdoc
- Changes-1.3.rdoc
- RELEASE_NOTES-1.4.0.rdoc
- RELEASE_NOTES-1.4.1.rdoc
- RELEASE_NOTES-1.4.2.rdoc

### Class/Module Index

Quicksearch

- Bio
- Bio::AAindex
- Bio::AAindex1
- Bio::AAindex2
- Bio::Abif
- Bio::Abif::DirectoryEntry
- Bio::Alignment
- Bio::Alignment::ArrayExtension
- Bio::Alignment::EnumerableExtension
- Bio::Alignment::FactoryTemplate
- Bio::Alignment::FactoryTemplate::FileInFileOut
- Bio::Alignment::FactoryTemplate::FileInFileOutWithTree
- Bio::Alignment::FactoryTemplate::FileInStdoutOut
- Bio::Alignment::FactoryTemplate::Simple
- Bio::Alignment::FactoryTemplate::StdinInFileOut
- Bio::Alignment::FactoryTemplate::WrapInputStdin
- Bio::Alignment::FactoryTemplate::WrapInputTempfile
- Bio::Alignment::FactoryTemplate::WrapOutputStdout
- Bio::Alignment::FactoryTemplate::WrapOutputTempfile
- Bio::Alignment::GAP
- Bio::Alignment::HashExtension
- Bio::Alignment::MultiFastaFormat
- Bio::Alignment::OriginalAlignment
- Bio::Alignment::OriginalPrivate
- Bio::Alignment::Output
- Bio::Alignment::PropertyMethods
- Bio::Alignment::SequenceArray
- Bio::Alignment::SequenceHash
- Bio::Alignment::Site
- Bio::Alignment::SiteMethods
- Bio::AminoAcid
- Bio::AminoAcid::Data
- Bio::Blast
- Bio::Blast::Bl2seq
- Bio::Blast::Bl2seq::Report
- Bio::Blast::Bl2seq::Report::HSP
- Bio::Blast::Bl2seq::Report::Hit
- Bio::Blast::Bl2seq::Report::Iteration
- Bio::Blast::Default
- Bio::Blast::Default::Report
- Bio::Blast::Default::Report::HSP
- Bio::Blast::Default::Report::Hit
- Bio::Blast::Default::Report::Iteration
- Bio::Blast::Default::Report_TBlast
- Bio::Blast::Fastacmd
- Bio::Blast::NCBIOptions
- Bio::Blast::RPSBlast
- Bio::Blast::RPSBlast::RPSBlastSplitter
- Bio::Blast::RPSBlast::Report
- Bio::Blast::RPSBlast::Report::FLATFILE_SPLITTER
- Bio::Blast::RPSBlast::Report::Iteration
- Bio::Blast::Remote
- Bio::Blast::Remote::DDBJ
- Bio::Blast::Remote::DDBJ::Information
- Bio::Blast::Remote::Ddbj
- Bio::Blast::Remote::GenomeNet
- Bio::Blast::Remote::GenomeNet::Information
- Bio::Blast::Remote::Genomenet
- Bio::Blast::Remote::Information
- Bio::Blast::Report
- Bio::Blast::Report::BlastXmlSplitter
- Bio::Blast::Report::FLATFILE_SPLITTER
- Bio::Blast::Report::Hit
- Bio::Blast::Report::Hsp
- Bio::Blast::Report::Iteration
- Bio::Blast::Report_tab
- Bio::Blast::WU
- Bio::Blast::WU::Report
- Bio::Blast::WU::Report::HSP
- Bio::Blast::WU::Report::Hit
- Bio::Blast::WU::Report::Iteration
- Bio::Blast::WU::Report_TBlast
- Bio::Blat
- Bio::Blat::Report
- Bio::Blat::Report::FLATFILE_SPLITTER
- Bio::Blat::Report::Hit
- Bio::Blat::Report::SegmentPair
- Bio::Blat::Report::SeqDesc
- Bio::ClustalW
- Bio::ClustalW::Report
- Bio::CodonTable
- Bio::ColorScheme
- Bio::Command
- Bio::Command::Tmpdir
- Bio::Command::Tmpdir::Remover
- Bio::ContingencyTable
- Bio::DAS
- Bio::DAS::DNA
- Bio::DAS::DSN
- Bio::DAS::ENTRY_POINT
- Bio::DAS::FEATURE
- Bio::DAS::GFF
- Bio::DAS::GROUP
- Bio::DAS::LINK
- Bio::DAS::SEGMENT
- Bio::DAS::SEQUENCE
- Bio::DAS::TARGET
- Bio::DAS::TYPE
- Bio::DAS::TYPES
- Bio::DB
- Bio::DBGET
- Bio::DDBJ
- Bio::DDBJ::REST
- Bio::DDBJ::REST::Blast
- Bio::DDBJ::REST::ClustalW
- Bio::DDBJ::REST::DDBJ
- Bio::DDBJ::REST::Mafft
- Bio::DDBJ::REST::RequestManager
- Bio::DDBJ::REST::WABItemplate
- Bio::DDBJ::XML
- Bio::DDBJ::XML::Blast
- Bio::DDBJ::XML::ClustalW
- Bio::DDBJ::XML::DDBJ
- Bio::DDBJ::XML::Fasta
- Bio::DDBJ::XML::GetEntry
- Bio::DDBJ::XML::Gib
- Bio::DDBJ::XML::Gtop
- Bio::DDBJ::XML::PML
- Bio::DDBJ::XML::RequestManager
- Bio::DDBJ::XML::RequestManager::REST
- Bio::DDBJ::XML::SRS
- Bio::DDBJ::XML::TxSearch
- Bio::EBI
- Bio::EBI::SOAP
- Bio::EBI::SOAP::Citation
- Bio::EBI::SOAP::ClustalW
- Bio::EBI::SOAP::Dbfetch
- Bio::EBI::SOAP::Emboss
- Bio::EBI::SOAP::Fasta
- Bio::EBI::SOAP::InterProScan
- Bio::EBI::SOAP::MPsrch
- Bio::EBI::SOAP::MSD
- Bio::EBI::SOAP::Muscle
- Bio::EBI::SOAP::Ontology
- Bio::EBI::SOAP::ScanPS
- Bio::EBI::SOAP::TCoffee
- Bio::EBI::SOAP::WUBlast
- Bio::EMBL
- Bio::EMBLDB
- Bio::EMBLDB::Common
- Bio::EMBOSS
- Bio::Ensembl
- Bio::Ensembl::Base
- Bio::Ensembl::Human
- Bio::Ensembl::Mouse
- Bio::FANTOM
- Bio::FANTOM::MaXML
- Bio::FANTOM::MaXML::Annotation
- Bio::FANTOM::MaXML::Annotation::DataSrc
- Bio::FANTOM::MaXML::Annotations
- Bio::FANTOM::MaXML::Cluster
- Bio::FANTOM::MaXML::Sequence
- Bio::FANTOM::MaXML::Sequences
- Bio::Fasta
- Bio::Fasta::Report
- Bio::Fasta::Report::FLATFILE_SPLITTER
- Bio::Fasta::Report::FastaFormat10Splitter
- Bio::Fasta::Report::Hit
- Bio::Fasta::Report::Hit::Query
- Bio::Fasta::Report::Hit::Target
- Bio::Fasta::Report::Program
- Bio::FastaDefline
- Bio::FastaFormat
- Bio::FastaNumericFormat
- Bio::Fastq
- Bio::Fastq::Error
- Bio::Fastq::Error::Diff_ids
- Bio::Fastq::Error::Long_qual
- Bio::Fastq::Error::No_atmark
- Bio::Fastq::Error::No_ids
- Bio::Fastq::Error::No_qual
- Bio::Fastq::Error::No_seq
- Bio::Fastq::Error::Qual_char
- Bio::Fastq::Error::Qual_range
- Bio::Fastq::Error::Seq_char
- Bio::Fastq::Error::Short_qual
- Bio::Fastq::Error::Skipped_unformatted_lines
- Bio::Fastq::FLATFILE_SPLITTER
- Bio::Fastq::FormatData
- Bio::Fastq::FormatData::FASTQ_ILLUMINA
- Bio::Fastq::FormatData::FASTQ_SANGER
- Bio::Fastq::FormatData::FASTQ_SOLEXA
- Bio::Feature
- Bio::Feature::Qualifier
- Bio::Features
- Bio::Fetch
- Bio::FlatFile
- Bio::FlatFile::AutoDetect
- Bio::FlatFile::AutoDetect::RuleDebug
- Bio::FlatFile::AutoDetect::RuleProc
- Bio::FlatFile::AutoDetect::RuleRegexp
- Bio::FlatFile::AutoDetect::RuleRegexp2
- Bio::FlatFile::AutoDetect::RuleSpecial
- Bio::FlatFile::AutoDetect::RuleTemplate
- Bio::FlatFile::AutoDetect::RulesArray
- Bio::FlatFile::BufferedInputStream
- Bio::FlatFile::Splitter
- Bio::FlatFile::Splitter::Default
- Bio::FlatFile::Splitter::LineOriented
- Bio::FlatFile::Splitter::Template
- Bio::FlatFile::UnknownDataFormatError
- Bio::FlatFileIndex
- Bio::FlatFileIndex::BDB_1
- Bio::FlatFileIndex::BDB_1::BDBMappingFile
- Bio::FlatFileIndex::BDB_1::PrimaryNameSpace
- Bio::FlatFileIndex::BDB_1::SecondaryNameSpace
- Bio::FlatFileIndex::BDBdefault
- Bio::FlatFileIndex::BDBwrapper
- Bio::FlatFileIndex::DEBUG
- Bio::FlatFileIndex::DataBank
- Bio::FlatFileIndex::FileID
- Bio::FlatFileIndex::FileIDs
- Bio::FlatFileIndex::Flat_1
- Bio::FlatFileIndex::Flat_1::FlatMappingFile
- Bio::FlatFileIndex::Flat_1::PrimaryNameSpace
- Bio::FlatFileIndex::Flat_1::Record
- Bio::FlatFileIndex::Flat_1::SecondaryNameSpace
- Bio::FlatFileIndex::Indexer
- Bio::FlatFileIndex::Indexer::NameSpace
- Bio::FlatFileIndex::Indexer::NameSpaces
- Bio::FlatFileIndex::Indexer::Parser
- Bio::FlatFileIndex::Indexer::Parser::BlastDefaultParser
- Bio::FlatFileIndex::Indexer::Parser::EMBLParser
- Bio::FlatFileIndex::Indexer::Parser::FastaFormatParser
- Bio::FlatFileIndex::Indexer::Parser::GenBankParser
- Bio::FlatFileIndex::Indexer::Parser::GenPeptParser
- Bio::FlatFileIndex::Indexer::Parser::MaXMLClusterParser
- Bio::FlatFileIndex::Indexer::Parser::MaXMLSequenceParser
- Bio::FlatFileIndex::Indexer::Parser::PDBChemicalComponentParser
- Bio::FlatFileIndex::Indexer::Parser::SPTRParser
- Bio::FlatFileIndex::Indexer::Parser::TemplateParser
- Bio::FlatFileIndex::NameSpaces
- Bio::FlatFileIndex::Results
- Bio::FlatFileIndex::Template
- Bio::FlatFileIndex::Template::NameSpace
- Bio::GCG
- Bio::GCG::Msf
- Bio::GCG::Seq
- Bio::GFF
- Bio::GFF::GFF2
- Bio::GFF::GFF2::Escape
- Bio::GFF::GFF2::MetaData
- Bio::GFF::GFF2::Record
- Bio::GFF::GFF2::Record::Value
- Bio::GFF::GFF3
- Bio::GFF::GFF3::Escape
- Bio::GFF::GFF3::Record
- Bio::GFF::GFF3::Record::Gap
- Bio::GFF::GFF3::Record::Gap::Code
- Bio::GFF::GFF3::Record::Target
- Bio::GFF::GFF3::RecordBoundary
- Bio::GFF::GFF3::SequenceRegion
- Bio::GFF::Record
- Bio::GO
- Bio::GO::External2go
- Bio::GO::GeneAssociation
- Bio::GO::Ontology
- Bio::GenBank
- Bio::GenBank::Locus
- Bio::GenPept
- Bio::GenPept::Locus
- Bio::Genscan
- Bio::Genscan::Report
- Bio::Genscan::Report::Exon
- Bio::Genscan::Report::Gene
- Bio::HGC
- Bio::HGC::HiGet
- Bio::HMMER
- Bio::HMMER::Report
- Bio::HMMER::Report::Hit
- Bio::HMMER::Report::Hsp
- Bio::Hinv
- Bio::Hinv::Acc2hit
- Bio::Hinv::Common
- Bio::Hinv::Hit2acc
- Bio::Hinv::HitCnt
- Bio::Hinv::HitDefinition
- Bio::Hinv::HitPubmedId
- Bio::Hinv::HitXML
- Bio::Hinv::Hix2hit
- Bio::Hinv::HixCnt
- Bio::Hinv::HixRepresent
- Bio::Hinv::HixXML
- Bio::Hinv::IdSearch
- Bio::Hinv::KeywordSearch
- Bio::Iprscan
- Bio::Iprscan::Report
- Bio::Iprscan::Report::Match
- Bio::KEGG
- Bio::KEGG::API
- Bio::KEGG::BRITE
- Bio::KEGG::COMPOUND
- Bio::KEGG::Common
- Bio::KEGG::Common::DblinksAsHash
- Bio::KEGG::Common::GenesAsHash
- Bio::KEGG::Common::ModulesAsHash
- Bio::KEGG::Common::OrthologsAsHash
- Bio::KEGG::Common::PathwaysAsHash
- Bio::KEGG::Common::References
- Bio::KEGG::Common::StringsAsHash
- Bio::KEGG::DRUG
- Bio::KEGG::ENZYME
- Bio::KEGG::EXPRESSION
- Bio::KEGG::GENES
- Bio::KEGG::GENOME
- Bio::KEGG::GLYCAN
- Bio::KEGG::KGML
- Bio::KEGG::KGML::Entry
- Bio::KEGG::KGML::Graphics
- Bio::KEGG::KGML::Product
- Bio::KEGG::KGML::Reaction
- Bio::KEGG::KGML::Relation
- Bio::KEGG::KGML::Substrate
- Bio::KEGG::KGML::SubstrateProduct
- Bio::KEGG::Keggtab
- Bio::KEGG::Keggtab::DB
- Bio::KEGG::MODULE
- Bio::KEGG::ORTHOLOGY
- Bio::KEGG::PATHWAY
- Bio::KEGG::REACTION
- Bio::KEGG::Taxonomy
- Bio::KEGGDB
- Bio::LITDB
- Bio::Lasergene
- Bio::Location
- Bio::Locations
- Bio::MAFFT
- Bio::MAFFT::Report
- Bio::MEDLINE
- Bio::Map
- Bio::Map::ActsLikeMap
- Bio::Map::ActsLikeMarker
- Bio::Map::Mapping
- Bio::Map::Marker
- Bio::Map::SimpleMap
- Bio::Meme
- Bio::Meme::Mast
- Bio::Meme::Mast::Report
- Bio::Meme::Motif
- Bio::Muscle
- Bio::NBRF
- Bio::NCBI
- Bio::NCBI::REST
- Bio::NCBI::REST::EFetch
- Bio::NCBI::REST::EFetch::Methods
- Bio::NCBI::REST::ESearch
- Bio::NCBI::REST::ESearch::Methods
- Bio::NCBI::SOAP
- Bio::NCBI::SOAP::EFetch
- Bio::NCBI::SOAP::EFetchLite
- Bio::NCBI::SOAP::EUtils
- Bio::NCBI::SOAP::EUtilsLite
- Bio::NCBIDB
- Bio::NCBIDB::Common
- Bio::Newick
- Bio::Newick::Edge
- Bio::Newick::Node
- Bio::Newick::ParseError
- Bio::Nexus
- Bio::Nexus::CharactersBlock
- Bio::Nexus::DataBlock
- Bio::Nexus::DistancesBlock
- Bio::Nexus::GenericBlock
- Bio::Nexus::NexusMatrix
- Bio::Nexus::NexusMatrix::NexusMatrixError
- Bio::Nexus::NexusParseError
- Bio::Nexus::TaxaBlock
- Bio::Nexus::TreesBlock
- Bio::Nexus::Util
- Bio::NucleicAcid
- Bio::NucleicAcid::Data
- Bio::PAML
- Bio::PAML::Baseml
- Bio::PAML::Baseml::Report
- Bio::PAML::Codeml
- Bio::PAML::Codeml::Model
- Bio::PAML::Codeml::PositiveSite
- Bio::PAML::Codeml::PositiveSites
- Bio::PAML::Codeml::Rates
- Bio::PAML::Codeml::Report
- Bio::PAML::Codeml::ReportError
- Bio::PAML::Codeml::ReportSingle
- Bio::PAML::Common
- Bio::PAML::Common::Report
- Bio::PAML::Yn00
- Bio::PAML::Yn00::Report
- Bio::PDB
- Bio::PDB::AtomFinder
- Bio::PDB::Chain
- Bio::PDB::ChainFinder
- Bio::PDB::ChemicalComponent
- Bio::PDB::ChemicalComponent::Record
- Bio::PDB::Coordinate
- Bio::PDB::DataType
- Bio::PDB::DataType::ConstLikeMethod
- Bio::PDB::DataType::Pdb_AChar
- Bio::PDB::DataType::Pdb_Atom
- Bio::PDB::DataType::Pdb_Character
- Bio::PDB::DataType::Pdb_Date
- Bio::PDB::DataType::Pdb_IDcode
- Bio::PDB::DataType::Pdb_Integer
- Bio::PDB::DataType::Pdb_LString
- Bio::PDB::DataType::Pdb_List
- Bio::PDB::DataType::Pdb_Real
- Bio::PDB::DataType::Pdb_Residue_name
- Bio::PDB::DataType::Pdb_SList
- Bio::PDB::DataType::Pdb_Specification_list
- Bio::PDB::DataType::Pdb_String
- Bio::PDB::DataType::Pdb_StringRJ
- Bio::PDB::DataType::Pdb_SymOP
- Bio::PDB::HetatmFinder
- Bio::PDB::Heterogen
- Bio::PDB::HeterogenFinder
- Bio::PDB::Model
- Bio::PDB::ModelFinder
- Bio::PDB::Record
- Bio::PDB::Record::ANISOU
- Bio::PDB::Record::ATOM
- Bio::PDB::Record::HETATM
- Bio::PDB::Record::Jrnl
- Bio::PDB::Record::Remark1
- Bio::PDB::Record::Remark2
- Bio::PDB::Residue
- Bio::PDB::ResidueFinder
- Bio::PDB::Utils
- Bio::PROSITE
- Bio::PSORT
- Bio::PSORT::CGIDriver
- Bio::PSORT::IPSORT
- Bio::PSORT::PSORT1
- Bio::PSORT::PSORT1::Remote
- Bio::PSORT::PSORT1::Report
- Bio::PSORT::PSORT2
- Bio::PSORT::PSORT2::Remote
- Bio::PSORT::PSORT2::Report
- Bio::PSORT::PSORTB
- Bio::PSORT::WoLF_PSORT
- Bio::PTS1
- Bio::PTS1::Report
- Bio::Pathway
- Bio::Phylip
- Bio::Phylip::DistanceMatrix
- Bio::Phylip::PhylipFormat
- Bio::PhyloXML
- Bio::PhyloXML::Accession
- Bio::PhyloXML::Annotation
- Bio::PhyloXML::BinaryCharacters
- Bio::PhyloXML::BranchColor
- Bio::PhyloXML::CladeRelation
- Bio::PhyloXML::Confidence
- Bio::PhyloXML::Date
- Bio::PhyloXML::Distribution
- Bio::PhyloXML::DomainArchitecture
- Bio::PhyloXML::Events
- Bio::PhyloXML::Id
- Bio::PhyloXML::Node
- Bio::PhyloXML::Other
- Bio::PhyloXML::Parser
- Bio::PhyloXML::Point
- Bio::PhyloXML::Polygon
- Bio::PhyloXML::Property
- Bio::PhyloXML::ProteinDomain
- Bio::PhyloXML::Reference
- Bio::PhyloXML::Sequence
- Bio::PhyloXML::SequenceRelation
- Bio::PhyloXML::Taxonomy
- Bio::PhyloXML::Tree
- Bio::PhyloXML::Uri
- Bio::PhyloXML::Writer
- Bio::Probcons
- Bio::PubMed
- Bio::REBASE
- Bio::RefSeq
- Bio::Reference
- Bio::References
- Bio::Registry
- Bio::Registry::DB
- Bio::RestrictionEnzyme
- Bio::RestrictionEnzyme::Analysis
- Bio::RestrictionEnzyme::CutSymbol
- Bio::RestrictionEnzyme::CutSymbol::CutSymbol__
- Bio::RestrictionEnzyme::DenseIntArray
- Bio::RestrictionEnzyme::DoubleStranded
- Bio::RestrictionEnzyme::DoubleStranded::AlignedStrands
- Bio::RestrictionEnzyme::DoubleStranded::CutLocationPair
- Bio::RestrictionEnzyme::DoubleStranded::CutLocationPairInEnzymeNotation
- Bio::RestrictionEnzyme::DoubleStranded::CutLocations
- Bio::RestrictionEnzyme::DoubleStranded::CutLocationsInEnzymeNotation
- Bio::RestrictionEnzyme::DoubleStranded::EnzymeAction
- Bio::RestrictionEnzyme::Fragments
- Bio::RestrictionEnzyme::Range
- Bio::RestrictionEnzyme::Range::CutRange
- Bio::RestrictionEnzyme::Range::CutRanges
- Bio::RestrictionEnzyme::Range::HorizontalCutRange
- Bio::RestrictionEnzyme::Range::SequenceRange
- Bio::RestrictionEnzyme::Range::SequenceRange::CalculatedCuts
- Bio::RestrictionEnzyme::Range::SequenceRange::Fragment
- Bio::RestrictionEnzyme::Range::SequenceRange::Fragments
- Bio::RestrictionEnzyme::Range::VerticalCutRange
- Bio::RestrictionEnzyme::SingleStrand
- Bio::RestrictionEnzyme::SingleStrand::CutLocationsInEnzymeNotation
- Bio::RestrictionEnzyme::SingleStrandComplement
- Bio::RestrictionEnzyme::SortedNumArray
- Bio::RestrictionEnzyme::StringFormatting
- Bio::SOAPWSDL
- Bio::SOFT
- Bio::SOSUI
- Bio::SOSUI::Report
- Bio::SOSUI::Report::TMH
- Bio::SPTR
- Bio::SQL
- Bio::SQL::Biodatabase
- Bio::SQL::Bioentry
- Bio::SQL::BioentryDbxref
- Bio::SQL::BioentryPath
- Bio::SQL::BioentryQualifierValue
- Bio::SQL::BioentryReference
- Bio::SQL::BioentryRelationship
- Bio::SQL::Biosequence
- Bio::SQL::Comment
- Bio::SQL::Dbxref
- Bio::SQL::DbxrefQualifierValue
- Bio::SQL::DummyBase
- Bio::SQL::Location
- Bio::SQL::LocationQualifierValue
- Bio::SQL::Ontology
- Bio::SQL::Reference
- Bio::SQL::Seqfeature
- Bio::SQL::SeqfeatureDbxref
- Bio::SQL::SeqfeaturePath
- Bio::SQL::SeqfeatureQualifierValue
- Bio::SQL::SeqfeatureRelationship
- Bio::SQL::Sequence
- Bio::SQL::Taxon
- Bio::SQL::TaxonName
- Bio::SQL::Term
- Bio::SQL::TermDbxref
- Bio::SQL::TermPath
- Bio::SQL::TermRelationship
- Bio::SQL::TermRelationshipTerm
- Bio::SQL::TermSynonym
- Bio::SangerChromatogram
- Bio::Scf
- Bio::Sequence
- Bio::Sequence::AA
- Bio::Sequence::Adapter
- Bio::Sequence::Adapter::BioSQL
- Bio::Sequence::Adapter::EMBL
- Bio::Sequence::Adapter::FastaFormat
- Bio::Sequence::Adapter::FastaNumericFormat
- Bio::Sequence::Adapter::Fastq
- Bio::Sequence::Adapter::GenBank
- Bio::Sequence::Adapter::SangerChromatogram
- Bio::Sequence::Common
- Bio::Sequence::DBLink
- Bio::Sequence::Format
- Bio::Sequence::Format::AminoFormatter
- Bio::Sequence::Format::Formatter
- Bio::Sequence::Format::Formatter::Fasta
- Bio::Sequence::Format::Formatter::Fasta_ncbi
- Bio::Sequence::Format::Formatter::Fasta_numeric
- Bio::Sequence::Format::Formatter::Fastq
- Bio::Sequence::Format::Formatter::Fastq_illumina
- Bio::Sequence::Format::Formatter::Fastq_sanger
- Bio::Sequence::Format::Formatter::Fastq_solexa
- Bio::Sequence::Format::Formatter::Qual
- Bio::Sequence::Format::Formatter::Raw
- Bio::Sequence::Format::FormatterBase
- Bio::Sequence::Format::INSDFeatureHelper
- Bio::Sequence::Format::NucFormatter
- Bio::Sequence::Format::NucFormatter::Embl
- Bio::Sequence::Format::NucFormatter::Genbank
- Bio::Sequence::NA
- Bio::Sequence::NA::MidiTrack
- Bio::Sequence::QualityScore
- Bio::Sequence::QualityScore::Converter
- Bio::Sequence::QualityScore::Phred
- Bio::Sequence::QualityScore::Solexa
- Bio::Sequence::SequenceMasker
- Bio::Shell
- Bio::Shell::ColoredCodonTable
- Bio::Shell::Core
- Bio::Shell::Demo
- Bio::Shell::Ghost
- Bio::Shell::Irb
- Bio::Shell::Private
- Bio::Shell::Script
- Bio::Shell::Setup
- Bio::Shell::Web
- Bio::Shell::Web::Results
- Bio::SiRNA
- Bio::SiRNA::Pair
- Bio::SiRNA::ShRNA
- Bio::Sim4
- Bio::Sim4::Report
- Bio::Sim4::Report::Hit
- Bio::Sim4::Report::Segment
- Bio::Sim4::Report::SegmentPair
- Bio::Sim4::Report::SeqDesc
- Bio::Spidey
- Bio::Spidey::Report
- Bio::Spidey::Report::Hit
- Bio::Spidey::Report::Segment
- Bio::Spidey::Report::SegmentPair
- Bio::Spidey::Report::SeqDesc
- Bio::SwissProt
- Bio::TMHMM
- Bio::TMHMM::Report
- Bio::TMHMM::TMH
- Bio::TRANSFAC
- Bio::TRANSFAC::CELL
- Bio::TRANSFAC::CLASS
- Bio::TRANSFAC::FACTOR
- Bio::TRANSFAC::GENE
- Bio::TRANSFAC::MATRIX
- Bio::TRANSFAC::SITE
- Bio::TargetP
- Bio::TargetP::Report
- Bio::Taxonomy
- Bio::Tcoffee
- Bio::Tcoffee::DEFAULT_PARSER
- Bio::TogoWS
- Bio::TogoWS::AccessWait
- Bio::TogoWS::REST
- Bio::TrEMBL
- Bio::Tree
- Bio::Tree::Edge
- Bio::Tree::NoPathError
- Bio::Tree::Node
- Bio::UniProt
- BiorubyController
- BiorubyGenerator
- BiorubyHelper
- Hash
- Object
- String

No matching classes.

# Bio::Alignment::OriginalAlignment

Bio::Alignment::OriginalAlignment is the BioRuby original multiple sequence alignment container class. It includes HashExtension.

It is recommended only to use methods defined in EnumerableExtension (and the each_seq method). The method only defined in this class might be obsoleted in the future.

### Attributes

keys[R]

identifiers (or definitions or names) of the sequences

### Public Class Methods

new(seqs = []) click to toggle source

Creates a new alignment object. seqs may be one of follows: an array of sequences (or strings), an array of sequence database objects, an alignment object.

    # File lib/bio/alignment.rb, line 1553
    def initialize(seqs = [])
      @seqs = {}
      @keys = []
      self.add_sequences(seqs)
    end

new2(*arg) click to toggle source

Creates a new alignment object from given arguments.

It will be obsoleted.

    # File lib/bio/alignment.rb, line 1544
    def self.new2(*arg)
      self.new(arg)
    end

readfiles(*files) click to toggle source

Read files and creates a new alignment object.

It will be obsoleted.

    # File lib/bio/alignment.rb, line 1530
    def self.readfiles(*files)
      require 'bio/io/flatfile'
      aln = self.new
      files.each do |fn|
        Bio::FlatFile.open(nil, fn) do |ff|
          aln.add_sequences(ff)
        end
      end
      aln
    end

### Public Instance Methods

<<(seq) click to toggle source

Adds a sequence without key. The key is automatically determined.

    # File lib/bio/alignment.rb, line 1709
    def <<(seq)
      #(Array-like)
      self.store(nil, seq)
      self
    end

==(x) click to toggle source

If x is the same value, returns true. Otherwise, returns false.

    # File lib/bio/alignment.rb, line 1561
    def ==(x)
      #(original)
      if x.is_a?(self.class)
        self.to_hash == x.to_hash
      else
        false
      end
    end

[](*arg) click to toggle source

Gets a sequence. (Like Hash#[])

    # File lib/bio/alignment.rb, line 1716
    def [](*arg)
      #(Hash-like)
      @seqs[*arg]
    end

__store__(key, seq) click to toggle source

stores a sequences with the name

key | name of the sequence
seq | sequence

    # File lib/bio/alignment.rb, line 1614
    def __store__(key, seq)
      #(Hash-like)
      h = { key => seq }
      @keys << h.keys[0]
      @seqs.update(h)
      seq
    end

add_seq(seq, key = nil) click to toggle source

Adds a sequence to the alignment. Returns key if succeeded. Returns nil (and not added to the alignment) if key is already used.

It resembles BioPerl's AlignI::add_seq method.

    # File lib/bio/alignment.rb, line 1905
    def add_seq(seq, key = nil)
      #(BioPerl) AlignI::add_seq like method
      unless seq.is_a?(Bio::Sequence::NA) or seq.is_a?(Bio::Sequence::AA)
        s =   extract_seq(seq)
        key = extract_key(seq) unless key
        seq = s
      end
      self.store(key, seq)
    end

add_sequences(seqs) click to toggle source

Adds sequences to the alignment. seqs may be one of follows: an array of sequences (or strings), an array of sequence database objects, an alignment object.

    # File lib/bio/alignment.rb, line 1581
    def add_sequences(seqs)
      if block_given? then
        seqs.each do |x|
          s, key = yield x
          self.store(key, s)
        end
      else
        if seqs.is_a?(self.class) then
          seqs.each_pair do |k, s|
            self.store(k, s)
          end
        elsif seqs.respond_to?(:each_pair)
          seqs.each_pair do |k, x|
            s = extract_seq(x)
            self.store(k, s)
          end
        else
          seqs.each do |x|
            s = extract_seq(x)
            k = extract_key(x)
            self.store(k, s)
          end
        end
      end
      self
    end

alignment_collect() click to toggle source

Iterates over each sequence and each results running block are collected and returns a new alignment.

The method name 'collect_align' will be obsoleted. Please use 'alignment_collect' instead.

    # File lib/bio/alignment.rb, line 1864
    def alignment_collect
      #(original)
      na = self.class.new
      na.set_all_property(get_all_property)
      self.each_pair do |k, s|
        na.store(k, yield(s))
      end
      na
    end

Also aliased as: collect_align
collect!() click to toggle source

Iterates over each sequence, replacing the sequence with the value returned by the block.

    # File lib/bio/alignment.rb, line 1756
    def collect!
      #(Array-like)
      @keys.each do |k|
        @seqs[k] = yield @seqs[k]
      end
    end

collect_align() click to toggle source
Alias for: alignment_collect
compact() click to toggle source

Removes empty sequences or nil and returns new alignment. (Like Array#compact)

    # File lib/bio/alignment.rb, line 1893
    def compact
      #(Array-like)
      na = self.dup
      na.compact!
      na
    end

compact!() click to toggle source

Removes empty sequences or nil in the alignment. (Like Array#compact!)

    # File lib/bio/alignment.rb, line 1877
    def compact!
      #(Array-like)
      d = []
      self.each_pair do |k, s|
        if !s or s.empty?
          d << k
        end
      end
      d.each do |k|
        self.delete(k)
      end
      d.empty? ? nil : d
    end

concat(aln) click to toggle source

Concatenates a string or an alignment. Returns self.

Note that the method will be obsoleted. Please use `each_seq { |s| s << str }` for concatenating a string and `alignment_concat(aln)` for concatenating an alignment.

    # File lib/bio/alignment.rb, line 2038
    def concat(aln)
      #(String-like)
      if aln.respond_to?(:to_str) then #aln.is_a?(String)
        self.each do |s|
          s << aln
        end
        self
      else
        alignment_concat(aln)
      end
    end

delete(key) click to toggle source

Removes the sequence whose key is key. Returns the removed sequence. If not found, returns nil.

    # File lib/bio/alignment.rb, line 1695
    def delete(key)
      #(Hash-like)
      @keys.delete(key)
      @seqs.delete(key)
    end

do_align(factory) click to toggle source

Performs multiple alignment by using external program.

    # File lib/bio/alignment.rb, line 2076
    def do_align(factory)
      a0 = self.class.new
      (0...self.size).each { |i| a0.store(i, self.order(i)) }
      r = factory.query(a0)
      a1 = r.alignment
      a0.keys.each do |k|
        unless a1[k.to_s] then
          raise 'alignment result is inconsistent with input data'
        end
      end
      a2 = self.new
      a0.keys.each do |k|
        a2.store(self.keys[k], a1[k.to_s])
      end
      a2
    end

dup() click to toggle source

Duplicates the alignment

    # File lib/bio/alignment.rb, line 1778
    def dup
      #(Hash-like)
      self.new(self)
    end

each() click to toggle source

Iterates over each sequence. (Like Array#each)

    # File lib/bio/alignment.rb, line 1737
    def each
      #(Array-like)
      @keys.each do |k|
        yield @seqs[k]
      end
    end

Also aliased as: each_seq
each_pair() click to toggle source

Iterates over each key and sequence. (Like Hash#each_pair)

    # File lib/bio/alignment.rb, line 1747
    def each_pair
      #(Hash-like)
      @keys.each do |k|
        yield k, @seqs[k]
      end
    end

each_seq() click to toggle source
Alias for: each
has_key?(key) click to toggle source

If the key exists, returns true. Otherwise, returns false. (Like Hash#has_key?)

    # File lib/bio/alignment.rb, line 1730
    def has_key?(key)
      #(Hash-like)
      @seqs.has_key?(key)
    end

index(seq) click to toggle source

Returns the key for a given sequence. If not found, returns nil.

    # File lib/bio/alignment.rb, line 1822
    def index(seq)
      #(Hash-like)
      last_key = nil
      self.each_pair do |k, s|
        last_key = k
        if s.class == seq.class then
          r = (s == seq)
        else
          r = (s.to_s == seq.to_s)
        end
        break if r
      end
      last_key
    end

isolate(*arg) click to toggle source

Sequences in the alignment are duplicated. If keys are given to the argument, sequences of given keys are duplicated.

It will be obsoleted.

    # File lib/bio/alignment.rb, line 1842
    def isolate(*arg)
      #(original)
      if arg.size == 0 then
        self.collect! do |s|
          seqclass.new(s)
        end
      else
        arg.each do |k|
          if self.has_key?(k) then
            s = self.delete(key)
            self.store(k, seqclass.new(s))
          end
        end
      end
      self
    end

lstrip() click to toggle source

Not-destructive version of alignment_lstrip!. Returns a new alignment.

    # File lib/bio/alignment.rb, line 2000
    def lstrip
      #(String-like)
      na = self.dup
      na.isolate
      na.alignment_lstrip!
      na
    end

merge(*other) click to toggle source

Merges given alignment and returns a new alignment.

    # File lib/bio/alignment.rb, line 1788
    def merge(*other)
      #(Hash-like)
      na = self.new(self)
      na.merge!(*other)
      na
    end

merge!(*other) click to toggle source

Merge given alignment. Note that it is destructive method.

    # File lib/bio/alignment.rb, line 1797
    def merge!(*other)
      #(Hash-like)
      if block_given? then
        other.each do |aln|
          aln.each_pair do |k, s|
            if self.has_key?(k) then
              s = yield k, self[k], s
              self.to_hash.store(k, s)
            else
              self.store(k, s)
            end
          end
        end
      else
        other.each do |aln|
          aln.each_pair do |k, s|
            self.delete(k) if self.has_key?(k)
            self.store(k, s)
          end
        end
      end
      self
    end

normalize() click to toggle source

Not-destructive version of alignment_normalize!. Returns a new alignment.

    # File lib/bio/alignment.rb, line 1981
    def normalize
      #(original)
      na = self.dup
      na.alignment_normalize!
      na
    end

number_of_sequences() click to toggle source
Alias for: size
order(n) click to toggle source

Gets the n-th sequence. If not found, returns nil.

    # File lib/bio/alignment.rb, line 1687
    def order(n)
      #(original)
      @seqs[@keys[n]]
    end

purge(*arg) click to toggle source

Removes sequences from the alignment by given keys. Returns an alignment object consists of removed sequences.

It resembles BioPerl's AlignI::purge method.

    # File lib/bio/alignment.rb, line 1932
    def purge(*arg)
      #(BioPerl) AlignI::purge like method
      purged = self.new
      arg.each do |k|
        if self[k] then
          purged.store(k, self.delete(k))
        end
      end
      purged
    end

rehash() click to toggle source

Reconstructs internal data structure. (Like Hash#rehash)

    # File lib/bio/alignment.rb, line 1651
    def rehash
      @seqs.rehash
      oldkeys = @keys
      tmpkeys = @seqs.keys
      @keys.collect! do |k|
        tmpkeys.delete(k)
      end
      @keys.compact!
      @keys.concat(tmpkeys)
      self
    end

remove_all_gaps() click to toggle source

Not-destructive version of remove_gaps!. Returns a new alignment.

The method name 'remove_gap' will be obsoleted. Please use 'remove_all_gaps' instead.

    # File lib/bio/alignment.rb, line 2023
    def remove_all_gaps
      #(original)
      na = self.dup
      na.isolate
      na.remove_all_gaps!
      na
    end

remove_seq(seq) click to toggle source

Removes given sequence from the alignment. Returns removed sequence. If nothing removed, returns nil.

It resembles BioPerl's AlignI::remove_seq.

    # File lib/bio/alignment.rb, line 1919
    def remove_seq(seq)
      #(BioPerl) AlignI::remove_seq like method
      if k = self.index(seq) then
        self.delete(k)
      else
        nil
      end
    end

replace_slice(aln, *arg) click to toggle source

Replace the specified region of the alignment to aln.

aln | String or Bio::Alignment object
arg | same format as String#slice

It will be obsoleted.

    # File lib/bio/alignment.rb, line 2055
    def replace_slice(aln, *arg)
      #(original)
      if aln.respond_to?(:to_str) then #aln.is_a?(String)
        self.each do |s|
          s[*arg] = aln
        end
      elsif aln.is_a?(self.class) then
        aln.each_pair do |k, s|
          self[k][*arg] = s
        end
      else
        i = 0
        aln.each do |s|
          self.order(i)[*arg] = s
          i += 1
        end
      end
      self
    end

rstrip() click to toggle source

Not-destructive version of alignment_rstrip!. Returns a new alignment.

    # File lib/bio/alignment.rb, line 1990
    def rstrip
      #(String-like)
      na = self.dup
      na.isolate
      na.alignment_rstrip!
      na
    end

select(*arg) click to toggle source

If block is given, it acts like Array#select (Enumerable#select). Returns a new alignment containing all sequences of the alignment for which return value of given block is not false nor nil.

If no block is given, it acts like the BioPerl's AlignI::select. Returns a new alignment containing sequences of given keys.

The BioPerl's AlignI::select-like action will be obsoleted.

    # File lib/bio/alignment.rb, line 1951
    def select(*arg)
      #(original)
      na = self.new
      if block_given? then
        # 'arg' is ignored
        # nearly same action as Array#select (Enumerable#select)
        self.each_pair.each do |k, s|
          na.store(k, s) if yield(s)
        end
      else
        # BioPerl's AlignI::select like function
        arg.each do |k|
          if s = self[k] then
            na.store(k, s)
          end
        end
      end
      na
    end

shift() click to toggle source

Removes the first sequence in the alignment and returns [ key, seq ].

    # File lib/bio/alignment.rb, line 1675
    def shift
      k = @keys.shift
      if k then
        s = @seqs.delete(k)
        [ k, s ]
      else
        nil
      end
    end

size() click to toggle source

Number of sequences in the alignment.

    # File lib/bio/alignment.rb, line 1722
    def size
      #(Hash&Array-like)
      @seqs.size
    end

Also aliased as: number_of_sequences
store(key, seq) click to toggle source

stores a sequence with key (name or definition of the sequence). Unlike `__store__` method, the method doesn't allow same keys. If the key is already used, returns nil. When succeeded, returns key.

    # File lib/bio/alignment.rb, line 1628
    def store(key, seq)
      #(Hash-like) returns key instead of seq
      if @seqs.has_key?(key) then
        # don't allow same key
        # New key is discarded, while existing key is preserved.
        key = nil
      end
      unless key then
        unless defined?(@serial)
          @serial = 0
        end
        @serial = @seqs.size if @seqs.size > @serial
        while @seqs.has_key?(@serial)
          @serial += 1
        end
        key = @serial
      end
      self.__store__(key, seq)
      key
    end

strip() click to toggle source

Not-destructive version of alignment_strip!. Returns a new alignment.

    # File lib/bio/alignment.rb, line 2010
    def strip
      #(String-like)
      na = self.dup
      na.isolate
      na.alignment_strip!
      na
    end

to_fasta(*arg) click to toggle source

Converts to fasta format and returns a string.

The specification of the argument will be changed.

Note: `to_fasta` is deprecated. Please use `output_fasta` instead.

    # File lib/bio/alignment.rb, line 2139
    def to_fasta(*arg)
      #(original)
      warn "to_fasta is deprecated. Please use output_fasta."
      self.to_fasta_array(*arg).join('')
    end

to_fasta_array(*arg) click to toggle source

Convert to fasta format and returns an array of strings.

It will be obsoleted.

    # File lib/bio/alignment.rb, line 2096
    def to_fasta_array(*arg)
      #(original)
      width = nil
      if arg[0].is_a?(Integer) then
        width = arg.shift
      end
      options = (arg.shift or {})
      width = options[:width] unless width
      if options[:avoid_same_name] then
        na = __clustal_avoid_same_name(self.keys, 30)
      else
        na = self.keys.collect { |k| k.to_s.gsub(/[\r\n\x00]/, ' ') }
      end
      a = self.collect do |s|
        ">#{na.shift}\n" +
          if width then
            s.to_s.gsub(Regexp.new(".{1,#{width}}"), "\\0\n")
          else
            s.to_s + "\n"
          end
      end
      a
    end

to_fastaformat_array(*arg) click to toggle source

Convets to fasta format and returns an array of FastaFormat objects.

It will be obsoleted.

    # File lib/bio/alignment.rb, line 2123
    def to_fastaformat_array(*arg)
      #(original)
      require 'bio/db/fasta'
      a = self.to_fasta_array(*arg)
      a.collect! do |x|
        Bio::FastaFormat.new(x)
      end
      a
    end

to_hash() click to toggle source

convert to hash

    # File lib/bio/alignment.rb, line 1571
    def to_hash
      #(Hash-like)
      @seqs
    end

unshift(key, seq) click to toggle source

Prepends seq (with key) to the front of the alignment. (Like Array#unshift)

    # File lib/bio/alignment.rb, line 1665
    def unshift(key, seq)
      #(Array-like)
      self.store(key, seq)
      k = @keys.pop
      @keys.unshift(k)
      k
    end

values() click to toggle source

Returns sequences. (Like Hash#values)

    # File lib/bio/alignment.rb, line 1702
    def values
      #(Hash-like)
      @keys.collect { |k| @seqs[k] }
    end

### Protected Instance Methods

new(*arg) click to toggle source

Creates new alignment. Internal use only.

    # File lib/bio/alignment.rb, line 1770
    def new(*arg)
      na = self.class.new(*arg)
      na.set_all_property(get_all_property)
      na
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.