NCBI C++ ToolKit
Classes | Public Types | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Static Private Member Functions | List of all members
CAlignFormatUtil Class Reference

Search Toolkit Book for CAlignFormatUtil

This class contains misc functions for displaying BLAST results. More...

#include <objtools/align_format/align_format_util.hpp>

Classes

struct  SBlastError
 Error info structure. More...
 
struct  SDbInfo
 Blast database info. More...
 
struct  SLinkoutInfo
 
struct  SSeqAlignSetCalcParams
 Structure that holds information for all hits of one subject in Seq Align Set. More...
 
struct  SSeqURLInfo
 Structure that holds information needed for creation seqID URL in descriptions and alignments. More...
 

Public Types

enum  DbSortOrder { eNonGenomicFirst = 1 , eGenomicFirst }
 
enum  HitOrder {
  eEvalue = 0 , eHighestScore , eTotalScore , ePercentIdentity ,
  eQueryCoverage
}
 
enum  HspOrder {
  eHspEvalue = 0 , eScore , eQueryStart , eHspPercentIdentity ,
  eSubjectStart
}
 
enum  CustomLinkType {
  eLinkTypeDefault = 0 , eLinkTypeMapViewer = (1 << 0) , eLinkTypeSeqViewer = (1 << 1) , eDownLoadSeq = (1 << 2) ,
  eLinkTypeGenLinks = (1 << 3) , eLinkTypeTraceLinks = (1 << 4) , eLinkTypeSRALinks = (1 << 5) , eLinkTypeSNPLinks = (1 << 6) ,
  eLinkTypeGSFastaLinks = (1 << 7)
}
 
enum  DbType { eDbGi = 0 , eDbGeneral , eDbTypeNotSet }
 db type More...
 
enum  SpacesFormatingFlag {
  eSpacePosToCenter = (1 << 0) , eSpacePosAtLineStart = (1 << 1) , eSpacePosAtLineEnd = (1 << 2) , eAddEOLAtLineStart = (1 << 3) ,
  eAddEOLAtLineEnd = (1 << 4)
}
 

Static Public Member Functions

static void BlastPrintError (list< SBlastError > &error_return, bool error_post, CNcbiOstream &out)
 Output blast errors. More...
 
static void PrintTildeSepLines (string str, size_t line_len, CNcbiOstream &out)
 Print out misc information separated by "~". More...
 
static void FillScanModeBlastDbInfo (vector< SDbInfo > &retval, bool is_protein, int numSeqs, Int8 numLetters, string &tag)
 Fills one BLAST dbinfo structure. More...
 
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. More...
 
static void PrintDbReport (const vector< SDbInfo > &dbinfo_list, size_t line_length, CNcbiOstream &out, bool top=false)
 Print out blast database information. More...
 
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. More...
 
static string GetSeqIdString (const objects::CBioseq &cbs, bool believe_local_id=true)
 Returns a full '|'-delimited Seq-id string for a Bioseq. More...
 
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. More...
 
static string GetSeqDescrString (const objects::CBioseq &cbs)
 Returns a full description for a Bioseq, concatenating all available titles. More...
 
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. More...
 
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. More...
 
static void GetAsciiProteinMatrix (const char *matrix_name, CNcbiMatrix< int > &retval)
 Retrieve a scoring matrix for the provided matrix name. More...
 
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) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static void GetUseThisSequence (const objects::CSeq_align &aln, list< TGi > &use_this_gi)
 Extract use_this_gi info from blast alingment. More...
 
static void GetUseThisSequence (const objects::CSeq_align &aln, list< string > &use_this_seq)
 Extract use_this_seq info from blast alingment. More...
 
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. More...
 
static bool MatchSeqInSeqList (CConstRef< objects::CSeq_id > &alnSeqID, list< string > &use_this_seq, vector< string > &seqList)
 Matches string of seqIDs (gis or text seqID) More...
 
static bool MatchSeqInUseThisSeqList (list< string > &use_this_seq, string textSeqIDToMatch)
 
static bool IsGiList (list< string > &use_this_seq)
 Check if use_this_seq conatins gi list. More...
 
static list< TGiStringGiToNumGiList (list< string > &use_this_seq)
 Convert if string gi list to TGi list. More...
 
static void AddSpace (CNcbiOstream &out, size_t number)
 Add the specified white space. More...
 
static string GetGnlID (const objects::CDbtag &dtg)
 Return ID for GNL label. More...
 
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|" to trace IDs. More...
 
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 More...
 
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. More...
 
static unsigned int GetSubjectsNumber (const objects::CSeq_align_set &source_aln, unsigned int num)
 Calculate number of subject sequnces in alignment limitted by num. More...
 
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 last subget seq unique slave seqids. More...
 
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. More...
 
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-aligns and put them all in a flat Seq-align-set. More...
 
static CRef< objects::CSeq_align > CreateDensegFromDendiag (const objects::CSeq_align &aln)
 Create denseseg representation for densediag seqalign. More...
 
static TTaxId GetTaxidForSeqid (const objects::CSeq_id &id, objects::CScope &scope)
 return the tax id for a seqid More...
 
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. More...
 
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 More...
 
static bool SortHitByMasterCoverageDescending (CRef< objects::CSeq_align_set > const &info1, CRef< objects::CSeq_align_set > const &info2)
 
static void HspListToHitList (list< CRef< objects::CSeq_align_set > > &target, const objects::CSeq_align_set &source)
 group hsp's with the same id togeter More...
 
static CRef< objects::CSeq_align_set > HitListToHspList (list< CRef< objects::CSeq_align_set > > &source)
 extract all nested hsp's into a list More...
 
static void ExtractSeqAlignForSeqList (CRef< objects::CSeq_align_set > &all_aln_set, string alignSeqList)
 extract seq_align_set coreesponding to seqid list More...
 
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) More...
 
static string BuildSRAUrl (const objects::CBioseq::TId &ids, string user_url)
 return the SRA (Short Read Archive) URL More...
 
static double GetPercentIdentity (const objects::CSeq_align &aln, objects::CScope &scope, bool do_translation)
 calculate the percent identity for a seqalign More...
 
static int GetAlignmentLength (const objects::CSeq_align &aln, bool do_translation)
 get the alignment length More...
 
static void SortHitByPercentIdentityDescending (list< CRef< objects::CSeq_align_set > > &seqalign_hit_list, bool do_translation)
 sort a list of seqalign set by alignment identity More...
 
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 More...
 
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 More...
 
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 More...
 
static bool SortHspBySubjectStartAscending (const CRef< objects::CSeq_align > &info1, const CRef< objects::CSeq_align > &info2)
 
static bool SortHitByScoreDescending (const CRef< objects::CSeq_align_set > &info1, const CRef< objects::CSeq_align_set > &info2)
 
static bool SortHspByScoreDescending (const CRef< objects::CSeq_align > &info1, const CRef< objects::CSeq_align > &info2)
 
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 More...
 
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 More...
 
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 More...
 
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 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 CRef< objects::CSeq_align_set > SortSeqalignForSortableFormat (objects::CSeq_align_set &aln_set, bool nuc_to_nuc_translation, int hit_order, int hsp_order)
 
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 int GetPercentMatch (int numerator, int denominator)
 function for calculating percent match for an alignment. More...
 
static double GetPercentIdentity (int numerator, int denominator)
 
static CRef< objects::CSeq_align_set > FilterSeqalignByEval (objects::CSeq_align_set &source_aln, double evalueLow, double evalueHigh)
 function for Filtering seqalign by expect value More...
 
static CRef< objects::CSeq_align_set > FilterSeqalignByPercentIdent (objects::CSeq_align_set &source_aln, double percentIdentLow, double percentIdentHigh)
 function for Filtering seqalign by percent identity More...
 
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 More...
 
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 CRef< objects::CSeq_align_set > FilterSeqalignBySeqList (objects::CSeq_align_set &source_aln, vector< string > &seqList)
 function for Filtering seqalign by specific subjects More...
 
static bool RemoveSeqsOfAccessionTypeFromSeqInUse (list< string > &use_this_seq, objects::CSeq_id::EAccessionInfo accesionType)
 function to remove sequences of accesionType from use_this_seq list More...
 
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) More...
 
static CRef< objects::CSeq_align_set > ExtractQuerySeqAlign (CRef< objects::CSeq_align_set > &source_aln, int queryNumber)
 function for extracting seqalign for the query More...
 
static void BuildFormatQueryString (CCgiContext &ctx, string &cgi_query)
 
static void BuildFormatQueryString (CCgiContext &ctx, map< string, string > &parameters_to_change, string &cgi_query)
 
static bool IsMixedDatabase (const objects::CSeq_align_set &alnset, objects::CScope &scope, ILinkoutDB *linkoutdb, const string &mv_build_name)
 
static bool IsMixedDatabase (CCgiContext &ctx)
 
