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

Go to the SVN repository for this file.

1 /* $Id: asn1.cpp 100392 2023-07-27 15:57:51Z souvorov $
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: Vyacheslav Chetvernin
27  *
28  * File Description:
29  * conversion to/from ASN1
30  *
31  */
32 
33 #include <ncbi_pch.hpp>
34 #include <algo/gnomon/asn1.hpp>
40 #include <objects/seq/seq__.hpp>
42 #include "gnomon_seq.hpp"
44 
47 #include <objmgr/util/sequence.hpp>
48 #include <objmgr/seq_vector.hpp>
49 #include <objmgr/seq_annot_ci.hpp>
50 #include <objmgr/feat_ci.hpp>
51 #include <objmgr/align_ci.hpp>
52 
54 BEGIN_SCOPE(gnomon)
56 
57 
58 
59 // defined in gnomon_model.cpp
60 typedef map<string,string> TAttributes;
63 
64 // defined in gnomon_objmgr.cpp
65 Int8 GetModelId(const CSeq_align& seq_align);
66 
67 
68 const string kGnomonConstructed = "Is [re]constructed alignment";
69 
70 
71 struct SModelData {
72  SModelData(const CAlignModel& model, const CEResidueVec& contig_seq, int shift);
73 
78 
79  bool is_ncrna;
80 };
81 
82 SModelData::SModelData(const CAlignModel& m, const CEResidueVec& contig_seq, int shift) : model(m)
83 {
84  CAlignMap amap = model.GetAlignMap();
85  CCDSInfo cds = model.GetCdsInfo();
86  if(cds.IsMappedToGenome()) {
87  cds = cds.MapFromOrigToEdited(amap); // all coords on mRNA
88  model.SetCdsInfo(cds);
89  }
90 
91  amap.MoveOrigin(shift);
92  amap.EditedSequence(contig_seq, mrna_seq, true);
93 
94  prot_sid.Reset(new CSeq_id);
96  mrna_sid.Reset(new CSeq_id);
98 
99  is_ncrna = m.ReadingFrame().Empty();
100 }
101 
102 
104 public:
105  CImplementationData(const string& contig_name, const CResidueVec& seq, IEvidence& evdnc, int genetic_code, int sh);
106 
107  void ResetASN1();
108  void AddModel(const CAlignModel& model);
110 
111 private:
112  void CreateModelProducts(SModelData& model);
116  // CRef<CSpliced_exon> spliced_exon (const CModelExon& e, EStrand strand) const;
118 
120  void AddInternalFeature(const SModelData& md);
121  void DumpEvidence(const SModelData& md);
122 
123  string contig_name;
126 
127  int gencode;
128  int shift;
129 
135 
139 
140  unique_ptr<CFeatureGenerator> feature_generator;
142 
143  friend class CAnnotationASN1;
144 };
145 
146 void NameAnnot(CSeq_annot& annot, const string& name)
147 {
148  annot.SetNameDesc(name);
149  annot.SetTitleDesc(name);
150 }
151 
154 
155  CBioseq_set& bioseq_set = main_seq_entry->SetSet();
156 
157  nucprots = &bioseq_set.SetSeq_set();
158 
160  NameAnnot(*gnomon_models_annot, "Gnomon models");
161  CRef<CAnnotdesc> desc(new CAnnotdesc());
162  CRef<CSeq_loc> genomic_seqloc(new CSeq_loc());
163  genomic_seqloc->SetWhole(*contig_sid);
164  desc->SetRegion(*genomic_seqloc);
165  gnomon_models_annot->SetDesc().Set().push_back(desc);
166 
167  CRef<CSeq_annot> gnomon_models_annot_ref(gnomon_models_annot);
168  bioseq_set.SetAnnot().push_back(gnomon_models_annot_ref);
169  feature_table = &gnomon_models_annot->SetData().SetFtable();
170 
171  CRef<CSeq_annot> seq_annot(new CSeq_annot);
172  NameAnnot(*seq_annot, "Gnomon internal attributes");
173  bioseq_set.SetAnnot().push_back(seq_annot);
174  internal_feature_table = &seq_annot->SetData().SetFtable();
175 }
176 
177 CAnnotationASN1::CImplementationData::CImplementationData(const string& a_contig_name, const CResidueVec& seq, IEvidence& evdnc, int genetic_code, int sh) :
178  contig_name(a_contig_name),
179  contig_sid(CIdHandler::ToSeq_id(a_contig_name)),
180  gencode(genetic_code),
181  shift(sh),
182  evidence(evdnc)
183 {
184  Convert(seq, contig_seq);
185  ResetASN1();
186 
188  scope.Reset(new CScope(*obj_mgr));
189  scope->AddDefaults();
193  feature_generator->SetAllowedUnaligned(0);
194 }
195 
197  m_data->ResetASN1();
198 }
199 
200 CAnnotationASN1::CAnnotationASN1(const string& contig_name, const CResidueVec& seq, IEvidence& evdnc,
201  int genetic_code, int shift) :
202  m_data(new CImplementationData(contig_name, seq, evdnc, genetic_code, shift))
203 {
204 }
205 
207 {
208 }
209 
211 {
212  return m_data->main_seq_entry;
213 }
214 
215 
217 {
218  m_data->AddModel(model);
219 }
220 
222 {
224  CRef<CSeq_feat> cds_feat;
225 
226  CSeq_feat* cds_feat_ptr = NULL;
227  if (!md.is_ncrna) {
228  cds_feat = create_cdregion_feature(md);
229  cds_feat_ptr = cds_feat.GetPointer();
230  }
231 
232  CRef<CSeq_entry> model_products(new CSeq_entry);
233  nucprots->push_back(model_products);
234  CRef<CSeq_annot> annot(new CSeq_annot);
235  feature_generator->ConvertAlignToAnnot(*align, *annot, model_products->SetSet(), 0, cds_feat_ptr);
236 }
237 
239 {
240  Int8 id = md.model.ID();
241  if (models_in_internal_feature_table.find(id) == models_in_internal_feature_table.end()) {
242  CRef<CSeq_feat> internal_feat = create_internal_feature(md);
243  internal_feature_table->push_back(internal_feat);
244  models_in_internal_feature_table.insert(id);
245  }
246 }
247 
249 {
250  SModelData md(model, contig_seq, shift);
251 
252  CRef< CSeq_align > align = model2spliced_seq_align(md);
253  CRef<CSeq_feat> cds_feat;
254  CSeq_feat* cds_feat_ptr = NULL;
255  if (!md.is_ncrna) {
256  cds_feat = create_cdregion_feature(md);
257  cds_feat_ptr = cds_feat.GetPointer();
258  }
259 
260  try {
261  CRef<CSeq_entry> model_products(new CSeq_entry);
262  nucprots->push_back(model_products);
263 
264  CRef<CSeq_feat> mrna_feat = feature_generator->ConvertAlignToAnnot(*align, *gnomon_models_annot, model_products->SetSet(), model.GeneID(), cds_feat_ptr);
265 
266  DumpEvidence(md);
267 
268  CRef< CUser_object > user_obj = create_ModelEvidence_user_object(model);
269  mrna_feat->SetExts().push_back(user_obj);
270 
271  AddInternalFeature(md);
272  }
273  catch (CException&) {
274  cerr << MSerial_AsnText << *align;
275  throw;
276  }
277 }
278 
280 {
281  const CGeneModel& model = md.model;
282  const CCDSInfo& cds = model.GetCdsInfo();
283 
284  CRef<CSeq_feat> cdregion_feature(new CSeq_feat);
285 
287  cdrcode->SetId(gencode);
288  cdregion_feature->SetData().SetCdregion().SetCode().Set().push_back(cdrcode);
289 
290  if(model.PStop()) {
291  CCdregion::TCode_break& code_breaks = cdregion_feature->SetData().SetCdregion().SetCode_break();
292  ITERATE(CCDSInfo::TPStops,s,cds.PStops()) {
293  if(!Include(cds.Cds(),*s))
294  continue;
295 
296  CRef< CCode_break > code_break(new CCode_break);
297  CRef<CSeq_loc> pstop;
298 
299  TSeqPos from = s->GetFrom();
300  TSeqPos to = s->GetTo();
301  _ASSERT(from+2==to);
302 
303  pstop.Reset(new CSeq_loc(*md.mrna_sid, from, to, eNa_strand_plus));
304 
305  code_break->SetLoc(*pstop);
307  if(s->m_status == CCDSInfo::eSelenocysteine)
308  aa->SetNcbieaa('U');
309  else
310  aa->SetNcbieaa('X');
311  code_break->SetAa(*aa);
312  code_breaks.push_back(code_break);
313  }
314  }
315 
316  cdregion_feature->SetProduct().SetWhole(*md.prot_sid);
317 
318  TSignedSeqRange tlim = model.TranscriptLimits();
319  int altstart = (cds.MaxCdsLimits()&tlim).GetFrom();
320  int start = cds.Cds().GetFrom();
321  int stop = (cds.MaxCdsLimits()&tlim).GetTo();
322 
323  int frame = 0;
324  if(!model.HasStart()) {
325  _ASSERT(altstart == 0);
326  frame = start%3;
327  start = 0;
328  }
330  if(frame == 1) ncbi_frame = CCdregion::eFrame_two;
331  else if(frame == 2) ncbi_frame = CCdregion::eFrame_three;
332  cdregion_feature->SetData().SetCdregion().SetFrame(ncbi_frame);
333 
334  CRef<CSeq_loc> cdregion_location;
335 
336  cdregion_location.Reset(new CSeq_loc(*md.mrna_sid, start, stop, eNa_strand_plus));
337 
338  if (0 < altstart && altstart != start)
339  cdregion_location->SetInt().SetFuzz_from().SetAlt().push_back(altstart);
340 
341  if (!model.HasStart())
342  cdregion_location->SetPartialStart(true,eExtreme_Biological);
343  if (!model.HasStop())
344  cdregion_location->SetPartialStop(true,eExtreme_Biological);
345  cdregion_feature->SetLocation(*cdregion_location);
346 
347  if (!model.HasStart() || !model.HasStop() || !model.Continuous())
348  cdregion_feature->SetPartial(true);
349 
350  return cdregion_feature;
351 }
352 
354 {
355  CRef<CSeq_loc> seq_loc(new CSeq_loc);
356  CPacked_seqint& packed_int = seq_loc->SetPacked_int();
358 
359  CAlignMap amap = model.GetAlignMap();
360 
361  for (size_t i=0; i < model.Exons().size(); ++i) {
362  const CModelExon* e = &model.Exons()[i];
363 
364  if(e->Limits().NotEmpty()) { // not a ggap
365  TSignedSeqRange interval_range_on_mrna = amap.MapRangeOrigToEdited(e->Limits()) & limits_on_mrna;
366  if (interval_range_on_mrna.Empty())
367  continue;
368 
369  bool extends_to_left = interval_range_on_mrna.GetFrom() > limits_on_mrna.GetFrom();
370  bool extends_to_right = interval_range_on_mrna.GetTo() < limits_on_mrna.GetTo();
371  if(model.Strand() == eMinus)
372  swap(extends_to_left,extends_to_right);
373 
374  TSignedSeqRange interval_range = amap.MapRangeEditedToOrig(interval_range_on_mrna);
375  CRef<CSeq_interval> interval(new CSeq_interval(*contig_sid, interval_range.GetFrom(),interval_range.GetTo(), strand));
376 
377  if (i > 0 && (!e->m_fsplice || (model.Exons()[i-1].Limits().Empty() && extends_to_left))) {
378  _ASSERT(interval_range.GetFrom() == e->Limits().GetFrom());
379  interval->SetFuzz_from().SetLim(CInt_fuzz::eLim_lt);
380  }
381  if (i < model.Exons().size()-1 && (!e->m_ssplice || (model.Exons()[i+1].Limits().Empty() && extends_to_right))) {
382  _ASSERT(interval_range.GetTo() == e->Limits().GetTo());
383  interval->SetFuzz_to().SetLim(CInt_fuzz::eLim_gt);
384  }
385 
386  packed_int.AddInterval(*interval);
387  }
388  }
389  return seq_loc->Merge(CSeq_loc::fSort, NULL);
390 }
391 
392 void ExpandSupport(const CSupportInfoSet& src, CSupportInfoSet& dst, IEvidence& evidence)
393 {
394  ITERATE(CSupportInfoSet, s, src) {
395  dst.insert(*s);
396 
397  const CAlignModel* m = evidence.GetModel(s->GetId());
398  if (m && (m->Type()&(CAlignModel::eChain|CAlignModel::eGnomon))!=0) {
399  _ASSERT( !s->IsCore() );
400  ExpandSupport(m->Support(), dst, evidence);
401  }
402  }
403 }
404 
406 {
407  const CGeneModel& model = md.model;
408  evidence.GetModel(model.ID()); // complete chains might not get marked as used otherwise
409 
410  if (model.Support().empty())
411  return;
412  CRef<CSeq_annot> seq_annot(new CSeq_annot);
413  CSeq_annot::C_Data::TAlign* aligns = &seq_annot->SetData().SetAlign();
414 
415  {{
416  string id_str = CIdHandler::ToString(*md.mrna_sid);
417 
418  NameAnnot(*seq_annot, "Evidence for " + id_str);
419 
420  CRef<CAnnot_id> annot_id(new CAnnot_id);
421  annot_id->SetGeneral().SetDb("GNOMON");
422  CIdHandler::SetId(annot_id->SetGeneral().SetTag(), md.model.ID());
423  seq_annot->SetId().push_back(annot_id);
424  }}
425 
426 
427  ITERATE(CSupportInfoSet, s, model.Support()) {
428  Int8 id = s->GetId();
429 
430  CRef<CSeq_align> a(const_cast<CSeq_align*>(evidence.GetSeq_align(id).GetPointerOrNull()));
431  if (a.NotEmpty()) { //output asn alignments (chainer)
432  aligns->push_back(a);
433  } else {
434  const CAlignModel* m = evidence.GetModel(id);
435  if (m != NULL && (m->Type()&CGeneModel::eChain)) { //output supporting chains (gnomon)
436  unique_ptr<SModelData> smd;
437  smd.reset( new SModelData(*m, contig_seq, shift) );
438  AddInternalFeature(*smd);
439  CreateModelProducts(*smd);
440  aligns->push_back(model2spliced_seq_align(*smd));
441  }
442  }
443  }
444 
445  if(!aligns->empty())
446  main_seq_entry->SetSet().SetAnnot().push_back(seq_annot);
447 }
448 
449 int CollectUserField(const CUser_field& field, const string& name, vector<string>& values)
450 {
451  int count = 0;
452  if (field.HasField(name)) {
453  const CUser_field& fn = field.GetField(name);
454  const CUser_field::C_Data::TStrs& strs = fn.GetData().GetStrs();
455  copy(strs.begin(), strs.end(), back_inserter(values));
456  if(fn.CanGetNum())
457  count = fn.GetNum();
458  else
459  count = (int)strs.size();
460  }
461 
462  return count;
463 }
464 
465 
466 string ModelMethod(const CGeneModel& model) {
467  string method;
468  bool ggap = false;
469  for(int i = 1; i < (int)model.Exons().size() && !ggap; ++i) {
470  ggap = model.Exons()[i-1].m_ssplice_sig == "XX" || model.Exons()[i].m_fsplice_sig == "XX";
471  }
472  if(model.Type()&CGeneModel::eChain) {
473  method = ggap ? "Chainer_GapFilled" : "Chainer";
474  } else if(model.Type()&CGeneModel::eGnomon) {
475  if(model.Support().empty())
476  method = "FullAbInitio";
477  else
478  method = ggap ? "PartAbInitio_GapFilled" : "PartAbInitio";
479  } else {
480  method = CGeneModel::TypeToString(model.Type());
481  }
482 
483  return method;
484 }
485 
486 
488 {
489  if(model.Type()&CGeneModel::eChain) {
490  CRef<CUser_object> uo = evidence.GetModelEvidenceUserObject(model.ID());
491  if(uo.NotNull() && uo->HasField("Support"))
492  return uo;
493  }
494 
495  CRef< CUser_object > user_obj(new CUser_object);
497  type->SetStr("ModelEvidence");
498  user_obj->SetType(*type);
499 
500  user_obj->AddField("Method",ModelMethod(model));
501 
502  if (!model.Support().empty()) {
503  CRef<CUser_field> support_field(new CUser_field());
504  support_field->SetLabel().SetStr("Support");
505  vector<string> chains;
506  vector<string> cores;
507  vector<string> proteins;
508  vector<string> mrnas;
509  vector<string> ests;
510  vector<string> short_reads;
511  vector<string> long_sras;
512  vector<string> others;
513  vector<string> unknown;
514 
515  int ests_count = 0;
516  int long_sras_count = 0;
517  int others_count = 0;
518 
519  ITERATE(CSupportInfoSet, s, model.Support()) {
520  Int8 id = s->GetId();
521  const CAlignModel* m = evidence.GetModel(id);
522  if(m == 0)
523  continue;
524 
525  int type = m->Type();
526  string accession;
527  if (m->Type()&CGeneModel::eChain) {
529  } else {
530  accession = CIdHandler::ToString(*m->GetTargetId());
531  }
532 
533  if (s->IsCore())
534  cores.push_back(accession);
535 
536  if (type&CGeneModel::eChain) {
537  chains.push_back(accession);
538  CRef<CUser_object> uo = evidence.GetModelEvidenceUserObject(id);
539  if(uo.NotNull() && uo->HasField("Support")) {
540  const CUser_field& support_field = uo->GetField("Support");
541  CollectUserField(support_field, "Core", cores);
542  CollectUserField(support_field, "Proteins", proteins);
543  CollectUserField(support_field, "mRNAs", mrnas);
544  ests_count += CollectUserField(support_field, "ESTs", ests);
545  CollectUserField(support_field, "RNASeq", short_reads);
546  long_sras_count += CollectUserField(support_field, "longSRA", long_sras);
547  others_count += CollectUserField(support_field, "other", others);
548  }
549  } else if (type&CGeneModel::eProt) {
550  proteins.push_back(accession);
551  } else if (type&CGeneModel::emRNA) {
552  mrnas.push_back(accession);
553  } else if (type&CGeneModel::eEST) {
554  if(NStr::StartsWith(accession, "gi|")) {
555  ests.push_back(accession);
556  ests_count += m->Weight();
557  } else if(NStr::StartsWith(accession, "gnl|SRA")) {
558  long_sras.push_back(accession);
559  long_sras_count += m->Weight();
560  } else {
561  others.push_back(accession);
562  others_count += m->Weight();
563  }
564  } else if (type&CGeneModel::eSR) {
565  short_reads.push_back(accession);
566  } else {
567  unknown.push_back(accession);
568  }
569  }
570 
571  bool have_something = false;
572 
573  if (!chains.empty()) {
574  support_field->AddField("Chains",chains);
575  support_field->SetData().SetFields().back()->SetNum((CUser_field_Base::TNum)chains.size());
576  have_something = true;
577  }
578  if (!cores.empty()) {
579  support_field->AddField("Core",cores);
580  support_field->SetData().SetFields().back()->SetNum((CUser_field_Base::TNum)cores.size());
581  have_something = true;
582  }
583  if (!proteins.empty()) {
584  sort(proteins.begin(),proteins.end());
585  support_field->AddField("Proteins",proteins);
586  support_field->SetData().SetFields().back()->SetNum((CUser_field_Base::TNum)proteins.size());
587  have_something = true;
588  }
589  if (!mrnas.empty()) {
590  sort(mrnas.begin(),mrnas.end());
591  support_field->AddField("mRNAs",mrnas);
592  support_field->SetData().SetFields().back()->SetNum((CUser_field_Base::TNum)mrnas.size());
593  have_something = true;
594  }
595  if (!ests.empty()) {
596  sort(ests.begin(),ests.end());
597  support_field->AddField("ESTs",ests);
598  support_field->SetData().SetFields().back()->SetNum(ests_count);
599  have_something = true;
600  }
601  if (!short_reads.empty()) {
602  sort(short_reads.begin(),short_reads.end());
603  support_field->AddField("RNASeq",short_reads);
604  support_field->SetData().SetFields().back()->SetNum((CUser_field_Base::TNum)short_reads.size());
605  have_something = true;
606  }
607  if (!long_sras.empty()) {
608  sort(long_sras.begin(),long_sras.end());
609  support_field->AddField("longSRA",long_sras);
610  support_field->SetData().SetFields().back()->SetNum(long_sras_count);
611  have_something = true;
612  }
613  if (!others.empty()) {
614  sort(others.begin(),others.end());
615  support_field->AddField("other",others);
616  support_field->SetData().SetFields().back()->SetNum(others_count);
617  have_something = true;
618  }
619  if (!unknown.empty()) {
620  support_field->AddField("unknown",unknown);
621  support_field->SetData().SetFields().back()->SetNum((CUser_field_Base::TNum)unknown.size());
622  have_something = true;
623  }
624 
625  if (have_something)
626  user_obj->SetData().push_back(support_field);
627  }
628 
629  if(!model.ProteinHit().empty())
630  user_obj->AddField("BestTargetProteinHit",model.ProteinHit());
631  if(model.Status()&CGeneModel::eFullSupCDS)
632  user_obj->AddField("CDS support",string("full"));
633 
634  return user_obj;
635 }
636 
637 
639 {
640  const CAlignModel& model = md.model;
641 
642  CRef<CSeq_feat> feature(new CSeq_feat);
643 
644  CRef<CObject_id> obj_id( new CObject_id() );
645  CIdHandler::SetId(*obj_id, model.ID());
646  CRef<CFeat_id> feat_id( new CFeat_id() );
647  feat_id->SetLocal(*obj_id);
648  feature->SetIds().push_back(feat_id);
649 
650  CRef<CUser_object> user( new CUser_object);
651  user->SetClass("Gnomon");
652  user->SetType().SetStr("Model Internal Attributes");
653  feature->SetExts().push_back(user);
654 
655  if (model.Type() & (CGeneModel::eGnomon | CGeneModel::eChain))
656  user->AddField("Method", ModelMethod(model));
657 
660  if (model.GetTargetId().NotEmpty())
661  attributes["Target"] = CIdHandler::ToString(*model.GetTargetId());
663  if (!a->second.empty())
664  user->AddField(a->first, a->second);
665  }
666 
667  if (model.Score() != BadScore())
668  user->AddField("cds_score", model.Score());
669 
670  const CCDSInfo& cds_info = model.GetCdsInfo();
671  TSignedSeqRange rcds_on_mrna = cds_info.MaxCdsLimits() & model.TranscriptLimits();
672  int frame = 0;
673  if(cds_info.HasStart())
674  rcds_on_mrna.SetFrom(cds_info.Start().GetFrom());
675  else
676  frame = (cds_info.Cds().GetFrom()-rcds_on_mrna.GetFrom())%3;
677 
678  if (cds_info.ReadingFrame().NotEmpty() && model.GetAlignMap().MapRangeOrigToEdited(model.Limits(),false).IntersectingWith(rcds_on_mrna)) { // at least some CDS could be projected on genome
679  // create cdregion feature as there is no other place to show CDS on evidence alignment
680 
681  _ASSERT((model.Status()&CGeneModel::eReversed) == 0); // needs to be changed if not true
682 
683  feature->SetLocation(*create_packed_int_seqloc(model,rcds_on_mrna));
685  cdrcode->SetId(1);
686  feature->SetData().SetCdregion().SetCode().Set().push_back(cdrcode);
687 
689  if(frame == 1) ncbi_frame = CCdregion::eFrame_two;
690  else if(frame == 2) ncbi_frame = CCdregion::eFrame_three;
691  feature->SetData().SetCdregion().SetFrame(ncbi_frame);
692  } else {
693  feature->SetLocation(*create_packed_int_seqloc(model,model.TranscriptLimits()));
694  feature->SetData().SetRna().SetType(CRNA_ref::eType_mRNA);
695  }
696 
697  return feature;
698 }
699 
700 //CRef<CSpliced_exon> CAnnotationASN1::CImplementationData::spliced_exon (const CModelExon& e, EStrand strand) const
702 {
704 
705  if(e.Limits().NotEmpty()) { // normal exon
706  se->SetGenomic_start(e.GetFrom());
707  se->SetGenomic_end(e.GetTo());
708  } else { // gap filler
710  se->SetGenomic_id(*fillerid);
711  se->SetGenomic_strand(e.m_source.m_strand==ePlus?eNa_strand_plus:eNa_strand_minus);
712  se->SetGenomic_start(e.m_source.m_range.GetFrom());
713  se->SetGenomic_end(e.m_source.m_range.GetTo());
714  }
715 
716  if(e.m_ident > 0) {
717  CRef<CScore> scr(new CScore);
718  scr->SetValue().SetReal(e.m_ident);
719  CRef<CObject_id> id(new CObject_id());
720  id->SetStr("idty");
721  scr->SetId(*id);
722  se->SetScores().Set().push_back(scr);
723  }
724 
725  if (e.m_fsplice) {
726  // _ASSERT(e.m_fsplice_sig.length() == 2);
727  if (strand==ePlus) {
728  se->SetAcceptor_before_exon().SetBases(e.m_fsplice_sig);
729  } else {
730  se->SetDonor_after_exon().SetBases(e.m_fsplice_sig);
731  }
732  }
733  if (e.m_ssplice) {
734  // _ASSERT(e.m_ssplice_sig.length() == 2);
735  if (strand==ePlus) {
736  se->SetDonor_after_exon().SetBases(e.m_ssplice_sig);
737  } else {
738  se->SetAcceptor_before_exon().SetBases(e.m_ssplice_sig);
739  }
740  }
741  return se;
742 }
743 
744 
747  pos->SetProtpos().SetFrame(nultripos%3 + 1);
748  pos->SetProtpos().SetAmin(nultripos/3);
749  return pos;
750 }
751 
752 CRef<CSeq_align> AlignModelToSeqalign(const CAlignModel& model, CSeq_id& mrnaid, CSeq_id& contigid, bool is_align, bool is_protalign, bool stop_found) {
753 
754  CRef< CSeq_align > seq_align( new CSeq_align );
755 
756  if(model.ID() > 0) {
757  CRef<CObject_id> id(new CObject_id());
758  CIdHandler::SetId(*id, model.ID());
759  seq_align->SetId().push_back(id);
760  }
761 
763  CSpliced_seg& spliced_seg = seq_align->SetSegs().SetSpliced();
764 
765  if(is_protalign) {
767  int product_length = model.TargetLen()/3;
768  if(stop_found)
769  --product_length;
770  spliced_seg.SetProduct_length(product_length);
771  } else {
773  spliced_seg.SetProduct_length(model.TargetLen());
774  }
775  if (model.Status() & CAlignModel::ePolyA) {
776  spliced_seg.SetPoly_a((model.Status() & CAlignModel::eReversed)? model.PolyALen() - 1 : model.TargetLen() - model.PolyALen());
777  }
778 
779  spliced_seg.SetProduct_id(mrnaid);
780  spliced_seg.SetGenomic_id(contigid);
783 
784  CSpliced_seg::TExons& exons = spliced_seg.SetExons();
785 
786  TInDels indels = (is_protalign ? model.GetInDels(false) : model.FrameShifts());
787  TInDels::const_iterator indel_i = indels.begin();
788  for (int i = 0; i < (int)model.Exons().size(); ++i) {
789  const CModelExon *e = &model.Exons()[i];
790 
791  CRef<CSpliced_exon> se = spliced_exon(*e,model.Strand());
792 
793  TSignedSeqRange transcript_exon = model.TranscriptExon(i);
794  if(is_protalign) {
795  se->SetProduct_start(*NucPosToProtPos(transcript_exon.GetFrom()));
796  se->SetProduct_end(*NucPosToProtPos(transcript_exon.GetTo()));
797  } else {
798  se->SetProduct_start().SetNucpos(transcript_exon.GetFrom());
799  se->SetProduct_end().SetNucpos(transcript_exon.GetTo());
800  }
801 
802  if(e->Limits().NotEmpty()) { // normal exon
803  int last_chunk = e->GetFrom();
804  for( ;indel_i != indels.end() && indel_i->Loc() <= e->GetTo()+1; ++indel_i) {
805  const CInDelInfo& indel = *indel_i;
806  _ASSERT( e->GetFrom() <= indel.Loc() );
807 
808  if (indel.Loc()-last_chunk > 0) {
810  if(is_align) {
811  if(is_protalign)
812  chunk->SetDiag(indel.Loc()-last_chunk);
813  else
814  chunk->SetMatch(indel.Loc()-last_chunk);
815  } else
816  chunk->SetMatch(indel.Loc()-last_chunk);
817  se->SetParts().push_back(chunk);
818  last_chunk = indel.Loc();
819  }
820 
821  if(indel.IsMismatch()) {
822  _ASSERT(!is_protalign);
824  chunk->SetMismatch(indel.Len());
825  se->SetParts().push_back(chunk);
826 
827  last_chunk += indel.Len();
828  } else if (indel.IsInsertion()) {
830  chunk->SetGenomic_ins(indel.Len());
831  se->SetParts().push_back(chunk);
832 
833  last_chunk += indel.Len();
834  } else {
836  chunk->SetProduct_ins(indel.Len());
837  se->SetParts().push_back(chunk);
838  }
839  }
840  if (e->GetFrom() <= last_chunk && last_chunk <= e->GetTo()) {
842  if(is_align) {
843  if(is_protalign)
844  chunk->SetDiag(e->GetTo()-last_chunk+1);
845  else
846  chunk->SetMatch(e->GetTo()-last_chunk+1);
847  } else
848  chunk->SetMatch(e->GetTo()-last_chunk+1);
849  se->SetParts().push_back(chunk);
850  }
851  } else { // gap filler
853  if(is_align) {
854  if(is_protalign)
855  chunk->SetDiag(e->m_source.m_range.GetLength());
856  else
857  chunk->SetMatch(e->m_source.m_range.GetLength());
858  } else
859  chunk->SetMatch(e->m_source.m_range.GetLength());
860  se->SetParts().push_back(chunk);
861  }
862 
863  exons.push_back(se);
864  }
865  _ASSERT( indel_i == indels.end() );
866 
867  if (model.Strand() == eMinus) {
868  // reverse if minus strand (don't forget to reverse chunks)
869  exons.reverse();
870  NON_CONST_ITERATE(CSpliced_seg::TExons, exon_i, exons) {
871  CSpliced_exon& se = **exon_i;
872  if (se.IsSetParts())
873  se.SetParts().reverse();
874  }
875  }
876 
877  if(!model.FrameShifts().empty() && !is_protalign) {
878  TSignedSeqRange tlim = model.TranscriptLimits();
879  int left_not_aligned = tlim.GetFrom();
880  int right_not_aligned = model.TargetLen()-tlim.GetTo()-1;
881  if(model.Strand() == eMinus)
882  swap(left_not_aligned, right_not_aligned);
883 
884  string mismatches(left_not_aligned, 'N'); // will include mismatches and deletions
885  string mismstatus; // will include status for mismatches and indels
886  TInDels::const_iterator indl = model.FrameShifts().begin();
887  for(int e = 0; e < (int)model.Exons().size(); ++e) {
888  if(model.Exons()[e].Limits().Empty())
889  continue;
890  if(e > 0 && !model.Exons()[e].m_fsplice) {
891  int len;
892  if(model.Orientation() == ePlus)
893  len = model.TranscriptExon(e).GetFrom()-model.TranscriptExon(e-1).GetTo()-1;
894  else
895  len = model.TranscriptExon(e-1).GetFrom()-model.TranscriptExon(e).GetTo()-1;
896  mismatches += string(len, 'N');
897  }
898  for( ; indl != model.FrameShifts().end() && indl->IntersectingWith(model.Exons()[e].GetFrom(), model.Exons()[e].GetTo()); ++indl) {
899  switch(indl->GetStatus()) {
901  mismstatus.push_back('n'); break;
903  mismstatus.push_back('c'); break;
904  default:
905  mismstatus.push_back('u'); break;
906  }
907  if(!indl->IsInsertion())
908  mismatches += indl->GetInDelV();
909  }
910  }
911  mismatches += string(right_not_aligned, 'N');
912 
913  if(mismatches.find_first_not_of('N') != string::npos) {
914  CRef<CUser_object> userm( new CUser_object);
915  CRef<CObject_id> typem(new CObject_id);
916  typem->SetStr("MismatchedBases");
917  userm->SetType(*typem);
918  userm->AddField("Bases", mismatches);
919  seq_align->SetExt().push_back(userm);
920  }
921 
922  if(mismstatus.find_first_not_of('u') != string::npos) {
923  CRef<CUser_object> users( new CUser_object);
925  types->SetStr("MismatchedBasesStatus");
926  users->SetType(*types);
927  users->AddField("Status", mismstatus);
928  seq_align->SetExt().push_back(users);
929  }
930  }
931 
932  return seq_align;
933 }
934 
936 
937  bool is_align = !(Type()&(eChain|eGnomon));
938 
939  CAlignModel model = *this;
940  if(is_align && (Type()&eProt) && HasStop()) {
941  _ASSERT(GetCdsInfo().IsMappedToGenome());
942  TSignedSeqRange lim = GetCdsInfo().Start()+GetCdsInfo().ReadingFrame();
943  model.Clip(lim,eRemoveExons); // protein alignments doesn't include stop
944  }
945 
946  CRef<CSeq_id> contig_sid(CIdHandler::ToSeq_id(contig));
947  CRef<CSeq_id> mrna_sid(new CSeq_id);
948  mrna_sid->Assign(*GetTargetId());
949  CRef<CSeq_align> seq_align = AlignModelToSeqalign(model, *mrna_sid, *contig_sid, is_align, is_align && (Type()&eProt), is_align && (Type()&eProt) && HasStop());
950 
951  if(is_align) {
952  CSpliced_seg& spliced_seg = seq_align->SetSegs().SetSpliced();
953 
954  if(Ident() > 0) {
955  int matches = Ident()*seq_align->GetAlignLength()+0.5;
956  seq_align->SetNamedScore("matches", matches);
957  }
958 
959  if(Status()&eBestPlacement)
960  seq_align->SetNamedScore("rank", 1);
961 
962  if(Status()&eUnknownOrientation)
963  seq_align->SetNamedScore("ambiguous_orientation", 1);
964 
965  if(Weight() > 1)
966  seq_align->SetNamedScore("count", int(Weight()+0.5));
967 
968  if(Type()&eProt) {
969  if(HasStart()) {
971  modi->SetStart_codon_found(true);
972  spliced_seg.SetModifiers().push_back(modi);
973  }
974  if(HasStop()) {
976  modi->SetStop_codon_found(true);
977  spliced_seg.SetModifiers().push_back(modi);
978  }
979  }
980  }
981 
982  return seq_align;
983 }
984 
986 {
987  const CAlignModel& model = md.model;
988 
989  CRef<CSeq_align> seq_align = AlignModelToSeqalign(model, *md.mrna_sid, *contig_sid, false, false, false);
990 
991  CRef<CUser_object> user( new CUser_object);
992  user->SetClass("Gnomon");
994  type->SetStr("AlignmentAttributes");
995  user->SetType(*type);
996  seq_align->SetExt().push_back(user);
997  user->AddField(kGnomonConstructed, true);
998 
999 #ifdef _DEBUG
1000  try {
1001  seq_align->Validate(true);
1002  } catch (...) {
1003  _ASSERT(false);
1004  }
1005 // try {
1006 // CNcbiOstrstream ostream;
1007 // ostream << MSerial_AsnBinary << *seq_align;
1008 // } catch (...) {
1009 // _ASSERT(false);
1010 // }
1011 #endif
1012 
1013  return seq_align;
1014 }
1015 
1017 {
1018  ITERATE(CSeq_feat::TExts, uo, feat.GetSeq_feat()->GetExts()) {
1019  if ((*uo)->GetType().GetStr() == "ModelEvidence" ) {
1020  return *uo;
1021  }
1022  }
1023  return CRef<CUser_object>();
1024 }
1025 
1027 {
1028  const CUser_object& user = *feat.GetSeq_feat()->GetExts().front();
1029  _ASSERT( user.GetType().GetStr() == "Model Internal Attributes" || user.GetType().GetStr() == "ModelEvidence" );
1030  if (user.HasField("Method")) {
1031  string method = user.GetField("Method").GetData().GetStr();
1032  if (method.find("AbInitio") != string::npos || method.find("Gnomon") != string::npos)
1034  else if (method.find("Chainer") != string::npos)
1035  model.SetType(CGeneModel::eChain);
1036  }
1037 }
1038 
1039 void RestoreModelAttributes(const CSeq_feat_Handle& feat_handle, CAlignModel& model)
1040 {
1042 
1043  _ASSERT(feat_handle);
1044 
1045  const CUser_object& user = *feat_handle.GetOriginalSeq_feat()->GetExts().front();
1046  _ASSERT( user.GetClass() == "Gnomon" );
1047  _ASSERT( user.GetType().GetStr() == "Model Internal Attributes" );
1048 
1049 
1050  model.SetType(0);
1051  RestoreModelMethod(feat_handle, model);
1052 
1053  ITERATE(CUser_object::TData, f, user.GetData()) {
1054  const CUser_field& fld = **f;
1055  if (fld.GetData().IsStr())
1056  attributes[fld.GetLabel().GetStr()] = fld.GetData().GetStr();
1057  else if (fld.GetLabel().GetStr() == "cds_score")
1058  attributes["cds_score"] = NStr::DoubleToString(fld.GetData().GetReal());
1059  }
1060 
1061  ParseAttributes(attributes, model);
1062 
1063  if (attributes.find("cds_score") != attributes.end()) {
1064  double score = NStr::StringToDouble(attributes["cds_score"]);
1065  CCDSInfo cds_info = model.GetCdsInfo();
1066  cds_info.SetScore(score, cds_info.OpenCds());
1067  model.SetCdsInfo(cds_info);
1068  }
1069 
1070  if(model.GetCdsInfo().ReadingFrame().NotEmpty()) {
1071  CCDSInfo cds_info_t = model.GetCdsInfo();
1072  CCDSInfo cds_info_g = cds_info_t.MapFromEditedToOrig(model.GetAlignMap());
1073  if(cds_info_g.ReadingFrame().NotEmpty()) // successful projection
1074  model.SetCdsInfo(cds_info_g);
1075  }
1076 }
1077 
1079 {
1080  if (feat && feat.GetFeatType() == CSeqFeatData::e_Cdregion) {
1081  TSeqRange cds_range = feat.GetLocation().GetTotalRange();
1082  TSignedSeqRange rf = TSignedSeqRange(cds_range.GetFrom(), cds_range.GetTo());
1083  if (!feat.GetLocation().GetId()->Match(*CIdHandler::GnomonMRNA(model.ID()))) {
1084  rf = model.GetAlignMap().MapRangeOrigToEdited(rf, false);
1085  }
1086 
1087  if (feat.GetData().GetCdregion().CanGetFrame()) {
1088 
1089  CCdregion::EFrame ncbi_frame = feat.GetData().GetCdregion().GetFrame();
1090  int phase = 0;
1091  switch (ncbi_frame) {
1093  case CCdregion::eFrame_one:
1094  phase = 0;
1095  break;
1096  case CCdregion::eFrame_two:
1097  phase = 1;
1098  break;
1100  phase = 2;
1101  break;
1102  default:
1103  _ASSERT( false);
1104  }
1105 
1106  bool notreversed = (model.Status()&CGeneModel::eReversed) == 0;
1107  if(notreversed) {
1108  rf.SetFrom(rf.GetFrom()+phase);
1109  rf.SetTo(rf.GetTo()-rf.GetLength()%3);
1110  } else {
1111  rf.SetTo(rf.GetTo()-phase);
1112  rf.SetFrom(rf.GetFrom()+rf.GetLength()%3);
1113  }
1114  }
1115 
1116  CCDSInfo cds_info(false); // mrna coordinates; will be projected to genome at the end if possible
1117  cds_info.SetReadingFrame(rf, false);
1118  model.SetCdsInfo(cds_info);
1119  }
1120 }
1121 
1122 CAlignModel* RestoreModel(const CSeq_feat_Handle& internal_feat, const CSeq_feat_Handle& cds_feat, const CSeq_align& align)
1123 {
1124  CAlignModel* model = new CAlignModel(align);
1125 
1126  RestoreModelReadingFrame(cds_feat, *model);
1127 
1128  RestoreModelAttributes(internal_feat, *model);
1129 
1130  return model;
1131 }
1132 
1134 {
1135  CScope& scope = feat.GetScope();
1136  CBioseq_Handle mrna_handle = scope.GetBioseqHandle(*feat.GetProduct().GetId());
1137  CConstRef<CBioseq> mrna = mrna_handle.GetCompleteBioseq();
1138  _ASSERT(mrna->IsNa());
1139 
1140  const CSeq_align& align = *mrna->GetInst().GetHist().GetAssembly().front();
1141  const CObject_id& obj_id = *align.GetId().back();
1142 
1143  CFeat_CI cds_feat(mrna_handle);
1144  while (cds_feat && !cds_feat->GetOriginalFeature().GetData().IsCdregion())
1145  ++cds_feat;
1146 
1147  const CTSE_Handle& tse_handle = feat.GetAnnot().GetTSE_Handle();
1148  CSeq_feat_Handle feat_handle = tse_handle.GetFeatureWithId(CSeqFeatData::e_Rna, obj_id);
1149  if (!feat_handle) {
1150  feat_handle = tse_handle.GetFeatureWithId(CSeqFeatData::e_Cdregion, obj_id);
1151  }
1152 
1153  return RestoreModel(feat_handle, *cds_feat, align);
1154 }
1155 
1157 {
1158  Int8 id = CIdHandler::GetId(feat.GetOriginalSeq_feat()->GetIds().front()->GetLocal());
1159 
1160  CScope& scope = feat.GetScope();
1161  CConstRef<CSeq_id> mrna_seq_id = CIdHandler::GnomonMRNA(id);
1162  CBioseq_Handle mrna_handle = scope.GetBioseqHandle(*mrna_seq_id);
1163  if (!mrna_handle)
1164  return NULL;
1165  CConstRef<CBioseq> mrna = mrna_handle.GetCompleteBioseq();
1166  _ASSERT(mrna->IsNa());
1167 
1168  const CSeq_align& align = *mrna->GetInst().GetHist().GetAssembly().front();
1169 
1170  return RestoreModel(feat, feat, align);
1171 }
1172 
1173 bool IsGnomonConstructed(const CSeq_align& seq_align)
1174 {
1175  if (seq_align.CanGetExt()) {
1176  CSeq_align::TExt ext = seq_align.GetExt();
1177  ITERATE(CSeq_align::TExt, u, ext) {
1178  if ((*u)->CanGetClass() && (*u)->GetClass() == "Gnomon" &&
1179  (*u)->HasField(kGnomonConstructed) &&
1180  (*u)->GetField(kGnomonConstructed).GetData().GetBool())
1181  return true;
1182  }
1183  }
1184  return false;
1185 }
1186 
1188  TAlignModelList& evidence_models, list<CRef<CSeq_align> >& evidence_alignments,
1189  CSeq_entry_Handle seq_entry_handle, map<string, CRef<CSeq_annot> >& seq_annot_map,
1190  set<Int8>& processed_ids)
1191 {
1192  map<string, CRef<CSeq_annot> >::iterator annot = seq_annot_map.find("Evidence for "+CIdHandler::ToString(*CIdHandler::GnomonMRNA(model_id)));
1193  if (annot == seq_annot_map.end())
1194  return;
1195 
1196  CSeq_annot::TData::TAlign aligns = annot->second->SetData().SetAlign();
1197 
1198  NON_CONST_ITERATE (CSeq_annot::TData::TAlign, align_ci, aligns) {
1199  CSeq_align& seq_align = **align_ci;
1200  const CObject_id& obj_id = *seq_align.GetId().back();
1201  Int8 id = CIdHandler::GetId(obj_id);
1202  if (!processed_ids.insert(id).second) // already there
1203  continue;
1204 
1205  const CTSE_Handle& tse_handle = seq_entry_handle.GetTSE_Handle();
1206  CSeq_feat_Handle feat_handle = tse_handle.GetFeatureWithId(CSeqFeatData::e_Rna, obj_id);
1207  if (!feat_handle)
1208  feat_handle = tse_handle.GetFeatureWithId(CSeqFeatData::e_Cdregion, obj_id);
1209 
1211  if(!cds_handle)
1212  cds_handle = feat_handle;
1213 
1214  unique_ptr<CAlignModel> model( RestoreModel(feat_handle, cds_handle, seq_align) );
1215  evidence_models.push_back(*model);
1216 
1217  ExtractSupportModels(id, evidence_models, evidence_alignments, seq_entry_handle, seq_annot_map, processed_ids);
1218 
1219  if (IsGnomonConstructed(seq_align))
1220  continue;
1221 
1222  CRef<CSeq_align> align_ref(&seq_align);
1223  evidence_alignments.push_back(align_ref);
1224  }
1225 }
1226 
1227 string CAnnotationASN1::ExtractModels(objects::CSeq_entry& seq_entry,
1228  TAlignModelList& model_list,
1229  TAlignModelList& evidence_models,
1230  list<CRef<CSeq_align> >& evidence_alignments,
1231  map<Int8, CRef<CUser_object> >& model_evidence_uo)
1232 {
1234  CSeq_entry_Handle seq_entry_handle = scope.AddTopLevelSeqEntry(seq_entry);
1235 
1236  map<string, CRef<CSeq_annot> > seq_annot_map;
1237 
1238  string contig;
1239 
1240  ITERATE(CBioseq_set::TAnnot, annot, seq_entry.SetSet().SetAnnot()) {
1241  CAnnot_descr::Tdata::const_iterator iter = (*annot)->GetDesc().Get().begin();
1242  string name;
1243  string region;
1244  for ( ; iter != (*annot)->GetDesc().Get().end(); ++iter) {
1245  if ((*iter)->IsName() ) {
1246  name = (*iter)->GetName();
1247  }
1248  if ((*iter)->IsRegion() ) {
1249  region = CIdHandler::ToString(*(*iter)->GetRegion().GetId());
1250  }
1251  }
1252  if (!name.empty()) {
1253  seq_annot_map[name] = *annot;
1254  if (name=="Gnomon models") {
1255  contig = region;
1256  }
1257  }
1258  }
1259 
1260  CRef<CSeq_annot> feature_table = seq_annot_map["Gnomon models"];
1261  _ASSERT( feature_table.NotEmpty() );
1262  _ASSERT( feature_table->IsFtable() );
1263 
1264  CRef<CSeq_annot> internal_feature_table = seq_annot_map["Gnomon internal attributes"];
1265  _ASSERT( internal_feature_table.NotEmpty() );
1266  _ASSERT( internal_feature_table->IsFtable() );
1267 
1268  SAnnotSelector sel;
1270  CFeat_CI feat_ci(scope.GetSeq_annotHandle(*feature_table), sel);
1271 
1272  if (contig.empty() && feat_ci) {
1273  contig = CIdHandler::ToString(*feat_ci->GetLocation().GetId());
1274  }
1275 
1276  set<Int8> processed_ids;
1277  for (; feat_ci; ++feat_ci) {
1278  unique_ptr<CAlignModel> model( RestoreModelFromPublicMrnaFeature(feat_ci->GetSeq_feat_Handle()) );
1279  model_list.push_back(*model);
1280  processed_ids.insert(model->ID());
1281  ExtractSupportModels(model->ID(), evidence_models, evidence_alignments, seq_entry_handle, seq_annot_map, processed_ids);
1282  model_evidence_uo[model->ID()] = GetModelEvidenceUserObject(feat_ci->GetSeq_feat_Handle());
1283  }
1284 
1285  CFeat_CI internal_feat_ci(scope.GetSeq_annotHandle(*internal_feature_table));
1286  for (; internal_feat_ci; ++internal_feat_ci) {
1287  Int8 id = CIdHandler::GetId(internal_feat_ci->GetOriginalFeature().GetIds().front()->GetLocal());
1288  if (processed_ids.find(id) != processed_ids.end()) // already there
1289  continue;
1290  unique_ptr<CAlignModel> model( RestoreModelFromInternalGnomonFeature(internal_feat_ci->GetSeq_feat_Handle()) );
1291  if (model.get() == NULL)
1292  continue;
1293  evidence_models.push_back(*model);
1294  processed_ids.insert(id);
1295  ExtractSupportModels(model->ID(), evidence_models, evidence_alignments, seq_entry_handle, seq_annot_map, processed_ids);
1296  }
1297 
1298 
1299  return contig;
1300 }
1301 
1302 END_SCOPE(gnomon)
@ eExtreme_Biological
5' and 3'
Definition: Na_strand.hpp:62
CRef< CUser_object > GetModelEvidenceUserObject(const CSeq_feat_Handle &feat)
Definition: asn1.cpp:1016
CAlignModel * RestoreModelFromPublicMrnaFeature(const CSeq_feat_Handle &feat)
Definition: asn1.cpp:1133
void ParseAttributes(TAttributes &attributes, CAlignModel &a)
CRef< CSpliced_exon > spliced_exon(const CModelExon &e, EStrand strand)
Definition: asn1.cpp:701
bool IsGnomonConstructed(const CSeq_align &seq_align)
Definition: asn1.cpp:1173
USING_SCOPE(ncbi::objects)
CRef< CProduct_pos > NucPosToProtPos(int nultripos)
Definition: asn1.cpp:745
int CollectUserField(const CUser_field &field, const string &name, vector< string > &values)
Definition: asn1.cpp:449
void ExpandSupport(const CSupportInfoSet &src, CSupportInfoSet &dst, IEvidence &evidence)
Definition: asn1.cpp:392
void CollectAttributes(const CAlignModel &a, TAttributes &attributes)
void RestoreModelMethod(const CSeq_feat_Handle &feat, CAlignModel &model)
Definition: asn1.cpp:1026
void NameAnnot(CSeq_annot &annot, const string &name)
Definition: asn1.cpp:146
void ExtractSupportModels(Int8 model_id, TAlignModelList &evidence_models, list< CRef< CSeq_align > > &evidence_alignments, CSeq_entry_Handle seq_entry_handle, map< string, CRef< CSeq_annot > > &seq_annot_map, set< Int8 > &processed_ids)
Definition: asn1.cpp:1187
void RestoreModelAttributes(const CSeq_feat_Handle &feat_handle, CAlignModel &model)
Definition: asn1.cpp:1039
void RestoreModelReadingFrame(const CSeq_feat_Handle &feat, CAlignModel &model)
Definition: asn1.cpp:1078
Int8 GetModelId(const CSeq_align &seq_align)
const string kGnomonConstructed
Definition: asn1.cpp:68
CAlignModel * RestoreModel(const CSeq_feat_Handle &internal_feat, const CSeq_feat_Handle &cds_feat, const CSeq_align &align)
Definition: asn1.cpp:1122
string ModelMethod(const CGeneModel &model)
Definition: asn1.cpp:466
CAlignModel * RestoreModelFromInternalGnomonFeature(const CSeq_feat_Handle &feat)
Definition: asn1.cpp:1156
CRef< CSeq_align > AlignModelToSeqalign(const CAlignModel &model, CSeq_id &mrnaid, CSeq_id &contigid, bool is_align, bool is_protalign, bool stop_found)
Definition: asn1.cpp:752
void MoveOrigin(TSignedSeqPos shift)
TSignedSeqRange MapRangeEditedToOrig(TSignedSeqRange edited_range, bool withextras=true) const
Definition: gnomon_seq.cpp:966
void EditedSequence(const In &original_sequence, Out &edited_sequence, bool includeholes=false) const
Definition: gnomon_seq.cpp:632
TSignedSeqRange MapRangeOrigToEdited(TSignedSeqRange orig_range, ERangeEnd lend, ERangeEnd rend) const
Definition: gnomon_seq.cpp:938
CRef< objects::CSeq_align > MakeSeqAlign(const string &contig) const
Definition: asn1.cpp:935
virtual void Clip(TSignedSeqRange limits, EClipMode mode, bool ensure_cds_invariant=true)
int PolyALen() const
CConstRef< objects::CSeq_id > GetTargetId() const
int TargetLen() const
virtual CAlignMap GetAlignMap() const
CAnnot_id –.
Definition: Annot_id.hpp:66
CBioseq_set::TSeq_set * nucprots
Definition: asn1.cpp:130
void AddModel(const CAlignModel &model)
Definition: asn1.cpp:248
map< Int8, CRef< CSeq_feat > > TGeneMap
Definition: asn1.cpp:136
CImplementationData(const string &contig_name, const CResidueVec &seq, IEvidence &evdnc, int genetic_code, int sh)
Definition: asn1.cpp:177
CRef< CUser_object > create_ModelEvidence_user_object(const CGeneModel &model)
Definition: asn1.cpp:487
CSeq_annot::C_Data::TFtable * feature_table
Definition: asn1.cpp:132
CRef< CSeq_align > model2spliced_seq_align(SModelData &md)
Definition: asn1.cpp:985
CRef< CSeq_feat > create_cdregion_feature(SModelData &md)
Definition: asn1.cpp:279
void DumpEvidence(const SModelData &md)
Definition: asn1.cpp:405
CRef< CSeq_feat > create_internal_feature(const SModelData &md)
Definition: asn1.cpp:638
void CreateModelProducts(SModelData &model)
Definition: asn1.cpp:221
CSeq_annot::C_Data::TFtable * internal_feature_table
Definition: asn1.cpp:133
unique_ptr< CFeatureGenerator > feature_generator
Definition: asn1.cpp:140
void AddInternalFeature(const SModelData &md)
Definition: asn1.cpp:238
CRef< CSeq_loc > create_packed_int_seqloc(const CGeneModel &model, TSignedSeqRange limits_on_mrna=TSignedSeqRange::GetWhole())
Definition: asn1.cpp:353
set< Int8 > models_in_internal_feature_table
Definition: asn1.cpp:134
CRef< CSeq_entry > main_seq_entry
Definition: asn1.cpp:109
static string ExtractModels(objects::CSeq_entry &seq_entry, TAlignModelList &model_list, TAlignModelList &evidence_models, list< CRef< objects::CSeq_align > > &evidence_alignments, map< Int8, CRef< CUser_object > > &model_evidence_uo)
Definition: asn1.cpp:1227
void ResetASN1()
Definition: asn1.cpp:196
CAnnotationASN1(const string &contig_name, const CResidueVec &seq, IEvidence &evidence, int genetic_code=1, int shift=0)
Definition: asn1.cpp:200
~CAnnotationASN1()
Definition: asn1.cpp:206
CRef< objects::CSeq_entry > GetASN1() const
Definition: asn1.cpp:210
unique_ptr< CImplementationData > m_data
Definition: asn1.hpp:75
void AddModel(const CAlignModel &model)
Definition: asn1.cpp:216
CAnnotdesc –.
Definition: Annotdesc.hpp:66
CBioseq_Handle –.
bool IsNa(void) const
Definition: Bioseq.cpp:345
CCDSInfo MapFromEditedToOrig(const CAlignMap &amap) const
CCDSInfo MapFromOrigToEdited(const CAlignMap &amap) const
TSignedSeqRange MaxCdsLimits() const
bool OpenCds() const
bool HasStart() const
bool IsMappedToGenome() const
void SetScore(double score, bool open=false)
TSignedSeqRange Start() const
TSignedSeqRange Cds() const
TSignedSeqRange ReadingFrame() const
const TPStops & PStops() const
vector< SPStop > TPStops
void SetReadingFrame(TSignedSeqRange r, bool protein=false)
CCode_break –.
Definition: Code_break.hpp:66
CFeat_CI –.
Definition: feat_ci.hpp:64
CFeat_id –.
Definition: Feat_id.hpp:66
double Score() const
Int8 GeneID() const
TSignedSeqRange TranscriptLimits() const
EStrand Orientation() const
double Weight() const
unsigned int & Status()
const CSupportInfoSet & Support() const
const TExons & Exons() const
TSignedSeqRange ReadingFrame() const
virtual CAlignMap GetAlignMap() const
bool Continuous() const
void SetType(int t)
TSignedSeqRange TranscriptExon(int i) const
void SetCdsInfo(const CCDSInfo &cds_info)
Int8 ID() const
TSignedSeqRange Limits() const
int Type() const
const CCDSInfo & GetCdsInfo() const
bool HasStop() const
const string & ProteinHit() const
bool HasStart() const
TInDels GetInDels(bool fs_only) const
bool PStop(bool includeall=true) const
static string TypeToString(int type)
TInDels & FrameShifts()
EStrand Strand() const
static CRef< CSeq_id > GnomonMRNA(Int8 id)
Definition: id_handler.cpp:78
static void SetId(CObject_id &obj, Int8 value)
Definition: id_handler.cpp:119
static CRef< CSeq_id > ToSeq_id(const string &str)
Definition: id_handler.cpp:73
static string ToString(const CSeq_id &id)
Definition: id_handler.cpp:68
static Int8 GetId(const CObject_id &obj)
Definition: id_handler.cpp:107
static CRef< CSeq_id > GnomonProtein(Int8 id)
Definition: id_handler.cpp:87
int Len() const
TSignedSeqPos Loc() const
bool IsInsertion() const
bool IsMismatch() const
CInDelInfo::SSource m_source
string m_fsplice_sig
double m_ident
string m_ssplice_sig
TSignedSeqPos GetFrom() const
const TSignedSeqRange & Limits() const
TSignedSeqPos GetTo() const
void AddInterval(const CSeq_interval &ival)
for convenience
CScope –.
Definition: scope.hpp:92
Definition: Score.hpp:57
void SetNamedScore(const string &id, int score)
Definition: Seq_align.cpp:636
TSeqPos GetAlignLength(bool include_gaps=true) const
Get the length of this alignment.
Definition: Seq_align.cpp:1993
void Validate(bool full_test=false) const
Definition: Seq_align.cpp:649
void SetNameDesc(const string &name)
Definition: Seq_annot.cpp:66
void SetTitleDesc(const string &title)
Definition: Seq_annot.cpp:96
bool IsFtable(void) const
Definition: Seq_annot.cpp:177
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
CSeq_feat_Handle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
CSpliced_exon_chunk –.
CSpliced_seg_modifier –.
CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
Definition: tse_handle.cpp:635
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user field.
Definition: User_field.cpp:211
CUser_field & AddField(const string &label, int value)
add fields to the current user field
Definition: User_field.cpp:92
bool HasField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Verify that a named field exists.
Definition: User_field.cpp:393
bool HasField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Verify that a named field exists.
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Access a named field in this user object.
Definition: User_object.cpp:71
virtual const CAlignModel * GetModel(Int8 id)=0
const_iterator end() const
Definition: map.hpp:152
const_iterator find(const key_type &key) const
Definition: map.hpp:153
Definition: map.hpp:338
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
bool empty() const
Definition: set.hpp:133
const_iterator find(const key_type &key) const
Definition: set.hpp:137
const_iterator end() const
Definition: set.hpp:136
#define md
Definition: compat-1.3.h:1989
static const struct attribute attributes[]
Definition: attributes.c:165
static int type
Definition: getdata.c:31
static const struct type types[]
Definition: type.c:22
vector< TResidue > CResidueVec
list< CAlignModel > TAlignModelList
double BadScore()
EStrand
@ eMinus
@ ePlus
bool Include(TSignedSeqRange big, TSignedSeqRange small)
vector< CInDelInfo > TInDels
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
Definition: ncbimisc.hpp:1508
string
Definition: cgiapp.hpp:687
#define NULL
Definition: ncbistd.hpp:225
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
Definition: Seq_id.cpp:318
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
Definition: Seq_id.hpp:1065
void SetPacked_int(TPacked_int &v)
Definition: Seq_loc.hpp:984
void SetWhole(TWhole &v)
Definition: Seq_loc.hpp:982
TRange GetTotalRange(void) const
Definition: Seq_loc.hpp:913
CRef< CSeq_loc > Merge(TOpFlags flags, ISynonymMapper *syn_mapper) const
All functions create and return a new seq-loc object.
Definition: Seq_loc.cpp:5037
void SetInt(TInt &v)
Definition: Seq_loc.hpp:983
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
Definition: Seq_loc.hpp:941
void SetPartialStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (lt/gt - indicating partial interval)
Definition: Seq_loc.cpp:3280
void SetPartialStop(bool val, ESeqLocExtremes ext)
Definition: Seq_loc.cpp:3313
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
Definition: scope.cpp:522
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
Definition: scope.cpp:504
CSeq_annot_Handle GetSeq_annotHandle(const CSeq_annot &annot, EMissing action=eMissing_Default)
Definition: scope.cpp:192
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
const CSeq_annot_Handle & GetAnnot(void) const
Get handle to seq-annot for this feature.
virtual CConstRef< CSeq_feat > GetSeq_feat(void) const
const CTSE_Handle & GetTSE_Handle(void) const
const CSeqFeatData & GetData(void) const
const CTSE_Handle & GetTSE_Handle(void) const
virtual const CSeq_loc & GetProduct(void) const
virtual const CSeq_loc & GetLocation(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
CSeqFeatData::E_Choice GetFeatType(void) const
SAnnotSelector & SetFeatType(TFeatType type)
Set feature type (also set annotation type to feat)
const CSeq_loc & GetLocation(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.
Definition: mapped_feat.hpp:71
bool NotNull(void) const THROWS_NONE
Check if pointer is not null – same effect as NotEmpty().
Definition: ncbiobj.hpp:744
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:1392
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
position_type GetLength(void) const
Definition: range.hpp:158
bool NotEmpty(void) const
Definition: range.hpp:152
bool IntersectingWith(const TThisType &r) const
Definition: range.hpp:331
bool Empty(void) const
Definition: range.hpp:148
CRange< TSignedSeqPos > TSignedSeqRange
Definition: range.hpp:420
static TThisType GetWhole(void)
Definition: range.hpp:272
#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
static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)
Convert double to string.
Definition: ncbistr.hpp:5187
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
Definition: ncbistr.cpp:1387
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5412
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
void SetFrom(TFrom value)
Assign a value to From data member.
Definition: Range_.hpp:231
TTo GetTo(void) const
Get the To member data.
Definition: Range_.hpp:269
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
void SetTo(TTo value)
Assign a value to To data member.
Definition: Range_.hpp:278
const TStr & GetStr(void) const
Get the variant data.
const TStrs & GetStrs(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool CanGetNum(void) const
Check if it is safe to call GetNum method.
const TClass & GetClass(void) const
Get the Class member data.
bool IsStr(void) const
Check if variant Str is selected.
void SetClass(const TClass &value)
Assign a value to Class data member.
TData & SetData(void)
Assign a value to Data data member.
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
void SetLabel(TLabel &value)
Assign a value to Label data member.
TStr & SetStr(void)
Select the variant.
Definition: Object_id_.hpp:304
const TData & GetData(void) const
Get the Data member data.
TReal GetReal(void) const
Get the variant data.
void SetType(TType &value)
Assign a value to Type data member.
void SetData(TData &value)
Assign a value to Data data member.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
vector< CStringUTF8 > TStrs
vector< CRef< CUser_field > > TData
TNum GetNum(void) const
Get the Num member data.
@ eLim_gt
greater than
Definition: Int_fuzz_.hpp:211
@ eLim_lt
less than
Definition: Int_fuzz_.hpp:212
const TId & GetId(void) const
Get the Id member data.
Definition: Seq_align_.hpp:976
TModifiers & SetModifiers(void)
Assign a value to Modifiers data member.
TId & SetId(void)
Assign a value to Id data member.
Definition: Seq_align_.hpp:982
void SetAmin(TAmin value)
Assign a value to Amin data member.
Definition: Prot_pos_.hpp:229
bool IsSetParts(void) const
basic seqments always are in biologic order Check if a value has been assigned to Parts data member.
void SetProduct_id(TProduct_id &value)
Assign a value to Product_id data member.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
Definition: Seq_align_.cpp:310
TExons & SetExons(void)
Assign a value to Exons data member.
void SetProduct_strand(TProduct_strand value)
Assign a value to Product_strand data member.
void SetProduct_length(TProduct_length value)
Assign a value to Product_length data member.
list< CRef< CUser_object > > TExt
Definition: Seq_align_.hpp:402
void SetType(TType value)
Assign a value to Type data member.
Definition: Seq_align_.hpp:818
TExt & SetExt(void)
Assign a value to Ext data member.
void SetProduct_type(TProduct_type value)
Assign a value to Product_type data member.
bool CanGetExt(void) const
Check if it is safe to call GetExt method.
Definition: Seq_align_.hpp:995
list< CRef< CSpliced_exon > > TExons
void SetPoly_a(TPoly_a value)
Assign a value to Poly_a data member.
TProtpos & SetProtpos(void)
Select the variant.
TParts & SetParts(void)
Assign a value to Parts data member.
void SetGenomic_id(TGenomic_id &value)
Assign a value to Genomic_id data member.
const TExt & GetExt(void) const
Get the Ext member data.
void SetGenomic_strand(TGenomic_strand value)
Assign a value to Genomic_strand data member.
void SetFrame(TFrame value)
Assign a value to Frame data member.
Definition: Prot_pos_.hpp:279
@ eType_partial
mapping pieces together
Definition: Seq_align_.hpp:103
void SetAa(TAa &value)
Assign a value to Aa data member.
const TExts & GetExts(void) const
Get the Exts member data.
Definition: Seq_feat_.hpp:1477
void SetLocation(TLocation &value)
Assign a value to Location data member.
Definition: Seq_feat_.cpp:131
const TIds & GetIds(void) const
Get the Ids member data.
Definition: Seq_feat_.hpp:1452
bool IsCdregion(void) const
Check if variant Cdregion is selected.
TIds & SetIds(void)
Assign a value to Ids data member.
Definition: Seq_feat_.hpp:1458
list< CRef< CUser_object > > TExts
Definition: Seq_feat_.hpp:127
void SetPartial(TPartial value)
Assign a value to Partial data member.
Definition: Seq_feat_.hpp:971
void SetProduct(TProduct &value)
Assign a value to Product data member.
Definition: Seq_feat_.cpp:110
TExts & SetExts(void)
Assign a value to Exts data member.
Definition: Seq_feat_.hpp:1483
TLocal & SetLocal(void)
Select the variant.
Definition: Feat_id_.cpp:140
list< CRef< CCode_break > > TCode_break
Definition: Cdregion_.hpp:111
TFrame GetFrame(void) const
Get the Frame member data.
Definition: Cdregion_.hpp:534
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_feat_.cpp:94
const TCdregion & GetCdregion(void) const
Get the variant data.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
bool CanGetFrame(void) const
Check if it is safe to call GetFrame method.
Definition: Cdregion_.hpp:515
@ eFrame_not_set
not set, code uses one
Definition: Cdregion_.hpp:95
@ eFrame_three
reading frame
Definition: Cdregion_.hpp:98
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
void SetFuzz_to(TFuzz_to &value)
Assign a value to Fuzz_to data member.
void SetFuzz_from(TFuzz_from &value)
Assign a value to Fuzz_from data member.
@ eNa_strand_plus
Definition: Na_strand_.hpp:66
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
list< CRef< CSeq_annot > > TAnnot
list< CRef< CSeq_entry > > TSeq_set
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
const TInst & GetInst(void) const
Get the Inst member data.
Definition: Bioseq_.hpp:336
void SetDesc(TDesc &value)
Assign a value to Desc data member.
Definition: Seq_annot_.cpp:223
list< CRef< CSeq_align > > TAlign
Definition: Seq_annot_.hpp:194
const TAssembly & GetAssembly(void) const
Get the Assembly member data.
Definition: Seq_hist_.hpp:512
TRegion & SetRegion(void)
Select the variant.
Definition: Annotdesc_.cpp:300
const THist & GetHist(void) const
Get the Hist member data.
Definition: Seq_inst_.hpp:859
list< CRef< CSeq_feat > > TFtable
Definition: Seq_annot_.hpp:193
TId & SetId(void)
Assign a value to Id data member.
Definition: Seq_annot_.hpp:739
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
int i
int len
const TYPE & Get(const CNamedParameterList *param)
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
Magic spell ;-) needed for some weird compilers... very empiric.
unsigned int a
Definition: ncbi_localip.c:102
T max(T x_, T y_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
Definition: njn_matrix.hpp:613
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
The Object manager core.
TSignedSeqRange m_range
SAnnotSelector –.
CRef< CSeq_id > mrna_sid
Definition: asn1.cpp:76
CEResidueVec mrna_seq
Definition: asn1.cpp:75
SModelData(const CAlignModel &model, const CEResidueVec &contig_seq, int shift)
Definition: asn1.cpp:82
CRef< CSeq_id > prot_sid
Definition: asn1.cpp:77
CAlignModel model
Definition: asn1.cpp:74
bool is_ncrna
Definition: asn1.cpp:79
Definition: type.c:6
#define _ASSERT
#define Type
const value_slice::CValueConvert< value_slice::SRunTimeCP, FROM > Convert(const FROM &value)
#define const
Definition: zconf.h:232
Modified on Sat Apr 20 12:19:20 2024 by modify_doxy.py rev. 669887