{
"BL2SEQ_WBLAST_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/blast/bl2seq/wblast2.cgi"},
97{
"CBLAST_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/Structure/cblast/cblast.cgi"},
98{
"DOWNLOAD_CGI",
"/blast/dumpgnl.cgi"},
99{
"ENTREZ_QUERY_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/entrez/query.fcgi"},
100{
"ENTREZ_SITES_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/sites/entrez"},
101{
"ENTREZ_SUBSEQ_TM",
"<@protocol@>//www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=gbwithparts&from=<@from@>&to=<@to@>&RID=<@rid@>"},
102{
"ENTREZ_TM",
"<@protocol@>//www.ncbi.nlm.nih.gov/<@db@>/<@acc@>?report=genbank&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>"},
103{
"ENTREZ_VIEWER_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/entrez/viewer.fcgi"},
104{
"GENE_INFO",
"<@protocol@>//www.ncbi.nlm.nih.gov/sites/entrez?db=gene&cmd=search&term=%d&RID=%s&log$=geneexplicit%s&blast_rank=%d"},
105{
"MAP_SEARCH_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/mapview/map_search.cgi"},
106{
"MAPVIEWER_CGI",
"https://www.ncbi.nlm.nih.gov/mapview/maps.cgi?maps=blast_set"},
107{
"SEQVIEW_URL",
"https://www.ncbi.nlm.nih.gov/<@dbtype@>/<@seqid@>?report=graph&rid=<@rid@>[<@seqid@>]&"},
108{
"SEQVIEW_URL_NON_GI",
"https://www.ncbi.nlm.nih.gov/projects/sviewer/?RID=<@rid@>&id=<@firstSeqID@>&"},
109{
"TRACE_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/Traces/trace.cgi"},
110{
"TREEVIEW_CGI",
"<@protocol@>//www.ncbi.nlm.nih.gov/blast/treeview/blast_tree_view.cgi"},
111{
"WGS",
"<@protocol@>//www.ncbi.nlm.nih.gov/nuccore/<@wgsacc@>"},
117{
"BIOASSAY_NUC",
"<a href=\"https://www.ncbi.nlm.nih.gov/entrez?db=pcassay&term=<@gi@>[RNATargetGI]&RID=<@rid@>&log$=pcassay<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
119{
"BIOASSAY_PROT",
"<a href=\"https://www.ncbi.nlm.nih.gov/entrez?db=pcassay&term=<@gi@>[PigGI]&RID=<@rid@>&log$=pcassay<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
121{
"BIOASSAY_IMG",
"<img border=0 height=16 width=16 src=\"images/Bioassay.gif\" alt=\"PubChem BioAssay Info linked to <@label@>\">"},
123{
"BIOASSAY_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">bioactivity screening</span></div>"},
125{
"GENE",
"<a class=\"gene\" term=\"<@uid@>\" href=\"https://www.ncbi.nlm.nih.gov/gene?<@termParam@>RID=<@rid@>&log$=gene<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a><input type=\"hidden\" value=\"<@label@>\" />"},
127{
"GENE_IMG",
"<img border=0 height=16 width=16 src=\"images/G.gif\" alt=\"Gene info linked to <@label@>\">"},
129{
"GENE_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">associated gene details</span></div>"},
131{
"GENE_TERM",
"term=<@label@><@uid@>&"},
133{
"GENOME_DATA_VIEWER_NUC",
"<span class=\"adNew\">New</span><a href=\"https://www.ncbi.nlm.nih.gov/genome/gdv/browser/?context=blast&id=<@label@>&alignid=<@queryID@>&from=<@from@>&to=<@to@>&rid=<@rid@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
135{
"GENOME_DATA_VIEWER_PROT",
"<span class=\"adNew\">New</span><a href=\"https://www.ncbi.nlm.nih.gov/genome/gdv/browser/?context=Protein&acc=<@label@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
137{
"GENOME_DATA_VIEWER_TRANSCR",
"<span class=\"adNew\">New</span><a href=\"https://www.ncbi.nlm.nih.gov/genome/gdv/browser/?context=nucleotide&acc=<@label@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
139{
"GENOME_DATA_VIEWER_IMG",
"<div class=\"gdv\">V</div>"},
141{
"GENOME_DATA_VIEWER_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">aligned genomic context</span></div>"},
143{
"GEO",
"<a href=\"https://www.ncbi.nlm.nih.gov/geoprofiles/?term=genbank[Platform+Reporter+Type]+AND+<@label@>[Reporter+Identifier]&RID=<@rid@>&log$=geo<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
145{
"GEO_IMG",
"<img border=0 height=16 width=16 src=\"images/E.gif\" alt=\"GEO profiles info linked to <@label@>\">"},
147{
"GEO_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">microarray expression data</span></div>"},
149{
"MAPVIEWER",
"<a href=\"https://www.ncbi.nlm.nih.gov/mapview/map_search.cgi?direct=on&gbgi=<@gi@>&THE_BLAST_RID=<@rid@>&log$=map<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
151{
"MAPVIEWER_GENOME",
"<a href=\"<@user_url@>&db=<@db@>&na=<@is_na@>&gnl=<@gnl@>&gi=<@gi@>&term=<@gi@>[gi]&taxid=<@taxid@>&RID=<@rid@>&QUERY_NUMBER=<@query_number@>&log$=nucl<@log@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
153{
"MAPVIEWER_IMG",
"<img border=0 height=16 width=16 src=\"images/M.gif\" alt=\"Genome view with mapviewer linked to <@label@>\">"},
155{
"MAPVIEWER_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">aligned genomic context</span></div>"},
157{
"REPR_MICROBIAL_GENOMES",
"<a href=\"https://www.ncbi.nlm.nih.gov/genome?term=<@label@>[<@uid@>]&RID=<@rid@>&log$=map<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
159{
"REPR_MICROBIAL_GENOMES_IMG",
"<img border=0 height=16 width=16 src=\"images/L.gif\" alt=\"View genome information for <@label@>\">"},
161{
"REPR_MICROBIAL_GENOMES_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">Genomic Sequence</span></div>"},
163{
"STRUCTURE_URL",
"<a href=\"https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?from=blast&blast_rep_id=<@label@>&query_id=<@queryID@>&command=view+annotations;set+annotation+cdd;set+annotation+site;set+view+detailed+view;select+chain+<@label@>;show+selection&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
164{
"STRUCTURE_SINGLE_CHAIN_URL",
"<a href=\"https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?mmdbid=5FN2&command=select%20sets%20!<@chainID@>;%20show%20selection\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
166{
"STRUCTURE_IMG",
"<img border=0 height=16 width=16 src=\"https://www.ncbi.nlm.nih.gov/Structure/cblast/str_link.gif\" alt=\"Structure related to <@label@>\">"},
168{
"STRUCTURE_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">3D structure displays</span></div>"},
170{
"STRUCTURE_ALPHA_FOLD",
"<a href=\"https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?from=blast&blast_rep_id=<@label@>&query_id=<@queryID@>&command=view+annotations;set+annotation+cdd;set+annotation+site;set+view+detailed+view;select+chain+!A;show+selection&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
171{
"STRUCTURE_ALPHA_FOLD_NO_RID",
"<a href=\"https://www.ncbi.nlm.nih.gov/Structure/icn3d/full.html?from=blast&blast_rep_id=<@label@>&query_id=<@label@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a>"},
173{
"UNIGEN",
"<a class=\"gene\" term=\"<@uid@>\" href=\"https://www.ncbi.nlm.nih.gov/unigene/?<@termParam@>RID=<@rid@>&log$=unigene<@log@>&blast_rank=<@blast_rank@>\"<@lnkTitle@><@lnkTarget@>><@lnk_displ@></a><input type=\"hidden\" value=\"<@label@>\" />"},
175{
"UNIGEN_IMG",
"<img border=0 height=16 width=16 src=\"images/U.gif\" alt=\"UniGene info linked to <@label@>\">"},
177{
"UNIGEN_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">clustered expressed sequence tags</span></div>"},
179{
"BL2SEQ",
"<a href=\"blast.ncbi.nlm.nih.gov/Blast.cgi?QUERY=<@query@>&SUBJECTS=<@subject@>&PROGRAM=tblastx&EXPECT=10&CMD=request&SHOW_OVERVIEW=on&OLD_BLAST=false&NEW_VIEW=on\">Get TBLASTX alignments</a>"},
181{
"ENTREZ",
"<a title=\"Show report for <@acc@>\" <@cssInf@>href=\"https://www.ncbi.nlm.nih.gov/<@db@>/<@acc@>?report=genbank&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>\" <@target@>>"},
183{
"ENTREZ_SUBSEQ",
"<a href=\"https://www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=gbwithparts&from=<@from@>&to=<@to@>&RID=<@rid@>\">"},
185{
"STRUCTURE_OVW",
"<a href=\"https://www.ncbi.nlm.nih.gov/Structure/cblast/cblast.cgi?blast_RID=%s&blast_rep_gi=%d&hit=%d&%s&blast_view=%s&hsp=0&taxname=%s&client=blast\">Related Structures</a>"},
187{
"TRACE",
"<a title=\"Show report for <@val@>\" <@cssInf@>href=\"https://www.ncbi.nlm.nih.gov/Traces/trace.cgi?cmd=retrieve&dopt=fasta&val=<@val@>&RID=<@rid@>\">"},
189{
"CUSTOM_LINK_TEMPLATE",
"<a href=\"<@custom_url@>\" class=\"<@custom_cls@>\" target=\"<@custom_trg@>\" title=\"<@custom_title@>\"><@custom_lnk_displ@></a>"},
191{
"CUSTOM_LINK_TITLE",
"Show <@custom_report_type@> report for <@seqid@>"},
193{
"GENERIC_LINK_TEMPLATE",
"<a title=\"Show report for <@seqid@>\" href=\"<@url@>\" ><@seqid@></a>"},
195{
"GENERIC_LINK_MOUSE_OVER",
"<span class=\"jig-ncbipopper\" data-jigconfig=\"destText:'<@defline@>'\"><a onclick=\"window.open(this.href,'<@target@>')\" href=\"<@url@>\" ><@seqid@></a></span>"},
197{
"DOWNLOAD_LINK",
"<a href=\"<@download_url@>&segs=<@segs@>\"><@lnk_displ@></a>"},
199{
"DOWNLOAD_LINK_IMG",
"<img border=0 height=16 width=16 src=\"images/D.gif\" alt=\"Download subject sequence <@label@> spanning the HSP\">"},
201{
"IDENTICAL_PROTEINS_URL",
"<a href=\"https://www.ncbi.nlm.nih.gov/ipg/<@label@>\" title=\"View proteins identical to <@label@>\" <@lnkTarget@>><@lnk_displ@></a>"},
203{
"IDENTICAL_PROTEINS_DISPL",
"<div><@lnk@>-<span class=\"rlLink\">Identical proteins to <@label@></span></div>"},
210{
"CLASS_INFO",
"class=\"info\""},
212{
"LINKOUT_ORDER",
"G,U,E,S,B,R,M,V,T"},
214{
"SEQVIEW_COMMON_PARAMS",
"<@seqViewerParams@>&v=<@from@>:<@to@>&appname=ncbiblast&link_loc=<@link_loc@>"},
216{
"SEQVIEW_PARAMS",
"tracks=[key:sequence_track,name:Sequence,display_name:Sequence,id:STD1,category:Sequence,annots:Sequence,ShowLabel:true][key:gene_model_track,CDSProductFeats:false][key:alignment_track,name:other alignments,annots:NG Alignments|Refseq Alignments|Gnomon Alignments|Unnamed,shown:false]"},
229 template<
classcontainer>
bool 236list<TGi>& use_this_gi,
237 int& comp_adj_method)
239 const stringk_GiPrefix =
"gi:";
240 boolhasScore =
false;
241 ITERATE(
typenamecontainer, iter, scoreList) {
244 if(
id.GetStr()==
"score"){
245score = (*iter)->GetValue().GetInt();
246}
else if(
id.GetStr()==
"bit_score"){
247bits = (*iter)->GetValue().GetReal();
248}
else if(
id.GetStr()==
"e_value"||
id.GetStr()==
"sum_e") {
249evalue = (*iter)->GetValue().GetReal();
251}
else if(
id.GetStr()==
"use_this_gi"){
252 Uint4gi_v = (
Uint4)((*iter)->GetValue().GetInt());
254}
else if(
id.GetStr()==
"sum_n"){
255sum_n = (*iter)->GetValue().GetInt();
256}
else if(
id.GetStr()==
"num_ident"){
257num_ident = (*iter)->GetValue().GetInt();
258}
else if(
id.GetStr()==
"comp_adjustment_method") {
259comp_adj_method = (*iter)->GetValue().GetInt();
262 stringstrGi =
NStr::Replace(
id.GetStr(),k_GiPrefix,
"");
263 TGigi = NStr::StringToNumeric<TGi>(strGi);
264use_this_gi.push_back(gi);
282list<string> string_l;
289list<string>::iterator iter = string_l.begin();
290 while(iter != string_l.end())
303 stringerrsevmsg[] = {
"UNKNOWN",
"INFO",
"WARNING",
"ERROR",
308 if(iter->level > 5){
312 if(iter->level == 4){
315iter->level = iter->level;
321 out<< errsevmsg[iter->level] <<
": "<< iter->message <<
"\n";
330vector<string> split_line;
332 ITERATE(vector<string>, iter, split_line) {
342 static bools_FillDbInfoRemotely(
const string&
dbname,
347blastdb->SetName(
dbname);
348blastdb->SetType() =
info.is_protein
357 info.definition = dbinfo->GetDescription();
358 if(
info.definition.empty())
362 info.total_length = dbinfo->GetTotal_length();
363 info.number_seqs =
static_cast<int>(dbinfo->GetNum_sequences());
378 intdbfilt_algorithm)
387 if(
info.definition.empty())
394 info.filt_algorithm_name.clear();
395 info.filt_algorithm_options.clear();
396 if(dbfilt_algorithm == -1) {
400 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \ 401 (!defined(NCBI_COMPILER_MIPSPRO)) ) 402 stringfiltering_algorithm;
405 info.filt_algorithm_name,
406 info.filt_algorithm_options);
413 boolis_protein,
intnumSeqs,
Int8numLetters,
string&
tag)
417 info.is_protein = is_protein;
419 info.definition =
string(
"User specified sequence set.");
422 info.definition =
string(
"User specified sequence set ") +
425 info.number_seqs = numSeqs;
426 info.total_length = numLetters;
427retval.push_back(
info);
432 const string& blastdb_names,
boolis_protein,
433 intdbfilt_algorithm
,
438 boolfound_all =
false;
440vector<string> missing_names;
441vector< CRef<objects::CBlast4_database_info> > all_db_info =
442rmt_blast_services.
GetDatabaseInfo(blastdb_names,is_protein,&found_all,&missing_names);
443 if( !missing_names.empty() ){
445 for(
size_tndx=0 ; ndx < missing_names.size(); ndx++){
446 msg+= missing_names[ndx];
448 msg+=
string(
"' not found on NCBI servers.\n");
451 for(
size_tndx=0 ; ndx < all_db_info.size(); ndx++){
453objects::CBlast4_database_info &dbinfo = *all_db_info[ndx];
454 info.name = dbinfo.GetDatabase().GetName();
455 info.definition = dbinfo.GetDescription();
456 if(
info.definition.empty())
460 info.total_length = dbinfo.GetTotal_length();
461 info.number_seqs =
static_cast<int>(dbinfo.GetNum_sequences());
462 if(
info.total_length < 0) {
467 msg+=
string(
"' has bad total length on NCBI servers.\n");
471retval.push_back(
info);
476vector<CTempString> dbs;
478retval.reserve(dbs.size());
480 ITERATE(vector<CTempString>,
i, dbs) {
482 info.is_protein = is_protein;
483 boolsuccess =
false;
492retval.push_back(
info);
497 msg+=
string(
"' not found on NCBI servers.\n");
513 out<<
"Database: ";
519 for(
size_t i= 1;
i< dbinfo_list.size();
i++) {
520db_titles +=
"; "+ dbinfo_list[
i].definition;
521tot_num_seqs +=
static_cast<Int8>(dbinfo_list[
i].number_seqs);
522tot_length += dbinfo_list[
i].total_length;
537 " total letters\n\n";
541 ITERATE(vector<SDbInfo>, dbinfo, dbinfo_list) {
542 if(dbinfo->subset ==
false) {
543 out<<
" Database: ";
546 if( !dbinfo->filt_algorithm_name.empty() ) {
547 out<<
" Masked using: '"<< dbinfo->filt_algorithm_name <<
"'";
548 if( !dbinfo->filt_algorithm_options.empty() ) {
549 out<<
", options: '"<< dbinfo->filt_algorithm_options <<
"'";
554 out<<
" Posted date: ";
555 out<< dbinfo->date <<
"\n";
557 out<<
" Number of letters in database: ";
560 out<<
" Number of sequences in database: ";
565 out<<
" Subset of the database(s) listed below"<<
"\n";
566 out<<
" Number of letters searched: ";
569 out<<
" Number of sequences searched: ";
586 out<<
"Gapped"<<
"\n";
588 out<<
"Lambda K H";
591 out<<
" a alpha sigma";
599sprintf(
buffer,
"%#8.3g ", k);
601sprintf(
buffer,
"%#8.3g ", h);
605sprintf(
buffer,
"%#8.3g ", gbp->
a);
638 booluse_long_seqids =
false;
642use_long_seqids = (
registry.
Get(
"BLAST",
"LONG_SEQID") ==
"1");
644 if(!use_long_seqids) {
677 if((*iter)->IsTitle()) {
678all_descr_str += (*iter)->GetTitle();
682 returnall_descr_str;
693 const string label(
"Query");
696 label, tabular, rid);
707 const string label(
"Subject");
719 const string&
label,
726}
else if(tabular) {
750 out<<
"\n"<<
"# RID: "<< rid;
752 out<<
"\n"<<
"RID: "<< rid <<
"\n";
758 const string& pattern,
763 out<< num_patterns <<
" occurrence(s) of pattern: "<<
"\n" 764<< pattern <<
" at position(s) ";
767 for(vector<int>::iterator it =
offsets.begin();
777 out<<
" of query sequence"<<
"\n";
778 out<<
"pattern probability="<<
prob<<
"\n";
788list<TGi>& use_this_gi)
790 intcomp_adj_method = 0;
793num_ident, use_this_gi, comp_adj_method);
802list<string>& use_this_seq)
804 intcomp_adj_method = 0;
807num_ident, use_this_seq, comp_adj_method);
817list<TGi>& use_this_gi,
818 int& comp_adj_method)
820 boolhasScore =
false;
830sum_n, num_ident, use_this_gi, comp_adj_method);
837score, bits, evalue, sum_n, num_ident, use_this_gi, comp_adj_method);
840score, bits, evalue, sum_n, num_ident, use_this_gi, comp_adj_method);
843score, bits, evalue, sum_n, num_ident, use_this_gi, comp_adj_method);
846 if(use_this_gi.size() == 0) {
854 const stringk_GiPrefix =
"gi:";
855list<string> use_this_seq;
856 ITERATE(list<TGi>, iter_gi, use_this_gi){
858use_this_seq.push_back(strSeq);
869list<string>& use_this_seq,
870 int& comp_adj_method)
872 boolhasScore =
false;
880list<TGi> use_this_gi;
883sum_n, num_ident, use_this_gi, comp_adj_method);
890score, bits, evalue, sum_n, num_ident, use_this_gi, comp_adj_method);
893score, bits, evalue, sum_n, num_ident, use_this_gi, comp_adj_method);
896score, bits, evalue, sum_n, num_ident, use_this_gi, comp_adj_method);
899 if(use_this_gi.size() == 0) {
923 const CDbtag& dtg =
id->GetGeneral();
927retval =
id->GetSeqIdString(with_version);
942 doubletotal_bit_score,
945 string& bit_score_str,
946 string& total_bit_score_str,
947 string& raw_score_str)
949 charevalue_buf[100], bit_score_buf[100], total_bit_score_buf[100];
952 static stringkBitScoreFormat(
"%4.1lf");
953 #ifdef CTOOLKIT_COMPATIBLE 954 static boolctoolkit_compatible =
false;
955 static boolvalue_set =
false;
957 if(getenv(
"CTOOLKIT_COMPATIBLE")) {
958kBitScoreFormat.assign(
"%4.0lf");
959ctoolkit_compatible =
true;
965 if(evalue < 1.0e-180) {
966snprintf(evalue_buf,
sizeof(evalue_buf),
"0.0");
967}
else if(evalue < 1.0e-99) {
968snprintf(evalue_buf,
sizeof(evalue_buf),
"%2.0le", evalue);
969 #ifdef CTOOLKIT_COMPATIBLE 970 if(ctoolkit_compatible) {
971strncpy(evalue_buf, evalue_buf+1,
sizeof(evalue_buf-1));
974}
else if(evalue < 0.0009) {
975snprintf(evalue_buf,
sizeof(evalue_buf),
"%3.0le", evalue);
976}
else if(evalue < 0.1) {
977snprintf(evalue_buf,
sizeof(evalue_buf),
"%4.3lf", evalue);
978}
else if(evalue < 1.0) {
979snprintf(evalue_buf,
sizeof(evalue_buf),
"%3.2lf", evalue);
980}
else if(evalue < 10.0) {
981snprintf(evalue_buf,
sizeof(evalue_buf),
"%2.1lf", evalue);
983snprintf(evalue_buf,
sizeof(evalue_buf),
"%2.0lf", evalue);
986 if(bit_score > 99999){
987snprintf(bit_score_buf,
sizeof(bit_score_buf),
"%5.3le", bit_score);
988}
else if(bit_score > 99.9){
989snprintf(bit_score_buf,
sizeof(bit_score_buf),
"%3.0ld",
992snprintf(bit_score_buf,
sizeof(bit_score_buf), kBitScoreFormat.c_str(),
995 if(total_bit_score > 99999){
996snprintf(total_bit_score_buf,
sizeof(total_bit_score_buf),
"%5.3le",
998}
else if(total_bit_score > 99.9){
999snprintf(total_bit_score_buf,
sizeof(total_bit_score_buf),
"%3.0ld",
1000(
long)total_bit_score);
1002snprintf(total_bit_score_buf,
sizeof(total_bit_score_buf),
"%2.1lf",
1005evalue_str = evalue_buf;
1006bit_score_str = bit_score_buf;
1007total_bit_score_str = total_bit_score_buf;
1019 boolis_first_aln =
true;
1020 unsigned intnum_align = 0;
1023 if((*iter)->GetSegs().IsDisc()) {
1026subid = &((*iter)->GetSeq_id(1));
1027 if(is_first_aln || (!is_first_aln && !subid->
Match(*previous_id))){
1031 if(num_align >
number) {
1035is_first_aln =
false;
1036previous_id = subid;
1038new_aln.
Set().push_back(*iter);
1047 boolis_first_aln =
true;
1048 unsigned intnum_align = 0;
1051 if((*iter)->GetSegs().IsDisc()) {
1054subid = &((*iter)->GetSeq_id(1));
1055 if(is_first_aln || (!is_first_aln && !subid->
Match(*previous_id))){
1059 if(num_align >=
number) {
1063is_first_aln =
false;
1064previous_id = subid;
1076 boolis_first_aln =
true;
1077 unsigned intnum_align = 0;
1078 boolfinishCurrent =
false;
1080 if((*iter)->GetSegs().IsDisc()) {
1083subid = &((*iter)->GetSeq_id(1));
1084 if(is_first_aln || (!is_first_aln && !subid->
Match(*previous_id))){
1085finishCurrent = (num_align + 1 ==
number) ?
true:
false;
1088is_first_aln =
false;
1089previous_id = subid;
1091 if(num_align >
number&& !finishCurrent) {
1094new_aln.
Set().push_back(*iter);
1101 int& num_gaps,
int& num_gap_opens)
1103num_gaps = num_gap_opens = align_length = 0;
1108 for(
int i=0;
i<chunk_vec->size();
i++) {
1110 intchunk_length = chunk->GetAlnRange().GetLength();
1113 if(chunk->IsGap()) {
1115num_gaps += chunk_length;
1119align_length += chunk_length;
1130 for(CSeq_align_set::Tdata::const_iterator iter =
source.Get().begin();
1131iter !=
source.Get().end(); iter++) {
1132 if((*iter)->IsSetSegs()){
1136 for(CSeq_align_set::Tdata::const_iterator iter2 =
1139target.
Set().push_back(*iter2);
1142target.
Set().push_back(*iter);
1177 if((*iter)->IsSetDim()){
1178ds.
SetDim((*iter)->GetDim());
1180 if((*iter)->IsSetIds()){
1181ds.
SetIds() = (*iter)->GetIds();
1185 if((*iter)->IsSetStarts()){
1187ds.
SetStarts().push_back(*iterStarts);
1190 if((*iter)->IsSetLen()){
1191ds.
SetLens().push_back((*iter)->GetLen());
1193 if((*iter)->IsSetStrands()){
1198 if((*iter)->IsSetScores()){
1200ds.
SetScores().push_back(*iterScores);
1221 if(bdl_id && bdl_id->
Match(
id) &&
1222(*iter_bdl)->IsSetTaxid() && (*iter_bdl)->CanGetTaxid()){
1223taxid = (*iter_bdl)->GetTaxid();
1238frame = (start % 3) + 1;
1265 intscore1, sum_n1, num_ident1;
1266 doublebits1, evalue1;
1267list<TGi> use_this_gi1;
1269 intscore2, sum_n2, num_ident2;
1270 doublebits2, evalue2;
1271list<TGi> use_this_gi2;
1274 GetAlnScores(*info1, score1, bits1, evalue1, sum_n1, num_ident1, use_this_gi1);
1275 GetAlnScores(*info2, score2, bits2, evalue2, sum_n2, num_ident2, use_this_gi2);
1279 boolretval =
false;
1282 if(length1 > 0 && length2 > 0 && num_ident1 > 0 &&num_ident2 > 0 ) {
1283 if(((
double)num_ident1)/length1 == ((
double)num_ident2)/length2) {
1285retval = evalue1 < evalue2;
1288retval = ((double)num_ident1)/length1 >= ((double)num_ident2)/length2;
1292retval = evalue1 < evalue2;
1307 intscore1, sum_n1, num_ident1;
1308 doublebits1, evalue1;
1309list<TGi> use_this_gi1;
1311 intscore2, sum_n2, num_ident2;
1312 doublebits2, evalue2;
1313list<TGi> use_this_gi2;
1315 GetAlnScores(*(info1->
Get().front()), score1, bits1, evalue1, sum_n1, num_ident1, use_this_gi1);
1316 GetAlnScores(*(info2->
Get().front()), score2, bits2, evalue2, sum_n2, num_ident2, use_this_gi2);
1317 returnbits1 > bits2;
1326 boolretval =
false;
1329retval = cov1 > cov2;
1330}
else if(cov1 == cov2) {
1331 intscore1, sum_n1, num_ident1;
1332 doublebits1, evalue1;
1333list<TGi> use_this_gi1;
1335 intscore2, sum_n2, num_ident2;
1336 doublebits2, evalue2;
1337list<TGi> use_this_gi2;
1338 GetAlnScores(*(info1->
Get().front()), score1, bits1, evalue1, sum_n1, num_ident1, use_this_gi1);
1339 GetAlnScores(*(info2->
Get().front()), score2, bits2, evalue2, sum_n2, num_ident2, use_this_gi2);
1340retval = evalue1 < evalue2;
1349 intstart1 = 0, start2 = 0;
1356start1 =
min(info1->
Get().front()->GetSeqStart(0),
1357info1->
Get().front()->GetSeqStop(0));
1358start2 =
min(info2->
Get().front()->GetSeqStart(0),
1359info2->
Get().front()->GetSeqStop(0));
1361 if(start1 == start2) {
1363 intscore1, sum_n1, num_ident1;
1364 doublebits1, evalue1;
1365list<TGi> use_this_gi1;
1367 intscore2, sum_n2, num_ident2;
1368 doublebits2, evalue2;
1369list<TGi> use_this_gi2;
1372 GetAlnScores(*(info1->
Get().front()), score1, bits1, evalue1, sum_n1, num_ident1, use_this_gi1);
1373 GetAlnScores(*(info1->
Get().front()), score2, bits2, evalue2, sum_n2, num_ident2, use_this_gi2);
1374 returnevalue1 < evalue2;
1377 returnstart1 < start2;
1387 intscore1, sum_n1, num_ident1;
1388 doublebits1, evalue1;
1389list<TGi> use_this_gi1;
1391 intscore2, sum_n2, num_ident2;
1392 doublebits2, evalue2;
1393list<TGi> use_this_gi2;
1396 GetAlnScores(*info1, score1, bits1, evalue1, sum_n1, num_ident1, use_this_gi1);
1397 GetAlnScores(*info2, score2, bits2, evalue2, sum_n2, num_ident2, use_this_gi2);
1398 returnbits1 > bits2;
1406 intstart1 = 0, start2 = 0;
1411 if(start1 == start2) {
1413 intscore1, sum_n1, num_ident1;
1414 doublebits1, evalue1;
1415list<TGi> use_this_gi1;
1417 intscore2, sum_n2, num_ident2;
1418 doublebits2, evalue2;
1419list<TGi> use_this_gi2;
1422 GetAlnScores(*info1, score1, bits1, evalue1, sum_n1, num_ident1, use_this_gi1);
1423 GetAlnScores(*info2, score2, bits2, evalue2, sum_n2, num_ident2, use_this_gi2);
1424 returnevalue1 < evalue2;
1428 returnstart1 < start2;
1436 intstart1 = 0, start2 = 0;
1441 if(start1 == start2) {
1443 intscore1, sum_n1, num_ident1;
1444 doublebits1, evalue1;
1445list<TGi> use_this_gi1;
1447 intscore2, sum_n2, num_ident2;
1448 doublebits2, evalue2;
1449list<TGi> use_this_gi2;
1452 GetAlnScores(*info1, score1, bits1, evalue1, sum_n1, num_ident1, use_this_gi1);
1453 GetAlnScores(*info2, score2, bits2, evalue2, sum_n2, num_ident2, use_this_gi2);
1454 returnevalue1 < evalue2;
1458 returnstart1 < start2;
1475 if(do_translation) {
1478final_aln = denseg_aln;
1494 booldo_translation) {
1495 doubleidentity = 0;
1506 if(do_translation) {
1509final_aln = denseg_aln;
1523alnvec.GetWholeAlnSeqString(0,
query);
1524alnvec.GetWholeAlnSeqString(1,
subject);
1529 for(
int i= 0;
i< length; ++
i) {
1536identity = ((double)num_ident)/length;
1545 double&percentIdent1,
1546 double&percentIdent2)
1575 doubleevalue1 = seqSetInfo1->evalue;
1576 doubleevalue2 = seqSetInfo2->evalue;
1577 doublepercentIdent1 = seqSetInfo1->percent_identity;
1578 doublepercentIdent2 = seqSetInfo2->percent_identity;
1580 boolretval =
false;
1581 if(percentIdent1 < 0 || percentIdent2 < 0) {
1584 if(percentIdent1 > 0 &&percentIdent2 > 0) {
1585 if(percentIdent1 == percentIdent2) {
1586retval = evalue1 < evalue2;
1589retval = percentIdent1 >= percentIdent2;
1592retval = evalue1 < evalue2;
1600 intscore1, score2, sum_n, num_ident;
1601 doublebits, evalue;
1602list<TGi> use_this_gi;
1603 doubletotal_bits1 = 0, total_bits2 = 0;
1607sum_n, num_ident, use_this_gi);
1608total_bits1 += bits;
1613sum_n, num_ident, use_this_gi);
1614total_bits2 += bits;
1618 returntotal_bits1 >= total_bits2;
1622 #ifndef NCBI_COMPILER_WORKSHOP 1631 const string& mv_build_name)
1637id1 = &(info1->
Get().front()->GetSeq_id(1));
1638id2 = &(info2->
Get().front()->GetSeq_id(1));
1640 intlinkout1 = 0, linkout2 = 0;
1659 const string& mv_build_name)
1663 #ifndef NCBI_COMPILER_WORKSHOP 1669 booldo_translation,
CScope& scope,
int 1671 const string& mv_build_name)
1676 if(sort_method == 1) {
1677 #ifndef NCBI_COMPILER_WORKSHOP 1681}
else if(sort_method == 2) {
1683}
else if(sort_method == 3) {
1695 const string& mv_build_name)
1699 intlinkoutPrev = 0;
1702 const CSeq_id&
id= (*iter)->GetSeq_id(1);
1707 if(prevSubjectId.
Empty() || !
id.Match(*prevSubjectId)){
1708prevSubjectId = &id;
1709linkout = linkoutdb ? linkoutdb->
GetLinkout(
id, mv_build_name): 0;
1710linkoutPrev = linkout;
1714linkout = linkoutPrev;
1717 if(sort_method == 1) {
1718target[1]->Set().push_back(*iter);
1719}
else if(sort_method == 2){
1720target[0]->Set().push_back(*iter);
1722target[1]->Set().push_back(*iter);
1725 if(sort_method == 1) {
1726target[0]->Set().push_back(*iter);
1727}
else if(sort_method == 2) {
1728target[1]->Set().push_back(*iter);
1730target[0]->Set().push_back(*iter);
1734target[0]->Set().push_back(*iter);
1738target[0]->Set().push_back(*iter);
1750 const CSeq_id& cur_id = (*iter)->GetSeq_id(1);
1751 if(previous_id.
Empty()) {
1753temp->
Set().push_back(*iter);
1754target.push_back(temp);
1755}
else if(cur_id.
Match(*previous_id)){
1756temp->
Set().push_back(*iter);
1760temp->
Set().push_back(*iter);
1761target.push_back(temp);
1763previous_id = &cur_id;
1778align_set->
Set().push_back(*iter2);
1792 for(
size_t i= 0;
i< seqIdList.size();
i++) {
1798 const CSeq_id& cur_id = (*iter)->GetSeq_id(1);
1799 if(previous_id.
Empty() || !cur_id.
Match(*previous_id)) {
1800 if(
count>= seqIdList.size()) {
1804 if(hitsMap.
find(idString) != hitsMap.
end()) {
1806temp->
Set().push_back(*iter);
1807hitsMap[idString] = temp;
1814 else if(cur_id.
Match(*previous_id)){
1815 if(!temp.
Empty()) {
1816temp->
Set().push_back(*iter);
1819previous_id = &cur_id;
1826vector <string> seqIds;
1834list< CRef<CSeq_align_set> > orderedSet;
1836 for(
size_t i= 0;
i< seqIds.size();
i++) {
1837 if(hitsMap.
find(seqIds[
i]) != hitsMap.
end()) {
1838orderedSet.push_back(hitsMap[seqIds[
i]]);
1847 boolsuccess =
false;
1851 if(!seqId.
Empty())
1860 if(!strTag.empty())
1862vector<string> vecInfo;
1872 if(vecInfo.size() != 3)
1877strRun = vecInfo[0];
1878strSpotId = vecInfo[1];
1879strReadIndex = vecInfo[2];
1889 stringstrRun, strSpotId,strReadIndex;
1896link +=
"?run="+ strRun;
1897link +=
"."+ strSpotId;
1898link +=
"."+ strReadIndex;
1911 if(!id_general.
Empty() && id_general->
AsFastaString().find(
"gnl|BL_ORD_ID") != string::npos){
1916 if(id_general.
Empty()){
1918 if(id_other.
Empty()){
1919bestid = id_accession;
1922bestid = id_general;
1933 booldb_is_na,
stringrid,
intquery_number,
1934 boolfor_alignment) {
1939 if(!id_general.
Empty()
1940&& id_general->
AsFastaString().find(
"gnl|BL_ORD_ID") != string::npos){
1948 boolnodb_path =
false;
1950 if(user_url.find(
"dumpgnl.cgi") ==string::npos){
1955 char*chptr, *dbtmp;
1957 char*
dbname=
new char[
sizeof(char)*length + 2];
1961dbtmp =
new char[
sizeof(char)*length + 2];
1962memset(dbtmp,
'\0',
sizeof(
char)*length + 2);
1963 for(
i= 0;
i< length;
i++) {
1971 while(!
isspace((
unsigned char)
dbname[
i]) && j < 256 &&
i< length) {
1979 if((chptr = strrchr(tmpbuff,
'/')) !=
NULL) {
1980 strcat(dbtmp, (
char*)(chptr+1));
1991 if(!bestID.empty()){
1992strcpy(gnl, bestID.c_str());
2000 if(user_url.find(
"?") == string::npos){
2001link += user_url +
"?"+
"db="+
str+
"&na="+ (db_is_na?
"1":
"0");
2003 if(user_url.find(
"=") != string::npos) {
2006link += user_url +
"db="+
str+
"&na="+ (db_is_na?
"1":
"0");
2009 if(gnl[0] !=
'\0'){
2022link +=
"&RID="+ rid;
2025 if(query_number > 0){
2029 if(user_url.find(
"dumpgnl.cgi") ==string::npos){
2031link +=
"&log$=nuclalign";
2033link +=
"&log$=nucltop";
2060 value_type(
"composition_based_statistics",
""));
2066 boolis_first =
true;
2069 stringparameter = it->first;
2071 if(parameters_to_change.count(
NStr::ToLower(parameter)) > 0 ||
2072parameters_to_change.count(
NStr::ToUpper(parameter)) > 0) {
2081it->first +
"="+ parameters_to_change[it->first];
2088cgi_query += it->first +
"="+ it->second;
2098 stringformat_type =
ctx.GetRequestValue(
"FORMAT_TYPE").GetValue();
2099 stringridstr =
ctx.GetRequestValue(
"RID").GetValue();
2100 stringalign_view =
ctx.GetRequestValue(
"ALIGNMENT_VIEW").GetValue();
2102cgi_query +=
"RID="+ ridstr;
2103cgi_query +=
"&FORMAT_TYPE="+ format_type;
2104cgi_query +=
"&ALIGNMENT_VIEW="+ align_view;
2106cgi_query +=
"&QUERY_NUMBER="+
ctx.GetRequestValue(
"QUERY_NUMBER").GetValue();
2107cgi_query +=
"&FORMAT_OBJECT="+
ctx.GetRequestValue(
"FORMAT_OBJECT").GetValue();
2108cgi_query +=
"&RUN_PSIBLAST="+
ctx.GetRequestValue(
"RUN_PSIBLAST").GetValue();
2109cgi_query +=
"&I_THRESH="+
ctx.GetRequestValue(
"I_THRESH").GetValue();
2111cgi_query +=
"&DESCRIPTIONS="+
ctx.GetRequestValue(
"DESCRIPTIONS").GetValue();
2113cgi_query +=
"&ALIGNMENTS="+
ctx.GetRequestValue(
"ALIGNMENTS").GetValue();
2115cgi_query +=
"&NUM_OVERVIEW="+
ctx.GetRequestValue(
"NUM_OVERVIEW").GetValue();
2117cgi_query +=
"&NCBI_GI="+
ctx.GetRequestValue(
"NCBI_GI").GetValue();
2119cgi_query +=
"&SHOW_OVERVIEW="+
ctx.GetRequestValue(
"SHOW_OVERVIEW").GetValue();
2121cgi_query +=
"&SHOW_LINKOUT="+
ctx.GetRequestValue(
"SHOW_LINKOUT").GetValue();
2123cgi_query +=
"&GET_SEQUENCE="+
ctx.GetRequestValue(
"GET_SEQUENCE").GetValue();
2125cgi_query +=
"&MASK_CHAR="+
ctx.GetRequestValue(
"MASK_CHAR").GetValue();
2126cgi_query +=
"&MASK_COLOR="+
ctx.GetRequestValue(
"MASK_COLOR").GetValue();
2128cgi_query +=
"&SHOW_CDS_FEATURE="+
ctx.GetRequestValue(
"SHOW_CDS_FEATURE").GetValue();
2131cgi_query +=
"&FORMAT_EQ_TEXT="+
2133GetRequestValue(
"FORMAT_EQ_TEXT").
2138cgi_query +=
"&FORMAT_EQ_OP="+
2140GetRequestValue(
"FORMAT_EQ_OP").
2145cgi_query +=
"&FORMAT_EQ_MENU="+
2147GetRequestValue(
"FORMAT_EQ_MENU").
2151cgi_query +=
"&EXPECT_LOW="+
ctx.GetRequestValue(
"EXPECT_LOW").GetValue();
2152cgi_query +=
"&EXPECT_HIGH="+
ctx.GetRequestValue(
"EXPECT_HIGH").GetValue();
2154cgi_query +=
"&BL2SEQ_LINK="+
ctx.GetRequestValue(
"BL2SEQ_LINK").GetValue();
2161 const string& mv_build_name)
2163 boolis_mixed =
false;
2164 boolis_first =
true;
2165 intprev_database = 0;
2169 const CSeq_id&
id= (*iter)->GetSeq_id(1);
2170 intlinkout = linkoutdb
2171? linkoutdb->
GetLinkout(
id, mv_build_name)
2174 if(!is_first && cur_database != prev_database) {
2178prev_database = cur_database;
2189 boolformatAsMixedDbs =
false;
2190 stringmixedDbs =
ctx.GetRequestValue(
"MIXED_DATABASE").GetValue();
2191 if(!mixedDbs.empty()) {
2193formatAsMixedDbs = (mixedDbs ==
"on"|| mixedDbs ==
"true"|| mixedDbs ==
"yes") ?
true:
false;
2195 returnformatAsMixedDbs;
2205 stringlnk_tl_info =
"",
2206 stringlnk_title =
"")
2208 const stringkLinkTitle=
" title=\"View <@lnk_tl_info@> for <@label@>\" ";
2209 const stringkLinkTarget=
"target=\"lnk"+ rid +
"\"";
2210 stringlnkTitle = (lnk_title.empty()) ? kLinkTitle : lnk_title;
2216 stringlnkTarget =
NStr::StartsWith(lnk_displ,
"<img") ?
"": kLinkTarget;
2232 booltextLink =
true)
2235list<string> linkout_list;
2236 stringurl_link,lnk_displ,lnk_title,lnkTitleInfo;
2238vector<string> accs;
2240 stringfirstAcc = (accs.size() > 0)? accs[0] : labelList;
2249lnkTitleInfo =
"UniGene cluster";
2250 stringuid = !linkoutInfo.
is_na?
"[Protein Accession]":
"[Nucleotide Accession]";
2258linkout_list.push_back(url_link);
2267linkTitle =
" title=\"View 3D structure <@label@>\"";
2272linkTitle =
" title=\"View AlphaFold 3D structure <@label@>\"";
2277 stringmolID,chainID;
2287linkout_list.push_back(url_link);
2289 if(linkout &
eGeo){
2293lnkTitleInfo =
"Expression profiles";
2302linkout_list.push_back(url_link);
2304 if(linkout &
eGene){
2307lnk_displ =
"Gene";
2308lnkTitleInfo =
"gene information";
2316 stringuid = !linkoutInfo.
is_na?
"[Protein Accession]":
"[Nucleotide Accession]";
2325linkout_list.push_back(url_link);
2331lnk_displ =
"Map Viewer";
2333lnkTitleInfo =
"BLAST hits on the "+ linkoutInfo.
taxName+
" genome";
2339 stringuser_url = (linkoutInfo.
user_url.empty()) ? mapviewBlastHitUrl : linkoutInfo.
user_url;
2355linkout_list.push_back(url_link);
2362 stringlinkTitle =
" title=\"View <@label@> aligned to the "+ linkoutInfo.
taxName+
" genome\"";
2369linkout_list.push_back(url_link);
2376 stringlinkTitle =
" title=\"View Bioassays involving <@label@>\"";
2378giList =
NStr::Replace(giList,
",",
"[RNATargetGI] OR ");
2385linkout_list.push_back(url_link);
2391lnkTitleInfo =
"Bioassay data";
2392 stringlinkTitle =
" title=\"View Bioassays involving <@label@>\"";
2401linkout_list.push_back(url_link);
2407lnkTitleInfo =
"genomic information";
2409 stringuid = !linkoutInfo.
is_na?
"Protein Accession":
"Nucleotide Accession";
2417linkout_list.push_back(url_link);
2423urlTag =
"GENOME_DATA_VIEWER_TRANSCR";
2424lnkTitleInfo =
"title=\"View the annotation of the transcript <@label@> within a genomic context in NCBI's Genome Data Viewer (GDV)- genome browser for RefSeq annotated assemblies. See other genomic features annotated at the same location as the protein annotation and browse to other regions.\"";
2427urlTag = linkoutInfo.
is_na?
"GENOME_DATA_VIEWER_NUC":
"GENOME_DATA_VIEWER_PROT";
2428lnkTitleInfo = linkoutInfo.
is_na?
2429 "title=\"View BLAST hits for <@label@> within a genomic context in NCBI's Genome Data Viewer (GDV)- genome browser for RefSeq annotated assemblies. See other genomic features annotated at the same location as hits and browse to other regions.\"" 2431 "title=\"View the annotation of the protein <@label@> within a genomic context in NCBI's Genome Data Viewer (GDV)- genome browser for RefSeq annotated assemblies. See other genomic features annotated at the same location as the protein annotation and browse to other regions.\"";
2439seqFrom = (seqFrom == 0) ? seqFrom : seqFrom - 1;
2442seqTo = (seqTo == 0) ? seqTo : seqTo - 1;
2451linkout_list.push_back(url_link);
2453 returnlinkout_list;
2459 const string& cdd_rid,
2460 const string& entrez_term,
2463 boolstructure_linkout_as_group,
2464 boolfor_alignment,
intcur_align,
2465 stringpreComputedResID)
2468list<string> linkout_list;
2474first_gi = (first_gi ==
ZERO_GI) ? gi : first_gi;
2479linkoutInfo.
Init(rid,
2488structure_linkout_as_group,
2501 returnlinkout_list;
2507 if(linkLetter ==
"U") {
2510 else if(linkLetter ==
"S") {
2513 else if(linkLetter ==
"E") {
2516 else if(linkLetter ==
"G") {
2519 else if(linkLetter ==
"M") {
2522 else if(linkLetter ==
"N") {
2525 else if(linkLetter ==
"B") {
2528 else if(linkLetter ==
"R") {
2531 else if(linkLetter ==
"V") {
2534 else if(linkLetter ==
"T") {
2544 if(linkout_map.count(linkout) > 0){
2545linkout_map[linkout].push_back(cur_id);
2548vector <CBioseq::TId > idList;
2549idList.push_back(cur_id);
2550linkout_map.
insert(
map<
int, vector <CBioseq::TId > >::
value_type(linkout,idList));
2556 const string& mv_build_name,
2567linkout = (*linkoutdb)->GetLinkout(gi, mv_build_name);
2571linkout = (*linkoutdb)->GetLinkout(*seqID, mv_build_name);
2574 intlinkoutWithoutVersion = (*linkoutdb)->GetLinkout(*seqIDNew, mv_build_name);
2575 if(linkoutWithoutVersion && (linkoutWithoutVersion |
eStructure)) {
2576linkout = linkout | linkoutWithoutVersion;
2582cerr <<
"[BLAST FORMATTER EXCEPTION] Problem with linkoutdb: "<< e.
GetMsg() << endl;
2591 map<
int, vector <CBioseq::TId > > &linkout_map,
2593 const string& mv_build_name)
2595 if(!linkoutdb)
return;
2601 if(linkout &
eGene){
2607 if(linkout &
eGeo){
2638 map<
int, vector <CBioseq::TId > > &linkout_map,
2640 const string& mv_build_name)
2642 const intkMaxDeflineNum = 10;
2645iter != bdl.end(); iter++){
2653 if(num > kMaxDeflineNum)
break;
2664taxName =
info.common_name;
2678list<string> &linkout_list)
2688 stringlnk_displ =
"Identical Proteins";
2693linkout_list.push_back(url_link);
2702 map<
int, vector < CBioseq::TId > > &linkout_map,
2703 boolgetIdentProteins)
2706list<string> linkout_list;
2708vector<string> linkLetters;
2710 for(
size_t i= 0;
i< linkLetters.size();
i++) {
2712vector < CBioseq::TId > idList;
2714linkoutInfo.
taxName.clear();
2719 if(linkout_map.
find(linkout) != linkout_map.
end()) {
2720idList = linkout_map[linkout];
2723 booldisableLink = (linkout == 0 || idList.size() == 0);
2726 stringgiList,labelList;
2728 for(
size_t i= 0;
i< idList.size();
i++) {
2731 if(first_gi ==
ZERO_GI) first_gi = gi;
2736 if(!labelList.empty()) labelList +=
",";
2737labelList +=
label;
2740 if(!giList.empty() && (linkout &
eBioAssay) && !linkoutInfo.
is_na)
continue;
2741 if(!giList.empty()) giList +=
",";
2745linkoutInfo.
gnl.clear();
2757 if(one_linkout.size() > 0) {
2758list<string>::iterator iter = one_linkout.begin();
2759linkout_list.push_back(*iter);
2763 if(getIdentProteins) {
2766 returnlinkout_list;
2772list<string> linkout_list;
2774 if(bdl.size() > 0) {
2776list< CRef< CBlast_def_line > >::const_iterator iter = bdl.begin();
2781!linkoutInfo.
is_na&& bdl.size() > 1);
2783 returnlinkout_list;
2789 const string& cdd_rid,
2790 const string& entrez_term,
2792 boolstructure_linkout_as_group,
2795 string& linkoutOrder,
2800 string&preComputedResID,
2802 const string& mv_build_name)
2805list<string> linkout_list;
2807 if(bdl.size() > 0) {
2809list< CRef< CBlast_def_line > >::const_iterator iter = bdl.begin();
2812SLinkoutInfo linkoutInfo;
2813linkoutInfo.
Init(rid,
2822structure_linkout_as_group,
2825linkoutInfo.cur_align = cur_align;
2826linkoutInfo.taxid = taxid;
2831!is_na && bdl.size() > 1);
2833 returnlinkout_list;
2839 boolgetIdentProteins)
2841list<string> linkout_list;
2849 returnlinkout_list;
2854 const string& cdd_rid,
2855 const string& entrez_term,
2857 boolstructure_linkout_as_group,
2860 string& linkoutOrder,
2865 string&preComputedResID,
2867 const string& mv_build_name,
2868 boolgetIdentProteins)
2871list<string> linkout_list;
2875SLinkoutInfo linkoutInfo;
2876linkoutInfo.
Init(rid,
2885structure_linkout_as_group,
2888linkoutInfo.cur_align = cur_align;
2889linkoutInfo.taxid = taxid;
2895 returnlinkout_list;
2911 booloppositeStrands =
false;
2912 boolisFirst =
false;
2919query_list.push_back(query_range);
2923 if(subject_range.
GetFrom() > subject_range.
GetTo()){
2924subject_range.
Set(subject_range.
GetTo(), subject_range.
GetFrom());
2926subject_list.push_back(subject_range);
2928oppositeStrands = (!isFirst) ? (*iter)->GetSeqStrand(0) != (*iter)->GetSeqStrand(1) : oppositeStrands;
2934 returnoppositeStrands;
2943list<CRange<TSeqPos> > merge_list;
2945 boolis_first =
true;
2950merge_list.push_back(*iter);
2955merge_list.pop_back();
2957merge_list.push_back(temp_range);
2958prev_range = temp_range;
2960merge_list.push_back(*iter);
2972list<CRange<TSeqPos> > merge_list;
2974list<CRange<TSeqPos> > temp;
2981temp.push_back(seq_range);
2988 intmaster_covered_lenghth = 0;
2990master_covered_lenghth += iter->GetLength();
2992 returnmaster_covered_lenghth;
3001list<CRange<TSeqPos> > query_list;
3002list<CRange<TSeqPos> > subject_list;
3009*master_covered_lenghth = 0;
3011*master_covered_lenghth += iter->GetLength();
3016from = (from == 0) ? iter->GetFrom() :
min(from,iter->GetFrom());
3017to =
max(to,iter->GetTo());
3021 returnsubjectRange;
3028 boolnuc_to_nuc_translation,
3033 const string& mv_build_name) {
3036 if(db_sort == 0 && hit_sort < 1 && hsp_sort < 1)
3039list< CRef<CSeq_align_set> > seqalign_hit_total_list;
3040vector< CRef<CSeq_align_set> > seqalign_vec(2);
3046linkoutdb, mv_build_name);
3054nuc_to_nuc_translation,
3058seqalign_hit_total_list.splice(seqalign_hit_total_list.end(),one_seqalign_hit_total_list);
3064list< CRef<CSeq_align_set> >
3066 boolnuc_to_nuc_translation,
3070list< CRef<CSeq_align_set> > seqalign_hit_total_list;
3071list< CRef<CSeq_align_set> > seqalign_hit_list;
3080nuc_to_nuc_translation);
3091}
else if(hsp_sort ==
eScore) {
3097seqalign_hit_total_list.push_back(temp);
3099 returnseqalign_hit_total_list;
3104 boolnuc_to_nuc_translation,
3114nuc_to_nuc_translation,
3125 intscore, sum_n, num_ident;
3126 doublebits, evalue;
3127list<TGi> use_this_gi;
3133sum_n, num_ident, use_this_gi);
3138 if(evalue >= evalueLow && evalue <= evalueHigh) {
3139new_aln->
Set().push_back(*iter);
3154 if(numerator == denominator)
3157 intretval =(
int) (0.5 + 100.0*((
double)numerator)/((double)denominator));
3158retval =
min(99, retval);
3165 if(numerator == denominator)
3168 doubleretval =100*(double)numerator/(
double)denominator;
3174 doublepercentIdentLow,
3175 doublepercentIdentHigh)
3177 intscore, sum_n, num_ident;
3178 doublebits, evalue;
3179list<TGi> use_this_gi;
3185sum_n, num_ident, use_this_gi);
3187 if(seqAlnLength > 0 && num_ident > 0) {
3189 if(alnPercentIdent >= percentIdentLow && alnPercentIdent <= percentIdentHigh) {
3190new_aln->
Set().push_back(*iter);
3200 doublepercentIdentLow,
3201 doublepercentIdentHigh)
3203 intscore, sum_n, num_ident;
3204 doublebits, evalue;
3205list<TGi> use_this_gi;
3211sum_n, num_ident, use_this_gi);
3217 if(seqAlnLength > 0 && num_ident > 0) {
3219 if( (evalue >= evalueLow && evalue <= evalueHigh) &&
3220(alnPercentIdent >= percentIdentLow && alnPercentIdent <= percentIdentHigh)) {
3221new_aln->Set().push_back(*iter);
3237 doublepercentIdent,
3241 doublepercentIdentLow,
3242 doublepercentIdentHigh,
3248 boolisInRange =
false;
3251 stringevalue_buf, bit_score_buf, total_bit_buf, raw_score_buf;
3256 if(evalueLow >= 0 && percentIdentLow >= 0 && queryCoverLow >= 0) {
3257isInRange = (evalue >= evalueLow && evalue <= evalueHigh) &&
3258(percentIdent >= percentIdentLow && percentIdent <= percentIdentHigh) &&
3259(queryCover >= queryCoverLow && queryCover <= queryCoverHigh);
3261 else if(evalueLow >= 0 && percentIdentLow >= 0) {
3262isInRange = (evalue >= evalueLow && evalue <= evalueHigh) &&
3263(percentIdent >= percentIdentLow && percentIdent <= percentIdentHigh);
3265 else if(evalueLow >= 0 && queryCoverLow >= 0) {
3266isInRange = (evalue >= evalueLow && evalue <= evalueHigh) &&
3267(queryCover >= queryCoverLow && queryCover <= queryCoverHigh);
3269 else if(queryCoverLow >= 0 && percentIdentLow >= 0) {
3270isInRange = (queryCover >= queryCoverLow && queryCover <= queryCoverHigh) &&
3271(percentIdent >= percentIdentLow && percentIdent <= percentIdentHigh);
3273 else if(evalueLow >= 0) {
3274isInRange = (evalue >= evalueLow && evalue <= evalueHigh);
3276 else if(percentIdentLow >= 0) {
3277isInRange = (percentIdent >= percentIdentLow && percentIdent <= percentIdentHigh);
3279 else if(queryCoverLow >= 0) {
3280isInRange = (queryCover >= queryCoverLow && queryCover <= queryCoverHigh);
3288 doublepercentIdentLow,
3289 doublepercentIdentHigh,
3293list< CRef<CSeq_align_set> > seqalign_hit_total_list;
3294list< CRef<CSeq_align_set> > seqalign_hit_list;
3311seqalign_hit_total_list.push_back(temp);
3324 intalignCount = 0,hspCount = 0;
3326 const CSeq_id& newQueryId = (*iter)->GetSeq_id(0);
3327 if(prevQueryId.
Empty() || !newQueryId.
Match(*prevQueryId)){
3328 if(hspCount >= maxHsps) {
3332prevQueryId = &newQueryId;
3334 if(alignCount < maxAligns) {
3335 const CSeq_id& newSubjectId = (*iter)->GetSeq_id(1);
3337 if(prevSubjectId.
Empty() || !newSubjectId.
Match(*prevSubjectId)){
3339prevSubjectId = &newSubjectId;
3343new_aln->
Set().push_back(*iter);
3354 if(queryNumber == 0) {
3360 intcurrQueryNum = 0;
3363 const CSeq_id& newQueryId = (*iter)->GetSeq_id(0);
3364 if(prevQueryId.
Empty() || !newQueryId.
Match(*prevQueryId)){
3366prevQueryId = &newQueryId;
3369 if(currQueryNum == queryNumber) {
3370 if(new_aln.
Empty()) {
3373new_aln->
Set().push_back(*iter);
3375 else if(currQueryNum > queryNumber) {
3385 stringl_cfg_file_name;
3389 boolcfgExists =
true;
3391 stringl_fmtcfg_env;
3392 if(
NULL!= getenv(
"NCBI") ) l_ncbi_env = getenv(
"NCBI");
3393 if(
NULL!= getenv(
"FMTCFG") ) l_fmtcfg_env = getenv(
"FMTCFG");
3395 if( l_fmtcfg_env.empty() )
3396l_cfg_file_name =
".ncbirc";
3398l_cfg_file_name = l_fmtcfg_env;
3400 CFilel_fchecker( l_cfg_file_name );
3401cfgExists = l_fchecker.
Exists();
3402 if( (!cfgExists) && (!l_ncbi_env.empty()) ) {
3403 if( l_ncbi_env.rfind(
"/") != (l_ncbi_env.length() -1 ))
3404l_ncbi_env.append(
"/");
3405l_cfg_file_name = l_ncbi_env + l_cfg_file_name;
3406 CFilel_fchecker2( l_cfg_file_name );
3407cfgExists = l_fchecker2.
Exists();
3412 if( l_dbg ) fprintf(stderr,
"REGISTRY: %s\n",l_cfg_file_name.c_str());
3434 stringl_key, l_host_port, l_format;
3435 stringl_secion_name =
"BLASTFMTUTIL";
3436 stringl_fmt_suffix =
"_FORMAT";
3437 stringl_host_port_suffix =
"_HOST_PORT";
3438 stringl_subst_pattern;
3444 stringl_base_dir =
m_Reg->Get(l_secion_name,
"INCLUDE_BASE_DIR");
3445 if( !l_base_dir.empty() && ( l_base_dir.rfind(
"/") != (l_base_dir.length()-1)) ) {
3446l_base_dir.append(
"/");
3450 stringdefault_host_port;
3454l_subst_pattern=
"<@"+l_key_ndx+
"@>";
3455l_host_port =
m_Reg->Get(l_secion_name, l_key_ndx);
3458 if( l_host_port.empty()){
3459l_key = url_name + l_host_port_suffix; l_subst_pattern=
"<@"+l_key+
"@>";
3460l_host_port =
m_Reg->Get(l_secion_name, l_key);
3462 if( l_host_port.empty())
return GetURLDefault(url_name,index);
3465l_key = url_name + l_fmt_suffix ;
3468l_format =
m_Reg->Get(l_secion_name, l_key_ndx);
3471 if( l_format.empty() ) l_format =
m_Reg->Get(l_secion_name, l_key);
3472 if( l_format.empty())
return GetURLDefault(url_name,index);
3474 stringl_format_file = l_base_dir + l_format;
3475 CFilel_fchecker( l_format_file );
3476 boolfile_name_mode = l_fchecker.
Exists();
3477 if( file_name_mode ) {
3478 stringl_inc_file_name = l_format_file;
3482 char*l_mem =
new char[ (size_t) l_inc_size + 1];
3483memset( l_mem,0, (
size_t) l_inc_size + 1 ) ;
3484l_file.seekg( 0, ios::beg );
3485l_file.read(l_mem, l_inc_size);
3487l_format.erase(); l_format.reserve( (
size_t)l_inc_size + 1 );
3492result_url =
NStr::Replace(l_format,l_subst_pattern,l_host_port);
3494 if( result_url.empty())
return GetURLDefault(url_name,index);
3502 stringsearch_name = url_name;
3507 if(url_link.empty()) {
3518 autocit = kMapTagToURL.find(tag_name);
3520 if( cit != kMapTagToURL.end()) {
3525 autocit = kMapTagToHTML.find(tag_name);
3527 if( cit != kMapTagToHTML.end()) {
3528mappedStr = cit->second;
3532 autocit = kMapTagToString.find(tag_name);
3534 if( cit != kMapTagToString.end()) {
3535mappedStr = cit->second;
3552retval.
Resize(0, 0, -1);
3553 if(matrix_name ==
NULL||
3560 if(packed_mtx ==
NULL) {
3577retval(
'*',
'*') = 1;
3579retval(
'U',
'U') = retval(
'C',
'C');
3580retval(
'U',
'C') = retval(
'C',
'C');
3581retval(
'C',
'U') = retval(
'C',
'C');
3588 stringtmplParam =
"<@"+ tmplParamName +
"@>";
3596 stringtmplParam =
"<@"+ tmplParamName +
"@>";
3597 NStr::Replace(inpString,tmplParam,templParamVal,outString);
3603templParamVal =
AddSpaces(templParamVal, maxParamValLength, spacesFormatFlag);
3604 stringoutString =
MapTemplate(inpString,tmplParamName,templParamVal);
3614 if(maxParamValLength >= paramVal.size()) {
3615 size_tnumSpaces = maxParamValLength - paramVal.size() + 1;
3617numSpaces = numSpaces/2;
3619spaceString.assign(numSpaces,
' ');
3622paramVal = paramVal.substr(0, maxParamValLength - 3) +
"...";
3623spaceString +=
" ";
3626paramVal = paramVal + spaceString;
3629paramVal = spaceString + paramVal + spaceString;
3632paramVal = spaceString + paramVal;
3647 stringhttpProt =
"https:";
3648 if(!config_reg.
Empty()) {
3649 if(config_reg.
HasEntry(
"BLASTFMTUTIL",
"PROTOCOL")) {
3650httpProt = config_reg.
Get(
"BLASTFMTUTIL",
"PROTOCOL");
3675 stringdb,logstr_moltype;
3676 if(seqUrlInfo->
isDbNa) {
3678logstr_moltype =
"nucl";
3681logstr_moltype =
"prot";
3683 stringlogstr_location = (seqUrlInfo->
isAlignLink) ?
"align":
"top";
3697 stringurl_link = urlTemplate;
3698 if(seqUrlInfo->
user_url.find(
"sra.cgi") != string::npos) {
3699 stringstrRun, strSpotId,strReadIndex;
3716 const unsigned intkWgsProjLength = 4;
3717 const unsigned intkWgsProjIDLengthMin = 8;
3718 const unsigned intkWgsProjIDLengthMax = 10;
3721 if(wgsAccession.size() < 6) {
3730 stringwgsProj = wgsAccession.substr(0,kWgsProjLength);
3731 for(
size_t i= 0;
i< wgsProj.length();
i++){
3732 if(!
isalpha(wgsProj[
i]&0xff)) {
3738 stringwgsId = wgsAccession.substr(kWgsProjLength);
3739 if(wgsId.length() >= kWgsProjIDLengthMin && wgsId.length() <= kWgsProjIDLengthMax) {
3740 for(
size_t i= 0;
i< wgsId.length();
i++){
3757 const unsigned intkWgsProgNameLength = 6;
3760wgsProjName = wgsAccession.substr(0,kWgsProgNameLength);
3772 stringtitle =
"title=\"Show report for "+ seqUrlInfo->accession +
"\" ";
3775 stringtemp_class_info = classInfo; temp_class_info +=
" ";
3777 stringwgsAccession = seqUrlInfo->accession;
3778 boolisWGS =
false;
3782 if(isWGS && seqUrlInfo->useTemplates) {
3788 else if(hasTextSeqID) {
3793 if(!seqUrlInfo->useTemplates) {
3806 if(seqUrlInfo->useTemplates) {
3808url_link = l_TraceUrl + (
string)
"?cmd=retrieve&dopt=fasta&val="+ actual_id +
"&RID="+ seqUrlInfo->rid;
3813temp_class_info = (!seqUrlInfo->defline.empty())?
CAlignFormatUtil::MapTemplate(temp_class_info,
"defline",seqUrlInfo->defline):temp_class_info;
3824user_url = (seqUrlInfo->addCssInfo) ?
m_Reg->Get(
"LOCAL_ID",
"TOOL_URL_ALIGN") :
m_Reg->Get(
"LOCAL_ID",
"TOOL_URL");
3831temp_class_info = (!seqUrlInfo->defline.empty())?
CAlignFormatUtil::MapTemplate(temp_class_info,
"defline",seqUrlInfo->defline):temp_class_info;
3838seqUrlInfo->seqUrl = url_link;
3856 stringtitle =
"title=\"Show report for "+ seqUrlInfo->accession +
"\" ";
3859!((seqUrlInfo->user_url.find(
"dumpgnl.cgi") != string::npos && seqUrlInfo->gi >
ZERO_GI) ||
3860(seqUrlInfo->user_url.find(
"maps.cgi") != string::npos))) {
3862 stringurl_with_parameters,toolURLParams;
3863 if(
m_Reg&& !seqUrlInfo->blastType.empty() && seqUrlInfo->blastType !=
"newblast") {
3864toolURLParams =
m_Reg->Get(seqUrlInfo->blastType,
"TOOL_URL_PARAMS");
3866 if(!toolURLParams.empty()) {
3867 stringurlLinkTemplate = seqUrlInfo->user_url + toolURLParams;
3868url_with_parameters =
s_MapURLLink(urlLinkTemplate, seqUrlInfo, *ids);
3871 if(seqUrlInfo->user_url.find(
"sra.cgi") != string::npos) {
3876seqUrlInfo->database,
3877seqUrlInfo->isDbNa, seqUrlInfo->rid,
3878seqUrlInfo->queryNumber,
3879seqUrlInfo->isAlignLink);
3883 if(!seqUrlInfo->useTemplates) {
3885 if(seqUrlInfo->addCssInfo) {
3889url_link +=
"<a "+ title + deflineInfo +
"href=\"";
3891url_link += url_with_parameters;
3892 if(!seqUrlInfo->useTemplates) url_link +=
"\">";
3899seqUrlInfo->seqUrl = url_link;
3914 if((seqUrlInfo->advancedView || seqUrlInfo->blastType ==
"mapview"|| seqUrlInfo->blastType ==
"mapview_prev") ||
3915seqUrlInfo->blastType ==
"gsfasta"|| seqUrlInfo->blastType ==
"gsfasta_prev") {
3919 stringurl_link =
GetIDUrl(seqUrlInfo,ids);
3927 stringlinkURL =
GetIDUrl(seqUrlInfo,ids);
3928 if(!linkURL.empty()) {
3931 stringlinkTmpl = (seqUrlInfo->
addCssInfo) ? genericLinkMouseoverTmpl : genericLinkTemplate;
3944 static string s_MapCustomLink(
stringlinkUrl,
stringreportType,
stringaccession,
stringlinkText,
stringlinktrg,
stringlinkTitle =
"",
stringlinkCls =
"")
3946 if(linkTitle.empty()) {
3966list<string> customLinksList;
3970 stringlinkUrl,link,linkTiltle = customLinkTitle;
3972linkUrl = seqUrlInfo->
seqUrl;
3977 stringlinkText = (seqUrlInfo->
isDbNa) ?
"GenBank":
"GenPept";
3979linkUrl +=
"&from=<@fromHSP@>&to=<@toHSP@>";
3980linkTiltle =
"Aligned region spanning positions <@fromHSP@> to <@toHSP@> on <@seqid@>";
3983customLinksList.push_back(link);
3985 returncustomLinksList;
3992 stringdbtype = (seqUrlInfo->
isDbNa) ?
"nuccore":
"protein";
3999 stringseqViewUrl = (seqUrlInfo->
gi>
ZERO_GI)?seqViewerUrl:seqViewerUrlNonGi;
4002 stringseqViewerParams;
4004seqViewerParams =
m_Reg->Get(seqUrlInfo->
blastType,
"SEQVIEW_PARAMS");
4007seqViewerParams = seqViewerParams.empty() ? seqViewerParamsDefault : seqViewerParams;
4012 stringlinkTitle =
"Show alignment to <@seqid@> in <@custom_report_type@>";
4018link_loc =
"fromSubj";
4022link_loc =
"fromHSP";
4023linkTitle +=
" for <@fromHSP@> to <@toHSP@> range";
4027 stringtitle = (seqUrlInfo->
isDbNa) ?
"Nucleotide Graphics":
"Protein Graphics";
4037list<string> customLinksList =
GetGiLinksList(seqUrlInfo,hspRange);
4039 if(!graphicLink.empty()) {
4040customLinksList.push_back(graphicLink);
4042 returncustomLinksList;
4047 intcustomLinkTypes = customLinkTypesInp;
4055 else if(seqUrlInfo->
blastType==
"sra") {
4058 else if(seqUrlInfo->
blastType==
"snp") {
4061 else if(seqUrlInfo->
blastType==
"gsfasta") {
4064 returncustomLinkTypes;
4072objects::CScope &scope,
4073 intcustomLinkTypes)
4075list<string> customLinksList;
4076 stringlinkUrl,link;
4082linkUrl = seqUrlInfo->
seqUrl;
4084customLinksList.push_back(link);
4088customLinksList.push_back(link);
4092customLinksList.push_back(link);
4096customLinksList.push_back(link);
4099linkUrl = seqUrlInfo->
seqUrl;
4101customLinksList.push_back(link);
4104linkUrl = seqUrlInfo->
seqUrl;
4106customLinksList.push_back(link);
4111linkUrl = seqUrlInfo->
resourcesUrl+ rs +
"?report=FLT";
4115customLinksList.push_back(link);
4119customLinksList.push_back(link);
4123customLinksList.push_back(link);
4126linkUrl = seqUrlInfo->
seqUrl;
4128customLinksList.push_back(link);
4130 returncustomLinksList;
4136objects::CScope &scope)
4140 stringlinkUrl,link;
4151 if(!linkUrl.empty()) {
4152linkUrl +=
"&segs="+ seqUrlInfo->
segs;
4162objects::CScope &scope)
4170linkUrl = seqUrlInfo->
seqUrl;
4174linkUrl = seqUrlInfo->
seqUrl;
4175vector<string> parts;
4179 if(parts.size() > 1) {
4182linkUrl = seqUrlInfo->
resourcesUrl+ rs +
"?report=fasta";
4203 const CDbtag& dtg = subject_id.GetGeneral();
4204 const string& dbName = dtg.
GetDb();
4222list<TGi> use_this_gi;
4224use_this_gi.clear();
4227num_ident, use_this_gi);
4230seqSetInfo->sum_n = sum_n == -1 ? 1:sum_n ;
4232seqSetInfo->use_this_gi = use_this_gi;
4233seqSetInfo->bit_score = bits;
4234seqSetInfo->raw_score = score;
4235seqSetInfo->evalue = evalue;
4236seqSetInfo->match = num_ident;
4239seqSetInfo->flip =
false;
4241 returnseqSetInfo.release();
4256 if(aln.
Get().empty())
4261 doubletotal_bits = 0;
4262 doublehighest_bits = 0;
4263 doublelowest_evalue = 0;
4264 inthighest_length = 1;
4265 inthighest_ident = 0;
4267 doubletotalLen = 0;
4269list<TGi> use_this_gi;
4279totalLen += align_length;
4282num_ident, use_this_gi);
4283use_this_gi.clear();
4293 if(bits > highest_bits) {
4294highest_length = align_length;
4295highest_ident = num_ident;
4299 if(bits > highest_bits) {
4300highest_bits = bits;
4301lowest_evalue = evalue;
4304seqSetInfo->
match= highest_ident;
4310seqSetInfo->
evalue= lowest_evalue;
4311seqSetInfo->
hspNum=
static_cast<int>(aln.
Size());
4325 if(aln.
Get().empty())
4328 doublehighest_bits = 0;
4329 inthighest_length = 1;
4330 inthighest_ident = 0;
4332list<TGi> use_this_gi;
4338num_ident, use_this_gi);
4347 if(bits > highest_bits) {
4348highest_length = align_length;
4349highest_ident = num_ident;
4351highest_bits = bits;
4356 returnpercent_identity;
4360 template<
classcontainer>
bool 4364 double& totalBitScore,
4365 int& percentCoverage,
4366 double& percentIdent,
4371list<TGi>& use_this_gi)
4373 const stringk_GiPrefix =
"gi:";
4374 boolhasScore =
false;
4377 ITERATE(
typenamecontainer, iter, scoreList) {
4381 if(
id.GetStr()==
"seq_evalue") {
4382evalue = (*iter)->GetValue().GetReal();
4383}
else if(
id.GetStr()==
"seq_bit_score"){
4384bitScore = (*iter)->GetValue().GetReal();
4385}
else if(
id.GetStr()==
"seq_total_bit_score"){
4386totalBitScore = (*iter)->GetValue().GetReal();
4387}
else if(
id.GetStr()==
"seq_percent_coverage"){
4388percentCoverage = (*iter)->GetValue().GetInt();
4389}
else if(
id.GetStr()==
"seq_percent_identity"&& (*iter)->GetValue().IsInt()){
4390percentIdent = (*iter)->GetValue().GetInt();
4391}
else if(
id.GetStr()==
"seq_percent_identity"&& (*iter)->GetValue().IsReal()){
4392percentIdent = (*iter)->GetValue().GetReal();
4393}
else if(
id.GetStr()==
"seq_hspnum"){
4394hspNum = (*iter)->GetValue().GetInt();
4395}
else if(
id.GetStr()==
"seq_align_totlen"){
4396totalLen = (*iter)->GetValue().GetReal();
4397}
else if(
id.GetStr()==
"score"){
4398rawScore = (*iter)->GetValue().GetInt();
4399}
else if(
id.GetStr()==
"use_this_gi"){
4400 Uint4gi_v = (
Uint4) ((*iter)->GetValue().GetInt());
4402}
else if(
id.GetStr()==
"sum_n"){
4403sum_n = (*iter)->GetValue().GetInt();
4406 stringstrGi =
NStr::Replace(
id.GetStr(),k_GiPrefix,
"");
4407 TGigi = NStr::StringToNumeric<TGi>(strGi);
4408use_this_gi.push_back(gi);
4419 const stringk_GiPrefix =
"gi:";
4426 for(CUser_object::TData::const_iterator fit = fields.begin(); fit != fields.end(); ++fit) {
4435 TGigi = NStr::StringToNumeric<TGi>(strGi);
4436use_this_gi.push_back(gi);
4454 for(CUser_object::TData::const_iterator fit = fields.begin(); fit != fields.end(); ++fit) {
4461use_this_seq.push_back(*acc_iter);
4473 boolhasScore =
false;
4475 doublebitScore = -1;
4476 doubletotalBitScore = -1;
4477 intpercentCoverage = -1;
4478 doublepercentIdent = -1;
4480 doubletotalLen = 0;
4483list<TGi> use_this_gi;
4484list<string> use_this_seq;
4488hasScore =
s_GetBlastScore(aln.
GetScore(),evalue,bitScore, totalBitScore,percentCoverage,percentIdent,hspNum,totalLen,rawScore,sum_n,use_this_gi);
4494evalue,bitScore, totalBitScore,percentCoverage,percentIdent,hspNum,totalLen,rawScore,sum_n,use_this_gi);
4497evalue,bitScore, totalBitScore,percentCoverage,percentIdent,hspNum,totalLen,rawScore,sum_n,use_this_gi);
4500evalue,bitScore, totalBitScore,percentCoverage,percentIdent,hspNum,totalLen,rawScore,sum_n,use_this_gi);
4504 if(use_this_gi.size() == 0) {
4513seqSetInfo->evalue = evalue;
4514seqSetInfo->bit_score = bitScore;
4515seqSetInfo->total_bit_score = totalBitScore;
4516seqSetInfo->percent_coverage = percentCoverage;
4517seqSetInfo->percent_identity = percentIdent;
4518seqSetInfo->hspNum = hspNum;
4519seqSetInfo->totalLen = (
Int8)totalLen;
4521seqSetInfo->sum_n = sum_n == -1 ? 1:sum_n ;
4524seqSetInfo->use_this_seq = use_this_seq;
4525seqSetInfo->raw_score = rawScore;
4528seqSetInfo->flip =
false;
4530 returnseqSetInfo.release();
4535list<TGi>& use_this_gi,
4546list<TGi>& use_this_gi,
4563 boolfound =
false;
4565iter != bdl.end(); iter++){
4569 if((*iter)->IsSetTaxid() && (*iter)->CanGetTaxid()){
4570taxid = (*iter)->GetTaxid();
4572 if(!use_this_gi.empty()) {
4573 ITERATE(list<TGi>, iter_gi, use_this_gi){
4574 if(cur_gi == *iter_gi){
4581 if((*iter_id)->Match(aln_id)
4583(*iter_id)->IsGeneral() && (*iter_id)->GetGeneral().CanGetDb() &&
4584aln_id.
GetGeneral().
GetDb() == (*iter_id)->GetGeneral().GetDb())) {
4603 const stringk_GiPrefix =
"gi:";
4604 const stringk_SeqIDPrefix =
"seqid:";
4612textSeqid =
NStr::Replace(use_this_seqid,k_SeqIDPrefix,
"");
4628 ITERATE(list<string>, iter_seq, use_this_seq){
4637list<TGi> use_this_gi;
4638 ITERATE(list<string>, iter_seq, use_this_seq){
4641 if(isGi) use_this_gi.push_back(NStr::StringToNumeric<TGi>(strGI));
4650 boolfound =
false;
4654 ITERATE(list<string>, iter_seq, use_this_seq){
4657 if((isGi && cur_gi == NStr::StringToNumeric<TGi>((useThisSeq))) || (!isGi && curSeqID == useThisSeq)){
4662 if(isGiList) *isGiList = isGi;
4671 if(alnSeqID->
IsGi()) {
4678 boolfound = std::find(seqList.begin(), seqList.end(), curSeqID) != seqList.end();
4681 ITERATE(list<string>, iter_seq, use_this_seq){
4683found = std::find(seqList.begin(), seqList.end(), useThisSeq) != seqList.end();
4694 boolhas_match =
false;
4696 ITERATE(list<string>, iter_seq, use_this_seq) {
4699 if(useThisSeq == textSeqIDToMatch) {
4709list<string> new_use_this_seq;
4710 boolhasAccType =
false;
4713 ITERATE(list<string>, iter_seq, use_this_seq) {
4716 if(useThisSeqAccType != accessionType) {
4717new_use_this_seq.push_back(useThisSeq);
4723use_this_seq = new_use_this_seq;
4729list<string>& use_this_seq,
4745 if(gi) *gi =
FindGi(*ids);
4746 if(textSeqID) *textSeqID =
GetLabel(wid,
true);
4748 boolfound =
false;
4750iter != bdl.end(); iter++){
4754 stringcurSeqID =
GetLabel(wid,
true);
4755 if(taxid && (*iter)->IsSetTaxid() && (*iter)->CanGetTaxid()){
4756*taxid = (*iter)->GetTaxid();
4758 if(!use_this_seq.empty()) {
4759 ITERATE(list<string>, iter_seq, use_this_seq){
4762 if((isGi && cur_gi == NStr::StringToNumeric<TGi>((useThisSeq))) || (!isGi && curSeqID == useThisSeq)){
4769 if((*iter_id)->Match(aln_id)
4771(*iter_id)->IsGeneral() && (*iter_id)->GetGeneral().CanGetDb() &&
4772aln_id.
GetGeneral().
GetDb() == (*iter_id)->GetGeneral().GetDb())) {
4778 if(gi) *gi = cur_gi;
4779 if(textSeqID) *textSeqID = curSeqID;
4791list<TGi>& use_this_gi)
4798 boolfound =
false;
4800iter != bdl.end(); iter++){
4803 if(!use_this_gi.empty()) {
4804 ITERATE(list<TGi>, iter_gi, use_this_gi){
4805 if(cur_gi == *iter_gi){
4812 if((*iter_id)->Match(aln_id)
4814(*iter_id)->IsGeneral() && (*iter_id)->GetGeneral().CanGetDb() &&
4815aln_id.
GetGeneral().
GetDb() == (*iter_id)->GetGeneral().GetDb())) {
4846list<CRef<CSeq_align> >::iterator mItr=alnset.
Set().begin();
4860 for(;mItr != alnset.
Set().end(); ++mItr) {
4870 if(coll[0] == align_subj_rng) {
4874subj_rng_coll += align_subj_rng;
4886query_rng.
SetFrom(
map.GetSeqPosFromAlnPos(0,subj_aln_start));
4887query_rng.
SetTo(
map.GetSeqPosFromAlnPos(0,subj_aln_end));
4891subj_rng_coll += subj_rng;
4909 for(CBioseq::TId::const_iterator iter = ids.begin(); iter != ids.end();
4911 if((*iter)->Which() == choice){
4928 if(!(
id.
Empty())){
4929 return id->GetGi();
4938 for(;desc_t; ++desc_t) {
4948 if(
id.IsGi() ||
id.IsPrf() ||
id.IsPir()) {
4949retval =
id.AsFastaString();
4952retval =
id.GetSeqIdString(
true);
4961 boolhasTextSeqID =
true;
4967hasTextSeqID =
false;
4971 if(hasTextSeqID && textSeqID) {
4974 returnhasTextSeqID;
4981 boolhasTextSeqID =
false;
4985 if(seqID.
Empty()) {
4988 if(seqID.
Empty()) {
4991 if(!seqID.
Empty()) {
4992hasTextSeqID =
true;
4995 returnhasTextSeqID;
4999vector <string> &seqList)
5002list<string> use_this_seq;
5003 bool match=
false;
5007subid = &((*iter)->GetSeq_id(1));
5008 if(previous_id.
Empty() || !subid->
Match(*previous_id)){
5009use_this_seq.clear();
5014previous_id = subid;
5016new_aln->
Set().push_back(*iter);
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.
static void s_CalcAlnPercentIdent(const CRef< CSeq_align_set > &info1, const CRef< CSeq_align_set > &info2, double &percentIdent1, double &percentIdent2)
static string s_GetTaxName(TTaxId taxid)
static bool s_ProcessAlignSet(const CSeq_align_set &alnset, list< CRange< TSeqPos > > &query_list, list< CRange< TSeqPos > > &subject_list)
static CRef< CSeq_id > s_GetSeqIdByType(const list< CRef< CSeq_id > > &ids, CSeq_id::E_Choice choice)
return id type specified or null ref
static string s_MapURLLink(string urlTemplate, CAlignFormatUtil::SSeqURLInfo *seqUrlInfo, const CBioseq::TId &ids)
static list< CRange< TSeqPos > > s_MergeRangeList(list< CRange< TSeqPos > > &source)
MAKE_CONST_MAP(kMapTagToURL, ct::tagStrNocase, ct::tagStrNocase, { { "BL2SEQ_WBLAST_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/blast/bl2seq/wblast2.cgi" }, { "CBLAST_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/Structure/cblast/cblast.cgi" }, { "DOWNLOAD_CGI","/blast/dumpgnl.cgi"}, { "ENTREZ_QUERY_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/entrez/query.fcgi" }, { "ENTREZ_SITES_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/sites/entrez" }, { "ENTREZ_SUBSEQ_TM", "<@protocol@>//www.ncbi.nlm.nih.gov/<@db@>/<@gi@>?report=gbwithparts&from=<@from@>&to=<@to@>&RID=<@rid@>" }, { "ENTREZ_TM", "<@protocol@>//www.ncbi.nlm.nih.gov/<@db@>/<@acc@>?report=genbank&log$=<@log@>&blast_rank=<@blast_rank@>&RID=<@rid@>" }, { "ENTREZ_VIEWER_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/entrez/viewer.fcgi" }, { "GENE_INFO", "<@protocol@>//www.ncbi.nlm.nih.gov/sites/entrez?db=gene&cmd=search&term=%d&RID=%s&log$=geneexplicit%s&blast_rank=%d" }, { "MAP_SEARCH_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/mapview/map_search.cgi" }, { "MAPVIEWER_CGI", "https://www.ncbi.nlm.nih.gov/mapview/maps.cgi?maps=blast_set" }, {"SEQVIEW_URL","https://www.ncbi.nlm.nih.gov/<@dbtype@>/<@seqid@>?report=graph&rid=<@rid@>[<@seqid@>]&"}, {"SEQVIEW_URL_NON_GI","https://www.ncbi.nlm.nih.gov/projects/sviewer/?RID=<@rid@>&id=<@firstSeqID@>&"}, { "TRACE_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/Traces/trace.cgi" }, { "TREEVIEW_CGI", "<@protocol@>//www.ncbi.nlm.nih.gov/blast/treeview/blast_tree_view.cgi"}, { "WGS", "<@protocol@>//www.ncbi.nlm.nih.gov/nuccore/<@wgsacc@>" }, })
static void s_AddLinkoutInfo(map< int, vector< CBioseq::TId > > &linkout_map, int linkout, CBioseq::TId &cur_id)
static string s_MapCustomLink(string linkUrl, string reportType, string accession, string linkText, string linktrg, string linkTitle="", string linkCls="")
static bool s_GetSRASeqMetadata(const CBioseq::TId &ids, string &strRun, string &strSpotId, string &strReadIndex)
void s_AddOtherRelatedInfoLinks(CBioseq::TId &cur_id, const string &rid, bool is_na, bool for_alignment, int cur_align, list< string > &linkout_list)
static list< string > s_NumGiToStringGiList(list< TGi > use_this_gi)
static CRange< TSeqPos > & s_FixMinusStrandRange(CRange< TSeqPos > &rng)
static bool s_FillDbInfoLocally(const string &dbname, CAlignFormatUtil::SDbInfo &info, int dbfilt_algorithm)
Initialize database statistics with data obtained from local BLAST databases.
static CRef< CScope > kScope
bool s_GetBlastScore(const container &scoreList, int &score, double &bits, double &evalue, int &sum_n, int &num_ident, list< TGi > &use_this_gi, int &comp_adj_method)
Get blast score information.
static list< string > s_GetLinkoutUrl(int linkout, string giList, string labelList, TGi first_gi, CAlignFormatUtil::SLinkoutInfo &linkoutInfo, bool textLink=true)
string s_GetBestIDForURL(CBioseq::TId &ids)
static bool s_isAlnInFilteringRange(double evalue, double percentIdent, int queryCover, double evalueLow, double evalueHigh, double percentIdentLow, double percentIdentHigh, int queryCoverLow, int queryCoverHigh)
static string s_MapCommonUrlParams(string urlTemplate, CAlignFormatUtil::SSeqURLInfo *seqUrlInfo)
static int s_LinkLetterToType(string linkLetter)
static double adjustPercentIdentToDisplayValue(double value)
const char k_PSymbol[ePMatrixSize+1]
Residues.
static string s_UseThisSeqToTextSeqID(string use_this_seqid, bool &isGi)
static string s_MapLinkoutGenParam(string &url_link_tmpl, const string &rid, string giList, bool for_alignment, int cur_align, string &label, string &lnk_displ, string lnk_tl_info="", string lnk_title="")
static list< string > s_GetFullLinkoutUrl(CBioseq::TId &cur_id, CAlignFormatUtil::SLinkoutInfo &linkoutInfo, map< int, vector< CBioseq::TId > > &linkout_map, bool getIdentProteins)
static bool FromRangeAscendingSort(CRange< TSeqPos > const &info1, CRange< TSeqPos > const &info2)
const int k_NumAsciiChar
Number of ASCII characters for populating matrix columns.
Declares the CBlastServices class.
static string GetProtocol(void)
static const char * kNoHitsFound
The string containing the message that no hits were found.
static CRef< objects::CSeq_align_set > FilterSeqalignBySeqList(objects::CSeq_align_set &source_aln, vector< string > &seqList)
function for Filtering seqalign by specific subjects
static void PrintPhiInfo(int num_patterns, const string &pattern, double prob, vector< int > &offsets, CNcbiOstream &out)
Prints out PHI-BLAST info for header (or footer)
static CAlignFormatUtil::SSeqAlignSetCalcParams * GetSeqAlignSetCalcParamsFromASN(const objects::CSeq_align_set &alnSet)
static string GetIDUrl(SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
Create URL for seqid.
static int GetAlignmentLength(const objects::CSeq_align &aln, bool do_translation)
get the alignment length
static bool IsWGSAccession(string &accession, string &wgsProj)
Check if accession is WGS.
static void PruneSeqalign(const objects::CSeq_align_set &source_aln, objects::CSeq_align_set &new_aln, unsigned int num=static_cast< unsigned int >(kDfltArgNumAlignments))
Fill new alignset containing the specified number of alignments with unique slave seqids.
static int GetUniqSeqCoverage(objects::CSeq_align_set &alnset)
Calculate the uniq subject query coverage range (blastn only)
static CAlignFormatUtil::SSeqAlignSetCalcParams * GetSeqAlignSetCalcParams(const objects::CSeq_align_set &aln, int queryLength, bool do_translation)
static void SortHitByMolecularType(list< CRef< objects::CSeq_align_set > > &seqalign_hit_list, objects::CScope &scope, ILinkoutDB *linkoutdb, const string &mv_build_name)
sort a list of seqalign set by molecular type
static void AcknowledgeBlastQuery(const objects::CBioseq &cbs, size_t line_len, CNcbiOstream &out, bool believe_query, bool html, bool tabular=false, const string &rid=kEmptyStr)
Print out blast query info.
static bool IsMixedDatabase(const objects::CSeq_align_set &alnset, objects::CScope &scope, ILinkoutDB *linkoutdb, const string &mv_build_name)
static list< CRef< objects::CSeq_align_set > > SortOneSeqalignForSortableFormat(const objects::CSeq_align_set &source, bool nuc_to_nuc_translation, int hit_sort, int hsp_sort)
static void GetAsciiProteinMatrix(const char *matrix_name, CNcbiMatrix< int > &retval)
Retrieve a scoring matrix for the provided matrix name.
static list< string > GetFullLinkoutUrl(const list< CRef< objects::CBlast_def_line > > &bdl, const string &rid, const string &cdd_rid, const string &entrez_term, bool is_na, bool structure_linkout_as_group, bool for_alignment, int cur_align, string &linkoutOrder, TTaxId taxid, string &database, int query_number, string &user_url, string &preComputedResID, ILinkoutDB *linkoutdb, const string &mv_build_name)
Get linkout membership for for the list of blast deflines.
static void x_AcknowledgeBlastSequence(const objects::CBioseq &cbs, size_t line_len, CNcbiOstream &out, bool believe_query, bool html, const string &label, bool tabular, const string &rid)
static void PrintDbReport(const vector< SDbInfo > &dbinfo_list, size_t line_length, CNcbiOstream &out, bool top=false)
Print out blast database information.
static void GetAlnScores(const objects::CSeq_align &aln, int &score, double &bits, double &evalue, int &sum_n, int &num_ident, list< TGi > &use_this_gi)
Extract score info from blast alingment.
static void BuildFormatQueryString(CCgiContext &ctx, string &cgi_query)
static string GetSeqDescrString(const objects::CBioseq &cbs)
Returns a full description for a Bioseq, concatenating all available titles.
@ eAddEOLAtLineEnd
add EOL at the beginning of the string
@ eAddEOLAtLineStart
add spaces at the end of the string
@ eSpacePosAtLineEnd
add spaces at the begining of the string
static list< TGi > StringGiToNumGiList(list< string > &use_this_seq)
Convert if string gi list to TGi list.
static string AddSpaces(string paramVal, size_t maxParamLength, int spacesFormatFlag=eSpacePosToCenter)
Calculate the number of spaces and add them to paramVal.
static CRef< objects::CSeq_align_set > FilterSeqalignByPercentIdent(objects::CSeq_align_set &source_aln, double percentIdentLow, double percentIdentHigh)
function for Filtering seqalign by percent identity
static bool RemoveSeqsOfAccessionTypeFromSeqInUse(list< string > &use_this_seq, objects::CSeq_id::EAccessionInfo accesionType)
function to remove sequences of accesionType from use_this_seq list
static bool SortHitByMasterStartAscending(CRef< objects::CSeq_align_set > &info1, CRef< objects::CSeq_align_set > &info2)
sorting function for sorting a list of seqalign set by ascending mater start position
static void GetScoreString(double evalue, double bit_score, double total_bit_score, int raw_score, string &evalue_str, string &bit_score_str, string &total_bit_score_str, string &raw_score_str)
format evalue and bit_score
static map< string, CRef< objects::CSeq_align_set > > HspListToHitMap(vector< string > seqIdList, const objects::CSeq_align_set &source)
static string GetBareId(const objects::CSeq_id &id)
Get sequence id with no database source (bare accession)
static string GetGnlID(const objects::CDbtag &dtg)
Return ID for GNL label.
static bool m_geturl_debug_flag
static void SortHit(list< CRef< objects::CSeq_align_set > > &seqalign_hit_list, bool do_translation, objects::CScope &scope, int sort_method, ILinkoutDB *linkoutdb, const string &mv_build_name)
actual sorting function for SortHitByMolecularType
static void FillScanModeBlastDbInfo(vector< SDbInfo > &retval, bool is_protein, int numSeqs, Int8 numLetters, string &tag)
Fills one BLAST dbinfo structure.
static bool SortHitByTotalScoreDescending(CRef< objects::CSeq_align_set > const &info1, CRef< objects::CSeq_align_set > const &info2)
return the comparison result: 1st >= 2nd => true, false otherwise
static string GetIDUrlGen(SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
Create URL for seqid that goes to entrez or trace.
static bool SortHspBySubjectStartAscending(const CRef< objects::CSeq_align > &info1, const CRef< objects::CSeq_align > &info2)
static CAlignFormatUtil::DbType GetDbType(const objects::CSeq_align_set &actual_aln_list, objects::CScope &scope)
Set the database as gi type.
static void PruneSeqalignAll(const objects::CSeq_align_set &source_aln, objects::CSeq_align_set &new_aln, unsigned int number)
Fill new alignset containing the specified number of alignments plus the rest of alignments for the l...
static void PrintTildeSepLines(string str, size_t line_len, CNcbiOstream &out)
Print out misc information separated by "~".
static string BuildUserUrl(const objects::CBioseq::TId &ids, TTaxId taxid, string user_url, string database, bool db_is_na, string rid, int query_number, bool for_alignment)
return the custom url (such as mapview)
static string MapTemplate(string inpString, string tmplParamName, Int8 templParamVal)
Replace template tags by real data.
static CAlignFormatUtil::SSeqAlignSetCalcParams * GetSeqAlignCalcParams(const objects::CSeq_align &aln)
static string GetURLFromRegistry(const string url_name, int index=-1)
retrieve URL from .ncbirc file combining host/port and format strings values.
static bool IsGiList(list< string > &use_this_seq)
Check if use_this_seq conatins gi list.
static double GetSeqAlignSetCalcPercentIdent(const objects::CSeq_align_set &aln, bool do_translation)
static string GetGraphiscLink(SSeqURLInfo *seqUrlInfo, bool hspRange=false)
static bool MatchSeqInSeqList(TGi cur_gi, CRef< objects::CSeq_id > &seqID, list< string > &use_this_seq, bool *isGiList=NULL)
Matches text seqID or gi with the list of seqIds or gis.
static int GetSeqLinkoutInfo(objects::CBioseq::TId &cur_id, ILinkoutDB **linkoutdb, const string &mv_build_name, TGi gi=INVALID_GI)
static CRef< objects::CSeq_id > GetDisplayIds(const objects::CBioseq_Handle &handle, const objects::CSeq_id &aln_id, list< TGi > &use_this_gi, TGi &gi, TTaxId &taxid)
Scan the the list of blast deflines and find seqID to be use in display.
static list< string > GetLinkoutUrl(int linkout, const objects::CBioseq::TId &ids, const string &rid, const string &cdd_rid, const string &entrez_term, bool is_na, TGi first_gi, bool structure_linkout_as_group, bool for_alignment, int cur_align, string preComputedResID)
Get the list of urls for linkouts.
static void PrintKAParameters(double lambda, double k, double h, size_t line_len, CNcbiOstream &out, bool gapped, const Blast_GumbelBlk *gbp=NULL)
Print out kappa, lamda blast parameters.
static CRef< objects::CSeq_align > CreateDensegFromDendiag(const objects::CSeq_align &aln)
Create denseseg representation for densediag seqalign.
static list< string > GetCustomLinksList(SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope, int customLinkTypes=eLinkTypeDefault)
Create the list of string links for seqid that go.
static string GetURLDefault(const string url_name, int index=-1)
settings are not complete.
static CRef< objects::CSeq_align_set > FilterSeqalignByEval(objects::CSeq_align_set &source_aln, double evalueLow, double evalueHigh)
function for Filtering seqalign by expect value
static string GetFASTALinkURL(SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
Create URL showing aligned regions info.
static bool GetTextSeqID(const list< CRef< objects::CSeq_id > > &ids, string *textSeqID=NULL)
static void GetBlastDbInfo(vector< SDbInfo > &retval, const string &blastdb_names, bool is_protein, int dbfilt_algorithm, bool is_remote=false)
Retrieve BLAST database information for presentation in BLAST report.
static void GetUseThisSequence(const objects::CSeq_align &aln, list< TGi > &use_this_gi)
Extract use_this_gi info from blast alingment.
static bool SortHitByPercentIdentityDescendingEx(const CRef< objects::CSeq_align_set > &info1, const CRef< objects::CSeq_align_set > &info2)
sorting function for sorting a list of seqalign set by descending identity
static void ExtractSeqAlignForSeqList(CRef< objects::CSeq_align_set > &all_aln_set, string alignSeqList)
extract seq_align_set coreesponding to seqid list
static int GetPercentMatch(int numerator, int denominator)
function for calculating percent match for an alignment.
static string GetSeqIdString(const objects::CBioseq &cbs, bool believe_local_id=true)
Returns a full '|'-delimited Seq-id string for a Bioseq.
static bool MatchSeqInUseThisSeqList(list< string > &use_this_seq, string textSeqIDToMatch)
static list< string > GetSeqLinksList(SSeqURLInfo *seqUrlInfo, bool hspRange=false)
static CRef< objects::CSeq_align_set > SortSeqalignForSortableFormat(CCgiContext &ctx, objects::CScope &scope, objects::CSeq_align_set &aln_set, bool nuc_to_nuc_translation, int db_order, int hit_order, int hsp_order, ILinkoutDB *linkoutdb, const string &mv_build_name)
static double GetPercentIdentity(const objects::CSeq_align &aln, objects::CScope &scope, bool do_translation)
calculate the percent identity for a seqalign
static void ExtractSeqalignSetFromDiscSegs(objects::CSeq_align_set &target, const objects::CSeq_align_set &source)
If a Seq-align-set contains Seq-aligns with discontinuous type segments, extract the underlying Seq-a...
static bool IsWGSPattern(string &wgsAccession)
Check if accession is WGS.
static string MapTagToConstString(const string tag_name, EMapConstString flag=eMapToURL)
static bool SortHitByScoreDescending(const CRef< objects::CSeq_align_set > &info1, const CRef< objects::CSeq_align_set > &info2)
static CRef< objects::CSeq_align_set > FilterSeqalignByScoreParams(objects::CSeq_align_set &source_aln, double evalueLow, double evalueHigh, double percentIdentLow, double percentIdentHigh)
function for Filtering seqalign by expect value and percent identity
static void GetAlignLengths(objects::CAlnVec &salv, int &align_length, int &num_gaps, int &num_gap_opens)
Count alignment length, number of gap openings and total number of gaps in a single alignment.
static string BuildSRAUrl(const objects::CBioseq::TId &ids, string user_url)
return the SRA (Short Read Archive) URL
static bool SortHspByMasterStartAscending(const CRef< objects::CSeq_align > &info1, const CRef< objects::CSeq_align > &info2)
sorting function for sorting a list of seqalign by ascending mater start position
static int SetCustomLinksTypes(SSeqURLInfo *seqUrlInfo, int customLinkTypesInp)
Create info indicating what kind of links to display.
static int GetMasterCoverage(const objects::CSeq_align_set &alnset)
static unique_ptr< CNcbiRegistry > m_Reg
static int GetFrame(int start, objects::ENa_strand strand, const objects::CBioseq_Handle &handle)
return the frame for a given strand Note that start is zero bases.
static void GetBdlLinkoutInfo(const list< CRef< objects::CBlast_def_line > > &bdl, map< int, vector< objects::CBioseq::TId > > &linkout_map, ILinkoutDB *linkoutdb, const string &mv_build_name)
Create map that holds all linkouts for the list of blast deflines and corresponding seqIDs.
static bool SortHspByPercentIdentityDescending(const CRef< objects::CSeq_align > &info1, const CRef< objects::CSeq_align > &info2)
sorting function for sorting a list of seqalign by descending identity
static CRef< objects::CSeq_align_set > HitListToHspList(list< CRef< objects::CSeq_align_set > > &source)
extract all nested hsp's into a list
static string GetTitle(const objects::CBioseq_Handle &bh)
static TTaxId GetTaxidForSeqid(const objects::CSeq_id &id, objects::CScope &scope)
return the tax id for a seqid
static void AddSpace(CNcbiOstream &out, size_t number)
Add the specified white space.
static string GetAlignedRegionsURL(SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
Create URL to FASTA info.
static list< string > GetGiLinksList(SSeqURLInfo *seqUrlInfo, bool hspRange=false)
static void AcknowledgeBlastSubject(const objects::CBioseq &cbs, size_t line_len, CNcbiOstream &out, bool believe_query, bool html, bool tabular=false)
Print out blast subject info.
static TGi GetGiForSeqIdList(const list< CRef< objects::CSeq_id > > &ids)
return gi from id list
static void SplitSeqalignByMolecularType(vector< CRef< objects::CSeq_align_set > > &target, int sort_method, const objects::CSeq_align_set &source, objects::CScope &scope, ILinkoutDB *linkoutdb, const string &mv_build_name)
static bool SortHitByMasterCoverageDescending(CRef< objects::CSeq_align_set > const &info1, CRef< objects::CSeq_align_set > const &info2)
static void BlastPrintError(list< SBlastError > &error_return, bool error_post, CNcbiOstream &out)
Output blast errors.
static string MapSpaceTemplate(string inpString, string tmplParamName, string templParamVal, unsigned int maxParamLength, int spacesFormatFlag=eSpacePosAtLineEnd)
Replace template tags by real data and calculate and add spaces dependent on maxParamLength and space...
static void HspListToHitList(list< CRef< objects::CSeq_align_set > > &target, const objects::CSeq_align_set &source)
group hsp's with the same id togeter
static void SortHitByPercentIdentityDescending(list< CRef< objects::CSeq_align_set > > &seqalign_hit_list, bool do_translation)
sort a list of seqalign set by alignment identity
static string MapProtocol(string url_link)
static string GetFullIDLink(SSeqURLInfo *seqUrlInfo, const objects::CBioseq::TId *ids)
static bool SortHspByScoreDescending(const CRef< objects::CSeq_align > &info1, const CRef< objects::CSeq_align > &info2)
static CRef< objects::CSeq_align_set > LimitSeqalignByHsps(objects::CSeq_align_set &source_aln, int maxAligns, int maxHsps)
function for Limitting seqalign by hsps number (by default results are not cut off within the query)
static CRef< objects::CSeq_align_set > ExtractQuerySeqAlign(CRef< objects::CSeq_align_set > &source_aln, int queryNumber)
function for extracting seqalign for the query
static string GetLabel(CConstRef< objects::CSeq_id > id, bool with_version=false)
Return a label for an ID Tries to recreate behavior of GetLabel before a change that prepends "ti|" t...
static string MapTagToHTML(const string tag_name)
static void x_WrapOutputLine(string str, size_t line_len, CNcbiOstream &out, bool html=false)
Wrap a string to specified length.
static unsigned int GetSubjectsNumber(const objects::CSeq_align_set &source_aln, unsigned int num)
Calculate number of subject sequnces in alignment limitted by num.
static CRange< TSeqPos > GetSeqAlignCoverageParams(const objects::CSeq_align_set &alnset, int *masterCoverage, bool *flip)
TDim GetNumRows(void) const
TSeqPos GetAlnStop(TNumseg seg) const
TSignedRange GetSeqAlnRange(TNumrow row) const
CRef< CAlnChunkVec > GetAlnChunks(TNumrow row, const TSignedRange &range, TGetChunkFlags flags=fAlnSegsOnly) const
API for Remote Blast Services.
static CNcbiApplication * Instance(void)
Singleton method.
void Resize(size_t i, size_t j, T val=T())
resize this matrix, filling the empty cells with a known value
TThisType & Subtract(const TRange &r)
position_type GetCoveredLength(void) const
Returns total length covered by ranges in this collection, i.e.
Uint8 GetTotalLength() const
Returns the sum of the lengths of all available sequences.
const string & GetDBNameList() const
Get list of database names.
void GetMaskAlgorithmDetails(int algorithm_id, objects::EBlast_filter_program &program, string &program_name, string &algo_opts)
Get information about one type of masking available here.
string GetTitle() const
Returns the database title.
int GetNumSeqs() const
Returns the number of sequences available.
string GetDate() const
Returns the construction date of the database.
static void GetTaxInfo(TTaxId taxid, SSeqDBTaxInfo &info)
Get taxonomy information.
static CRef< CBlast_def_line_set > ExtractBlastDefline(const CBioseq &bioseq)
Extract a Blast-def-line-set object from a Bioseq retrieved by CSeqDB.
Tdata::size_type Size() const
CRef< CSeq_align > CreateTranslatedDensegFromNADenseg(void) const
Create a Dense-seg with widths from Dense-seg of nucleotides Used by AlnMgr to handle translated nucl...
CRef< CSeq_align > CreateDensegFromStdseg(SSeqIdChooser *SeqIdChooser=0) const
---------------------------------------------------------------------------- PRE : the Seq-align has ...
TSeqPos GetSeqStop(TDim row) const
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
TSeqPos GetSeqStart(TDim row) const
@Seq_descr.hpp User-defined methods of the data storage class.
Class to sort by linkout bit.
string m_MapViewerBuildName
CSortHitByMolecularTypeEx(ILinkoutDB *linkoutdb, const string &mv_build_name)
bool operator()(const CRef< CSeq_align_set > &info1, const CRef< CSeq_align_set > &info2)
virtual int GetLinkout(TGi gi, const string &mv_build_name)=0
Retrieve the Linkout for a given GI.
const_iterator end() const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
const_iterator begin() const
const_iterator begin() const
const_iterator end() const
std::ofstream out("events_result.xml")
main entry point for tests
bool Empty(const CNcbiOstrstream &src)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static const char * str(char *buf, int n)
CRef< objects::CBlast4_database_info > GetDatabaseInfo(CRef< objects::CBlast4_database > blastdb)
Retrieve detailed information for one BLAST database If information about multiple databases is neede...
#define GI_FROM(T, value)
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
#define TAX_ID_TO(T, tax_id)
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
SStrictId_Tax::TId TTaxId
Taxon id type.
TCgiEntries::iterator TCgiEntriesI
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define ERR_POST_EX(err_code, err_subcode, message)
Error posting with error codes.
@ eDiag_Info
Informational message.
@ eDiag_Fatal
Fatal error â guarantees exit(or abort)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
virtual bool Exists(void) const
Check existence of file.
static string HTMLEncode(const string &str, THTMLEncodeFlags flags=fEncodeAll)
HTML encodes a string. E.g. <.
const string AsFastaString(void) const
TGi FindGi(const container &ids)
Return gi from id list if exists, return 0 otherwise.
static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)
Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...
string GetSeqIdString(bool with_version=false) const
Return seqid string with optional version for text seqid type.
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
CConstRef< CSeq_id > GetSeq_idByType(const container &ids, CSeq_id::E_Choice choice)
Search the container of CRef<CSeq_id> for the id of given type.
EAccessionInfo
For IdentifyAccession (below)
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
static int WorstRank(const CRef< CSeq_id > &id)
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
CConstRef< CSeq_id > FindTextseq_id(const container &ids)
Return text seq-id from id list if exists, return 0 otherwise.
@ eContent
Untagged human-readable accession or the like.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
TSeqPos GetBioseqLength(void) const
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty â not pointing to any object which means having a null value.
void Reset(void)
Reset reference object.
bool Empty(void) const THROWS_NONE
Check if CRef is empty â not pointing to any object, which means having a null value.
uint32_t Uint4
4-byte (32-bit) unsigned integer
int64_t Int8
8-byte (64-bit) signed integer
TThisType CombinationWith(const TThisType &r) const
bool IntersectingWith(const TThisType &r) const
TThisType & Set(position_type from, position_type to)
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
virtual bool HasEntry(const string §ion, const string &name=kEmptyStr, TFlags flags=0) const
bool Empty(TFlags flags=fAllLayers) const
Verify if Registry is empty.
#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.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)
Convert Int8 to string.
static CTempString TruncateSpaces_Unsafe(const CTempString str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to Int8.
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 double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static string JavaScriptEncode(const CTempString str)
Encode a string for JavaScript.
static bool SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
int TWrapFlags
Bitwise OR of "EWrapFlags".
static void Wrap(const string &str, SIZE_TYPE width, IWrapDest &dest, TWrapFlags flags, const string *prefix, const string *prefix1)
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.
static string & ToUpper(string &str)
Convert string to upper case â string& version.
static string URLEncode(const CTempString str, EUrlEncode flag=eUrlEnc_SkipMarkChars)
URL-encode string.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
static string & ToLower(string &str)
Convert string to lower case â string& version.
@ fConvErr_NoThrow
Do not throw an exception on error.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
@ fWrap_HTMLPre
Wrap as pre-formatted HTML?
@ fWrap_FlatFile
Wrap for flat file use.
@ fWithCommas
Use commas as thousands separator.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
@ fFormat_Simple
Use single characters as format symbols.
C::value_type FindBestChoice(const C &container, F score_func)
Find the best choice (lowest score) for values in a container.
static const char label[]
@ eBlast4_residue_type_nucleotide
@ eBlast4_residue_type_protein
const Tdata & Get(void) const
Get the member data.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetTo(TTo value)
Assign a value to To 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.
const TTag & GetTag(void) const
Get the Tag member data.
bool IsStrs(void) const
Check if variant Strs is selected.
const TStrs & GetStrs(void) const
Get the variant data.
bool IsId(void) const
Check if variant Id is selected.
const TData & GetData(void) const
Get the Data member data.
bool CanGetDb(void) const
Check if it is safe to call GetDb method.
bool CanGetTag(void) const
Check if it is safe to call GetTag method.
const TDb & GetDb(void) const
Get the Db member data.
bool IsSetLabel(void) const
field label Check if a value has been assigned to Label data member.
const TStr & GetStr(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
vector< CStringUTF8 > TStrs
vector< CRef< CUser_field > > TData
TId GetId(void) const
Get the variant data.
const TDenseg & GetDenseg(void) const
Get the variant data.
Tdata & Set(void)
Assign a value to data member.
TScore & SetScore(void)
Assign a value to Score data member.
TLens & SetLens(void)
Assign a value to Lens data member.
bool IsSetBounds(void) const
regions of sequence over which align was computed Check if a value has been assigned to Bounds data m...
E_Choice Which(void) const
Which variant is currently selected.
TDim GetDim(void) const
Get the Dim member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
TScores & SetScores(void)
Assign a value to Scores data member.
void SetDim(TDim value)
Assign a value to Dim data member.
void SetDim(TDim value)
Assign a value to Dim data member.
vector< TSeqPos > TStarts
void SetType(TType value)
Assign a value to Type data member.
bool IsDendiag(void) const
Check if variant Dendiag is selected.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
const TStd & GetStd(void) const
Get the variant data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
TStrands & SetStrands(void)
Assign a value to Strands data member.
bool CanGetExt(void) const
Check if it is safe to call GetExt method.
const TDendiag & GetDendiag(void) const
Get the variant data.
bool IsStd(void) const
Check if variant Std is selected.
vector< ENa_strand > TStrands
bool IsDisc(void) const
Check if variant Disc is selected.
vector< CRef< CScore > > TScores
TType GetType(void) const
Get the Type member data.
bool IsSetDim(void) const
dimensionality Check if a value has been assigned to Dim data member.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
const TExt & GetExt(void) const
Get the Ext member data.
bool IsSetScore(void) const
for whole alignment Check if a value has been assigned to Score data member.
list< CRef< CSeq_align > > Tdata
TIds & SetIds(void)
Assign a value to Ids data member.
const TScore & GetScore(void) const
Get the Score member data.
TBounds & SetBounds(void)
Assign a value to Bounds data member.
const TScores & GetScores(void) const
Get the Scores member data.
const TDisc & GetDisc(void) const
Get the variant data.
list< CRef< CDense_diag > > TDendiag
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
const TBounds & GetBounds(void) const
Get the Bounds member data.
ENa_strand
strand of nucleic acid
bool IsGeneral(void) const
Check if variant General is selected.
E_Choice Which(void) const
Which variant is currently selected.
TGi GetGi(void) const
Get the variant data.
E_Choice
Choice variants.
const TGeneral & GetGeneral(void) const
Get the variant data.
bool IsGi(void) const
Check if variant Gi is selected.
@ e_Other
for historical reasons, 'other' = 'refseq'
@ e_General
for other databases
@ e_Gi
GenInfo Integrated Database.
list< CRef< CSeqdesc > > Tdata
const TInst & GetInst(void) const
Get the Inst member data.
const TTitle & GetTitle(void) const
Get the variant data.
bool CanGetLength(void) const
Check if it is safe to call GetLength method.
const TId & GetId(void) const
Get the Id member data.
const Tdata & Get(void) const
Get the member data.
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
TLength GetLength(void) const
Get the Length member data.
list< CRef< CSeq_id > > TId
bool IsSetDescr(void) const
descriptors Check if a value has been assigned to Descr data member.
const TDescr & GetDescr(void) const
Get the Descr member data.
@ e_Ncbieaa
extended ASCII 1 letter aa codes
@ e_Title
a title for this sequence
char * dbname(DBPROCESS *dbproc)
Get name of current database.
unsigned int
A callback function used to compare two keys in a database.
HTML library helper classes and functions.
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
std::false_type tagStrNocase
constexpr bool empty(list< Ts... >) noexcept
const string version
version string
double value_type
The numeric datatype used by the parser.
Magic spell ;-) needed for some weird compilers... very empiric.
const GenericPointer< typename T::ValueType > T2 value
const CharType(& source)[N]
int strncmp(const char *str1, const char *str2, size_t count)
#define ASSERT
macro for assert.
Defines NCBI C++ diagnostic APIs, classes, and macros.
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Process information in the NCBI Registry, including working with configuration files.
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.
Useful/utility classes and methods.
std::istream & in(std::istream &in_, double &x_)
double lambda(size_t dimMatrix_, const Int4 *const *scoreMatrix_, const double *q_)
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
static PCRE2_SIZE * offsets
const SNCBIPackedScoreMatrix * NCBISM_GetStandardMatrix(const char *name)
void NCBISM_Unpack(const SNCBIPackedScoreMatrix *psm, SNCBIFullScoreMatrix *fsm)
Expand a packed score matrix into an unpacked one, which callers can proceed to index directly by sta...
Defines BLAST database access classes.
Defines exception class and several constants for SeqDB.
void SeqDB_SplitQuoted(const string &dbname, vector< CSeqDB_Substring > &dbs, bool keep_quote=false)
Combine and quote list of database names.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
Structure to hold the Gumbel parameters (for FSC).
double Alpha_un
Ungapped alpha.
double Sigma
cov(L) = sigma y + tau
double a
avg(L) = a y + b
double Alpha
var(L) = alpha y + beta
string filt_algorithm_name
Filtering algorithm ID used in BLAST search.
string filt_algorithm_options
Filtering algorithm options used in BLAST search.
void Init(string rid_in, string cdd_rid_in, string entrez_term_in, bool is_na_in, string database_in, int query_number_in, string user_url_in, string preComputedResID_in, string linkoutOrder_in, bool structure_linkout_as_group_in=false, bool for_alignment_in=true)
CRange< TSeqPos > subjRange
Structure that holds information for all hits of one subject in Seq Align Set.
CRange< TSeqPos > subjRange
int master_covered_length
Structure that holds information needed for creation seqID URL in descriptions and alignments.
string user_url
user url TOOL_URL from .ncbirc
string blastType
blast type refer to blobj->adm->trace->created_by
CRange< TSeqPos > seqRange
sequence range
string database
name of the database
string defline
sequence defline
bool addCssInfo
bool indicating that css info should be added
int queryNumber
the query number
string accession
accession
string segs
string containing align segments in the the following format seg1Start-seg1End,seg2Start-seg2End
int blast_rank
index of the current alignment
string seqUrl
sequence URL created
bool isAlignLink
bool indicating if link is in alignment section
bool isDbNa
bool indicating if the database is nucleotide or not
string resourcesUrl
URL(s) to other resources from .ncbirc.
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