static list< stringGetLinkoutUrl (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. More...
 
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. More...
 
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. More...
 
static list< stringGetFullLinkoutUrl (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. More...
 
static list< stringGetFullLinkoutUrl (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. More...
 
static list< stringGetFullLinkoutUrl (const list< CRef< objects::CBlast_def_line > > &bdl, SLinkoutInfo &linkoutInfo)
 
static list< stringGetFullLinkoutUrl (objects::CBioseq::TId &cur_id, SLinkoutInfo &linkoutInfo, bool getIdentProteins)
 
static int GetSeqLinkoutInfo (objects::CBioseq::TId &cur_id, ILinkoutDB **linkoutdb, const string &mv_build_name, TGi gi=INVALID_GI)
 
static int GetMasterCoverage (const objects::CSeq_align_set &alnset)
 
static CRange< TSeqPosGetSeqAlignCoverageParams (const objects::CSeq_align_set &alnset, int *masterCoverage, bool *flip)
 
static string GetURLFromRegistry (const string url_name, int index=-1)
 retrieve URL from .ncbirc file combining host/port and format strings values. More...
 
static string GetURLDefault (const string url_name, int index=-1)
 settings are not complete. More...
 
static string MapTemplate (string inpString, string tmplParamName, Int8 templParamVal)
 Replace template tags by real data. More...
 
static string MapTemplate (string inpString, string tmplParamName, string templParamVal)
 Replace template tags by real data. More...
 
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 spacesFormatFlag. More...
 
static string AddSpaces (string paramVal, size_t maxParamLength, int spacesFormatFlag=eSpacePosToCenter)
 Calculate the number of spaces and add them to paramVal. More...
 
static string GetProtocol (void)
 
static void InitConfig ()
 
static string MapProtocol (string url_link)
 
static string GetIDUrl (SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
 Create URL for seqid. More...
 
static string GetIDUrl (SSeqURLInfo *seqUrlInfo, const objects::CBioseq::TId *ids)
 Create URL for seqid. More...
 
static string GetFullIDLink (SSeqURLInfo *seqUrlInfo, const objects::CBioseq::TId *ids)
 
static string GetIDUrlGen (SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
 Create URL for seqid that goes to entrez or trace. More...
 
static string GetIDUrlGen (SSeqURLInfo *seqUrlInfo, const objects::CBioseq::TId *ids)
 Create URL for seqid that goes to entrez or trace. More...
 
static int SetCustomLinksTypes (SSeqURLInfo *seqUrlInfo, int customLinkTypesInp)
 Create info indicating what kind of links to display. More...
 
static list< stringGetCustomLinksList (SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope, int customLinkTypes=eLinkTypeDefault)
 Create the list of string links for seqid that go. More...
 
static list< stringGetGiLinksList (SSeqURLInfo *seqUrlInfo, bool hspRange=false)
 
static string GetGraphiscLink (SSeqURLInfo *seqUrlInfo, bool hspRange=false)
 
static list< stringGetSeqLinksList (SSeqURLInfo *seqUrlInfo, bool hspRange=false)
 
static string GetFASTALinkURL (SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
 Create URL showing aligned regions info. More...
 
static string GetAlignedRegionsURL (SSeqURLInfo *seqUrlInfo, const objects::CSeq_id &id, objects::CScope &scope)
 Create URL to FASTA info. More...
 
static CAlignFormatUtil::DbType GetDbType (const objects::CSeq_align_set &actual_aln_list, objects::CScope &scope)
 Set the database as gi type. More...
 
static CAlignFormatUtil::SSeqAlignSetCalcParamsGetSeqAlignCalcParams (const objects::CSeq_align &aln)
 
static CAlignFormatUtil::SSeqAlignSetCalcParamsGetSeqAlignSetCalcParams (const objects::CSeq_align_set &aln, int queryLength, bool do_translation)
 
static CAlignFormatUtil::SSeqAlignSetCalcParamsGetSeqAlignSetCalcParamsFromASN (const objects::CSeq_align_set &alnSet)
 
static double GetSeqAlignSetCalcPercentIdent (const objects::CSeq_align_set &aln, bool do_translation)
 
static map< string, CRef< objects::CSeq_align_set > > HspListToHitMap (vector< string > seqIdList, const objects::CSeq_align_set &source)
 
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. More...
 
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. More...
 
static TGi GetDisplayIds (const list< CRef< objects::CBlast_def_line > > &bdl, const objects::CSeq_id &aln_id, list< TGi > &use_this_gi)
 
static bool GetTextSeqID (const list< CRef< objects::CSeq_id > > &ids, string *textSeqID=NULL)
 
static bool GetTextSeqID (CConstRef< objects::CSeq_id > seqID, string *textSeqID=NULL)
 
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. More...
 
static bool IsWGSAccession (string &accession, string &wgsProj)
 Check if accession is WGS. More...
 
static bool IsWGSPattern (string &wgsAccession)
 Check if accession is WGS. More...
 
static int GetUniqSeqCoverage (objects::CSeq_align_set &alnset)
 Calculate the uniq subject query coverage range (blastn only) More...
 
static TGi GetGiForSeqIdList (const list< CRef< objects::CSeq_id > > &ids)
 return gi from id list More...
 
static string GetTitle (const objects::CBioseq_Handle &bh)
 
static string GetBareId (const objects::CSeq_id &id)
 Get sequence id with no database source (bare accession) More...
 

Static Public Attributes

static const char kNoHitsFound [] = "No hits found"
 The string containing the message that no hits were found. More...
 
static unique_ptr< CNcbiRegistrym_Reg
 
static string m_Protocol = ""
 
static bool m_geturl_debug_flag = false
 

Static Protected Member Functions

static void x_WrapOutputLine (string str, size_t line_len, CNcbiOstream &out, bool html=false)
 Wrap a string to specified length. More...
 

Static Private Member Functions

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)
 

Detailed Description

This class contains misc functions for displaying BLAST results.

Definition at line 347 of file align_format_util.hpp.

Member Enumeration Documentation

◆ CustomLinkType

Enumerator
eLinkTypeDefault 
eLinkTypeMapViewer 
eLinkTypeSeqViewer 
eDownLoadSeq 
eLinkTypeGenLinks 
eLinkTypeTraceLinks 
eLinkTypeSRALinks 
eLinkTypeSNPLinks 
eLinkTypeGSFastaLinks 

Definition at line 539 of file align_format_util.hpp.

◆ DbSortOrder

Enumerator
eNonGenomicFirst 
eGenomicFirst 

Definition at line 518 of file align_format_util.hpp.

◆ DbType

db type

Enumerator
eDbGi 
eDbGeneral 
eDbTypeNotSet 

Definition at line 552 of file align_format_util.hpp.

◆ HitOrder

Enumerator
eEvalue 
eHighestScore 
eTotalScore 
ePercentIdentity 
eQueryCoverage 

Definition at line 523 of file align_format_util.hpp.

◆ HspOrder

Enumerator
eHspEvalue 
eScore 
eQueryStart 
eHspPercentIdentity 
eSubjectStart 

Definition at line 531 of file align_format_util.hpp.

◆ SpacesFormatingFlag

Enumerator
eSpacePosToCenter 
eSpacePosAtLineStart 

place the param in the center of the string

eSpacePosAtLineEnd 

add spaces at the begining of the string

eAddEOLAtLineStart 

add spaces at the end of the string

eAddEOLAtLineEnd 

add EOL at the beginning of the string

Definition at line 559 of file align_format_util.hpp.

Member Function Documentation

◆ AcknowledgeBlastQuery()

void CAlignFormatUtil::AcknowledgeBlastQuery ( const objects::CBioseq &  cbs,
size_t  line_len,
CNcbiOstream out,
bool  believe_query,
bool  html,
bool  tabular = false,
const string rid = kEmptyStr 
)
static

Print out blast query info.

Parameters
cbsbioseq of interest
line_lenlength of each line desired
outstream to ouput
believe_queryuse user id or not
htmlin html format or not [in]
tabularIs this done for tabular formatting? [in]
ridthe RID to acknowledge (if not empty) [in]

Definition at line 560 of file align_format_util.cpp.

References label, out(), and x_AcknowledgeBlastSequence().

Referenced by CBlastTabularInfo::x_PrintQueryAndDbNames().

◆ AcknowledgeBlastSubject()

void CAlignFormatUtil::AcknowledgeBlastSubject ( const objects::CBioseq &  cbs,
size_t  line_len,
CNcbiOstream out,
bool  believe_query,
bool  html,
bool  tabular = false 
)
static

Print out blast subject info.

Parameters
cbsbioseq of interest
line_lenlength of each line desired
outstream to ouput
believe_queryuse user id or not
htmlin html format or not [in]
tabularIs this done for tabular formatting? [in]

Definition at line 575 of file align_format_util.cpp.

References kEmptyStr, label, out(), and x_AcknowledgeBlastSequence().

Referenced by CBlastTabularInfo::x_PrintQueryAndDbNames().

◆ AddSpace()

void CAlignFormatUtil::AddSpace ( CNcbiOstream out,
size_t  number 
)
static

◆ AddSpaces()

string CAlignFormatUtil::AddSpaces ( string  paramVal,
size_t  maxParamLength,
int  spacesFormatFlag = eSpacePosToCenter 
)
static

Calculate the number of spaces and add them to paramVal.

Parameters
stringinput parameter value
size_tmax length for the string that holds parameter
intadditional fomatting after adding spaces
stringthe position of spaces and additional formatting
Returns
:string containing paramVal and spaces place appropriately

Definition at line 3450 of file align_format_util.cpp.

References eAddEOLAtLineEnd, eAddEOLAtLineStart, eSpacePosAtLineEnd, and eSpacePosToCenter.

Referenced by CTaxFormat::DisplayOrgReport(), MapSpaceTemplate(), CBlastFormat::PrintOneResultSet(), CBlastFormat::PrintPhiResult(), and CTaxFormat::x_MapTaxInfoTemplate().

◆ BlastPrintError()

void CAlignFormatUtil::BlastPrintError ( list< SBlastError > &  error_return,
bool  error_post,
CNcbiOstream out 
)
static

Output blast errors.

Parameters
error_returnlist of errors to report
error_postpost to stderr or not
outstream to ouput

Definition at line 173 of file align_format_util.cpp.

References eDiag_Fatal, eDiag_Info, ERR_POST_EX, NON_CONST_ITERATE, and out().

◆ BuildFormatQueryString() [1/2]

void CAlignFormatUtil::BuildFormatQueryString ( CCgiContext ctx,
map< string, string > &  parameters_to_change,
string cgi_query 
)
static

◆ BuildFormatQueryString() [2/2]

void CAlignFormatUtil::BuildFormatQueryString ( CCgiContext ctx,
string cgi_query 
)
static

◆ BuildSRAUrl()

string CAlignFormatUtil::BuildSRAUrl ( const objects::CBioseq::TId &  ids,
string  user_url 
)
static

return the SRA (Short Read Archive) URL

Parameters
idsthe id list
user_urlthe URL of SRA cgi
Returns
newly constructed SRA URL pointing to the identified spot

Definition at line 1762 of file align_format_util.cpp.

References NcbiEmptyString, and s_GetSRASeqMetadata().

◆ BuildUserUrl()

string CAlignFormatUtil::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 
)
static

return the custom url (such as mapview)

Parameters
idsthe id list
taxid
user_urlthe custom url
database
db_is_nais db nucleotide?
ridblast rid
query_numberthe blast query number.
for_alignmentis the URL generated for an alignment or a top defline?

Definition at line 1806 of file align_format_util.cpp.

References CSeq_id::AsFastaString(), database, dbname(), CSeq_id_Base::e_General, CConstRef< C, Locker >::Empty(), FindGi(), GetSeq_idByType(), i, int, NStr::IntToString(), isspace(), NcbiEmptyString, NULL, NStr::NumericToString(), s_GetBestIDForURL(), str(), strcat, NStr::URLEncode(), ZERO_GI, and ZERO_TAX_ID.

Referenced by GetAlignedRegionsURL(), and CDisplaySeqalign::x_GetDumpgnlLink().

◆ CreateDensegFromDendiag()

CRef< CSeq_align > CAlignFormatUtil::CreateDensegFromDendiag ( const objects::CSeq_align &  aln)
static

◆ ExtractQuerySeqAlign()

CRef< CSeq_align_set > CAlignFormatUtil::ExtractQuerySeqAlign ( CRef< objects::CSeq_align_set > &  source_aln,
int  queryNumber 
)
static

function for extracting seqalign for the query

Parameters
source_alnCSeq_align_set original seqalign
queryNumberint query number ,starts from 1, 0 means return all queries
Returns
CRef<CSeq_align_set> - seq align set for queryNumber, if invalid queryNumber return empty CSeq_align_set

Definition at line 3223 of file align_format_util.cpp.

References CRef< C, Locker >::Empty(), CConstRef< C, Locker >::Empty(), CSeq_align_set_Base::Get(), ITERATE, CSeq_id::Match(), CRef< C, Locker >::Reset(), and CSeq_align_set_Base::Set().

◆ ExtractSeqAlignForSeqList()

void CAlignFormatUtil::ExtractSeqAlignForSeqList ( CRef< objects::CSeq_align_set > &  all_aln_set,
string  alignSeqList 
)
static

extract seq_align_set coreesponding to seqid list

Parameters
all_aln_setCSeq_align_set source/target list
alignSeqListstring of seqIds separated by comma

Definition at line 1699 of file align_format_util.cpp.

References map_checker< Container >::end(), map_checker< Container >::find(), HitListToHspList(), HspListToHitMap(), i, and NStr::Split().

Referenced by CBlastFormat::x_DisplayAlignsWithTemplates().

◆ ExtractSeqalignSetFromDiscSegs()

void CAlignFormatUtil::ExtractSeqalignSetFromDiscSegs ( objects::CSeq_align_set &  target,
const objects::CSeq_align_set &  source 
)
static

If a Seq-align-set contains Seq-aligns with discontinuous type segments, extract the underlying Seq-aligns and put them all in a flat Seq-align-set.

Parameters
sourceOriginal Seq-align-set
targetResulting Seq-align-set

Definition at line 1000 of file align_format_util.cpp.

References set< Key, Compare >::begin(), set< Key, Compare >::end(), CSeq_align_Base::C_Segs::GetDisc(), CSeq_align_Base::C_Segs::IsDisc(), CSeq_align_set_Base::Set(), and rapidjson::source.

Referenced by CDisplaySeqalign::DisplaySeqalign(), CVecscreen::ProcessSeqAlign(), and CVecscreenTest::VecscreenDisplay().

◆ FillScanModeBlastDbInfo()

void CAlignFormatUtil::FillScanModeBlastDbInfo ( vector< SDbInfo > &  retval,
bool  is_protein,
int  numSeqs,
Int8  numLetters,
string tag 
)
static

Fills one BLAST dbinfo structure.

Intended for use in bl2seq mode with multiple subject sequences. database title set to "User specified sequence set"

Parameters
retvalreturn vector [in/out]
is_proteinare these databases protein? [in]
numSeqsnumber of sequecnes in set [in]
numLetterssize of the set [in]
tagHint to user about subject sequences [in]

Definition at line 287 of file align_format_util.cpp.

References info, string, and tag.

◆ FilterSeqalignByEval()

CRef< CSeq_align_set > CAlignFormatUtil::FilterSeqalignByEval ( objects::CSeq_align_set &  source_aln,
double  evalueLow,
double  evalueHigh 
)
static

function for Filtering seqalign by expect value

Parameters
source_alnCSeq_align_set original seqalign
evalueLowdouble min expect value
evalueHighdouble max expect value
Returns
CRef<CSeq_align_set> - filtered seq align

Definition at line 2993 of file align_format_util.cpp.

References CSeq_align_set_Base::Get(), GetAlnScores(), ITERATE, and CSeq_align_set_Base::Set().

◆ FilterSeqalignByPercentIdent()

CRef< CSeq_align_set > CAlignFormatUtil::FilterSeqalignByPercentIdent ( objects::CSeq_align_set &  source_aln,
double  percentIdentLow,
double  percentIdentHigh 
)
static

function for Filtering seqalign by percent identity

Parameters
source_alnCSeq_align_set original seqalign
percentIdentLowdouble min percent identity
percentIdentHighdouble max percent identity
Returns
CRef<CSeq_align_set> - filtered seq align

Definition at line 3045 of file align_format_util.cpp.

References CSeq_align_set_Base::Get(), GetAlignmentLength(), GetAlnScores(), GetPercentIdentity(), ITERATE, kTranslation, and CSeq_align_set_Base::Set().

◆ FilterSeqalignByScoreParams() [1/2]

static CRef<objects::CSeq_align_set> CAlignFormatUtil::FilterSeqalignByScoreParams ( objects::CSeq_align_set &  source_aln,
double  evalueLow,
double  evalueHigh,
double  percentIdentLow,
double  percentIdentHigh 
)
static

function for Filtering seqalign by expect value and percent identity

Parameters
source_alnCSeq_align_set original seqalign
evalueLowdouble min expect value
evalueHighdouble max expect value
percentIdentLowdouble min percent identity
percentIdentHighdouble max percent identity
Returns
CRef<CSeq_align_set> - filtered seq align

◆ FilterSeqalignByScoreParams() [2/2]

static CRef<objects::CSeq_align_set> CAlignFormatUtil::FilterSeqalignByScoreParams ( objects::CSeq_align_set &  source_aln,
double  evalueLow,
double  evalueHigh,
double  percentIdentLow,
double  percentIdentHigh,
int  queryCoverageLow,
int  queryCoverageHigh 
)
static

◆ FilterSeqalignBySeqList()

CRef< CSeq_align_set > CAlignFormatUtil::FilterSeqalignBySeqList ( objects::CSeq_align_set &  source_aln,
vector< string > &  seqList 
)
static

function for Filtering seqalign by specific subjects

Parameters
source_alnCSeq_align_set original seqalign
seqListvector of strings with seqIDs
Returns
CRef<CSeq_align_set> - filtered seq align

Definition at line 4818 of file align_format_util.cpp.

References CConstRef< C, Locker >::Empty(), CSeq_align_set_Base::Get(), GetUseThisSequence(), ITERATE, CSeq_id::Match(), match(), MatchSeqInSeqList(), and CSeq_align_set_Base::Set().

◆ GetAlignedRegionsURL()

string CAlignFormatUtil::GetAlignedRegionsURL ( SSeqURLInfo seqUrlInfo,
const objects::CSeq_id &  id,
objects::CScope &  scope 
)
static

Create URL to FASTA info.

Parameters
seqUrlInfostruct SSeqURLInfo containing data for URL construction
idCSeq_id object
scopescope to fetch this sequence
Returns
: string containing URL

Definition at line 3957 of file align_format_util.cpp.

References BuildUserUrl(), CAlignFormatUtil::SSeqURLInfo::database, CBioseq_Handle::GetBioseqCore(), CBioseq_Base::GetId(), CAlignFormatUtil::SSeqURLInfo::isDbNa, kDownloadUrl, CAlignFormatUtil::SSeqURLInfo::queryNumber, CAlignFormatUtil::SSeqURLInfo::rid, CAlignFormatUtil::SSeqURLInfo::segs, and ZERO_TAX_ID.

Referenced by CDisplaySeqalign::x_InitAlignLinks().

◆ GetAlignLengths()

void CAlignFormatUtil::GetAlignLengths ( objects::CAlnVec &  salv,
int align_length,
int num_gaps,
int num_gap_opens 
)
static

Count alignment length, number of gap openings and total number of gaps in a single alignment.

Parameters
salvObject representing one alignment (HSP) [in]
align_lengthTotal length of this alignment [out]
num_gapsTotal number of insertions and deletions in this alignment [out]
num_gap_opensNumber of gap segments in the alignment [out]

Definition at line 975 of file align_format_util.cpp.

References CAlnMap::GetAlnChunks(), CAlnMap::GetNumRows(), CAlnMap::GetSeqAlnRange(), i, and row.

Referenced by CBlastTabularInfo::SetFields().

◆ GetAlignmentLength()

int CAlignFormatUtil::GetAlignmentLength ( const objects::CSeq_align &  aln,
bool  do_translation 
)
static

◆ GetAlnScores() [1/4]

static void CAlignFormatUtil::GetAlnScores ( const objects::CSeq_align &  aln,
int score,
double &  bits,
double &  evalue,
int sum_n,
int num_ident,
list< string > &  use_this_seq 
)
static

Extract score info from blast alingment.

Parameters
alnalignment to extract score info from
scoreplace to extract the raw score to
bitsplace to extract the bit score to
evalueplace to extract the e value to
sum_nplace to extract the sum_n to
num_identplace to extract the num_ident to
use_this_seqidplace to extract use_this_seqid to

◆ GetAlnScores() [2/4]

static void CAlignFormatUtil::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 
)
static

Extract score info from blast alingment Second version that fetches compositional adjustment integer.

Parameters
alnalignment to extract score info from
scoreplace to extract the raw score to
bitsplace to extract the bit score to
evalueplace to extract the e value to
sum_nplace to extract the sum_n to
num_identplace to extract the num_ident to
use_this_seqplace to extract use_this_seq to
comp_adj_methodcomposition based statistics method [out]

◆ GetAlnScores() [3/4]

static void CAlignFormatUtil::GetAlnScores ( const objects::CSeq_align &  aln,
int score,
double &  bits,
double &  evalue,
int sum_n,
int num_ident,
list< TGi > &  use_this_gi 
)
static

◆ GetAlnScores() [4/4]

static void CAlignFormatUtil::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 
)
static

Extract score info from blast alingment Second version that fetches compositional adjustment integer.

Parameters
alnalignment to extract score info from
scoreplace to extract the raw score to
bitsplace to extract the bit score to
evalueplace to extract the e value to
sum_nplace to extract the sum_n to
num_identplace to extract the num_ident to
use_this_giplace to extract use_this_gi to
comp_adj_methodcomposition based statistics method [out]

◆ GetAsciiProteinMatrix()

void CAlignFormatUtil::GetAsciiProteinMatrix ( const char *  matrix_name,
CNcbiMatrix< int > &  retval 
)
static

Retrieve a scoring matrix for the provided matrix name.

Returns
the requested matrix (indexed using ASCII characters) or an empty matrix if matrix_name is invalid or can't be found.

Definition at line 3389 of file align_format_util.cpp.

References ctll::empty(), ePMatrixSize, i, k_NumAsciiChar, k_PSymbol, mtx, NCBISM_GetStandardMatrix(), NCBISM_Unpack(), NULL, CNcbiMatrix< T >::Resize(), and NStr::TruncateSpaces().

Referenced by CBlastFormat::CBlastFormat().

◆ GetBareId()

string CAlignFormatUtil::GetBareId ( const objects::CSeq_id &  id)
static

◆ GetBdlLinkoutInfo() [1/2]

static void CAlignFormatUtil::GetBdlLinkoutInfo ( const list< CRef< objects::CBlast_def_line > > &  bdl,
map< int, vector< objects::CBioseq::TId > > &  linkout_map,
ILinkoutDB linkoutdb,
const string mv_build_name 
)
static

Create map that holds all linkouts for the list of blast deflines and corresponding seqIDs.

Parameters
bdllist of CRef<CBlast_def_line>
linkout_mapmap that holds linkouts and corresponding CBioseq::TId for the whole list of blast deflines

◆ GetBdlLinkoutInfo() [2/2]

static void CAlignFormatUtil::GetBdlLinkoutInfo ( objects::CBioseq::TId &  cur_id,
map< int, vector< objects::CBioseq::TId > > &  linkout_map,
ILinkoutDB linkoutdb,
const string mv_build_name 
)
static

Create map that holds all linkouts for one seqID.

Parameters
cur_idCBioseq::TId
linkout_mapmap that holds linkouts and corresponding CBioseq::TId for the whole list of blast deflines

◆ GetBlastDbInfo()

void CAlignFormatUtil::GetBlastDbInfo ( vector< SDbInfo > &  retval,
const string blastdb_names,
bool  is_protein,
int  dbfilt_algorithm,
bool  is_remote = false 
)
static

Retrieve BLAST database information for presentation in BLAST report.

Parameters
dbnamespace-separated list of BLAST database names [in]
is_proteinare these databases protein? [in]
dbfilt_algorithmBLAST database filtering algorithm ID (if applicable), use -1 if not applicable [in]
is_remoteis this a remote BLAST search? [in]

Definition at line 306 of file align_format_util.cpp.

References CTime::AsString(), CTimeFormat::fFormat_Simple, CBlastServices::GetDatabaseInfo(), i, info, ITERATE, NCBI_THROW, s_FillDbInfoLocally(), SeqDB_SplitQuoted(), string, NStr::TruncateSpaces(), and NStr::TruncateSpaces_Unsafe().

Referenced by CMagicBlastApp::x_LogBlastSearchInfo().

◆ GetCustomLinksList()

list< string > CAlignFormatUtil::GetCustomLinksList ( SSeqURLInfo seqUrlInfo,
const objects::CSeq_id &  id,
objects::CScope &  scope,
int  customLinkTypes = eLinkTypeDefault 
)
static

Create the list of string links for seqid that go.

  • to GenBank,FASTA and Seqviewer for gi > 0
  • customized links determined by seqUrlInfo->blastType for gi = 0
  • customized links determined by customLinkTypes
    Parameters
    seqUrlInfostruct SSeqURLInfo containing data for URL construction
    idCSeq_id object
    scopescope to fetch this sequence
    customLinkTypestypes of links to be included in the list(mapviewer,seqviewer or download etc)
    customLinksListlist of strings containing links

Definition at line 3893 of file align_format_util.cpp.

References CAlignFormatUtil::SSeqURLInfo::accession, eLinkTypeGSFastaLinks, eLinkTypeSNPLinks, eLinkTypeSRALinks, eLinkTypeTraceLinks, GetSeqLinksList(), NStr::Replace(), CAlignFormatUtil::SSeqURLInfo::resourcesUrl, CAlignFormatUtil::SSeqURLInfo::rid, s_MapCustomLink(), CAlignFormatUtil::SSeqURLInfo::seqUrl, and SetCustomLinksTypes().

Referenced by CDisplaySeqalign::x_InitAlignLinks().

◆ GetDbType()

CAlignFormatUtil::DbType CAlignFormatUtil::GetDbType ( const objects::CSeq_align_set &  actual_aln_list,
objects::CScope &  scope 
)
static

◆ GetDisplayIds() [1/4]

static TGi CAlignFormatUtil::GetDisplayIds ( const list< CRef< objects::CBlast_def_line > > &  bdl,
const objects::CSeq_id &  aln_id,
list< TGi > &  use_this_gi 
)
static

◆ GetDisplayIds() [2/4]

static CRef<objects::CSeq_id> CAlignFormatUtil::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 
)
static

Scan the the list of blast deflines and find seqID to be use in display.

Parameters
handleCBioseq_Handle [in]
aln_idCSeq_id object for alignment seq [in]
use_this_seqlist<string> list of seqids to use (gi:ssssss or seqid:sssss) [in]
gipointer to gi to be used for display if exists
taxidpointer to taxid to be used for display if exists
textSeqIDpointer to textSeqID to be used for display if exists
Returns
: CSeq_id object to be used for display

◆ GetDisplayIds() [3/4]

static CRef<objects::CSeq_id> CAlignFormatUtil::GetDisplayIds ( const objects::CBioseq_Handle &  handle,
const objects::CSeq_id &  aln_id,
list< TGi > &  use_this_gi,
TGi gi 
)
static

Scan the the list of blast deflines and find seqID to be use in display.

Parameters
handleCBioseq_Handle [in]
aln_idCSeq_id object for alignment seq [in]
use_this_gilist<int> list of gis to use [in]
gigi to be used for display if exists or 0
Returns
: CSeq_id object to be used for display

◆ GetDisplayIds() [4/4]

static CRef<objects::CSeq_id> CAlignFormatUtil::GetDisplayIds ( const objects::CBioseq_Handle &  handle,
const objects::CSeq_id &  aln_id,
list< TGi > &  use_this_gi,
TGi gi,
TTaxId taxid 
)
static

Scan the the list of blast deflines and find seqID to be use in display.

Parameters
handleCBioseq_Handle [in]
aln_idCSeq_id object for alignment seq [in]
use_this_gilist<int> list of gis to use [in]
gigi to be used for display if exists or 0
taxidtaxid to be used for display if exists or 0
Returns
: CSeq_id object to be used for display

Referenced by CShowBlastDefline::x_FillDeflineAndId(), CDisplaySeqalign::x_InitDefLinesHeader(), and CTaxFormat::x_InitTaxInfoMap().

◆ GetFASTALinkURL()

string CAlignFormatUtil::GetFASTALinkURL ( SSeqURLInfo seqUrlInfo,
const objects::CSeq_id &  id,
objects::CScope &  scope 
)
static

Create URL showing aligned regions info.

Parameters
seqUrlInfostruct SSeqURLInfo containing data for URL construction
idCSeq_id object
scopescope to fetch this sequence
Returns
: string containing URL

Definition at line 3983 of file align_format_util.cpp.

References CAlignFormatUtil::SSeqURLInfo::accession, eLinkTypeDefault, eLinkTypeGenLinks, eLinkTypeSNPLinks, eLinkTypeTraceLinks, NStr::fSplit_MergeDelimiters, NStr::Replace(), CAlignFormatUtil::SSeqURLInfo::resourcesUrl, CAlignFormatUtil::SSeqURLInfo::seqUrl, SetCustomLinksTypes(), and NStr::Split().

Referenced by CDisplaySeqalign::x_InitAlignLinks().

◆ GetFrame()

int CAlignFormatUtil::GetFrame ( int  start,
objects::ENa_strand  strand,
const objects::CBioseq_Handle &  handle 
)
static

return the frame for a given strand Note that start is zero bases.

It returns frame +/-(1-3). 0 indicates error

Parameters
startsequence start position
strandstrand
idthe seqid
Returns
: the frame

Definition at line 1108 of file align_format_util.cpp.

References eNa_strand_minus, eNa_strand_plus, CBioseq_Handle::GetBioseqLength(), and int.

Referenced by CBlastTabularInfo::SetFields().

◆ GetFullIDLink()

string CAlignFormatUtil::GetFullIDLink ( SSeqURLInfo seqUrlInfo,
const objects::CBioseq::TId *  ids 
)
static

◆ GetFullLinkoutUrl() [1/4]

static list<string> CAlignFormatUtil::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 
)
static

