A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/descr__mod__apply_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/readers/descr_mod_apply.cpp Source File

63 #include <unordered_map> 64 #include <unordered_set> 131  virtual bool IsSet

(

void

)

const

= 0;

172  function

<

bool

(

const CSeqdesc

&)> f_verify,

176  function

<

bool

(

const CSeqdesc

&)> f_verify,

199

m_fReportError(fReportError),

200

m_SkippedMods(skipped_mods)

217  static const

unordered_map<string,TMemFuncPtr>

234  auto

it = s_MethodMap.find(mod_name);

235  if

(it != s_MethodMap.end()) {

236  auto

mem_func_ptr = it->second;

237

(this->*mem_func_ptr)(mod_entry);

248  if

(name ==

"location"

) {

252  if

(it == s_GenomeStringToEnum.end()) {

260  if

(name ==

"origin"

) {

264  if

(it == s_OriginStringToEnum.end()) {

272  if

(name ==

"focus"

) {

313  for

(

const auto

&

mod

: mod_entry.second) {

314  const auto

&

value

=

mod

.GetValue();

321  if

(

mod

.IsSetAttrib()) {

322

pSubSource->SetAttrib(

mod

.GetAttrib());

324  m_pDescrCache

->SetSubtype().push_back(std::move(pSubSource));

331  const auto

set_size = primer_set.

Get

().size();

332

vector<string>

names

;

334  const auto

num_names =

names

.size();

336  auto

it = primer_set.

Set

().begin();

337  for

(

size_t i

=0;

i

<num_names; ++

i

) {

342

(*it)->SetName().Set(

names

[

i

]);

347

pPrimer->SetName().Set(

names

[

i

]);

348

primer_set.

Set

().push_back(std::move(pPrimer));

356  const auto

set_size = primer_set.

Get

().size();

359  const auto

num_seqs = seqs.size();

361  auto

it = primer_set.

Set

().begin();

362  for

(

size_t i

=0;

i

<num_seqs; ++

i

) {

367

(*it)->SetSeq().Set(seqs[

i

]);

372

pPrimer->SetSeq().Set(seqs[

i

]);

373

primer_set.

Set

().push_back(std::move(pPrimer));

381

vector<string>

names

;

383

reaction_names.insert(reaction_names.end(),

names

.begin(),

names

.end());

391  if

(seqs.size() > 1) {

392  if

(seqs.front().front() ==

'('

) {

393

seqs.front().erase(0,1);

395  if

(seqs.back().back() ==

')'

) {

396

seqs.back().erase(seqs.back().size()-1,1);

400  for

(

auto

& seq : seqs) {

411  if

(mod_name ==

"fwd-primer-name"

) {

412

vector<string>

names

;

413  for

(

const auto

&

mod

: mod_entry.second)

419  auto

it = pcr_reaction_set.Set().begin();

420  for

(

const auto

& reaction_names :

names

) {

421  if

(it == pcr_reaction_set.Set().end()) {

424

pcr_reaction_set.Set().push_back(std::move(pPCRReaction));

434  if

(mod_name ==

"fwd-primer-seq"

) {

436  for

(

const auto

&

mod

: mod_entry.second)

441  auto

it = pcr_reaction_set.Set().begin();

442  for

(

const auto

& reaction_seqs : seqs) {

443  if

(it == pcr_reaction_set.Set().end()) {

446

pcr_reaction_set.Set().push_back(std::move(pPCRReaction));

456  if

(mod_name ==

"rev-primer-name"

)

458

vector<string>

names

;

459  for

(

const auto

&

mod

: mod_entry.second) {

462  if

(!

names

.empty()) {

464  const size_t

num_reactions = pcr_reaction_set.Get().size();

465  const size_t

num_names =

names

.size();

466  if

(num_names <= num_reactions) {

467  auto

it = pcr_reaction_set.Set().rbegin();

468  for

(

int i

=num_names-1;

i

>=0; --

i

) {

473  auto

it = pcr_reaction_set.Set().begin();

474  for

(

size_t i

=0;

i

<num_reactions; ++

i

) {

478  for

(

auto i

=num_reactions;

i

<num_names; ++

i

) {

481

pcr_reaction_set.Set().push_back(std::move(pPCRReaction));

489  if

(mod_name ==

"rev-primer-seq"

)

492  for

(

const auto

&

mod

: mod_entry.second) {

497  const size_t

num_reactions = pcr_reaction_set.Get().size();

498  const size_t

num_seqs = seqs.size();

499  if

(num_seqs <= num_reactions) {

500  auto

it = pcr_reaction_set.Set().rbegin();

501  for

(

int i

=num_seqs-1;

i

>=0; --

i

) {

505  auto

it = pcr_reaction_set.Set().begin();

506  for

(

size_t i

=0;

i

<num_reactions; ++

i

) {

510  for

(

auto i

=num_reactions;

i

<num_seqs; ++

i

) {

513

pcr_reaction_set.Set().push_back(std::move(pPCRReaction));

527  if

(name ==

"taxname"

) {

530  if

(!preserve_taxid &&

538  if

(name ==

"taxid"

) {

542

taxid = NStr::StringToNumeric<TTaxId>(

value

);

549

preserve_taxid =

true

;

554  if

(name ==

"common"

) {

560  if

(name ==

"dbxref"

) {

574

vector<CRef<CDbtag>> dbtags;

575  for

(

const auto

& value_attrib : mod_entry.second) {

576  const auto

&

value

= value_attrib.GetValue();

578  auto

colon_pos =

value

.find(

":"

);

581  if

(colon_pos < (

value

.length()-1)) {

591

pDbtag->SetTag().SetStr(

tag

);

592

dbtags.push_back(std::move(pDbtag));

602  if

(name ==

"lineage"

) {

608  if

(name ==

"division"

) {

616  using

TFunction =

function

<void(

COrgName

&,

int

)>;

618

unordered_map<string, TFunction>

619

s_GetCodeSetterMethods =

624  auto

it = s_GetCodeSetterMethods.find(name);

625  if

(it != s_GetCodeSetterMethods.end()) {

653  for

(

const auto

&

mod

: mod_entry.second) {

656  if

(

mod

.IsSetAttrib()) {

657

pOrgMod->SetAttrib(

mod

.GetAttrib());

667  static const

unordered_map<string, string> s_NameToLabel =

668

{{

"sra"

,

"Sequence Read Archive"

},

669

{

"biosample"

,

"BioSample"

},

670

{

"bioproject"

,

"BioProject"

}};

672  const auto

&

label

= s_NameToLabel.at(name);

682

list<CTempString> value_list;

683  for

(

const auto

&

mod

: mod_entry.second) {

684

list<CTempString> value_sublist;

685  const auto

& vals =

mod

.GetValue();

687

value_list.splice(value_list.end(), value_sublist);

690  if

(value_list.empty()) {

698  const

list<CTempString>& vals,

707  for

(

auto

pUserField : dblink.

SetData

()) {

709

pUserField->IsSetLabel() &&

710

pUserField->GetLabel().IsStr() &&

721

dblink.

SetData

().push_back(pField);

724

pField->

SetData

().SetStrs().assign(vals.begin(), vals.end());

767  for

(

const auto

&

mod

: mod_entry.second) {

768

vals.push_back(

mod

.GetValue());

771  string label

= (mod_entry.first ==

"ft-map"

) ?

773  "BaseModification-FileTrackURL"

;

775  for

(

auto val

: vals) {

778

pField->SetLabel().SetStr(

label

);

780

pField->SetData().SetStr(

val

);

781

user.SetData().push_back(pField);

788

list<CStringUTF8> accession_list;

789  for

(

const auto

&

mod

: mod_entry.second) {

790

list<CTempString> value_sublist;

791  const auto

& vals =

mod

.GetValue();

794

list<CStringUTF8> accession_sublist;

796  transform

(value_sublist.begin(), value_sublist.end(), back_inserter(accession_sublist),

803

accession_list.splice(accession_list.end(), accession_sublist);

806  if

(accession_list.empty()) {

810  auto

make_user_field = [](

const CStringUTF8

& accession) {

812

pField->SetLabel().SetId(0);

814

pSubfield->SetLabel().SetStr(

"accession"

);

815

pSubfield->SetData().SetStr(accession);

816

pField->SetData().SetFields().push_back(std::move(pSubfield));

821

user.SetData().resize(accession_list.size());

822  transform

(accession_list.begin(), accession_list.end(),

823

user.SetData().begin(), make_user_field);

829

list<string> id_list;

830  for

(

const auto

&

mod

: mod_entry.second) {

831

list<CTempString> value_sublist;

832  const auto

& vals =

mod

.GetValue();

834  for

(

const auto

&

val

: value_sublist) {

838

id_list.insert(id_list.end(),idrange.

begin

(), idrange.

end

());

842

id_list.push_back(

value

);

847

gb_block.SetExtra_accessions().assign(id_list.begin(), id_list.end());

853

list<CTempString> value_list;

854  for

(

const auto

&

mod

: mod_entry.second) {

855

list<CTempString> value_sublist;

856  const auto

& vals =

mod

.GetValue();

858

value_list.splice(value_list.end(), value_sublist);

860  if

(value_list.empty()) {

863  m_pDescrCache

->SetGBblock().SetKeywords().assign(value_list.begin(), value_list.end());

872  for

(

const auto

&

mod

: mod_entry.second) {

873

list<CTempString> value_sublist;

874  const auto

& vals =

mod

.GetValue();

876

list<int> id_sublist;

878  transform

(value_sublist.begin(), value_sublist.end(), back_inserter(id_sublist),

885

id_list.splice(id_list.end(), id_sublist);

887  if

(id_list.empty()) {

891  auto

make_user_field = [](

const int

& id) {

894

pField->SetLabel().SetId(0);

895

pSubfield->SetLabel().SetStr(

"ProjectID"

);

896

pSubfield->SetData().SetInt(

id

);

897

pField->SetData().SetFields().push_back(pSubfield);

899

pSubfield->SetLabel().SetStr(

"ParentID"

);

900

pSubfield->SetData().SetInt(0);

901

pField->SetData().SetFields().push_back(pSubfield);

906

user.SetData().resize(id_list.size());

907  transform

(id_list.begin(), id_list.end(),

908

user.SetData().begin(), make_user_field);

914  for

(

const auto

&

mod

: mod_entry.second) {

923  for

(

const auto

&

mod

: mod_entry.second)

925  const auto

&

value

=

mod

.GetValue();

928

pmid = NStr::StringToNumeric<TEntrezId>(

value

);

934  auto

pPub =

Ref

(

new CPub

());

935

pPub->SetPmid().Set(pmid);

939

.push_back(std::move(pPub));

957  const string

& add_msg)

959  const auto

& mod_name = mod_data.

GetName

();

960  const auto

& mod_value = mod_data.

GetValue

();

961  string msg

=

"Invalid value: "

+ mod_name +

"="

+ mod_value +

"."

;

963  msg

+=

" "

+ add_msg;

984 template

<

class

TObject>

1010

pParentSet->IsSetClass() &&

1013  auto

& bioseq_set =

const_cast<CBioseq_set

&

>

(*pParentSet);

1036

!pDesc->

IsPub

()) {

1040  auto

& pub_desc = pDesc->

SetPub

();

1041

pub_desc.

SetPub

().Set().remove_if([](

const CRef<CPub>

& pPub) {

return

(pPub && pPub->

IsPmid

()); });

1042  return

pub_desc.GetPub().Get().empty();

1059  return

pDesc->SetPub();

1076  return

pDesc->SetComment();

1148

pDesc->SetGenbank();

1163

pDesc->SetMolinfo();

1220  function

<

bool

(

const CSeqdesc

&)> f_verify,

1228  function

<

bool

(

const CSeqdesc

&)> f_verify,

1232  auto

it =

m_Cache

.find(eChoice);

1234  return

*(it->second);

1239  if

(pDescrContainer->

IsSet

()) {

1240  for

(

auto

& pDesc : pDescrContainer->

SetDescr

().

Set

()) {

1241  if

(pDesc.NotEmpty() && f_verify(*pDesc)) {

1242  m_Cache

.insert(make_pair(eChoice, pDesc));

1248  auto

pDesc = f_create();

1249  m_Cache

.insert(make_pair(eChoice, pDesc));

1250

pDescrContainer->

SetDescr

().

Set

().push_back(pDesc);

User-defined methods of the data storage class.

User-defined methods of the data storage class.

User-defined methods of the data storage class.

User-defined methods of the data storage class.

User-defined methods of the data storage class.

void transform(Container &c, UnaryFunction *op)

CConstRef< CBioseq_set > GetParentSet(void) const

CPCRReactionSet * m_pPCRReactionSet

CBioSource::TSubtype TSubtype

SDescrContainer_Base TDescrContainer

unique_ptr< TDescrContainer > m_pNucProtSetContainer

void x_SetUserType(const string &type, CUser_object &user_object)

CUser_object & SetFileTrack(void)

unordered_map< EChoice, CRef< CSeqdesc >, hash< underlying_type< EChoice >::type > > TMap

CPCRReactionSet & SetPCR_primers(void)

CDescrCache(CBioseq &bioseq)

CGB_block & SetGBblock(void)

CSeqdesc & x_SetDescriptor(const EChoice eChoice, function< bool(const CSeqdesc &)> f_verify, function< CRef< CSeqdesc >(void)> f_create)

unique_ptr< TDescrContainer > m_pBioseqContainer

CMolInfo & SetMolInfo(void)

TDescrContainer * m_pPrimaryContainer

CUser_object & SetDBLink(void)

CBioSource & SetBioSource(void)

CPubdesc & SetPubdesc(void)

CUser_object & SetGenomeProjects(void)

string & SetComment(void)

CUser_object & SetTpaAssembly(void)

TSubtype & SetSubtype(void)

TOrgMods & SetOrgMods(void)

CDescrContainer(TObject &object)

CSeq_descr & SetDescr(void)

void x_SetMolInfoType(const TModEntry &mod_entry)

void x_SetOrgMod(const TModEntry &mod_entry)

CDescrModApply(CBioseq &bioseq, FReportError fReportError, TSkippedMods &skipped_mods)

void x_SetMolInfoCompleteness(const TModEntry &mod_entry)

bool x_TryBioSourceMod(const TModEntry &mod_entry, bool &preserve_taxid)

bool x_TryOrgNameMod(const TModEntry &mod_entry)

virtual ~CDescrModApply()

bool x_TryOrgRefMod(const TModEntry &mod_entry, bool &preserve_taxid)

TSkippedMods & m_SkippedMods

void x_SetTpaAssembly(const TModEntry &mod_entry)

bool x_TryPCRPrimerMod(const TModEntry &mod_entry)

CModAdder::FReportError FReportError

void x_SetFileTrack(const TModEntry &mod_entry)

CModAdder::TSkippedMods TSkippedMods

void x_SetPMID(const TModEntry &mod_entry)

void x_SetComment(const TModEntry &mod_entry)

CModHandler::TMods::value_type TModEntry

void x_SetGBblockKeywords(const TModEntry &mod_entry)

void x_SetGBblockIds(const TModEntry &mod_entry)

static const string & x_GetModValue(const TModEntry &mod_entry)

void x_SetDBLink(const TModEntry &mod_entry)

FReportError m_fReportError

unique_ptr< CDescrCache > m_pDescrCache

void x_SetDBLinkFieldVals(const string &label, const list< CTempString > &vals, CUser_object &db_link)

void x_SetDBLinkField(const string &label, const TModEntry &mod_entry, CDescrCache &descr_cache)

void x_SetDBxref(const TModEntry &mod_entry)

static const string & x_GetModName(const TModEntry &mod_entry)

void x_SetMolInfoTech(const TModEntry &mod_entry)

void x_ReportInvalidValue(const CModData &mod_data, const string &add_msg="")

void x_SetSubtype(const TModEntry &mod_entry)

bool Apply(const TModEntry &mod_entry)

void x_SetGenomeProjects(const TModEntry &mod_entry)

const string & GetValue(void) const

const string & GetName(void) const

static const string & GetCanonicalName(const TModEntry &mod_entry)

static const string & AssertReturnSingleValue(const TModEntry &mod_entry)

@OrgMod.hpp User-defined methods of the data storage class.

@Pubdesc.hpp User-defined methods of the data storage class.

@Seq_descr.hpp User-defined methods of the data storage class.

static bool NeedsNoText(const TSubtype &subtype)

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

Include a standard set of the NCBI C++ Toolkit most basic headers.

static const auto s_OrgModStringToEnum

static const unordered_map< string, CMolInfo::TTech > s_TechStringToEnum

static bool s_EmptyAfterRemovingPMID(CRef< CSeqdesc > &pDesc)

static const auto s_SubSourceStringToEnum

static void s_SetPrimerNames(const string &primer_names, CPCRPrimerSet &primer_set)

static const unordered_map< string, CMolInfo::TCompleteness > s_CompletenessStringToEnum

static bool s_IsUserType(const CUser_object &user_object, const string &type)

static void s_AppendPrimerNames(const string &mod, vector< string > &reaction_names)

static void s_AppendPrimerSeqs(const string &mod, vector< string > &reaction_seqs)

static void s_SetPrimerSeqs(const string &primer_seqs, CPCRPrimerSet &primer_set)

static const struct name_t names[]

SStrictId_Entrez::TId TEntrezId

TEntrezId type for entrez ids which require the same strictness as TGi.

SStrictId_Tax::TId TTaxId

Taxon id type.

@ eDiag_Error

Error message.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

const_iterator end(void) const

const_iterator begin(void) const

CRef< C > Ref(C *object)

Helper functions to get CRef<> and CConstRef<> objects.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define END_SCOPE(ns)

End the previously defined scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

#define BEGIN_SCOPE(ns)

Define a new scope.

static CTempString TruncateSpaces_Unsafe(const CTempString str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string.

static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to int.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)

Check if a string is blank (has no text).

static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)

Convert into UTF8 from a C/C++ string.

static unsigned int StringToUInt(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to unsigned int.

static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive equality of a substring with another string.

static string & ToLower(string &str)

Convert string to lower case – string& version.

@ fSplit_Tokenize

All delimiters are merged and trimmed, to get non-empty tokens only.

static const char label[]

const Tdata & Get(void) const

Get the member data.

list< CRef< CSubSource > > TSubtype

void SetPcr_primers(TPcr_primers &value)

Assign a value to Pcr_primers data member.

void SetOrg(TOrg &value)

Assign a value to Org data member.

Tdata & Set(void)

Assign a value to data member.

TSubtype & SetSubtype(void)

Assign a value to Subtype data member.

bool IsSetData(void) const

the object itself Check if a value has been assigned to Data data member.

bool IsStr(void) const

Check if variant Str is selected.

bool IsSetType(void) const

type of object within class Check if a value has been assigned to Type data member.

TData & SetData(void)

Assign a value to Data data member.

const TStr & GetStr(void) const

Get the variant data.

void SetLabel(TLabel &value)

Assign a value to Label data member.

void SetType(TType &value)

Assign a value to Type data member.

void SetData(TData &value)

Assign a value to Data data member.

const TType & GetType(void) const

Get the Type member data.

TMgcode & SetMgcode(void)

Assign a value to Mgcode data member.

TPgcode & SetPgcode(void)

Assign a value to Pgcode data member.

list< CRef< COrgMod > > TMod

TGcode & SetGcode(void)

Assign a value to Gcode data member.

bool IsPmid(void) const

Check if variant Pmid is selected.

@ eClass_nuc_prot

nuc acid and coded proteins

bool IsGenbank(void) const

Check if variant Genbank is selected.

const TUser & GetUser(void) const

Get the variant data.

bool IsMolinfo(void) const

Check if variant Molinfo is selected.

void SetPub(TPub &value)

Assign a value to Pub data member.

TPub & SetPub(void)

Select the variant.

bool IsComment(void) const

Check if variant Comment is selected.

bool IsSource(void) const

Check if variant Source is selected.

bool IsPub(void) const

Check if variant Pub is selected.

Tdata & Set(void)

Assign a value to data member.

bool IsUser(void) const

Check if variant User is selected.

@ eCompleteness_has_left

5' or NH3 end present

@ eCompleteness_complete

complete biological entity

@ eCompleteness_has_right

3' or COOH end present

@ eCompleteness_no_left

missing 5' or NH3 end

@ eCompleteness_partial

partial but no details given

@ eCompleteness_no_right

missing 3' or COOH end

@ eCompleteness_no_ends

missing both ends

@ eTech_htgs_2

ordered High Throughput sequence contig

@ eTech_physmap

from physical mapping techniques

@ eTech_htc

high throughput cDNA

@ eTech_both

concept transl. w/ partial pept. seq.

@ eTech_targeted

targeted locus sets/studies

@ eTech_seq_pept_homol

sequenced peptide, ordered by homology

@ eTech_composite_wgs_htgs

composite of WGS and HTGS

@ eTech_sts

Sequence Tagged Site.

@ eTech_htgs_3

finished High Throughput sequence

@ eTech_seq_pept_overlap

sequenced peptide, ordered by overlap

@ eTech_htgs_1

unordered High Throughput sequence contig

@ eTech_concept_trans

conceptual translation

@ eTech_tsa

transcriptome shotgun assembly

@ eTech_standard

standard sequencing

@ eTech_wgs

whole genome shotgun sequencing

@ eTech_seq_pept

peptide was sequenced

@ eTech_survey

one-pass genomic sequence

@ eTech_barcode

barcode of life project

@ eTech_htgs_0

single genomic reads for coordination

@ eTech_derived

derived from other data, not a primary entity

@ eTech_fli_cdna

full length insert cDNA

@ eTech_est

Expressed Sequence Tag.

@ eTech_concept_trans_a

conceptual transl. supplied by author

@ eTech_genemap

from genetic mapping techniques

unsigned int

A callback function used to compare two keys in a database.

use only n Cassandra database for the lookups</td > n</tr > n< tr > n< td > yes</td > n< td > do not use tables BIOSEQ_INFO and BLOB_PROP in the Cassandra database

const TStringToEnumMap< CMolInfo::TBiomol > g_BiomolStringToEnum

TStringToEnumMap< CSubSource::ESubtype > g_InitModNameSubSrcSubtypeMap(void)

TStringToEnumMap< COrgMod::ESubtype > g_InitModNameOrgSubtypeMap(void)

string g_GetNormalizedModVal(const string &unnormalized)

TStringToEnumMap< CBioSource::EGenome > g_InitModNameGenomeMap(void)

TStringToEnumMap< CBioSource::EOrigin > g_InitModNameOriginMap(void)

const GenericPointer< typename T::ValueType > T2 value

@ eModSubcode_InvalidValue

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

virtual ~SDescrContainer_Base(void)=default

virtual bool IsSet(void) const =0

virtual CSeq_descr & SetDescr(void)=0


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4