81 arg_desc->AddKey(
"data-in",
"InputData",
82 "Concatenated Seq-aligns used to generate gene models",
145 int kExpectedIdentities = 0;
147 kExpectedIdentities);
149 int kExpectedMismatches = 0;
151 kExpectedMismatches);
153 int kExpectedGapOpen = 0;
157 int kExpectedGaps = 0;
161 int kExpectedLength = 0;
165 int kExpectedScore = 0;
169 double kExpectedPctIdentity_Gapped = 0;
171 kExpectedPctIdentity_Gapped);
173 double kExpectedPctIdentity_Ungapped = 0;
175 kExpectedPctIdentity_Ungapped);
177 double kExpectedPctIdentity_GapOpeningOnly = 0;
179 kExpectedPctIdentity_GapOpeningOnly);
181 double kExpectedPctCoverage = 0;
183 kExpectedPctCoverage);
185 double kExpectedHighQualityPctCoverage = 0;
187 kExpectedHighQualityPctCoverage);
189 int kExpectedPositiveCount = -1;
191 kExpectedPositiveCount);
193 int kExpectedNegativeCount = -1;
195 kExpectedNegativeCount);
199 if ((*score_it)->GetId().IsStr()) {
200 expected_scores[(*score_it)->GetId().GetStr()] =
201 (*score_it)->GetValue().IsReal()
202 ? (*score_it)->GetValue().GetReal()
203 : (double)(*score_it)->GetValue().GetInt();
215 << kExpectedLength <<
" == " << actual);
216 BOOST_CHECK_EQUAL(kExpectedLength, actual);
225 << kExpectedIdentities <<
" == " << actual);
226 BOOST_CHECK_EQUAL(kExpectedIdentities, actual);
234 << kExpectedMismatches <<
" == " << actual);
235 BOOST_CHECK_EQUAL(kExpectedMismatches, actual);
241 int mismatches = 1000;
242 int identities = 1000;
244 identities, mismatches);
245 BOOST_CHECK_EQUAL(kExpectedMismatches, mismatches);
246 BOOST_CHECK_EQUAL(kExpectedIdentities, identities);
254 << kExpectedGapOpen <<
" == " << actual);
255 BOOST_CHECK_EQUAL(kExpectedGapOpen, actual);
263 << kExpectedGaps <<
" == " << actual);
264 BOOST_CHECK_EQUAL(kExpectedGaps, actual);
273 << kExpectedPctIdentity_Gapped <<
" == " << actual);
277 BOOST_CHECK_CLOSE(kExpectedPctIdentity_Gapped,
294 << kExpectedPctIdentity_Ungapped <<
" == " << actual);
298 BOOST_CHECK_CLOSE(kExpectedPctIdentity_Ungapped,
314 LOG_POST(
Error <<
"Verifying score: pct_identity_gapopen_only: "
315 << kExpectedPctIdentity_GapOpeningOnly <<
" == " << actual);
319 BOOST_CHECK_CLOSE(kExpectedPctIdentity_GapOpeningOnly,
335 << kExpectedPctCoverage <<
" == " << actual);
339 BOOST_CHECK_CLOSE(kExpectedPctCoverage,
353 score_builder.
AddScore(*scope, alignment,
357 << kExpectedHighQualityPctCoverage <<
" == " << actual);
361 BOOST_CHECK_CLOSE(kExpectedHighQualityPctCoverage,
379 << kExpectedScore <<
" == " << actual);
380 BOOST_CHECK_EQUAL(kExpectedScore, actual);
383 if (kExpectedPositiveCount >= 0) {
385 score_builder.
AddScore(*scope, alignment,
389 << kExpectedPositiveCount <<
" == " << actual);
390 BOOST_CHECK_EQUAL(kExpectedPositiveCount, actual);
391 score_builder.
AddScore(*scope, alignment,
395 << kExpectedNegativeCount <<
" == " << actual);
396 BOOST_CHECK_EQUAL(kExpectedNegativeCount, actual);
406 string score_name = (*score_it)->GetId().GetStr();
408 (*score_it)->GetValue().IsReal()
409 ? (*score_it)->GetValue().GetReal()
410 : (double)(*score_it)->GetValue().GetInt();
411 double expected = expected_scores[score_name];
415 BOOST_CHECK_CLOSE(
expected, actual, 1e-12);
429 accession \"BE669435\",\
439 seq-data ncbi2na 'FFC14200700A8BEB8084DFE879F774BD79ED210DE0B1FF0BB05E7470\
440 5749784549CEEDBEDF847BBA827FAFA9044FB40BC0350ECDD4D4E2B4F5838E8F53B44B7099D0E0\
441 4E5350B47EA27DD7AE882953DE53253E49E7468A2C9554A91D3793AAEA92291FB12BB7D1FAB4A6\
442 BD3158AEEA93AE7C5BBAA4AA195BC1E48EDE7893B526EACEA27A8F4D3FE7388E5E9E532BE13858\
443 3CA9D3CE1BDE852C769EFA9EA7144E3413BB8C3B7C1EA1A22C20'H\
452 data region \"alignable\",\
471 accession \"BE669548\",\
481 seq-data ncbi2na 'E6965809820A09D79575C09E09409829FC0A504292EF80AED4494400\
482 8208D646D1517D69A58211E61D6884950335DA0899D52880427E14739CD342FD67851E2DE53810\
483 8C81104111FBBD3EE8EF0250424523C04A7B8209ECE13E3BAD06D04578F7978E88820A4CEF61E9\
484 D78F18E7FA3BE50403E234D0'H\
493 data region \"alignable\",\
512 accession \"BE669549\",\
522 seq-data ncbi2na 'D108E9960260828275E55D70278250260A7F029420A4BBE02BB51251\
523 0020823591B4545F5A69608479875A212540CD768226754A20109F851CE734D0BF59E1478B794E\
524 0823208410447EEF4FBA3BC094109148F0129EE0827B384F8EE942B4115E3DA5E3A22082933BD8\
525 7A75E3C639FE8EF94100FA8D3701E2D490'H\
534 data region \"alignable\",\
556 completeness complete\
563 seq-data iupacaa \"MFITRTFSDMKIGKKLGLSFGVLIVATLAIALLAFKGFQSIKENSAKQDVTV\
564 NMVNTLSKARMNRLLYQYTKDEQYAQVNARALNELSAHFDTLKKFDWNAQGEQQLDVLGSALQSYQTLRQAFYLASKK\
565 TFAASAVIQGNDLLTLGQSLDGVNIPAQPEAMLQVLRLASLLKEVAGDVERFIDKPTEASKVEIYGNITSIEQIRTQL\
566 SALAIPEIQTVLNTQKTDLTQLKQAFTDYMTAVGAEAAASSQLSAVAEKLNTSVAELFDYQASESTSALLNAERQIAV\
567 VAALCILLSLLVAWRITRAITVPLKETLSVAQRISEGDLTATLSTTRRDELGQLMQAVSVMNESLQNIITNVRDGVNS\
568 VARASSEIAAGNMDLSSRTEQQSAAVVQTAASMEELTSTVKQNAENAHHASQLATEASANAGRGGDIIRNVVTTMQGI\
569 TTSSGKIGEIISVINGISFQTNILALNAAVEAARAGEQGRGFAVVAGEVRNLAQRSSVAAKEIETLIRDSLHRVNEGS\
570 TLVDQAGSTMDEIVLSVTQVKDIMSEIAAASDEQNRGISQIAQAMTEMDTTTQQNAALVEESSAAASSLESQAEELEK\
571 TVAVFRLPANKSGMAVSHSTAKSVTKAPVSLRQPNPAEGNWETF\"\
678 from 5755, to 5886, \
709 from 5116, to 5754, \
717 product-id gi 446828913, \
718 genomic-id gi 16763390, \
719 genomic-strand minus, \
720 product-type protein, \
723 product-start protpos { \
726 product-end protpos { \
729 genomic-start 5116, \
745 int expected_score = 1301;
757 int dense_seg_score = score_builder.
GetBlastScore(*scope, align);
758 BOOST_CHECK_EQUAL(dense_seg_score, expected_score);
765 int std_seg_p2p_score = score_builder.
GetBlastScore(*scope, align);
766 BOOST_CHECK_EQUAL(std_seg_p2p_score, expected_score);
773 int std_seg_p2n_score = score_builder.
GetBlastScore(*scope, align);
774 BOOST_CHECK_EQUAL(std_seg_p2n_score, expected_score);
781 int spliced_seg_score = score_builder.
GetBlastScore(*scope, align);
782 BOOST_CHECK_EQUAL(spliced_seg_score, expected_score);
786 int prosplign_tblastn_score = lu.
GetScore(align,
"prosplign_tblastn_score");
787 BOOST_CHECK_EQUAL(prosplign_tblastn_score, expected_score);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eBlastn
Nucl-Nucl (traditional blastn)
@ eBlastp
Protein-Protein.
@ eTblastn
Protein-Translated nucl.
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
static CNcbiApplication * Instance(void)
Singleton method.
TSeqPos GetAlignLength(const CSeq_align &align, bool ungapped=false)
Compute the length of the alignment (= length of all segments, gaps + aligned)
int GetIdentityCount(CScope &scope, const CSeq_align &align)
Compute the number of identities in the alignment.
void AddSplignScores(const CSeq_align &align, CSeq_align::TScore &scores)
Compute the six splign scores.
int GetGapCount(const CSeq_align &align)
Compute the number of gaps in the alignment.
double GetPercentCoverage(CScope &scope, const CSeq_align &align, unsigned query=0)
Compute percent coverage of the query (sequence 0) (range 0-100)
double GetPercentIdentity(CScope &scope, const CSeq_align &align, EPercentIdentityType type=eGapped)
int GetMismatchCount(CScope &scope, const CSeq_align &align)
Compute the number of mismatches in the alignment.
int GetGapBaseCount(const CSeq_align &align)
Compute the number of gap bases in the alignment (= length of all gap segments)
void AddScore(CScope &scope, CSeq_align &align, EScoreType score)
deprecated: use CSeq_align::EScoreType directly
int GetBlastScore(CScope &scope, const CSeq_align &align)
Compute the BLAST score of the alignment.
void SetScope(objects::CScope &scope)
CScoreLookup uses a scope internally.
double GetScore(const objects::CSeq_align &align, const string &score_name)
Get requested score for alignment.
@ eScore_PercentIdentity_GapOpeningOnly
@ eScore_PercentIdentity_Gapped
@ eScore_PercentIdentity_Ungapped
@ eScore_HighQualityPercentCoverage
bool GetNamedScore(const string &id, int &score) const
Get score.
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
@ eInputFile
Name of file (must exist and be readable)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
#define MSerial_AsnText
I/O stream manipulators –.
@ eSerial_AsnText
ASN.1 text.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
E_Choice Which(void) const
Which variant is currently selected.
vector< CRef< CScore > > TScore
void ResetScore(void)
Reset Score data member.
TProduct_type GetProduct_type(void) const
Get the Product_type member data.
const TSpliced & GetSpliced(void) const
Get the variant data.
bool IsStd(void) const
Check if variant Std is selected.
bool IsSpliced(void) const
Check if variant Spliced is selected.
const TScore & GetScore(void) const
Get the Score member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsDenseg(void) const
Check if variant Denseg is selected.
@ eProduct_type_transcript
static const char * expected[]
const std::string sc_TestEntries
NCBITEST_INIT_CMDLINE(arg_desc)
BOOST_AUTO_TEST_CASE(Test_Score_Builder)
CRef< objects::CObjectManager > om
Utility stuff for more convenient using of Boost.Test library.