Get linkout membership for for the list of blast deflines.

Parameters
bdllist of CRef<CBlast_def_line>
ridblast rid
cdd_ridblast cdd_rid
entrez_termentrez_term for building url
is_nabool indication if query is nucleotide
first_gifirst gi in the list (used to contsruct structure url)
structure_linkout_as_groupbool used to contsruct structure url
for_alignmentbool indicating tif link is locted in alignment section
intcur_align: int current alignment/description number
linkoutOrderstring of letters separated by comma specifing linkout order like "G,U,M,E,S,B"
taxidint taxid
databasedatabase name
query_numberquery_number
user_urlurl defined as TOOL_URL for blast_type in .ncbirc
Returns
list of string containing all linkout urls for all of the seqs in the list of blast deflines

Referenced by CDisplaySeqalign::x_InitAlignLinks(), and CShowBlastDefline::x_InitLinkOutInfo().

◆ GetFullLinkoutUrl() [2/4]

static list<string> CAlignFormatUtil::GetFullLinkoutUrl ( const list< CRef< objects::CBlast_def_line > > &  bdl,
SLinkoutInfo linkoutInfo 
)
static

◆ GetFullLinkoutUrl() [3/4]

static list<string> CAlignFormatUtil::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 
)
static

Get linkout membership for one seqID.

