(find(ids.begin(), ids.end(),
id) == ids.end()) {
94 if(! loc.
IsMix())
return false;
97 if((*it)->IsPacked_int()) {
109 boolany_nulls_seen =
false;
116any_nulls_seen =
true;
119 if( any_nulls_seen && ! new_mix_pieces.empty() ) {
122new_mix_pieces.push_back( null_piece );
126old_piece->
SetInt().Assign(seqint);
127new_mix_pieces.push_back( old_piece );
130 if( any_nulls_seen && ! new_mix_pieces.empty() ) {
133new_mix_pieces.push_back( null_piece );
136old_piece->
Assign(curr);
137new_mix_pieces.push_back( old_piece );
142new_loc->
SetMix(*new_mix);
154 boolsuppress_accession)
163 for( ; loc_ci; ++loc_ci ) {
168 if( cached_handle ) {
179 if(! show_all_accns) {
180 if(
ctx.GetHandle().IsSynonym( loc_ci.
GetSeq_id() ) ) {
185handles_set.
insert( handle );
187 if( ! handles_set.
empty() )
189vector<CSeq_id_Handle> handles_vec;
191back_inserter(handles_vec) );
196 ctx.GetScope().GetAccVers( &
results, handles_vec );
198 for(
unsigned intid_idx = 0; id_idx < handles_vec.size(); ++id_idx ) {
202handles_vec[id_idx], acc_handle );
212 x_Add(*flat, oss,
ctx,
type,
true, show_all_accns, add_join, suppress_accession);
214 x_Add(loc, oss,
ctx,
type,
true, show_all_accns, add_join, suppress_accession);
228 boolsuppress_accession)
234 boolis_flat_order =
false;
236 const char* prefix =
"join(";
242oss <<
"complement(";
243 x_Add(*rev_loc, oss,
ctx,
type,
false, show_all_accns, add_join, suppress_accession);
248 if( loc.
IsMix() ) {
252is_flat_order =
true;
260is_flat_order =
true;
268 switch( loc.
Which() ) {
279 if(fuzz && fuzz->
IsLim() &&
283oss << uLength <<
")";
311 x_Add(loc.
GetInt(), oss,
ctx,
type, show_comp, show_all_accns, suppress_accession);
321 const char* delim =
"";
324 if(!
x_Add(**it, oss,
ctx,
type, show_comp, show_all_accns, suppress_accession)) {
337 x_Add(loc.
GetPnt(), oss,
ctx,
type, show_comp, show_all_accns, suppress_accession);
348oss <<
"complement(";
351 const char* delim =
"";
377 const char* delim =
"";
378 if( !has_one || add_join ) {
381 booljoin_inside_order =
false;
390 const boolthis_is_virtual = next_is_virtual;
398 if( is_flat_order ) {
399 if( ( this_loc.
IsInt() || this_loc.
IsPnt() ) &&
400! join_inside_order && ! this_is_virtual && ! next_is_virtual ) {
402join_inside_order =
true;
407 if( this_is_virtual && ! print_virtual ) {
411 if(!
x_Add(this_loc, oss,
ctx,
type, show_comp, show_all_accns,
false, suppress_accession)) {
419 if( is_flat_order ) {
420 if( join_inside_order && next_is_virtual ) {
422join_inside_order =
false;
426 if( join_inside_order ) {
429 if( !has_one || add_join ) {
436 const char* delim =
"";
440 if(!
x_Add(**it, oss,
ctx,
type, show_comp, show_all_accns, suppress_accession)) {
458 x_Add(bond.
GetA(), oss,
ctx,
type, show_comp, show_all_accns, suppress_accession);
461 x_Add(bond.
GetB(), oss,
ctx,
type, show_comp, show_all_accns, suppress_accession);
482 if(!
si.IsSetFuzz_to()) {
492 if(to_fuzz.
IsLim()) {
493 switch( to_fuzz.
GetLim() ) {
515 boolsuppress_accession)
517 booldo_html =
ctx.Config().DoHTML();
528oss <<
"complement(";
530 x_AddID(
si.GetId(), oss,
ctx,
type, show_all_accns, suppress_accession);
561 boolsuppress_accession)
567 const booldo_html =
ctx.Config().DoHTML();
574oss <<
"complement(";
596 boolsuppress_accession)
604 switch( fuzz->
Which() ) {
607oss <<
'('<< pnt - fuzz->
GetP_m() <<
'.';
608 if( bFromSeqPoint ) {
609oss << pnt <<
")..("<< pnt <<
'.';
611oss << pnt + fuzz->
GetP_m() <<
')';
616oss << ( bFromSeqPoint ?
"":
"(")
618<< ( bFromSeqPoint ?
'^':
'.')
620<< ( bFromSeqPoint ?
"":
")");
626 const double delta= 0.001 * pnt * fuzz->
GetPct();
627 const longstart =
static_cast<long>(pnt -
delta);
628 const longend =
static_cast<long>(pnt +
delta);
629 if( bFromSeqPoint ) {
630oss << start <<
'^'<< end;
632oss <<
'('<< start <<
'.'<< end <<
')';
638 switch( fuzz->
GetLim() ) {
640 if( bFromSeqPoint ) {
641oss << pnt <<
'^'<< (pnt + 1);
646oss << (html ==
eHTML_Yes?
">":
">") << pnt;
649 if( bFromSeqPoint ) {
650oss << (pnt - 1) <<
'^'<< pnt;
655oss << (html ==
eHTML_Yes?
"<":
"<") << pnt;
692 boolsuppress_accession)
696 if(! show_all_accns) {
697 if(
ctx.GetHandle().IsSynonym(
id)) {
699oss <<
ctx.GetAccession() <<
':';
705 if(suppress_accession) {
722 switch( idp->
Which() ) {
759CFlatSeqLoc::TToAccessionMap::const_iterator map_iter =
760m_TheMap.find(
query);
761 if( map_iter == m_TheMap.end() ) {
764 returnmap_iter->second;
bool IsReverse(ENa_strand s)
TLength GetLength(void) const
const CInt_fuzz * GetFuzz() const
CFastMutex m_MutexForTheMap
void Insert(CSeq_id_Handle from, CSeq_id_Handle to)
CSeq_id_Handle Get(CSeq_id_Handle query)
bool x_FuzzToDisplayed(const CSeq_interval &si) const
bool x_Add(const CSeq_loc &loc, ostream &oss, CBioseqContext &ctx, TType type, bool show_comp, bool show_all_accns=false, bool join_whole_loc=false, bool suppress_accession=false)
CFlatSeqLoc(const CSeq_loc &loc, CBioseqContext &ctx, TType type=eType_location, bool show_all_accns=false, bool add_join=false, bool suppress_accession=false)
static CGuardedToAccessionMap m_ToAccessionMap
void x_AddID(const CSeq_id &id, ostream &oss, CBioseqContext &ctx, TType type, bool show_all_accns=false, bool suppress_accession=false)
bool x_IsAccessionVersion(CSeq_id_Handle id)
Seq-loc iterator class â iterates all intervals from a seq-loc in the correct order.
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
static const char si[8][64]
static bool s_NeedsFlattening(const CSeq_loc &loc)
static bool s_IsVirtualSeqInt(const CSeq_interval &seqint, const CBioseq_Handle &seq)
static bool s_IsVirtualLocation(const CSeq_loc &loc, const CBioseq_Handle &seq)
static CConstRef< CSeq_loc > s_FlattenLoc(const CSeq_loc &loc)
static bool s_IsVirtualId(const CSeq_id_Handle &id, const CBioseq_Handle &seq)
static DLIST_TYPE *DLIST_NAME() next(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
void Rewind(void)
Reset the iterator to the initial state.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
CSeq_id_Handle GetSeq_id_Handle(void) const
const CSeq_loc & GetEmbeddingSeq_loc(void) const
Get the nearest seq-loc containing the current range.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
void SetNull(void)
Override all setters to incorporate cache invalidation.
@ eEmpty_Allow
ignore empty locations
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
ENa_strand GetStrand(const CSeq_loc &loc, CScope *scope=0)
Returns eNa_strand_unknown if multiple Bioseqs in loc Returns eNa_strand_other if multiple strands in...
CSeq_loc * SeqLocRevCmpl(const CSeq_loc &loc, CScope *scope)
Get reverse complement of the seq-loc (?)
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
vector< CSeq_id_Handle > TSeq_id_Handles
Bulk retrieval methods Common argument typedef - vector of requested ids.
@ eGetBioseq_Loaded
Search in all loaded TSEs in the scope.
vector< CSeq_id_Handle > TId
TInst_Repr GetInst_Repr(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
void Reset(void)
Reset reference object.
#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.
bool IsLim(void) const
Check if variant Lim is selected.
TPct GetPct(void) const
Get the variant data.
TLim GetLim(void) const
Get the variant data.
TMin GetMin(void) const
Get the Min member data.
E_Choice Which(void) const
Which variant is currently selected.
TMax GetMax(void) const
Get the Max member data.
TP_m GetP_m(void) const
Get the variant data.
const TRange & GetRange(void) const
Get the variant data.
@ eLim_tl
space to left of position
@ eLim_tr
space to right of position
@ e_Pct
% plus or minus (x10) 0-1000
@ e_P_m
plus or minus fixed amount
bool IsMix(void) const
Check if variant Mix is selected.
const TB & GetB(void) const
Get the B member data.
list< CRef< CSeq_interval > > Tdata
ENa_strand
strand of nucleic acid
const Tdata & Get(void) const
Get the member data.
TStrand GetStrand(void) const
Get the Strand member data.
const TId & GetId(void) const
Get the Id member data.
const TPnt & GetPnt(void) const
Get the variant data.
TPoint GetPoint(void) const
Get the Point member data.
const TWhole & GetWhole(void) const
Get the variant data.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
bool IsSetFuzz(void) const
Check if a value has been assigned to Fuzz data member.
list< CRef< CSeq_loc > > Tdata
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
bool CanGetA(void) const
Check if it is safe to call GetA method.
E_Choice Which(void) const
Which variant is currently selected.
const TId & GetId(void) const
Get the Id member data.
E_Choice Which(void) const
Which variant is currently selected.
const TId & GetId(void) const
Get the Id member data.
TStrand GetStrand(void) const
Get the Strand member data.
const Tdata & Get(void) const
Get the member data.
const TPacked_pnt & GetPacked_pnt(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
const TEquiv & GetEquiv(void) const
Get the variant data.
list< CRef< CSeq_loc > > Tdata
vector< TSeqPos > TPoints
bool IsPacked_int(void) const
Check if variant Packed_int is selected.
const TA & GetA(void) const
Get the A member data.
bool CanGetB(void) const
Check if it is safe to call GetB method.
bool CanGetPoint(void) const
Check if it is safe to call GetPoint method.
bool CanGetFuzz(void) const
Check if it is safe to call GetFuzz method.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
const TPoints & GetPoints(void) const
Get the Points member data.
bool IsSetId(void) const
WARNING: this used to be optional Check if a value has been assigned to Id data member.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
bool IsNull(void) const
Check if variant Null is selected.
const TFuzz & GetFuzz(void) const
Get the Fuzz member data.
const TMix & GetMix(void) const
Get the variant data.
bool IsPnt(void) const
Check if variant Pnt is selected.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
const TBond & GetBond(void) const
Get the variant data.
@ e_Gi
GenInfo Integrated Database.
@ e_Equiv
equivalent sets of locations
@ e_Empty
to NULL one Seq-id in a collection
@ e_Feat
indirect, through a Seq-feat
@ eRepr_virtual
no seq data
double value_type
The numeric datatype used by the parser.
const CharType(& source)[N]
Int4 delta(size_t dimension_, const Int4 *score_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
const char * strLinkBaseEntrezViewer
Generic utility macros and templates for exploring NCBI objects.
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