header_editor.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:7k
- /*
- * ===========================================================================
- * PRODUCTION $Log: header_editor.cpp,v $
- * PRODUCTION Revision 1000.2 2004/06/01 21:02:16 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.4
- * PRODUCTION
- * ===========================================================================
- */
- /*
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software / database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software / database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Lou Friedman
- *
- * File Description:
- * Implementaion of CLocusEntryForm, for locus editing, CDefinEntryForm,
- * for definition editing.
- *
- */
- #include <ncbi_pch.hpp>
- #include "header_editor.hpp"
- #include <gui/dialogs/entry_form/table.hpp>
- #include <serial/iterator.hpp>
- #include <objects/seq/Bioseq.hpp>
- #include <objects/seq/MolInfo.hpp>
- #include <objects/seq/Seq_inst.hpp>
- BEGIN_NCBI_SCOPE
- USING_SCOPE(objects);
- SMenuEntryInfo SMolinfoBimolMapEntries[] = {
- { " ", 0 },
- { "Genomic DNA or RNA", 1 },
- { "Precursor RNA", 2 },
- { "mRNA [cDNA]", 3 },
- { "Ribosomal RNA", 4 },
- { "Transfer RNA", 5 },
- { "Small nuclear RNA", 6 },
- { "Small cytoplasmic RNA", 7 },
- { "Peptide", 8 },
- { "Other - Genetic", 9 },
- { "Genomic - mRNA", 10 },
- { "cRNA", 11 },
- { "Small nucleolar RNA", 12 },
- { "Transcribed RNA", 13 },
- { "Other", 255 },
- { 0, 0 }
- };
- CEntryFormMenu SMolinfoBimolMenu(SMolinfoBimolMapEntries);
- SMenuEntryInfo SMolinfoTechMapEntries[] = {
- { " ", 0 },
- { "Standard", 1 },
- { "EST", 2 },
- { "STS", 3 },
- { "Survey", 4 },
- { "Genetic Map", 5 },
- { "Physical Map", 6 },
- { "Derived", 7 },
- { "Concept - Trans", 8 },
- { "Seq - Pept", 9 },
- { "Both", 10 },
- { "Seq - Pept - Overlap", 11 },
- { "Seq - Pept - Homol", 12 },
- { "Concept - Trans - A", 13 },
- { "HTGS 0", 18 },
- { "HTGS 1", 14 },
- { "HTGS 2", 15 },
- { "HTGS 3", 16 },
- { "FLI_cDNA", 17 },
- { "HTC", 19 },
- { "WGS", 20 },
- { "Other:", 255 },
- { 0, 0 }
- };
- CEntryFormMenu SMolinfoTechMenu(SMolinfoTechMapEntries);
- SMenuEntryInfo MolinfoCompleteMapEntries [] = {
- { " ", 0 },
- { "Complete", 1 },
- { "Partial", 2 },
- { "No Left", 3 },
- { "No Right", 4 },
- { "No Ends", 5 },
- { "Other", 255 },
- { 0, 0 }
- };
- CEntryFormMenu SMolinfoCompleteMenu(SMolinfoTechMapEntries);
- SMenuEntryInfo MolClassMapEntries [] = {
- { " ", CSeq_inst::eMol_not_set },
- { "DNA", CSeq_inst::eMol_dna },
- { "RNA", CSeq_inst::eMol_rna },
- { "Protein", CSeq_inst::eMol_aa },
- { "Nucleotide", CSeq_inst::eMol_na },
- { "Other", CSeq_inst::eMol_other },
- { 0, 0 }
- };
- CEntryFormMenu SMolClassMenu(MolClassMapEntries);
- SMenuEntryInfo TopologyMapEntries [] = {
- { " ", CSeq_inst::eTopology_not_set },
- { "Linear", CSeq_inst::eTopology_linear },
- { "Circular", CSeq_inst::eTopology_circular },
- { "Tandem", CSeq_inst::eTopology_tandem },
- { "Other", 255 },
- { 0, 0 }
- };
- CEntryFormMenu STolpologyMenu(TopologyMapEntries);
- SMenuEntryInfo StrandMapEntires [] = {
- { " ", CSeq_inst::eStrand_not_set },
- { "Single", CSeq_inst::eStrand_ss },
- { "Double", CSeq_inst::eStrand_ds },
- { "Mixed", CSeq_inst::eStrand_mixed },
- { "Other", CSeq_inst::eStrand_other },
- { 0, 0 }
- };
- CEntryFormMenu SStrandMenu(StrandMapEntires);
- CLocusEntryForm::CLocusEntryForm(CParagraph* p)
- : CGenbankEntryForm(p)
- {
- SetTitle("Locus");
- auto_ptr<CEntryFormTable> t
- (new CEntryFormTable(GetFormWidget()->GetFormWidth(), 5));
-
- const CMolInfo* mi = dynamic_cast<const CMolInfo*>(p->topic());
-
- int bimol = CMolInfo::eBiomol_unknown;
- int complete = CMolInfo::eCompleteness_unknown;
- int tech = CMolInfo::eTech_unknown;
- if (mi) {
- bimol = mi->GetBiomol();
- complete = mi->GetCompleteness();
- tech = mi->GetTech();
- }
- m_Molecule = t->AddMenuRow("Molecule", SMolinfoBimolMenu, bimol);
- m_Completeness = t->AddMenuRow("Completeness", SMolinfoCompleteMenu,
- complete);
- m_Techniuqe = t->AddMenuRow("Techniuqe", SMolinfoTechMenu, tech);
- /*
- const CSeq_inst& inst = seq->GetInst();
- m_Class = t->AddMenuRow("Class", SMolClassMenu, inst.GetMol());
- m_Topology = t->AddMenuRow("Topology", STolpologyMenu,
- inst.GetTopology());
- CSeq_inst::EStrand strand = CSeq_inst::eStrand_not_set;
- if (inst.IsSetStrand()) {
- strand = inst.GetStrand();
- }
- m_Strand = t->AddMenuRow("Strand", SStrandMenu, strand);
- */
- t->End();
- AddEditWidget(t.release());
- }
- CLocusEntryForm::~CLocusEntryForm()
- {
- }
- CDefinEntryForm::CDefinEntryForm(CParagraph* p)
- : CGenbankEntryForm(p)
- {
- SetTitle("Definition");
- auto_ptr<CEntryFormTable> t
- (new CEntryFormTable(GetFormWidget()->GetFormWidth(), 5));
- // NOTE: flat file generator gets the difinition string from
- // sequence::GetTtitle. Instead of recreating the definition
- // string by calling GetTitle, I am gleaning the string from
- // the buffer. When saving the string, it will be saved in
- // the Bioseq->SeqDesc->title, which may have to be created.
- m_Defin = t->AddInputRow("Definition", p->buffer()->substr(12).c_str());
- t->End();
- AddEditWidget(t.release());
- }
- CDefinEntryForm::~CDefinEntryForm()
- {
- }
-
- END_NCBI_SCOPE