Parameters
cur_idCBioseq::TId seqID
ridblast rid
cdd_ridblast cdd_rid
entrez_termentrez_term for building url
is_nabool indication if query is nucleotide
first_gifirst gi in the list (used to contsruct structure url)
structure_linkout_as_groupbool used to contsruct structure url
for_alignmentbool indicating tif link is locted in alignment section
intcur_align: int current alignment/description number
linkoutOrderstring of letters separated by comma specifing linkout order like "G,U,M,E,S,B"
taxidint taxid
databasedatabase name
query_numberquery_number
user_urlurl defined as TOOL_URL for blast_type in .ncbirc
Returns
list of string containing all linkout urls for all of the seqs in the list of blast deflines

◆ GetFullLinkoutUrl() [4/4]

static list<string> CAlignFormatUtil::GetFullLinkoutUrl ( objects::CBioseq::TId &  cur_id,
SLinkoutInfo linkoutInfo,
bool  getIdentProteins 
)
static

◆ GetGiForSeqIdList()

TGi CAlignFormatUtil::GetGiForSeqIdList ( const list< CRef< objects::CSeq_id > > &  ids)
static

return gi from id list

Parameters
idsthe input ids
Returns
: the gi if found

Definition at line 4744 of file align_format_util.cpp.

References CSeq_id_Base::e_Gi, Empty(), s_GetSeqIdByType(), and ZERO_GI.

