SeqFeatData.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:11k
源码类别:

生物技术

开发平台:

C/C++

  1. /*
  2.  * ===========================================================================
  3.  * PRODUCTION $Log: SeqFeatData.hpp,v $
  4.  * PRODUCTION Revision 1000.1  2004/06/01 19:30:46  gouriano
  5.  * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.6
  6.  * PRODUCTION
  7.  * ===========================================================================
  8.  */
  9. /* $Id: SeqFeatData.hpp,v 1000.1 2004/06/01 19:30:46 gouriano Exp $
  10.  * ===========================================================================
  11.  *
  12.  *                            PUBLIC DOMAIN NOTICE
  13.  *               National Center for Biotechnology Information
  14.  *
  15.  *  This software/database is a "United States Government Work" under the
  16.  *  terms of the United States Copyright Act.  It was written as part of
  17.  *  the author's official duties as a United States Government employee and
  18.  *  thus cannot be copyrighted.  This software/database is freely available
  19.  *  to the public for use. The National Library of Medicine and the U.S.
  20.  *  Government have not placed any restriction on its use or reproduction.
  21.  *
  22.  *  Although all reasonable efforts have been taken to ensure the accuracy
  23.  *  and reliability of the software and data, the NLM and the U.S.
  24.  *  Government do not and cannot warrant the performance or results that
  25.  *  may be obtained by using this software or data. The NLM and the U.S.
  26.  *  Government disclaim all warranties, express or implied, including
  27.  *  warranties of performance, merchantability or fitness for any particular
  28.  *  purpose.
  29.  *
  30.  *  Please cite the author in any work or product based on this material.
  31.  *
  32.  * ===========================================================================
  33.  *
  34.  * Author:  .......
  35.  *
  36.  * File Description:
  37.  *   .......
  38.  *
  39.  * Remark:
  40.  *   This code was originally generated by application DATATOOL
  41.  *   using specifications from the ASN data definition file
  42.  *   'seqfeat.asn'.
  43.  */
  44. #ifndef OBJECTS_SEQFEAT_SEQFEATDATA_HPP
  45. #define OBJECTS_SEQFEAT_SEQFEATDATA_HPP
  46. // generated includes
  47. #include <objects/seqfeat/SeqFeatData_.hpp>
  48. // generated classes
  49. BEGIN_NCBI_SCOPE
  50. BEGIN_objects_SCOPE // namespace ncbi::objects::
  51. class NCBI_SEQFEAT_EXPORT CSeqFeatData : public CSeqFeatData_Base
  52. {
  53.     typedef CSeqFeatData_Base Tparent;
  54. public:
  55.     // constructor
  56.     CSeqFeatData(void);
  57.     // destructor
  58.     ~CSeqFeatData(void);
  59.     // ASCII representation of subtype (GenBank feature key, e.g.)
  60.     enum EVocabulary {
  61.         eVocabulary_full,
  62.         eVocabulary_genbank
  63.     };
  64.     string GetKey(EVocabulary vocab = eVocabulary_full) const;
  65.     enum ESubtype {
  66.         // These no longer need to match the FEATDEF values in the
  67.         // C toolkit's objfdef.h
  68.         eSubtype_bad = 0,
  69.         eSubtype_gene,
  70.         eSubtype_org,
  71.         eSubtype_cdregion,
  72.         eSubtype_prot,
  73.         eSubtype_preprotein,
  74.         eSubtype_mat_peptide_aa,
  75.         eSubtype_sig_peptide_aa,
  76.         eSubtype_transit_peptide_aa,
  77.         eSubtype_preRNA,
  78.         eSubtype_mRNA,
  79.         eSubtype_tRNA,
  80.         eSubtype_rRNA,
  81.         eSubtype_snRNA,
  82.         eSubtype_scRNA,
  83.         eSubtype_snoRNA,
  84.         eSubtype_otherRNA,
  85.         eSubtype_pub,
  86.         eSubtype_seq,
  87.         eSubtype_imp,
  88.         eSubtype_allele,
  89.         eSubtype_attenuator,
  90.         eSubtype_C_region,
  91.         eSubtype_CAAT_signal,
  92.         eSubtype_Imp_CDS,
  93.         eSubtype_conflict,
  94.         eSubtype_D_loop,
  95.         eSubtype_D_segment,
  96.         eSubtype_enhancer,
  97.         eSubtype_exon,
  98.         eSubtype_GC_signal,
  99.         eSubtype_iDNA,
  100.         eSubtype_intron,
  101.         eSubtype_J_segment,
  102.         eSubtype_LTR,
  103.         eSubtype_mat_peptide,
  104.         eSubtype_misc_binding,
  105.         eSubtype_misc_difference,
  106.         eSubtype_misc_feature,
  107.         eSubtype_misc_recomb,
  108.         eSubtype_misc_RNA,
  109.         eSubtype_misc_signal,
  110.         eSubtype_misc_structure,
  111.         eSubtype_modified_base,
  112.         eSubtype_mutation,
  113.         eSubtype_N_region,
  114.         eSubtype_old_sequence,
  115.         eSubtype_polyA_signal,
  116.         eSubtype_polyA_site,
  117.         eSubtype_precursor_RNA,
  118.         eSubtype_prim_transcript,
  119.         eSubtype_primer_bind,
  120.         eSubtype_promoter,
  121.         eSubtype_protein_bind,
  122.         eSubtype_RBS,
  123.         eSubtype_repeat_region,
  124.         eSubtype_repeat_unit,
  125.         eSubtype_rep_origin,
  126.         eSubtype_S_region,
  127.         eSubtype_satellite,
  128.         eSubtype_sig_peptide,
  129.         eSubtype_source,
  130.         eSubtype_stem_loop,
  131.         eSubtype_STS,
  132.         eSubtype_TATA_signal,
  133.         eSubtype_terminator,
  134.         eSubtype_transit_peptide,
  135.         eSubtype_unsure,
  136.         eSubtype_V_region,
  137.         eSubtype_V_segment,
  138.         eSubtype_variation,
  139.         eSubtype_virion,
  140.         eSubtype_3clip,
  141.         eSubtype_3UTR,
  142.         eSubtype_5clip,
  143.         eSubtype_5UTR,
  144.         eSubtype_10_signal,
  145.         eSubtype_35_signal,
  146.         eSubtype_gap,
  147.         eSubtype_operon,
  148.         eSubtype_oriT,
  149.         eSubtype_site_ref,
  150.         eSubtype_region,
  151.         eSubtype_comment,
  152.         eSubtype_bond,
  153.         eSubtype_site,
  154.         eSubtype_rsite,
  155.         eSubtype_user,
  156.         eSubtype_txinit,
  157.         eSubtype_num,
  158.         eSubtype_psec_str,
  159.         eSubtype_non_std_residue,
  160.         eSubtype_het,
  161.         eSubtype_biosrc,
  162.         eSubtype_max,
  163.         eSubtype_any = 255
  164.     };
  165.     ESubtype GetSubtype(void) const;
  166.     
  167.     // Call after changes that could affect the subtype
  168.     void InvalidateSubtype(void);
  169.     static E_Choice GetTypeFromSubtype (ESubtype subtype);
  170.     // List of available qualifiers for feature keys.
  171.     // For more information see: 
  172.     //   The DDBJ/EMBL/GenBank Feature Table: Definition
  173.     //   (http://www.ncbi.nlm.nih.gov/projects/collab/FT/index.html)
  174.     enum EQualifier
  175.     {
  176.         eQual_bad = 0,
  177.         eQual_allele,
  178.         eQual_anticodon,
  179.         eQual_bound_moiety,
  180.         eQual_cell_line,
  181.         eQual_cell_type,
  182.         eQual_chromosome,
  183.         eQual_citation,
  184.         eQual_clone,
  185.         eQual_clone_lib,
  186.         eQual_codon,
  187.         eQual_codon_start,
  188.         eQual_cons_splice,
  189.         eQual_country,
  190.         eQual_cultivar,
  191.         eQual_db_xref,
  192.         eQual_dev_stage,
  193.         eQual_direction,
  194.         eQual_EC_number,
  195.         eQual_ecotype,
  196.         eQual_environmental_sample,
  197.         eQual_estimated_length,
  198.         eQual_evidence,
  199.         eQual_exception,
  200.         eQual_focus,
  201.         eQual_frequency,
  202.         eQual_function,
  203.         eQual_gene,
  204.         eQual_germline,
  205.         eQual_haplotype,
  206.         eQual_insertion_seq,
  207.         eQual_isolate,
  208.         eQual_isolation_source,
  209.         eQual_label,
  210.         eQual_lab_host,
  211.         eQual_locus_tag,
  212.         eQual_map,
  213.         eQual_macronuclear,
  214.         eQual_mod_base,
  215.         eQual_mol_type,
  216.         eQual_note,
  217.         eQual_number,
  218.         eQual_operon,
  219.         eQual_organelle,
  220.         eQual_organism,
  221.         eQual_partial,
  222.         eQual_PCR_conditions,
  223.         eQual_phenotype,
  224.         eQual_pop_variant,
  225.         eQual_plasmid,
  226.         eQual_product,
  227.         eQual_protein_id,
  228.         eQual_proviral,
  229.         eQual_pseudo,
  230.         eQual_rearranged,
  231.         eQual_replace,
  232.         eQual_rpt_family,
  233.         eQual_rpt_type,
  234.         eQual_rpt_unit,
  235.         eQual_segment,
  236.         eQual_sequence_mol,
  237.         eQual_serotype,
  238.         eQual_serovar,
  239.         eQual_sex,
  240.         eQual_specific_host,
  241.         eQual_specimen_voucher,
  242.         eQual_standard_name,
  243.         eQual_strain,
  244.         eQual_sub_clone,
  245.         eQual_sub_species,
  246.         eQual_sub_strain,
  247.         eQual_tissue_lib,
  248.         eQual_tissue_type,
  249.         eQual_transgenic,
  250.         eQual_translation,
  251.         eQual_transl_except,
  252.         eQual_transl_table,
  253.         eQual_transposon,
  254.         eQual_usedin,
  255.         eQual_variety,
  256.         eQual_virion
  257.     };
  258.     typedef vector<EQualifier> TQualifiers;
  259.     // Test wheather a certain qualifier is legal for the feature
  260.     bool IsLegalQualifier(EQualifier qual) const;
  261.     static bool IsLegalQualifier(ESubtype subtype, EQualifier qual);
  262.     // Get a list of all the legal qualifiers for the feature.
  263.     const TQualifiers& GetLegalQualifiers(void) const;
  264.     static const TQualifiers& GetLegalQualifiers(ESubtype subtype);
  265.     // Get the list of all mandatory qualifiers for the feature.
  266.     const TQualifiers& GetMandatoryQualifiers(void) const;
  267.     static const TQualifiers& GetMandatoryQualifiers(ESubtype subtype);
  268.     
  269.     // Convert a qualifier from an enumerated value to a string representation.
  270.     static const string& GetQulifierAsString(EQualifier qual);
  271. private:
  272.     mutable ESubtype m_Subtype; // cached
  273.     // Prohibit copy constructor and assignment operator
  274.     CSeqFeatData(const CSeqFeatData& value);
  275.     CSeqFeatData& operator=(const CSeqFeatData& value);
  276.     typedef map<ESubtype, TQualifiers> TFeatQuals;
  277.     static void x_InitQuals(void);
  278.     static void x_InitLegalQuals(void);
  279.     static void x_InitMandatoryQuals(void);
  280.     static TFeatQuals sm_LegalQuals;
  281.     static TFeatQuals sm_MandatoryQuals;
  282. };
  283. /////////////////// CSeqFeatData inline methods
  284. // constructor
  285. inline
  286. CSeqFeatData::CSeqFeatData(void) : m_Subtype(eSubtype_any)
  287. {
  288. }
  289. inline
  290. void CSeqFeatData::InvalidateSubtype(void)
  291. {
  292.     m_Subtype = eSubtype_any;
  293. }
  294. inline
  295. bool CSeqFeatData::IsLegalQualifier(EQualifier qual) const
  296. {
  297.     x_InitQuals();  // does nothing if already intialized
  298.     return IsLegalQualifier(GetSubtype(), qual);
  299. }
  300. inline
  301. const CSeqFeatData::TQualifiers& CSeqFeatData::GetLegalQualifiers(void) const
  302. {
  303.     x_InitQuals();  // does nothing if already intialized
  304.     return GetLegalQualifiers(GetSubtype());
  305. }
  306. inline
  307. const CSeqFeatData::TQualifiers& CSeqFeatData::GetMandatoryQualifiers(void) const
  308. {
  309.     x_InitQuals();  // does nothing if already intialized
  310.     return GetMandatoryQualifiers(GetSubtype());
  311. }
  312. /////////////////// end of CSeqFeatData inline methods
  313. END_objects_SCOPE // namespace ncbi::objects::
  314. END_NCBI_SCOPE
  315. #endif // OBJECTS_SEQFEAT_SEQFEATDATA_HPP
  316. /*
  317. * ===========================================================================
  318. *
  319. * $Log: SeqFeatData.hpp,v $
  320. * Revision 1000.1  2004/06/01 19:30:46  gouriano
  321. * PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.6
  322. *
  323. * Revision 1.6  2004/05/19 14:39:42  shomrat
  324. * Added list of qualifiers
  325. *
  326. * Revision 1.5  2003/10/24 17:13:49  shomrat
  327. * added gap, operaon and oriT subtypes
  328. *
  329. * Revision 1.4  2003/04/19 16:38:06  dicuccio
  330. * Remove compiler warning about nested c-style comments
  331. *
  332. * Revision 1.3  2003/04/18 21:20:44  kans
  333. * regrouped ESubtype, removing most explicit numbers, added GetTypeFromSubtype, moved log to end of file
  334. *
  335. * Revision 1.2  2002/12/26 12:43:27  dicuccio
  336. * Added Win32 export specifiers
  337. *
  338. * Revision 1.1  2001/10/30 20:25:56  ucko
  339. * Implement feature labels/keys, subtypes, and sorting
  340. *
  341. *
  342. * ===========================================================================
  343. */
  344. /* Original file checksum: lines: 90, chars: 2439, CRC32: 742431cc */