82 if (d1->CanGetSeqid() && d2->CanGetSeqid()) {
89 int diff = rank_func(c1) - rank_func(c2);
103 if (acc1.find(
"WP") == 0 && acc2.find(
"NP_") == 0)
105 else if (acc1.find(
"WP_") == 0 && acc2.find(
"YP_") == 0)
107 else if (acc1.find(
"YP_") == 0 && acc2.find(
"WP_") == 0)
109 else if (acc1.find(
"NP_") == 0 && acc2.find(
"WP_") == 0)
111 else if ((acc1.find(
"WP_") == 0 || acc1.find(
"NP_") == 0 || acc1.find(
"YP_") == 0 || acc1.find(
"AP_") == 0)
112 && acc2.find(
"XP_") == 0)
114 else if ((acc1.find(
"WP_") == 0 || acc1.find(
"NP_") == 0 || acc1.find(
"YP_") == 0)
115 && acc2.find(
"AP_") == 0)
117 else if (acc1.find(
"AP_") == 0 &&
118 (acc2.find(
"NP_") == 0 || acc2.find(
"YP_") == 0 || acc2.find(
"WP_") == 0))
120 else if (acc1.find(
"YP_") == 0 && acc2.find(
"AP_") == 0)
122 else if (acc1.find(
"XP_") == 0 &&
123 (acc2.find(
"NP_") == 0 || acc2.find(
"AP_") == 0 || acc2.find(
"YP_") == 0 || acc2.find(
"WP") == 0))
125 else if (acc1.find(
"NM_") == 0 && acc2.find(
"XM_") ==0)
127 else if (acc1.find(
"XM_") == 0 && acc2.find(
"NM_") ==0)
139 const CSeq_id & cs1 = *d1->GetSeqid().front();
140 const CSeq_id & cs2 = *d2->GetSeqid().front();
191 if(useBlastRank && is_protein){
202 for (
auto& defline:
Set()) {
204 if (
id && id->
IsGi())
return true;
222 if ((*id)->IsGi() && (*id)->GetGi() == gi) {
223 first_defline = *defline;
228 Set().erase(defline);
235 Set().push_front(first_defline);
243 rv.push_back(make_pair(
eFromType,
string(
"eFromType")));
244 rv.push_back(make_pair(
eUnigene,
string(
"eUnigene")));
245 rv.push_back(make_pair(
eStructure,
string(
"eStructure")));
246 rv.push_back(make_pair(
eGeo,
string(
"eGeo")));
247 rv.push_back(make_pair(
eGene,
string(
"eGene")));
249 rv.push_back(make_pair(
eMapviewer,
string(
"eMapviewer")));
250 rv.push_back(make_pair(
eGenomicSeq,
string(
"eGenomicSeq")));
251 rv.push_back(make_pair(
eBioAssay,
string(
"eBioAssay")));
254 rv.push_back(make_pair(
eTranscript,
string(
"eTranscript")));
User-defined methods of the data storage class.
void GetLinkoutTypes(vector< TLinkoutTypeString > &rv)
Return the available linkout types in a human readable format.
bool s_DeflineCompareNA(const CRef< CBlast_def_line > &d1, const CRef< CBlast_def_line > &d2)
Ranking function for nucleotide Blast-def-lines.
bool s_DeflineCompareAA(const CRef< CBlast_def_line > &d1, const CRef< CBlast_def_line > &d2)
Ranking function for protein Blast-def-lines.
bool s_DeflineBlastRankAA(const CRef< CBlast_def_line > &d1, const CRef< CBlast_def_line > &d2)
static bool s_DeflineCompare(const CRef< CBlast_def_line > &d1, const CRef< CBlast_def_line > &d2, int(*rank_func)(const CRef< CSeq_id > &))
Compare two deflines for ordering purposes.
User-defined methods of the data storage class.
~CBlast_def_line_set(void)
void PutTargetGiFirst(TGi gi)
Place the CBlast_def_line object which contains the requested gi as the first in the list (if found)
void SortBySeqIdRank(bool is_protein, bool useBlastRank=false)
Sort the deflines according to the toolkit established ranking of Seq-ids.
void RemoveGIs()
Removes all SeqIDs with GIs in this defline set.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
const string AsFastaString(void) const
static int BlastRank(const CRef< CSeq_id > &id)
static int FastaNARank(const CRef< CSeq_id > &id)
static int FastaAARank(const CRef< CSeq_id > &id)
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
C::value_type FindBestChoice(const C &container, F score_func)
Find the best choice (lowest score) for values in a container.
list< CRef< CSeq_id > > TSeqid
Tdata & Set(void)
Assign a value to data member.
bool CanGet(void) const
Check if it is safe to call Get method.
list< CRef< CBlast_def_line > > Tdata
bool IsOther(void) const
Check if variant Other is selected.
TGi GetGi(void) const
Get the variant data.
const TOther & GetOther(void) const
Get the variant data.
bool IsGi(void) const
Check if variant Gi is selected.
const TAccession & GetAccession(void) const
Get the Accession member data.
Useful/utility classes and methods.