Referenced by CDisplaySeqalign::x_DisplaySequenceIDForQueryAnchored(), CDisplaySeqalign::x_FillSeqid(), and CDisplaySeqalign::x_InitSeqUrl().

◆ GetGiLinksList()

list< string > CAlignFormatUtil::GetGiLinksList ( SSeqURLInfo seqUrlInfo,
bool  hspRange = false 
)
static

◆ GetGnlID()

string CAlignFormatUtil::GetGnlID ( const objects::CDbtag &  dtg)
static

Return ID for GNL label.

Parameters
dtgdbtag to build label from

Definition at line 782 of file align_format_util.cpp.

References CObject_id_Base::GetId(), CObject_id_Base::GetStr(), CDbtag_Base::GetTag(), NStr::IntToString(), CObject_id_Base::IsId(), and NcbiEmptyString.

Referenced by GetLabel(), and CPhyTreeFormatter::x_InitTreeFeatures().

◆ GetGraphiscLink()

string CAlignFormatUtil::GetGraphiscLink ( SSeqURLInfo seqUrlInfo,
bool  hspRange = false 
)
static

◆ GetIDUrl() [1/2]

static string CAlignFormatUtil::GetIDUrl ( SSeqURLInfo seqUrlInfo,
const objects::CBioseq::TId *  ids 
)
static

Create URL for seqid.

Parameters
seqUrlInfostruct SSeqURLInfo containing data for URL construction
idsCBioseq::TId object

◆ GetIDUrl() [2/2]

static string CAlignFormatUtil::GetIDUrl ( SSeqURLInfo seqUrlInfo,
const objects::CSeq_id &  id,
objects::CScope &  scope 
)
static

Create URL for seqid.

Parameters
seqUrlInfostruct SSeqURLInfo containing data for URL construction
idseqid CSeq_id
scopeRef:scopeto fetch sequence

Referenced by GetFullIDLink(), CShowBlastDefline::x_FillDeflineAndId(), and CShowBlastDefline::x_GetDeflineInfo().

◆ GetIDUrlGen() [1/2]

static string CAlignFormatUtil::GetIDUrlGen ( SSeqURLInfo seqUrlInfo,
const objects::CBioseq::TId *  ids 
)
static

Create URL for seqid that goes to entrez or trace.

Parameters
seqUrlInfostruct SSeqURLInfo containing data for URL construction
idsCBioseq::TId object

◆ GetIDUrlGen() [2/2]

static string CAlignFormatUtil::GetIDUrlGen ( SSeqURLInfo seqUrlInfo,
const objects::CSeq_id &  id,
objects::CScope &  scope 
)
static

Create URL for seqid that goes to entrez or trace.

Parameters
seqUrlInfostruct SSeqURLInfo containing data for URL construction
idseqid CSeq_id
scopeRef:scopeto fetch sequence

◆ GetLabel()

string CAlignFormatUtil::GetLabel ( CConstRef< objects::CSeq_id >  id,
bool  with_version = false 
)
static

Return a label for an ID Tries to recreate behavior of GetLabel before a change that prepends "ti|" to trace IDs.

Parameters
idCSeqId: to build label from
with_versionbool: include version to the label

Definition at line 794 of file align_format_util.cpp.

References CSeq_id_Base::e_General, GetGnlID(), and CSeq_id_Base::Which().

Referenced by s_GetFullLinkoutUrl(), s_SeqAlignToXMLHit(), CDisplaySeqalign::x_DisplaySequenceIDForQueryAnchored(), CDisplaySeqalign::x_FillSeqid(), CShowBlastDefline::x_FormatDeflineTableLine(), CDisplaySeqalign::x_GetDumpgnlLink(), CDisplaySeqalign::x_InitDefLinesHeader(), and CShowBlastDefline::x_InitFormattingInfo().

◆ GetLinkoutUrl()

list< string > CAlignFormatUtil::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 
)
static

Get the list of urls for linkouts.

Get list of linkouts for one sequence.

Parameters
linkoutthe membership value
idsCBioseq::TId object
ridRID
cdd_ridCDD RID
entrez_termentrez query term
is_nais this sequence nucleotide or not
first_gifirst gi in the list (used to contsruct structure url)
structure_linkout_as_groupbool used to contsruct structure url
for_alignmentbool indicating if link is located in alignment section
intcur_align: int current alignment/description number
booltextLink: bool indicating that if true link will be presented as text, otherwise as image
Returns
list of string containing all linkout urls for one seq

Definition at line 2332 of file align_format_util.cpp.

References CAlignFormatUtil::SLinkoutInfo::cur_align, CSeq_id::eContent, FindBestChoice(), FindGi(), CSeq_id::GetLabel(), CAlignFormatUtil::SLinkoutInfo::Init(), label, NStr::NumericToString(), s_GetLinkoutUrl(), CAlignFormatUtil::SLinkoutInfo::taxid, CSeq_id::WorstRank(), ZERO_GI, and ZERO_TAX_ID.

Referenced by CShowBlastDefline::x_InitLinkOutInfo().

◆ GetMasterCoverage()

int CAlignFormatUtil::GetMasterCoverage ( const objects::CSeq_align_set &  alnset)
static

◆ GetPercentIdentity() [1/2]

static double CAlignFormatUtil::GetPercentIdentity ( const objects::CSeq_align &  aln,
objects::CScope &  scope,
bool  do_translation 
)
static

calculate the percent identity for a seqalign

Parameters
aln"the seqalign
scopescope to fetch sequences @do_translation: is this a translated nuc to nuc alignment?
Returns
: the identity

Referenced by FilterSeqalignByPercentIdent(), GetSeqAlignSetCalcParams(), and GetSeqAlignSetCalcPercentIdent().

◆ GetPercentIdentity() [2/2]

double CAlignFormatUtil::GetPercentIdentity ( int  numerator,
int  denominator 
)
static

Definition at line 3035 of file align_format_util.cpp.

◆ GetPercentMatch()

int CAlignFormatUtil::GetPercentMatch ( int  numerator,
int  denominator 
)
static

function for calculating percent match for an alignment.

Returns percent match for an alignment.

Parameters
numeratorint numerator in percent identity calculation.
denominatorint denominator in percent identity calculation.

Normally we round up the value, unless that means that an alignment with mismatches would be 100%. In that case it becomes 99%.

Parameters
numeratornumerator in percent identity calculation.
denominatordenominator in percent identity calculation.

Definition at line 3024 of file align_format_util.cpp.

References int, and min().

Referenced by s_DisplayIdentityInfo(), CShowBlastDefline::x_DisplayDeflineTableBody(), CShowBlastDefline::x_InitDefline(), CShowBlastDefline::x_InitDeflineTable(), and CDisplaySeqalign::x_PrepareIdentityInfo().

◆ GetProtocol()

string CAlignFormatUtil::GetProtocol ( void  )
static

◆ GetScoreString()

void CAlignFormatUtil::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 
)
static

format evalue and bit_score

Parameters
evaluee value
bit_scorebit score
total_bit_scoretotal bit score(??)
raw_scoreraw score (e.g., BLOSUM score)
evalue_strvariable to store the formatted evalue
bit_score_strvariable to store the formatted bit score
raw_score_strvariable to store the formatted raw score

Definition at line 815 of file align_format_util.cpp.

References NStr::IntToString().

Referenced by s_isAlnInFilteringRange(), CBlastTabularInfo::SetScores(), CDisplaySeqalign::x_DisplayAlignInfo(), CDisplaySeqalign::x_FormatAlnBlastInfo(), CShowBlastDefline::x_GetScoreInfo(), and CShowBlastDefline::x_GetScoreInfoForTable().

◆ GetSeqAlignCalcParams()

CAlignFormatUtil::SSeqAlignSetCalcParams * CAlignFormatUtil::GetSeqAlignCalcParams ( const objects::CSeq_align &  aln)
static

Definition at line 4038 of file align_format_util.cpp.

References GetAlnScores(), and CSeq_align::GetSeq_id().

Referenced by GetSeqAlignSetCalcParams().

◆ GetSeqAlignCoverageParams()

CRange< TSeqPos > CAlignFormatUtil::GetSeqAlignCoverageParams ( const objects::CSeq_align_set &  alnset,
int masterCoverage,
bool flip 
)
static

Definition at line 2869 of file align_format_util.cpp.

References ITERATE, max(), min(), s_MergeRangeList(), and s_ProcessAlignSet().

Referenced by GetSeqAlignSetCalcParams().

◆ GetSeqAlignSetCalcParams()

CAlignFormatUtil::SSeqAlignSetCalcParams * CAlignFormatUtil::GetSeqAlignSetCalcParams ( const objects::CSeq_align_set &  aln,
int  queryLength,
bool  do_translation 
)
static

◆ GetSeqAlignSetCalcParamsFromASN()

CAlignFormatUtil::SSeqAlignSetCalcParams * CAlignFormatUtil::GetSeqAlignSetCalcParamsFromASN ( const objects::CSeq_align_set &  alnSet)
static

◆ GetSeqAlignSetCalcPercentIdent()

double CAlignFormatUtil::GetSeqAlignSetCalcPercentIdent ( const objects::CSeq_align_set &  aln,
bool  do_translation 
)
static

