name = definition = date =
"Unknown";
148 SSeqURLInfo(
stringusurl,
stringbt,
boolisnuc,
stringdb,
stringrid_in,
intqn,
150 TTaxIdtxid =
INVALID_TAX_ID,
booladdCssInf =
false,
stringseqSegs =
"",
stringresUrl =
"",
booluseTmpl =
false,
booladvView =
false)
151: user_url(usurl),blastType(bt), isDbNa(isnuc),
database(db),rid(rid_in),
152queryNumber(qn), gi(gi_in), accession(acc), linkout(lnk),blast_rank(blrk),isAlignLink(alnLink),
153new_win(nw),seqRange(range),flip(flp),taxid (txid),addCssInfo(addCssInf),segs(seqSegs),
154resourcesUrl(resUrl),useTemplates(useTmpl),advancedView(advView){}
188 void Init(
stringrid_in,
stringcdd_rid_in,
stringentrez_term_in,
boolis_na_in,
189 stringdatabase_in,
intquery_number_in,
stringuser_url_in,
stringpreComputedResID_in,
190 stringlinkoutOrder_in,
191 boolstructure_linkout_as_group_in =
false,
boolfor_alignment_in =
true) {
193cdd_rid = cdd_rid_in;
194entrez_term = entrez_term_in;
197query_number = query_number_in;
198user_url = user_url_in;
199preComputedResID = preComputedResID_in;
201linkoutOrder = linkoutOrder_in;
206structure_linkout_as_group = structure_linkout_as_group_in;
207for_alignment = for_alignment_in;
210 void Init(
stringrid_in,
stringcdd_rid_in,
stringentrez_term_in,
boolis_na_in,
211 stringdatabase_in,
intquery_number_in,
stringuser_url_in,
stringpreComputedResID_in,
212 stringlinkoutOrder_in,
ILinkoutDB* linkoutdb_in,
stringmv_build_name_in,
213 boolstructure_linkout_as_group_in =
false,
boolfor_alignment_in =
true) {
215 Init(rid_in,cdd_rid_in,entrez_term_in,is_na_in,
216database_in,query_number_in, user_url_in,preComputedResID_in,
218structure_linkout_as_group_in, for_alignment_in);
220linkoutdb = linkoutdb_in;
221mv_build_name = mv_build_name_in;
255eNonGenomicFirst = 1,
276eLinkTypeDefault = 0,
277eLinkTypeMapViewer = (1 << 0),
278eLinkTypeSeqViewer = (1 << 1),
279eDownLoadSeq = (1 << 2),
280eLinkTypeGenLinks = (1 << 3),
281eLinkTypeTraceLinks = (1 << 4),
282eLinkTypeSRALinks = (1 << 5),
283eLinkTypeSNPLinks = (1 << 6),
284eLinkTypeGSFastaLinks = (1 << 7)
296eSpacePosToCenter = (1 << 0),
297eSpacePosAtLineStart = (1 << 1),
298eSpacePosAtLineEnd = (1 << 2),
299eAddEOLAtLineStart = (1 << 3),
300eAddEOLAtLineEnd = (1 << 4)
309 static voidBlastPrintError(list<SBlastError>& error_return,
317 static voidPrintTildeSepLines(
string str,
size_tline_len,
328 static voidFillScanModeBlastDbInfo(vector<SDbInfo>& retval,
329 boolis_protein,
intnumSeqs,
Int8numLetters,
string&
tag);
337 static voidGetBlastDbInfo(vector<SDbInfo>& retval,
338 const string& blastdb_names,
boolis_protein,
339 intdbfilt_algorithm,
340 boolis_remote =
false);
347 static voidPrintDbReport(
constvector<SDbInfo>& dbinfo_list,
360 static voidPrintKAParameters(
double lambda,
doublek,
doubleh,
379 static stringGetSeqDescrString(
constobjects::CBioseq& cbs);
390 static voidAcknowledgeBlastQuery(
constobjects::CBioseq& cbs,
size_tline_len,
392 boolhtml,
booltabular=
false,
403 static voidAcknowledgeBlastSubject(
constobjects::CBioseq& cbs,
size_tline_len,
405 boolhtml,
booltabular=
false);
410 static voidGetAsciiProteinMatrix(
const char* matrix_name,
413 static voidx_AcknowledgeBlastSequence(
constobjects::CBioseq& cbs,
418 const string&
label,
420 const string& rid
);
429 static voidPrintPhiInfo(
intnum_patterns,
const string& pattern,
449list<TGi>& use_this_gi);
466list<string>& use_this_seq);
485list<TGi>& use_this_gi,
486 int& comp_adj_method);
505list<string>& use_this_seq,
506 int& comp_adj_method);
533 static boolMatchSeqInUseThisSeqList(list<string> &use_this_seq,
stringtextSeqIDToMatch);
538 static boolIsGiList(list<string> &use_this_seq);
543 staticlist<TGi> StringGiToNumGiList(list<string> &use_this_seq);
553 static stringGetGnlID(
constobjects::CDbtag& dtg);
571 static voidGetScoreString(
doubleevalue,
573 doubletotal_bit_score,
576 string& bit_score_str,
577 string& total_bit_score_str,
578 string& raw_score_str);
587 static voidPruneSeqalign(
constobjects::CSeq_align_set& source_aln,
588objects::CSeq_align_set& new_aln,
595 static unsigned intGetSubjectsNumber(
constobjects::CSeq_align_set& source_aln,
607 static voidPruneSeqalignAll(
constobjects::CSeq_align_set& source_aln,
608objects::CSeq_align_set& new_aln,
618 static voidGetAlignLengths(objects::CAlnVec& salv,
int& align_length,
619 int& num_gaps,
int& num_gap_opens);
626 static voidExtractSeqalignSetFromDiscSegs(objects::CSeq_align_set& target,
627 constobjects::CSeq_align_set&
source);
638 static TTaxIdGetTaxidForSeqid(
constobjects::CSeq_id&
id, objects::CScope& scope);
648 static intGetFrame (
intstart,
objects::ENa_strandstrand,
constobjects::CBioseq_Handle& handle);
668 constobjects::CSeq_align_set&
source);
692 static stringBuildUserUrl(
constobjects::CBioseq::TId& ids,
TTaxIdtaxid,
stringuser_url,
693 string database,
booldb_is_na,
stringrid,
694 intquery_number,
boolfor_alignment);
701 static stringBuildSRAUrl(
constobjects::CBioseq::TId& ids,
stringuser_url);
711 booldo_translation);
718 static intGetAlignmentLength(
constobjects::CSeq_align& aln,
booldo_translation);
726 booldo_translation);
733 static boolSortHitByPercentIdentityDescendingEx
742 static boolSortHspByPercentIdentityDescending
758 static boolSortHitByScoreDescending
781objects::CScope& scope,
ILinkoutDB* linkoutdb,
782 const string& mv_build_name);
794 booldo_translation, objects::CScope& scope,
intsort_method,
795 ILinkoutDB* linkoutdb,
const string& mv_build_name);
800 constobjects::CSeq_align_set&
source,
801objects::CScope& scope,
803 const string& mv_build_name);
806objects::CScope& scope,
807objects::CSeq_align_set& aln_set,
808 boolnuc_to_nuc_translation,
813 const string& mv_build_name);
817 boolnuc_to_nuc_translation,
821 staticlist< CRef<objects::CSeq_align_set> >
822SortOneSeqalignForSortableFormat(
constobjects::CSeq_align_set&
source,
823 boolnuc_to_nuc_translation,
832 static intGetPercentMatch(
intnumerator,
intdenominator);
833 static doubleGetPercentIdentity(
intnumerator,
intdenominator);
859 doublepercentIdentLow,
860 doublepercentIdentHigh);
878 doublepercentIdentLow,
879 doublepercentIdentHigh);
885 doublepercentIdentLow,
886 doublepercentIdentHigh,
887 intqueryCoverageLow,
888 intqueryCoverageHigh);
897vector <string> &seqList);
906 static boolRemoveSeqsOfAccessionTypeFromSeqInUse(list<string> &use_this_seq, objects::CSeq_id::EAccessionInfo accesionType);
940objects::CScope& scope,
ILinkoutDB* linkoutdb,
941 const string& mv_build_name);
958 staticlist<string> GetLinkoutUrl(
intlinkout,
959 constobjects::CBioseq::TId& ids,
961 const string& cdd_rid,
962 const string& entrez_term,
965 boolstructure_linkout_as_group,
968 stringpreComputedResID);
976 map<
int, vector < objects::CBioseq::TId > > &linkout_map,
978 const string& mv_build_name);
985 map<
int, vector <objects::CBioseq::TId > > &linkout_map,
987 const string& mv_build_name);
1008 const string& cdd_rid,
1009 const string& entrez_term,
1011 boolstructure_linkout_as_group,
1014 string& linkoutOrder,
1019 string&preComputedResID,
1021 const string& mv_build_name);
1042 const string& cdd_rid,
1043 const string& entrez_term,
1045 boolstructure_linkout_as_group,
1048 string& linkoutOrder,
1053 string&preComputedResID,
1055 const string& mv_build_name,
1056 boolgetIdentProteins);
1059 static intGetSeqLinkoutInfo(objects::CBioseq::TId& cur_id,
1061 const string& mv_build_name,
1063 static intGetMasterCoverage(
constobjects::CSeq_align_set& alnset);
1064 static CRange<TSeqPos>GetSeqAlignCoverageParams(
constobjects::CSeq_align_set& alnset,
int*masterCoverage,
bool*flip);
1073 static stringGetURLFromRegistry(
const stringurl_name,
intindex = -1);
1080 static stringGetURLDefault(
const stringurl_name,
intindex = -1);
1089 static stringMapTemplate(
stringinpString,
stringtmplParamName,
Int8templParamVal);
1098 static stringMapTemplate(
stringinpString,
stringtmplParamName,
stringtemplParamVal);
1109 static stringMapSpaceTemplate(
stringinpString,
stringtmplParamName,
stringtemplParamVal,
unsigned intmaxParamLength,
intspacesFormatFlag = eSpacePosAtLineEnd);
1112 static stringMapTagToHTML(
const stringtag_name);
1114 static stringMapTagToConstString(
const stringtag_name,
EMapConstStringflag = eMapToURL);
1122 static stringAddSpaces(
stringparamVal,
size_tmaxParamLength,
intspacesFormatFlag = eSpacePosToCenter);
1125 static stringGetProtocol(
void);
1129 static stringMapProtocol(
stringurl_link);
1136 constobjects::CSeq_id&
id,
1137objects::CScope &scope);
1144 constobjects::CBioseq::TId* ids);
1146 static stringGetFullIDLink(
SSeqURLInfo*seqUrlInfo,
1147 constobjects::CBioseq::TId* ids);
1154 constobjects::CSeq_id&
id,
1155objects::CScope &scope);
1169 static intSetCustomLinksTypes(
SSeqURLInfo*seqUrlInfo,
intcustomLinkTypesInp);
1180 staticlist <string> GetCustomLinksList(
SSeqURLInfo*seqUrlInfo,
1181 constobjects::CSeq_id&
id,
1182objects::CScope &scope,
1183 intcustomLinkTypes = eLinkTypeDefault);
1185 staticlist<string> GetGiLinksList(
SSeqURLInfo*seqUrlInfo,
boolhspRange =
false);
1186 static stringGetGraphiscLink(
SSeqURLInfo*seqUrlInfo,
boolhspRange =
false);
1187 staticlist<string> GetSeqLinksList(
SSeqURLInfo*seqUrlInfo,
boolhspRange =
false);
1198 static stringGetFASTALinkURL(
SSeqURLInfo*seqUrlInfo,
1199 constobjects::CSeq_id&
id,
1200objects::CScope &scope);
1208 static stringGetAlignedRegionsURL(
SSeqURLInfo*seqUrlInfo,
1209 constobjects::CSeq_id&
id,
1210objects::CScope &scope);
1217objects::CScope & scope);
1224 static doubleGetSeqAlignSetCalcPercentIdent(
constobjects::CSeq_align_set& aln,
booldo_translation);
1236 constobjects::CSeq_id& aln_id,
1237list<TGi>& use_this_gi,
1247 constobjects::CSeq_id& aln_id,
1248list<TGi>& use_this_gi,
1252 constobjects::CSeq_id& aln_id,
1253list<TGi>& use_this_gi);
1267 constobjects::CSeq_id& aln_id,
1268list<string>& use_this_seq,
1271 string*textSeqID =
NULL);
1279 static bool IsWGSAccession(
string&accession,
string&wgsProj);
1286 static boolIsWGSPattern(
string&wgsAccession);
1288 staticunique_ptr<CNcbiRegistry>
m_Reg;
1294 static intGetUniqSeqCoverage(objects::CSeq_align_set & alnset);
1297 static string GetTitle(
constobjects::CBioseq_Handle & bh);
1300 static string GetBareId(
constobjects::CSeq_id&
id);
1312 static voidx_WrapOutputLine(
string str,
size_tline_len,
1314 boolhtml =
false);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
const int k_NumAsciiChar
Number of ASCII characters for populating matrix columns.
const char k_PSymbol[]
Residues.
Definitions and prototypes used by blast_stat.c to calculate BLAST statistics.
This class contains misc functions for displaying BLAST results.
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, int &comp_adj_method)
Extract score info from blast alingment Second version that fetches compositional adjustment integer.
static const char * kNoHitsFound
The string containing the message that no hits were found.
static string GetIDUrl(SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
Create URL for seqid.
static CRef< objects::CSeq_id > GetDisplayIds(const objects::CBioseq_Handle &handle, const objects::CSeq_id &aln_id, list< string > &use_this_seq, TGi *gi=NULL, TTaxId *taxid=NULL, string *textSeqID=NULL)
Scan the the list of blast deflines and find seqID to be use in display.
static void GetUseThisSequence(const objects::CSeq_align &aln, list< string > &use_this_seq)
Extract use_this_seq info from blast alingment.
static bool IsMixedDatabase(const objects::CSeq_align_set &alnset, objects::CScope &scope, ILinkoutDB *linkoutdb, const string &mv_build_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 string GetIDUrlGen(SSeqURLInfo *seqUrlInfo, const objects::CBioseq::TId *ids)
Create URL for seqid that goes to entrez or trace.
static string GetIDUrl(SSeqURLInfo *seqUrlInfo, const objects::CBioseq::TId *ids)
Create URL for seqid.
static void GetAlnScores(const objects::CSeq_align &aln, int &score, double &bits, double &evalue, int &sum_n, int &num_ident, list< string > &use_this_seq)
Extract score info from blast alingment.
static list< string > GetFullLinkoutUrl(objects::CBioseq::TId &cur_id, 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, bool getIdentProteins)
Get linkout membership for one seqID.
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 CRef< objects::CSeq_id > GetDisplayIds(const objects::CBioseq_Handle &handle, const objects::CSeq_id &aln_id, list< TGi > &use_this_gi, TGi &gi)
Scan the the list of blast deflines and find seqID to be use in display.
static bool m_geturl_debug_flag
static list< string > GetFullLinkoutUrl(objects::CBioseq::TId &cur_id, SLinkoutInfo &linkoutInfo, bool getIdentProteins)
static string GetIDUrlGen(SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
Create URL for seqid that goes to entrez or trace.
static CRef< objects::CSeq_align_set > FilterSeqalignByScoreParams(objects::CSeq_align_set &source_aln, double evalueLow, double evalueHigh, double percentIdentLow, double percentIdentHigh, int queryCoverageLow, int queryCoverageHigh)
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 CRef< objects::CSeq_align_set > SortSeqalignForSortableFormat(objects::CSeq_align_set &aln_set, bool nuc_to_nuc_translation, int hit_order, int hsp_order)
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 > GetFullLinkoutUrl(const list< CRef< objects::CBlast_def_line > > &bdl, SLinkoutInfo &linkoutInfo)
static bool GetTextSeqID(const list< CRef< objects::CSeq_id > > &ids, string *textSeqID=NULL)
static void GetUseThisSequence(const objects::CSeq_align &aln, list< TGi > &use_this_gi)
Extract use_this_gi info from blast alingment.
static string GetSeqIdString(const objects::CBioseq &cbs, bool believe_local_id=true)
Returns a full '|'-delimited Seq-id string for a Bioseq.
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 GetAlnScores(const objects::CSeq_align &aln, int &score, double &bits, double &evalue, int &sum_n, int &num_ident, list< string > &use_this_seq, int &comp_adj_method)
Extract score info from blast alingment Second version that fetches compositional adjustment integer.
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 TGi GetDisplayIds(const list< CRef< objects::CBlast_def_line > > &bdl, const objects::CSeq_id &aln_id, list< TGi > &use_this_gi)
static unique_ptr< CNcbiRegistry > m_Reg
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 GetTextSeqID(CConstRef< objects::CSeq_id > seqID, string *textSeqID=NULL)
static void GetBdlLinkoutInfo(objects::CBioseq::TId &cur_id, map< int, vector< objects::CBioseq::TId > > &linkout_map, ILinkoutDB *linkoutdb, const string &mv_build_name)
Create map that holds all linkouts for one seqID.
static bool MatchSeqInSeqList(CConstRef< objects::CSeq_id > &alnSeqID, list< string > &use_this_seq, vector< string > &seqList)
Matches string of seqIDs (gis or text seqID)
static string GetSeqIdString(const list< CRef< objects::CSeq_id > > &ids, bool believe_local_id)
Returns a full '|'-delimited Seq-id string for a a list of seq-ids.
std::ofstream out("events_result.xml")
main entry point for tests
static bool InitConfig(const CArgs &args, Parser &config)
@ eSubjectStart
Start of alignment in subject.
const size_t kDfltArgNumAlignments
Default number of alignments to display in the traditional BLAST report.
static const char * str(char *buf, int n)
SStrictId_Tax::TId TTaxId
Taxon id type.
EDiagSev
Severity level for the posted diagnostics.
string GetLabel(const CSeq_id &id)
NCBI_XOBJUTIL_EXPORT string GetTitle(const CBioseq_Handle &hnd, TGetTitleFlags flags=0)
int64_t Int8
8-byte (64-bit) signed integer
#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.
#define NCBI_ALIGN_FORMAT_EXPORT
static const char label[]
ENa_strand
strand of nucleic acid
Declares the ILinkoutDB interface.
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
static CRef< CSeq_align > CreateDensegFromDendiag(CSeq_align const &aln)
const CharType(& source)[N]
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.
double lambda(size_t dimMatrix_, const Int4 *const *scoreMatrix_, const double *q_)
static PCRE2_SIZE * offsets
static bool SortHspByMasterStartAscending(const SHspInfo *info1, const SHspInfo *info2)
Structure to hold the Gumbel parameters (for FSC).
SDbInfo()
Default constructor.
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
bool structure_linkout_as_group
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, ILinkoutDB *linkoutdb_in, string mv_build_name_in, bool structure_linkout_as_group_in=false, bool for_alignment_in=true)
Structure that holds information for all hits of one subject in Seq Align Set.
CConstRef< objects::CSeq_id > id
CRange< TSeqPos > subjRange
list< string > use_this_seq
int master_covered_length
Structure that holds information needed for creation seqID URL in descriptions and alignments.
bool flip
flip sequence in case of opposite strands
string user_url
user url TOOL_URL from .ncbirc
SSeqURLInfo(string usurl, string bt, bool isnuc, string db, string rid_in, int qn, TGi gi_in, string acc, int lnk, int blrk, bool alnLink, bool nw, CRange< TSeqPos > range=CRange< TSeqPos >(0, 0), bool flp=false, TTaxId txid=INVALID_TAX_ID, bool addCssInf=false, string seqSegs="", string resUrl="", bool useTmpl=false, bool advView=false)
Constructor.
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 new_win
bool indicating if click of the url will open a new window
bool addCssInfo
bool indicating that css info should be added
bool useTemplates
bool indicating that templates should be used when contsructing links
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
bool advancedView
bool indicating that advanced view design option should be used when contsructing links
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.
static bool IsWGSAccession(const string &acc, const CTextseq_id &id, TAllowSeqType allow_seq_type)
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