# defline.rb

Path: | lib/bio/db/fasta/defline.rb
Last Update: | Wed Jan 05 06:23:30 +0000 2011

# bio/db/fasta/defline.rb - FASTA defline parser class

Copyright: | Copyright (C) 2001, 2002 GOTO Naohisa <ngoto@gen-info.osaka-u.ac.jp>, Toshiaki Katayama <k@bioruby.org>
License: | The Ruby License

$Id: defline.rb,v 1.1.2.1 2008/06/20 13:22:32 ngoto Exp $

## Description

Bio::FastaDefline is a parser class for definition line (defline) of the FASTA format.

## Examples

          rub = Bio::FastaDefline.new('>gi|671595|emb|CAA85678.1| rubisco large subunit [Perovskia abrotanoides]')
          rub.entry_id       ==> 'gi|671595'
          rub.get('emb')     ==> 'CAA85678.1'
          rub.emb            ==> 'CAA85678.1'
          rub.gi             ==> '671595'
          rub.accession      ==> 'CAA85678'
          rub.accessions     ==> [ 'CAA85678' ]
          rub.acc_version    ==> 'CAA85678.1'
          rub.locus          ==> nil
          rub.list_ids       ==> [["gi", "671595"],
                                  ["emb", "CAA85678.1", nil],
                                  ["Perovskia abrotanoides"]]

          ckr = Bio::FastaDefline.new(">gi|2495000|sp|Q63931|CCKR_CAVPO CHOLECYSTOKININ TYPE A RECEPTOR (CCK-A RECEPTOR) (CCK-AR)\001gi|2147182|pir||I51898 cholecystokinin A receptor - guinea pig\001gi|544724|gb|AAB29504.1| cholecystokinin A receptor; CCK-A receptor [Cavia]")
          ckr.entry_id      ==> "gi|2495000"
          ckr.sp            ==> "CCKR_CAVPO"
          ckr.pir           ==> "I51898"
          ckr.gb            ==> "AAB29504.1"
          ckr.gi            ==> "2495000"
          ckr.accession     ==> "AAB29504"
          ckr.accessions    ==> ["Q63931", "AAB29504"]
          ckr.acc_version   ==> "AAB29504.1"
          ckr.locus         ==> nil
          ckr.description   ==>
            "CHOLECYSTOKININ TYPE A RECEPTOR (CCK-A RECEPTOR) (CCK-AR)"
          ckr.descriptions  ==>
            ["CHOLECYSTOKININ TYPE A RECEPTOR (CCK-A RECEPTOR) (CCK-AR)",
             "cholecystokinin A receptor - guinea pig",
             "cholecystokinin A receptor; CCK-A receptor [Cavia]"]
          ckr.words         ==>
            ["cavia", "cck-a", "cck-ar", "cholecystokinin", "guinea", "pig",
             "receptor", "type"]
          ckr.id_strings    ==>
            ["2495000", "Q63931", "CCKR_CAVPO", "2147182", "I51898",
             "544724", "AAB29504.1", "Cavia"]
          ckr.list_ids      ==>
            [["gi", "2495000"], ["sp", "Q63931", "CCKR_CAVPO"],
             ["gi", "2147182"], ["pir", nil, "I51898"], ["gi", "544724"],
             ["gb", "AAB29504.1", nil], ["Cavia"]]

## References

- FASTA format (WikiPedia) en.wikipedia.org/wiki/FASTA_format
- Fasta format description (NCBI) www.ncbi.nlm.nih.gov/BLAST/fasta.shtml

[Validate]