◆ GetSeqDescrString()

string CAlignFormatUtil::GetSeqDescrString ( const objects::CBioseq &  cbs)
static

Returns a full description for a Bioseq, concatenating all available titles.

Parameters
cbsBioseq object [in]

Definition at line 544 of file align_format_util.cpp.

References data, CSeq_descr_Base::Get(), CBioseq_Base::GetDescr(), CBioseq_Base::IsSetDescr(), ITERATE, and NcbiEmptyString.

Referenced by x_AcknowledgeBlastSequence().

◆ GetSeqIdString() [1/2]

static string CAlignFormatUtil::GetSeqIdString ( const list< CRef< objects::CSeq_id > > &  ids,
bool  believe_local_id 
)
static

Returns a full '|'-delimited Seq-id string for a a list of seq-ids.

Parameters
idslsit of seq-ids [in]
believe_local_idShould local ids be parsed? [in]

◆ GetSeqIdString() [2/2]

static string CAlignFormatUtil::GetSeqIdString ( const objects::CBioseq &  cbs,
bool  believe_local_id = true 
)
static

Returns a full '|'-delimited Seq-id string for a Bioseq.

Parameters
cbsBioseq object [in]
believe_local_idShould local ids be parsed? [in]

Referenced by x_AcknowledgeBlastSequence(), and CCmdLineBlastXML2ReportData::x_InitSubjects().

◆ GetSeqLinkoutInfo()

int CAlignFormatUtil::GetSeqLinkoutInfo ( objects::CBioseq::TId &  cur_id,
ILinkoutDB **  linkoutdb,
const string mv_build_name,
TGi  gi = INVALID_GI 
)
static

◆ GetSeqLinksList()

list< string > CAlignFormatUtil::GetSeqLinksList ( SSeqURLInfo seqUrlInfo,
bool  hspRange = false 
)
static

◆ GetSubjectsNumber()

unsigned int CAlignFormatUtil::GetSubjectsNumber ( const objects::CSeq_align_set &  source_aln,
unsigned int  num 
)
static

Calculate number of subject sequnces in alignment limitted by num.

Parameters
source_alnthe original alnset
numthe specified number of subj sequences to consider
Returns
actual number of subject seqs in alignment

Definition at line 918 of file align_format_util.cpp.

References CSeq_align_set_Base::Get(), ITERATE, CSeq_id::Match(), and number.

◆ GetTaxidForSeqid()

TTaxId CAlignFormatUtil::GetTaxidForSeqid ( const objects::CSeq_id &  id,
objects::CScope &  scope 
)
static

return the tax id for a seqid

Parameters
idseq id
scopescope to fetch this sequence

Definition at line 1085 of file align_format_util.cpp.

References CRef< C, Locker >::Empty(), CSeqDB::ExtractBlastDefline(), CBlast_def_line_set_Base::Get(), CScope::GetBioseqHandle(), GetSeq_idByType(), ITERATE, CSeq_id::Match(), and ZERO_TAX_ID.

Referenced by CTestAction::TestOID(), and CDisplaySeqalign::x_PrepareRowData().

◆ GetTextSeqID() [1/2]

static bool CAlignFormatUtil::GetTextSeqID ( CConstRef< objects::CSeq_id >  seqID,
string textSeqID = NULL 
)
static

◆ GetTextSeqID() [2/2]

static bool CAlignFormatUtil::GetTextSeqID ( const list< CRef< objects::CSeq_id > > &  ids,
string textSeqID = NULL 
)
static

◆ GetTitle()

string CAlignFormatUtil::GetTitle ( const objects::CBioseq_Handle &  bh)
static

Definition at line 4754 of file align_format_util.cpp.

References CSeqdesc_Base::e_Title, CSeqdesc_Base::GetTitle(), kEmptyStr, and t.

Referenced by s_ReplaceLocalId().

◆ GetUniqSeqCoverage()

int CAlignFormatUtil::GetUniqSeqCoverage ( objects::CSeq_align_set &  alnset)
static

◆ GetURLDefault()

string CAlignFormatUtil::GetURLDefault ( const string  url_name,
int  index = -1 
)
static

settings are not complete.

return corresponding static value

Parameters
url_nameconstant name to return .
indexname index ( default: -1: )
Returns
: URL format string defined in blastfmtutil.hpp

Definition at line 3372 of file align_format_util.cpp.

References NStr::IntToString(), and MapProtocol().

Referenced by GetURLFromRegistry().

◆ GetURLFromRegistry()

string CAlignFormatUtil::GetURLFromRegistry ( const string  url_name,
int  index = -1 
)
static

retrieve URL from .ncbirc file combining host/port and format strings values.

consult blastfmtutil.hpp

Parameters
url_nameurl name to retrieve
indexname index ( default: -1: )
Returns
: URL format string from .ncbirc file or default as kNAME

Definition at line 3304 of file align_format_util.cpp.

References CT_POS_TYPE, CFile::Exists(), GetURLDefault(), in(), InitConfig(), NStr::IntToString(), m_Reg, and NStr::Replace().

Referenced by s_GetLinkoutUrl(), CDisplaySeqalign::x_FormatDynamicFeaturesInfo(), CDisplaySeqalign::x_GetGeneLinkUrl(), and CDisplaySeqalign::x_PrintDynamicFeatures().

◆ GetUseThisSequence() [1/2]

static void CAlignFormatUtil::GetUseThisSequence ( const objects::CSeq_align &  aln,
list< string > &  use_this_seq 
)
static

Extract use_this_seq info from blast alingment.

Parameters
alnalignment to extract score info from
use_this_seqplace to extract use_this_seq to

◆ GetUseThisSequence() [2/2]

static void CAlignFormatUtil::GetUseThisSequence ( const objects::CSeq_align &  aln,
list< TGi > &  use_this_gi 
)
static

Extract use_this_gi info from blast alingment.

Parameters
alnalignment to extract score info from
use_this_giplace to extract use_this_gi to

Referenced by FilterSeqalignBySeqList(), GetSeqAlignSetCalcParamsFromASN(), and s_ModifySeqAlnWithFilteredSeqIDs().

◆ HitListToHspList()

CRef< CSeq_align_set > CAlignFormatUtil::HitListToHspList ( list< CRef< objects::CSeq_align_set > > &  source)
static

extract all nested hsp's into a list

Parameters
sourcethe source list
Returns
the list of hsp's

Definition at line 1644 of file align_format_util.cpp.

References ITERATE, CSeq_align_set_Base::Set(), and rapidjson::source.

Referenced by ExtractSeqAlignForSeqList().

◆ HspListToHitList()

void CAlignFormatUtil::HspListToHitList ( list< CRef< objects::CSeq_align_set > > &  target,
const objects::CSeq_align_set &  source 
)
static

group hsp's with the same id togeter

Parameters
targetthe result list
sourcethe source list

Definition at line 1618 of file align_format_util.cpp.

References CConstRef< C, Locker >::Empty(), ITERATE, CSeq_id::Match(), CSeq_align_set_Base::Set(), and rapidjson::source.

Referenced by SortOneSeqalignForSortableFormat().

◆ HspListToHitMap()

map< string, CRef< CSeq_align_set > > CAlignFormatUtil::HspListToHitMap ( vector< string seqIdList,
const objects::CSeq_align_set &  source 
)
static

◆ InitConfig()

void CAlignFormatUtil::InitConfig ( )
static

Definition at line 3255 of file align_format_util.cpp.

References CFile::Exists(), m_geturl_debug_flag, m_Reg, and NULL.

Referenced by GetURLFromRegistry(), and MapProtocol().

◆ IsGiList()

bool CAlignFormatUtil::IsGiList ( list< string > &  use_this_seq)
static

Check if use_this_seq conatins gi list.

Parameters
use_this_seqlist<string> containg gi:sssssss or seqid:sssssssss @ret: bool= true if use_this_seq conatins gi list

Definition at line 4445 of file align_format_util.cpp.

References ITERATE, and s_UseThisSeqToTextSeqID().

◆ IsMixedDatabase() [1/2]

bool CAlignFormatUtil::IsMixedDatabase ( CCgiContext ctx)
static

Definition at line 2062 of file align_format_util.cpp.

References ctx, and NStr::ToLower().

◆ IsMixedDatabase() [2/2]

static bool CAlignFormatUtil::IsMixedDatabase ( const objects::CSeq_align_set &  alnset,
objects::CScope &  scope,
ILinkoutDB linkoutdb,
const string mv_build_name 
)
static

◆ IsWGSAccession()

bool CAlignFormatUtil::IsWGSAccession ( string accession,
string wgsProj 
)
static

Check if accession is WGS.

Parameters
accessionstring accession [in]
wgsProjstring wgsProj [out]
Returns
: bool indicating if accession is WGS

Definition at line 3595 of file align_format_util.cpp.

References IsWGSPattern().

◆ IsWGSPattern()

bool CAlignFormatUtil::IsWGSPattern ( string wgsAccession)
static

Check if accession is WGS.

Parameters
accessionstring accession [in]
Returns
: bool indicating if accession is WGS

Definition at line 3553 of file align_format_util.cpp.

References NStr::Find(), i, isalpha(), isdigit(), NPOS, NStr::SplitInTwo(), and version.

Referenced by IsWGSAccession().

◆ LimitSeqalignByHsps()

CRef< CSeq_align_set > CAlignFormatUtil::LimitSeqalignByHsps ( objects::CSeq_align_set &  source_aln,
int  maxAligns,
int  maxHsps 
)
static

function for Limitting seqalign by hsps number (by default results are not cut off within the query)

Parameters
source_alnCSeq_align_set original seqalign
maxAlignsdouble max number of alignments (per query)
maxHspsdouble max number of Hsps (for all qeuries)
Returns
CRef<CSeq_align_set> - filtered seq align

Definition at line 3189 of file align_format_util.cpp.

References CConstRef< C, Locker >::Empty(), CSeq_align_set_Base::Get(), ITERATE, CSeq_id::Match(), and CSeq_align_set_Base::Set().

◆ MapProtocol()

string CAlignFormatUtil::MapProtocol ( string  url_link)
static

◆ MapSpaceTemplate()

string CAlignFormatUtil::MapSpaceTemplate ( string  inpString,
string  tmplParamName,
string  templParamVal,
unsigned int  maxParamLength,
int  spacesFormatFlag = eSpacePosAtLineEnd 
)
static

