NCBI C++ ToolKit
sequtils.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: sequtils.cpp 57812 2013-04-16 13:54:34Z voronov $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Mike DiCuccio
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 #include <misc/hgvs/sequtils.hpp>
34 
35 #include <objmgr/util/sequence.hpp>
36 #include <objects/seq/MolInfo.hpp>
37 
40 
41 
43 {
44  if (bsh.IsAa()) {
45  return CSeq_id::fAcc_prot;
46  }
47 
48  const CMolInfo* info = sequence::GetMolInfo(bsh);
49  if (info) {
50  if (info->GetBiomol() == CMolInfo::eBiomol_mRNA ||
51  info->GetBiomol() == CMolInfo::eBiomol_pre_RNA ||
52  info->GetBiomol() == CMolInfo::eBiomol_tRNA ||
53  info->GetBiomol() == CMolInfo::eBiomol_snRNA ||
54  info->GetBiomol() == CMolInfo::eBiomol_scRNA ||
55  info->GetBiomol() == CMolInfo::eBiomol_cRNA ||
56  info->GetBiomol() == CMolInfo::eBiomol_snoRNA ||
57  info->GetBiomol() == CMolInfo::eBiomol_ncRNA ||
58  info->GetBiomol() == CMolInfo::eBiomol_tmRNA) {
60  }
61 
62  if (info->GetBiomol() == CMolInfo::eBiomol_genomic) {
64  }
65  }
66 
67  CSeq_id_Handle idh = sequence::GetId(*bsh.GetSeqId(), bsh.GetScope(),
70 
72  id_info == CSeq_id::eAcc_refseq_mrna ||
74  id_info == CSeq_id::eAcc_gpipe_mrna) {
76  }
77  if (id_info == CSeq_id::eAcc_refseq_chromosome ||
78  id_info == CSeq_id::eAcc_refseq_contig ||
79  id_info == CSeq_id::eAcc_refseq_genomic ||
80  id_info == CSeq_id::eAcc_refseq_genome ||
83  }
84 
85  return (CSeq_id::eAcc_unknown);
86 }
87 
88 
CBioseq_Handle –.
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
Definition: Seq_id.cpp:1634
CConstRef< CSeq_id > GetSeqId(void) const
EAccessionInfo
For IdentifyAccession (below)
Definition: Seq_id.hpp:220
@ fAcc_prot
Definition: Seq_id.hpp:252
@ eAcc_refseq_contig
Definition: Seq_id.hpp:420
@ eAcc_refseq_mrna_predicted
Definition: Seq_id.hpp:439
@ eAcc_refseq_mrna
Definition: Seq_id.hpp:415
@ eAcc_mrna
Definition: Seq_id.hpp:268
@ eAcc_gpipe_mrna
Definition: Seq_id.hpp:551
@ fAcc_nuc
Definition: Seq_id.hpp:251
@ eAcc_refseq_chromosome
Definition: Seq_id.hpp:429
@ eAcc_refseq_genomic
Definition: Seq_id.hpp:430
@ eAcc_unknown
Definition: Seq_id.hpp:322
@ fAcc_genomic
Definition: Seq_id.hpp:286
@ eAcc_est
Definition: Seq_id.hpp:265
@ eAcc_division_mask
Definition: Seq_id.hpp:299
@ eAcc_refseq_wgs_intermed
Definition: Seq_id.hpp:431
@ eAcc_refseq_genome
Definition: Seq_id.hpp:419
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
const CMolInfo * GetMolInfo(const CBioseq &bioseq)
Retrieve the MolInfo object for a given bioseq handle.
Definition: sequence.cpp:284
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
Definition: sequence.hpp:101
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
@ eBiomol_pre_RNA
precursor RNA of any sort really
Definition: MolInfo_.hpp:102
@ eBiomol_cRNA
viral RNA genome copy intermediate
Definition: MolInfo_.hpp:111
@ eBiomol_snoRNA
small nucleolar RNA
Definition: MolInfo_.hpp:112
static MDB_envinfo info
Definition: mdb_load.c:37
Uint4 GetSequenceType(const CBioseq_Handle &bsh)
Return a (corrected) set of flags identifying the sequence type.
Definition: sequtils.cpp:42
#define const
Definition: zconf.h:232
Modified on Fri Sep 20 14:57:06 2024 by modify_doxy.py rev. 669887