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/fix__feature__id_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/cleanup/fix_feature_id.cpp Source File

35 #include <unordered_map> 44  for

(

CFeat_CI

feat_it(entry); feat_it; ++feat_it) {

45  if

(feat_it->IsSetId()) {

46  const CFeat_id

&

id

= feat_it->GetId();

47  if

(

id

.IsLocal() &&

id

.GetLocal().IsId() &&

id

.GetLocal().

GetId

() > feat_id) {

63

}

while

(existing_ids.find(

offset

) != existing_ids.end() ||

64

new_existing_ids.find(

offset

) != new_existing_ids.end() ||

65

current_ids.find(

offset

) != current_ids.end());

72

unordered_map<TId, TId> remapped_ids;

78  for

( ; feat_it; ++feat_it )

83  if

(feat.IsSetId() && feat.GetId().IsLocal() && feat.GetId().GetLocal().IsId())

86  if

(existing_ids.find(

id

) != existing_ids.end() ||

87

new_ids.find(

id

) != new_ids.end())

91  auto

it = remapped_ids.find(

id

);

92  if

(it != remapped_ids.end())

99

remapped_ids[id] =

offset

;

105

changed_feats[fh] = edited;

109

new_existing_ids.insert(

id

);

113

existing_ids.insert(new_existing_ids.begin(), new_existing_ids.end());

114

existing_ids.insert(new_ids.begin(), new_ids.end());

116  for

( ; feat_it; ++feat_it )

120  if

(changed_feats.find(fh) != changed_feats.end())

122

edited = changed_feats[fh];

132  bool

modified =

false

;

133  for

(

auto

pXref : edited->

SetXref

()) {

134  if

(pXref->IsSetId() &&

135

pXref->GetId().IsLocal() &&

136

pXref->GetId().GetLocal().IsId()) {

137  TId id

= pXref->GetId().GetLocal().GetId();

138  auto

it = remapped_ids.find(

id

);

139  if

(it != remapped_ids.end()){

140

pXref->SetId().SetLocal().SetId(it->second);

145

changed_feats[fh] = edited;

180  for

(

auto

entry : changed_feats)

182  auto

orig_feat = entry.first;

183  auto

new_feat = entry.second;

185

feh.Replace(*new_feat);

198  for

(

CFeat_CI

feat_it(entry); feat_it; ++feat_it) {

199  if

(feat_it->IsSetId()) {

200  const CFeat_id

&

id

= feat_it->GetId();

201  if

(

id

.IsLocal() &&

id

.GetLocal().IsId() && id_pairs.

find

(

id

.GetLocal().GetId()) == id_pairs.

end

()) {

202

id_pairs[

id

.GetLocal().GetId()] = ++feat_id;

217  for

(

CFeat_CI

feat_it(entry); feat_it; ++feat_it )

219  bool

modified =

false

;

222  if

(changed_feats.find(fh) != changed_feats.end())

224

edited = changed_feats[fh];

229

edited->

Assign

(feat_it->GetOriginalFeature());

235

edited->

SetId

().SetLocal().SetId(

id

);

240

CSeq_feat::TXref::iterator xref_it = edited->

SetXref

().begin();

241  while

( xref_it != edited->

SetXref

().end() )

243  if

((*xref_it)-> IsSetId() && (*xref_it)->GetId().IsLocal() && (*xref_it)->GetId().GetLocal().IsId())

246  if

(id_pairs.

find

((*xref_it)->GetId().GetLocal().GetId()) != id_pairs.

end

())

248  TId id

= id_pairs[(*xref_it)->GetId().GetLocal().GetId()];

249

(*xref_it)->SetId().SetLocal().SetId(

id

);

253

(*xref_it)->ResetId();

254

xref_it = edited->

SetXref

().erase(xref_it);

260  if

(edited->

SetXref

().empty())

265

changed_feats[fh] = edited;

User-defined methods of the data storage class.

static void s_ApplyToSeqInSet(objects::CSeq_entry_Handle tse, TFeatMap &changed_feats)

static void s_ReassignFeatureIds(const objects::CSeq_entry_Handle &entry, TFeatMap &changed_feats)

static TId s_FindHighestFeatureId(const objects::CSeq_entry_Handle &entry)

static void s_UpdateFeatureIds(const objects::CSeq_entry_Handle &entry, TFeatMap &changed_feats, TIdSet &existing_ids, TId &offset)

map< objects::CSeq_feat_Handle, CRef< objects::CSeq_feat > > TFeatMap

unordered_set< TId > TIdSet

static void s_MakeIDPairs(const objects::CSeq_entry_Handle &entry, map< TId, TId > &id_pairs)

objects::CFeat_id::TLocal::TId TId

CSeq_feat_EditHandle –.

namespace ncbi::objects::

const_iterator end() const

const_iterator find(const key_type &key) const

static void FindNextOffset(const CFixFeatureId::TIdSet &existing_ids, const CFixFeatureId::TIdSet &new_existing_ids, const CFixFeatureId::TIdSet &current_ids, CFixFeatureId::TId &offset)

virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)

Set object to copy of another one.

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,...

TClass GetClass(void) const

bool IsSetClass(void) const

const CSeq_feat & GetOriginalFeature(void) const

Get original feature with unmapped location/product.

const CSeq_feat_Handle & GetSeq_feat_Handle(void) const

Get original feature handle.

@ eNonRecursive

Deprecated.

void Reset(void)

Reset reference object.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

bool IsId(void) const

Check if variant Id is selected.

TId GetId(void) const

Get the variant data.

TXref & SetXref(void)

Assign a value to Xref data member.

const TId & GetId(void) const

Get the Id member data.

const TLocal & GetLocal(void) const

Get the variant data.

bool IsSetXref(void) const

cite other relevant features Check if a value has been assigned to Xref data member.

bool IsLocal(void) const

Check if variant Local is selected.

void SetId(TId &value)

Assign a value to Id data member.

bool IsSetId(void) const

Check if a value has been assigned to Id data member.

void ResetXref(void)

Reset Xref data member.

@ eClass_genbank

converted genbank


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