Replace template tags by real data and calculate and add spaces dependent on maxParamLength and spacesFormatFlag.

Parameters
inpStringstring containing template data
tmplParamName:stringwith template tag name
templParamValstring value that replaces template
maxParamLengthunsigned int maxParamLength
spacesFormatFlagint formatting flag
Returns
:string containing template data replaced by real data

@tmplParamName> is replaced by templParamVal

Definition at line 3441 of file align_format_util.cpp.

References AddSpaces(), and MapTemplate().

Referenced by CTaxFormat::DisplayOrgReport(), CShowBlastDefline::x_FormatClusterMemDataTxt(), CShowBlastDefline::x_FormatDeflineTableHeaderText(), CShowBlastDefline::x_FormatDeflineTableLineText(), and CTaxFormat::x_MapSeqTemplate().

◆ MapTemplate() [1/2]

string CAlignFormatUtil::MapTemplate ( string  inpString,
string  tmplParamName,
Int8  templParamVal 
)
static

Replace template tags by real data.

Parameters
inpStringstring containing template data
tmplParamName:stringwith template tag name
templParamValint value that replaces template
Returns
:string containing template data replaced by real data

@tmplParamName> is replaced by templParamVal

Definition at line 3425 of file align_format_util.cpp.

References NStr::NumericToString(), and NStr::Replace().

Referenced by CTaxFormat::DisplayLineageReport(), CShowBlastDefline::DisplayOneDefline(), CTaxFormat::DisplayOrgReport(), CTaxFormat::DisplayTaxonomyReport(), GetFullIDLink(), GetGraphiscLink(), MapProtocol(), MapSpaceTemplate(), s_AddOtherRelatedInfoLinks(), s_GetLinkoutUrl(), s_MapBarTemplate(), s_MapCommonUrlParams(), s_MapCustomLink(), s_MapFeatureURL(), s_MapLinkoutGenParam(), s_MapSeqInfoTemplate(), s_MapURLLink(), s_ProcessStyledContent(), CDisplaySeqalign::x_DisplayBl2SeqLink(), CShowBlastDefline::x_DisplayDeflineTableTemplate(), CDisplaySeqalign::x_DisplayInsertsForQueryAnchored(), CDisplaySeqalign::x_DisplayRowData(), CDisplaySeqalign::x_DisplaySequenceIDForPairwise(), CDisplaySeqalign::x_DisplaySequenceIDForQueryAnchored(), CDisplaySeqalign::x_FormatAlignSortInfo(), CDisplaySeqalign::x_FormatAlnBlastInfo(), CDisplaySeqalign::x_FormatAlnHSPLinks(), CShowBlastDefline::x_FormatClusterMemData(), CShowBlastDefline::x_FormatClusterMemDataTxt(), CDisplaySeqalign::x_FormatDefLinesHeader(), CShowBlastDefline::x_FormatDeflineTableLine(), CShowBlastDefline::x_FormatDeflineTableLineCSV(), CShowBlastDefline::x_FormatDeflineTableLineText(), CDisplaySeqalign::x_FormatDynamicFeaturesInfo(), CAlnGraphic::x_FormatGraphOverview(), CDisplaySeqalign::x_FormatIdentityInfo(), CDisplaySeqalign::x_FormatOneDynamicFeature(), CShowBlastDefline::x_FormatPsi(), CAlnGraphic::x_FormatScale(), CAlnGraphic::x_FormatScaleDigit(), CShowBlastDefline::x_FormatSeqSetHeaders(), CDisplaySeqalign::x_FormatSingleAlign(), CDisplaySeqalign::x_GetDumpgnlLink(), CBlastFormat::x_InitAlignTemplates(), CDisplaySeqalign::x_InitDefLinesHeader(), CTaxFormat::x_InitTaxFormat(), CTaxFormat::x_InitTaxIdToSeqsMap(), CDisplaySeqalign::x_MapDefLine(), CTaxFormat::x_MapSeqTemplate(), CTaxFormat::x_MapTaxInfoTemplate(), CDisplaySeqalign::x_OutputSeq(), CDisplaySeqalign::x_PrintDefLine(), and CDisplaySeqalign::x_PrintFeatures().

◆ MapTemplate() [2/2]

string CAlignFormatUtil::MapTemplate ( string  inpString,
string  tmplParamName,
string  templParamVal 
)
static

Replace template tags by real data.

Parameters
inpStringstring containing template data
tmplParamName:stringwith template tag name
templParamValstring value that replaces template
Returns
:string containing template data replaced by real data

@tmplParamName> is replaced by templParamVal

Definition at line 3433 of file align_format_util.cpp.

References NStr::Replace().

◆ MatchSeqInSeqList() [1/2]

static bool CAlignFormatUtil::MatchSeqInSeqList ( CConstRef< objects::CSeq_id > &  alnSeqID,
list< string > &  use_this_seq,
vector< string > &  seqList 
)
static

Matches string of seqIDs (gis or text seqID)

Parameters
alnSeqIDCSeq_id to extract label info to match
use_this_seqlist<string> containg gi:sssssss or seqid:sssssssss
seqListstring contaning comma separated seqIds @ret: bool=true if the match is found

◆ MatchSeqInSeqList() [2/2]

static bool CAlignFormatUtil::MatchSeqInSeqList ( TGi  cur_gi,
CRef< objects::CSeq_id > &  seqID,
list< string > &  use_this_seq,
bool isGiList = NULL 
)
static

Matches text seqID or gi with the list of seqIds or gis.

Parameters
cur_gigi to match
seqIDCSeq_id to extract label info to match
use_this_seqlist<string> containg gi:sssssss or seqid:sssssssss
isGiListbool= true if use_this_seq conatins gi list @ret: bool=true if the match is found

Referenced by FilterSeqalignBySeqList(), and CShowBlastDefline::x_FillDeflineAndId().

◆ MatchSeqInUseThisSeqList()

bool CAlignFormatUtil::MatchSeqInUseThisSeqList ( list< string > &  use_this_seq,
string  textSeqIDToMatch 
)
static

Definition at line 4512 of file align_format_util.cpp.

References ITERATE, and s_UseThisSeqToTextSeqID().

Referenced by s_ModifySeqAlnWithFilteredSeqIDs().

◆ PrintDbReport()

void CAlignFormatUtil::PrintDbReport ( const vector< SDbInfo > &  dbinfo_list,
size_t  line_length,
CNcbiOstream out,
bool  top = false 
)
static

Print out blast database information.

Parameters
dbinfo_listdatabase info list
line_lengthlength of each line desired
outstream to ouput
topIs this top or bottom part of the BLAST report?

Definition at line 381 of file align_format_util.cpp.

References AddSpace(), CAlignFormatUtil::SDbInfo::definition, CAlignFormatUtil::SDbInfo::filt_algorithm_name, CAlignFormatUtil::SDbInfo::filt_algorithm_options, NStr::fWithCommas, i, NStr::Int8ToString(), NStr::IntToString(), ITERATE, CAlignFormatUtil::SDbInfo::number_seqs, out(), CAlignFormatUtil::SDbInfo::total_length, and x_WrapOutputLine().

◆ PrintKAParameters()

void CAlignFormatUtil::PrintKAParameters ( double  lambda,
double  k,
double  h,
size_t  line_len,
CNcbiOstream out,
bool  gapped,
const Blast_GumbelBlk gbp = NULL 
)
static

Print out kappa, lamda blast parameters.

Parameters
lambda
k
h
line_lenlength of each line desired
outstream to ouput
gappedgapped alignment?
gbpGumbel parameters

Definition at line 453 of file align_format_util.cpp.

References Blast_GumbelBlk::a, Blast_GumbelBlk::a_un, Blast_GumbelBlk::Alpha, Blast_GumbelBlk::Alpha_un, buffer, lambda(), out(), and Blast_GumbelBlk::Sigma.

◆ PrintPhiInfo()

void CAlignFormatUtil::PrintPhiInfo ( int  num_patterns,
const string pattern,
double  prob,
vector< int > &  offsets,
CNcbiOstream out 
)
static

Prints out PHI-BLAST info for header (or footer)

Parameters
num_patternsnumber of times pattern appears in query [in]
patternthe pattern used [in]
probprobability of pattern [in]
offsetsvector of pattern offsets in query [in]
outstream to ouput [in]

Definition at line 632 of file align_format_util.cpp.

References first(), out(), and prob().

◆ PrintTildeSepLines()

void CAlignFormatUtil::PrintTildeSepLines ( string  str,
size_t  line_len,
CNcbiOstream out 
)
static

Print out misc information separated by "~".

Parameters
strinput information
line_lenlength of each line desired
outstream to ouput

Definition at line 202 of file align_format_util.cpp.

References ITERATE, out(), NStr::Split(), str(), and x_WrapOutputLine().

◆ PruneSeqalign()

void CAlignFormatUtil::PruneSeqalign ( const objects::CSeq_align_set &  source_aln,
objects::CSeq_align_set &  new_aln,
unsigned int  num = static_cast<unsigned int>(kDfltArgNumAlignments) 
)
static

Fill new alignset containing the specified number of alignments with unique slave seqids.

Note no new seqaligns were created. It just references the original seqalign

Parameters
source_alnthe original alnset
new_alnthe new alnset
numthe specified number
Returns
actual number of subject sequences

Definition at line 889 of file align_format_util.cpp.

References CSeq_align_set_Base::Get(), ITERATE, CSeq_id::Match(), number, and CSeq_align_set_Base::Set().

◆ PruneSeqalignAll()

void CAlignFormatUtil::PruneSeqalignAll ( const objects::CSeq_align_set &  source_aln,
objects::CSeq_align_set &  new_aln,
unsigned int  number 
)
static

Fill new alignset containing the specified number of alignments plus the rest of alignments for the last subget seq unique slave seqids.

Note no new seqaligns were created. It just references the original seqalign

Parameters
source_alnthe original alnset
new_alnthe new alnset
numthe specified number

Definition at line 946 of file align_format_util.cpp.

References CSeq_align_set_Base::Get(), ITERATE, CSeq_id::Match(), number, and CSeq_align_set_Base::Set().

◆ RemoveSeqsOfAccessionTypeFromSeqInUse()

bool CAlignFormatUtil::RemoveSeqsOfAccessionTypeFromSeqInUse ( list< string > &  use_this_seq,
objects::CSeq_id::EAccessionInfo  accesionType 
)
static

function to remove sequences of accesionType from use_this_seq list

Parameters
use_this_seqlist <string> of seqIDs
accesionTypeCSeq_id::EAccessionInfo accession type to check
Returns
bool true if list changed

Definition at line 4527 of file align_format_util.cpp.

References CSeq_id::IdentifyAccession(), ITERATE, and s_UseThisSeqToTextSeqID().

Referenced by s_ModifySeqAlnWithFilteredSeqIDs().

◆ SetCustomLinksTypes()

int CAlignFormatUtil::SetCustomLinksTypes ( SSeqURLInfo seqUrlInfo,
int  customLinkTypesInp 
)
static

Create info indicating what kind of links to display.

Parameters
seqUrlInfostruct SSeqURLInfo containing data for URL construction
customLinkTypesInporiginal types of links to be included in the list
Returns
: int containing customLinkTypes with the bits set to indicate what kind of links to display for the sequence

examples:(Mapviewer,Download,GenBank,FASTA,Seqviewer, Trace, SRA, SNP, GSFASTA)

Definition at line 3868 of file align_format_util.cpp.

References CAlignFormatUtil::SSeqURLInfo::blastType, eLinkTypeGenLinks, eLinkTypeGSFastaLinks, eLinkTypeSNPLinks, eLinkTypeSRALinks, eLinkTypeTraceLinks, NStr::Find(), CAlignFormatUtil::SSeqURLInfo::gi, NPOS, CAlignFormatUtil::SSeqURLInfo::seqUrl, and ZERO_GI.

Referenced by GetCustomLinksList(), and GetFASTALinkURL().

◆ SortHit()

void CAlignFormatUtil::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 
)
static

actual sorting function for SortHitByMolecularType

Parameters
info1the first element
info2the second element
Returns
: info1 >= info2?

Definition at line 1543 of file align_format_util.cpp.

References kScope, kTranslation, SortHitByPercentIdentityDescendingEx(), and SortHitByTotalScoreDescending().

◆ SortHitByMasterCoverageDescending()

bool CAlignFormatUtil::SortHitByMasterCoverageDescending ( CRef< objects::CSeq_align_set > const info1,
CRef< objects::CSeq_align_set > const info2 
)
static

◆ SortHitByMasterStartAscending()

bool CAlignFormatUtil::SortHitByMasterStartAscending ( CRef< objects::CSeq_align_set > &  info1,
CRef< objects::CSeq_align_set > &  info2 
)
static

sorting function for sorting a list of seqalign set by ascending mater start position

Parameters
info1the first element
info2the second element
Returns
: info1 >= info2?

Definition at line 1221 of file align_format_util.cpp.

References CSeq_align_set_Base::Get(), GetAlnScores(), min(), CSeq_align_set_Base::Set(), and SortHspByMasterStartAscending().

◆ SortHitByMolecularType()

void CAlignFormatUtil::SortHitByMolecularType ( list< CRef< objects::CSeq_align_set > > &  seqalign_hit_list,
objects::CScope &  scope,
ILinkoutDB linkoutdb,
const string mv_build_name 
)
static

sort a list of seqalign set by molecular type

Parameters
seqalign_hit_listlist to be sorted.
scopescope to fetch sequence

Definition at line 1531 of file align_format_util.cpp.

References kScope.

◆ SortHitByPercentIdentityDescending()

void CAlignFormatUtil::SortHitByPercentIdentityDescending ( list< CRef< objects::CSeq_align_set > > &  seqalign_hit_list,
bool  do_translation 
)
static

sort a list of seqalign set by alignment identity

Parameters
seqalign_hit_listlist to be sorted.
do_translationis this a translated nuc to nuc alignment?

Definition at line 1123 of file align_format_util.cpp.

References kTranslation, and SortHitByPercentIdentityDescendingEx().

Referenced by SortOneSeqalignForSortableFormat().

◆ SortHitByPercentIdentityDescendingEx()

bool CAlignFormatUtil::SortHitByPercentIdentityDescendingEx ( const CRef< objects::CSeq_align_set > &  info1,
const CRef< objects::CSeq_align_set > &  info2 
)
static

sorting function for sorting a list of seqalign set by descending identity

Parameters
info1the first element
info2the second element
Returns
: info1 >= info2?

Definition at line 1437 of file align_format_util.cpp.

References GetSeqAlignSetCalcParamsFromASN(), and s_CalcAlnPercentIdent().

Referenced by SortHit(), and SortHitByPercentIdentityDescending().

◆ SortHitByScoreDescending()

bool CAlignFormatUtil::SortHitByScoreDescending ( const CRef< objects::CSeq_align_set > &  info1,
const CRef< objects::CSeq_align_set > &  info2 
)
static

◆ SortHitByTotalScoreDescending()

bool CAlignFormatUtil::SortHitByTotalScoreDescending ( CRef< objects::CSeq_align_set > const info1,
CRef< objects::CSeq_align_set > const info2 
)
static

return the comparison result: 1st >= 2nd => true, false otherwise

Parameters
info1
info2
Returns
: the result

Definition at line 1472 of file align_format_util.cpp.

References CSeq_align_set_Base::Get(), GetAlnScores(), and ITERATE.

Referenced by SortHit(), and SortOneSeqalignForSortableFormat().

◆ SortHspByMasterStartAscending()

bool CAlignFormatUtil::SortHspByMasterStartAscending ( const CRef< objects::CSeq_align > &  info1,
const CRef< objects::CSeq_align > &  info2 
)
static

sorting function for sorting a list of seqalign by ascending mater start position

Parameters
info1the first element
info2the second element
Returns
: info1 >= info2?

Definition at line 1277 of file align_format_util.cpp.

References GetAlnScores(), CSeq_align::GetSeqStart(), CSeq_align::GetSeqStop(), and min().

Referenced by SortHitByMasterStartAscending(), and SortOneSeqalignForSortableFormat().

◆ SortHspByPercentIdentityDescending()

bool CAlignFormatUtil::SortHspByPercentIdentityDescending ( const CRef< objects::CSeq_align > &  info1,
const CRef< objects::CSeq_align > &  info2 
)
static

sorting function for sorting a list of seqalign by descending identity

Parameters
info1the first element
info2the second element
Returns
: info1 >= info2?

Definition at line 1135 of file align_format_util.cpp.

References GetAlignmentLength(), GetAlnScores(), and kTranslation.

Referenced by s_CalcAlnPercentIdent(), and SortOneSeqalignForSortableFormat().

◆ SortHspByScoreDescending()

bool CAlignFormatUtil::SortHspByScoreDescending ( const CRef< objects::CSeq_align > &  info1,
const CRef< objects::CSeq_align > &  info2 
)
static

Definition at line 1257 of file align_format_util.cpp.

References GetAlnScores().

Referenced by SortHitByScoreDescending(), and SortOneSeqalignForSortableFormat().

◆ SortHspBySubjectStartAscending()

bool CAlignFormatUtil::SortHspBySubjectStartAscending ( const CRef< objects::CSeq_align > &  info1,
const CRef< objects::CSeq_align > &  info2 
)
static

◆ SortOneSeqalignForSortableFormat()

list< CRef< CSeq_align_set > > CAlignFormatUtil::SortOneSeqalignForSortableFormat ( const objects::CSeq_align_set &  source,
bool  nuc_to_nuc_translation,
int  hit_sort,
int  hsp_sort 
)
static

◆ SortSeqalignForSortableFormat() [1/2]

static CRef<objects::CSeq_align_set> CAlignFormatUtil::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

◆ SortSeqalignForSortableFormat() [2/2]

static CRef<objects::CSeq_align_set> CAlignFormatUtil::SortSeqalignForSortableFormat ( objects::CSeq_align_set &  aln_set,
bool  nuc_to_nuc_translation,
int  hit_order,
int  hsp_order 
)
static

◆ SplitSeqalignByMolecularType()

void CAlignFormatUtil::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

◆ StringGiToNumGiList()

list< TGi > CAlignFormatUtil::StringGiToNumGiList ( list< string > &  use_this_seq)
static

Convert if string gi list to TGi list.

Parameters
use_this_seqlist<string> containg gi:sssssss @ret: list<TGi> containin sssssss

Definition at line 4455 of file align_format_util.cpp.

References ITERATE, and s_UseThisSeqToTextSeqID().

Referenced by GetSeqAlignSetCalcParamsFromASN().

◆ x_AcknowledgeBlastSequence()

void CAlignFormatUtil::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 
)
staticprivate

◆ x_WrapOutputLine()

void CAlignFormatUtil::x_WrapOutputLine ( string  str,
size_t  line_len,
CNcbiOstream out,
bool  html = false 
)
staticprotected

Wrap a string to specified length.

If break happens to be in a word, it will extend the line length until the end of the word

Parameters
strinput string
line_lenlength of each line desired
outstream to ouput
htmlIs this HTML output? [in]

If break happens to be in a word, it will extend the line length until the end of the word

Parameters
strinput string
line_lenlength of each line desired
outstream to ouput

Definition at line 154 of file align_format_util.cpp.

References flags, NStr::fWrap_FlatFile, NStr::fWrap_HTMLPre, CHTMLHelper::HTMLEncode(), out(), str(), and NStr::Wrap().

Referenced by PrintDbReport(), PrintTildeSepLines(), and x_AcknowledgeBlastSequence().

Member Data Documentation

◆ kNoHitsFound

const char CAlignFormatUtil::kNoHitsFound = "No hits found"
static

The string containing the message that no hits were found.

Definition at line 352 of file align_format_util.hpp.

◆ m_geturl_debug_flag

bool CAlignFormatUtil::m_geturl_debug_flag = false
static

Definition at line 1549 of file align_format_util.hpp.

Referenced by InitConfig().

◆ m_Protocol

string CAlignFormatUtil::m_Protocol = ""
static

Definition at line 1548 of file align_format_util.hpp.

Referenced by MapProtocol().

◆ m_Reg

unique_ptr< CNcbiRegistry > CAlignFormatUtil::m_Reg
static

The documentation for this class was generated from the following files:
Modified on Fri Jul 12 16:21:27 2024 by modify_doxy.py rev. 669887