A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/blastinput__unit__test_8cpp_source.html below:

NCBI C++ ToolKit: src/algo/blast/blastinput/unit_test/blastinput_unit_test.cpp Source File

66 #include <unordered_map> 68 #undef NCBI_BOOST_NO_AUTO_TEST_MAIN 71 #ifndef SKIP_DOXYGEN_PROCESSING 101  const bool

is_protein(

true

);

106

BOOST_REQUIRE(

source

->End() ==

false

);

107  bool

caught_exception(

false

);

109

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

115

BOOST_REQUIRE(

msg

.find(

"GI/accession/sequence mismatch: protein input required but nucleotide provided"

)

118

caught_exception =

true

;

120

BOOST_REQUIRE(caught_exception);

121

BOOST_REQUIRE(

source

->End() ==

true

);

128  const bool

is_protein(

false

);

133

BOOST_REQUIRE(

source

->End() ==

false

);

134  bool

caught_exception(

false

);

136

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

142

BOOST_REQUIRE(

msg

.find(

"GI/accession/sequence mismatch: nucleotide input required but protein provided"

)

145

caught_exception =

true

;

147

BOOST_REQUIRE(caught_exception);

148

BOOST_REQUIRE(

source

->End() ==

true

);

155  const bool

is_protein(

true

);

160

BOOST_REQUIRE(

source

->End() ==

false

);

161  bool

caught_exception(

false

);

163

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

169

BOOST_REQUIRE(

msg

.find(

"GI/accession/sequence mismatch: protein input required but nucleotide provided"

)

172

caught_exception =

true

;

174

BOOST_REQUIRE(caught_exception);

175

BOOST_REQUIRE(

source

->End() ==

true

);

182  const bool

is_protein(

false

);

187

BOOST_REQUIRE(

source

->End() ==

false

);

188  bool

caught_exception(

false

);

190

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

196

BOOST_REQUIRE(

msg

.find(

"GI/accession/sequence mismatch: nucleotide input required but protein provided"

)

199

caught_exception =

true

;

201

BOOST_REQUIRE(caught_exception);

202

BOOST_REQUIRE(

source

->End() ==

true

);

229

vector<SDubiousShortSequence> test_data;

232

seq.assign(

"ykrggggwgg gggwkggggg gggwkggggg gkgggg"

);

235

seq.assign(

"GGGGGGGGGGGGGGG"

);

241  ITERATE

(vector<SDubiousShortSequence>, itr, test_data) {

250

BOOST_REQUIRE(

source

->End() ==

false

);

251  bool

caught_exception(

false

);

254

ssl =

source

->GetNextSeqLocBatch(scope).front();

260

BOOST_REQUIRE(

msg

.find(

"Gi/accession mismatch: "

) !=

NPOS

);

263

caught_exception =

true

;

265

BOOST_REQUIRE(caught_exception ==

false

);

266

BOOST_REQUIRE(

source

->End() ==

true

);

269

BOOST_REQUIRE_EQUAL(itr->GetLength(), length);

276  ITERATE

(vector<SDubiousShortSequence>, itr, test_data) {

286

BOOST_REQUIRE(

source

->End() ==

false

);

287  bool

caught_exception(

false

);

290

ssl =

source

->GetNextSeqLocBatch(scope).front();

296

BOOST_REQUIRE(

msg

.find(

"Nucleotide FASTA provided for prot"

) !=

NPOS

);

299

caught_exception =

true

;

301

BOOST_REQUIRE(caught_exception ==

true

);

302

BOOST_REQUIRE(

source

->End() ==

true

);

311  const bool

is_protein(

false

);

317

BOOST_REQUIRE(

source

->End() ==

false

);

318  bool

caught_exception(

false

);

319  try

{ blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front(); }

322

BOOST_REQUIRE(

msg

.find(

"Protein FASTA provided for nucleotide"

) !=

NPOS

);

324

caught_exception =

true

;

326

BOOST_REQUIRE(caught_exception);

327

BOOST_REQUIRE(

source

->End() ==

true

);

334  const bool

is_protein(

true

);

340

BOOST_REQUIRE(

source

->End() ==

false

);

341  bool

caught_exception(

false

);

342  try

{ blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front(); }

345

BOOST_REQUIRE(

msg

.find(

"Nucleotide FASTA provided for protein"

) !=

NPOS

);

347

caught_exception =

true

;

349

BOOST_REQUIRE(caught_exception);

350

BOOST_REQUIRE(

source

->End() ==

true

);

357  const bool

is_protein(

true

);

362

BOOST_REQUIRE(

source

->End() ==

false

);

363

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

364

BOOST_REQUIRE(

source

->End() ==

true

);

366

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

369

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

370

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_unknown

, (

int

)ssl.seqloc->GetInt().GetStrand());

372

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

373

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

375

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

377

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

379

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

380

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Local

, ssl.seqloc->GetInt().GetId().Which());

382

BOOST_REQUIRE(!ssl.mask);

390  const bool

is_protein(

false

);

395

BOOST_REQUIRE(

source

->End() ==

false

);

396

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

397

BOOST_REQUIRE(

source

->End() ==

true

);

399

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

402

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

403

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

405

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

406

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

408

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

410

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

412

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

413

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Local

, ssl.seqloc->GetInt().GetId().Which());

415

BOOST_REQUIRE(!ssl.mask);

422  const bool

is_protein(

true

);

428

blast::SSeqLoc ssl = seqs.front();

429

BOOST_REQUIRE(

source

->End() ==

true

);

431

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

434

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

435

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

437

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

439

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

441  const CSeq_id

* seqid = ssl.seqloc->GetId();

445  for

(

size_t i

= 0;

i

< sv.

size

();

i

++) {

446

BOOST_CHECK_NE(

'-'

, (

char

)sv[

i

]);

452

BOOST_REQUIRE_EQUAL(inst.

GetLength

(), length);

457  for

(

size_t i

= 0;

i

< seq.size();

i

++) {

458

BOOST_CHECK_NE(

'-'

, (

char

)seq[

i

]);

467  const bool

is_protein(

false

);

473

blast::SSeqLoc ssl = seqs[0];

474

BOOST_REQUIRE(

source

->End() ==

true

);

476

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

479

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

480

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

482

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

483

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

485

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

487

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

489

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

490

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Local

, ssl.seqloc->GetInt().GetId().Which());

493

BOOST_REQUIRE(bioseqs.

NotEmpty

());

495

BOOST_REQUIRE(!ssl.mask);

504  const bool

is_protein(

false

);

510

blast::SSeqLoc ssl = seqs.front();

512

BOOST_REQUIRE(

source

->End() ==

true

);

516

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

517

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->GetSeq().CanGetInst());

518

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->GetSeq().GetInst().CanGetRepr());

519

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->GetSeq().GetInst().GetRepr()

536  const bool

is_protein(

false

);

541

BOOST_REQUIRE(

source

->End() ==

false

);

542

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

543

BOOST_REQUIRE(

source

->End() ==

true

);

546

BOOST_REQUIRE(s.find(

"Ignoring invalid residues at "

) !=

NPOS

);

548

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

551

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

552

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

554

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

555

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

557

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

559

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

561

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

562

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Local

, ssl.seqloc->GetInt().GetId().Which());

564

BOOST_REQUIRE(!ssl.mask);

570  const char

* fname =

"data/invalid_gi.txt"

;

571  const bool

is_protein(

false

);

576

BOOST_REQUIRE(

source

->End() ==

false

);

580  bool

caught_exception(

false

);

581  try

{ ssl =

source

->GetNextSeqLocBatch(scope).front(); }

584

BOOST_REQUIRE(

msg

.find(

"Sequence ID not found: "

) !=

NPOS

);

586

caught_exception =

true

;

588

BOOST_REQUIRE(caught_exception);

589

BOOST_REQUIRE(

source

->End() ==

true

);

595  const char

* fname =

"data/bad_seqid.txt"

;

596  const bool

is_protein(

false

);

601

BOOST_REQUIRE(

source

->End() ==

false

);

605  bool

caught_exception(

false

);

606  try

{ ssl =

source

->GetNextSeqLocBatch(scope).front(); }

610

caught_exception =

true

;

612

BOOST_REQUIRE(caught_exception);

613

BOOST_REQUIRE(

source

->End() ==

true

);

619  const char

* fname =

"data/bad_input.txt"

;

620  const bool

is_protein(

false

);

621  const size_t

kNumQueries(0);

628

BOOST_REQUIRE(

source

->End() ==

false

);

631

BOOST_REQUIRE_THROW(query_vector =

source

->GetAllSeqLocs(scope),

633

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

634

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

637

BOOST_REQUIRE(bioseqs.

Empty

());

643

BOOST_REQUIRE(

source

->End() ==

false

);

646

BOOST_REQUIRE_THROW(query_vector =

source

->GetAllSeqs(scope),

648

BOOST_REQUIRE(query_vector.

Empty

());

656  const char

* fname =

"data/gis_bad_input.txt"

;

658  const bool

is_protein(

false

);

662

vector< pair<long, long> > gi_length;

663

gi_length.push_back(make_pair(89161185L, 247249719L));

669

BOOST_REQUIRE(

source

->End() ==

false

);

674

BOOST_REQUIRE_THROW(seqs =

source

->GetAllSeqLocs(scope),

681  const char

* fname(

"/dev/null"

);

682  const bool

is_protein(

true

);

688

BOOST_REQUIRE(

source

->End() ==

true

);

691

BOOST_REQUIRE(query_vector.empty());

694

BOOST_REQUIRE(bioseqs.

Empty

());

700

BOOST_REQUIRE(

source

->End() ==

true

);

703

BOOST_REQUIRE(queries->

Empty

());

712  bool

caught_exception(

false

);

716

BOOST_REQUIRE(

msg

.find(

"No sequence input was provided"

) !=

NPOS

);

718

caught_exception =

true

;

720

BOOST_REQUIRE(caught_exception);

729  const string kFileName

(

"data/isprot.fa"

);

730  const string

kExpectedTitle(

"seq"

);

731  const bool

is_protein(

false

);

741

BOOST_REQUIRE(!bioseqs.

Empty

());

751

BOOST_REQUIRE_EQUAL(kExpectedTitle, title);

769  CFastaReader

fasta_reader(*line_reader, defaultBLASTflags);

782  const string

kUserInput(

">seq_1\nATGC"

);

783  const TSeqPos

kExpectedLength(4);

788  const string

kUserInput(

">seq_1\nATGC\n"

);

789  const TSeqPos

kExpectedLength(4);

794  const string

kUserInput(

"ATGC"

);

795  const TSeqPos

kExpectedLength(4);

804

BOOST_REQUIRE(objmgr);

812

BOOST_REQUIRE_EQUAL(expected_length,

815

BOOST_REQUIRE_EQUAL(expected_length, sv->

size

());

816

BOOST_REQUIRE_EQUAL(is_protein, sv->

IsProtein

());

818

string::size_type input_pos =

input

.find_first_of(

"ACTG"

);

819

BOOST_REQUIRE(input_pos != string::npos);

820  for

(

TSeqPos

pos = 0; pos < sv->

size

(); pos++, input_pos++) {

822

oss <<

"Sequence data differs at position "

<< pos <<

": '" 823

<<

input

[input_pos] <<

"' .vs '"

<< (*sv)[pos] <<

"'"

;

825

BOOST_REQUIRE_MESSAGE(

input

[input_pos] == (*sv)[pos],

msg

);

832  const string

kUserInput(

">seq_1\nATGC"

);

833  const TSeqPos

kExpectedLength(4);

839  const string

kUserInput(

">seq_1\nATGC\n"

);

840  const TSeqPos

kExpectedLength(4);

846  const string

kUserInput(

"ATGC"

);

847  const TSeqPos

kExpectedLength(4);

854  const string

kUserInput(

">mygene\n"

);

860  const bool

is_protein(

false

);

863  bool

caught_exception(

false

);

875

query_vector =

source

->GetAllSeqLocs(scope);

879

BOOST_REQUIRE(

msg

.find(

"Query contains no sequence data"

) !=

NPOS

);

880

BOOST_REQUIRE(warnings.empty());

882

caught_exception =

true

;

884

BOOST_REQUIRE(caught_exception);

885

BOOST_REQUIRE(query_vector.empty() ==

false

);

888

BOOST_REQUIRE(!bioseqs.

Empty

());

889

caught_exception =

false

;

893

BOOST_REQUIRE(

msg

.find(

"Query contains no sequence data"

) !=

NPOS

);

894

BOOST_REQUIRE(warnings.empty());

896

caught_exception =

true

;

898

BOOST_REQUIRE(caught_exception);

905

caught_exception =

false

;

910

BOOST_REQUIRE(

msg

.find(

"Query contains no sequence data"

) !=

NPOS

);

911

BOOST_REQUIRE(warnings.empty());

913

caught_exception =

true

;

915

BOOST_REQUIRE(caught_exception);

916

BOOST_REQUIRE(!queries.

Empty

());

930

caught_exception =

false

;

931

queries =

source

->GetAllSeqs(scope);

935

BOOST_REQUIRE(

msg

.find(

"Query contains no sequence data"

) !=

NPOS

);

936

BOOST_REQUIRE(warnings.empty());

938

caught_exception =

true

;

940

BOOST_REQUIRE(caught_exception);

948  const bool

is_protein(

false

);

954

BOOST_REQUIRE(

source

->End() ==

false

);

956

blast::SSeqLoc ssl = seqs.front();

957

BOOST_REQUIRE(

source

->End() ==

true

);

959

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

962

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

963

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

965

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

966

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

968

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

969  const TSeqPos

length(248956422);

970

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

972

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

973

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Other

, ssl.seqloc->GetInt().GetId().Which());

974  const string

accession(

"NC_000001"

);

975

BOOST_REQUIRE_EQUAL(accession,

976

ssl.seqloc->GetInt().GetId().GetOther().GetAccession());

978

BOOST_REQUIRE(!ssl.mask);

982

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

983

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

985

BOOST_REQUIRE(

b

.IsNa());

987

BOOST_REQUIRE_EQUAL(accession,

b

.GetId().front()->GetOther().GetAccession());

990

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

997  const bool

is_protein(

false

);

998  const TIntId

kGi = 568815597;

1000  const TSeqPos

kStop(248956421);

1001  SDataLoaderConfig

dlconfig(

"GPIPE/9606/current/GCF_000005045.26_top_level"

, is_protein);

1009

BOOST_REQUIRE(

source

->End() ==

false

);

1012

blast::SSeqLoc ssl = seqs.front();

1013

BOOST_REQUIRE(

source

->End() ==

true

);

1015

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1018

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1019

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1021

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1022

BOOST_REQUIRE_EQUAL(

kStart

, ssl.seqloc->GetInt().GetFrom());

1024

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1025

BOOST_REQUIRE_EQUAL(kStop, ssl.seqloc->GetInt().GetTo());

1027  const string

accession =

"NC_000001"

;

1029

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1031

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetInt().GetId().Which());

1032

BOOST_REQUIRE_EQUAL(

GI_CONST

(kGi), ssl.seqloc->GetInt().GetId().GetGi());

1035

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Other

, ssl.seqloc->GetInt().GetId().Which());

1036

BOOST_REQUIRE_EQUAL(accession, ssl.seqloc->GetInt().GetId().GetOther().GetAccession());

1037

BOOST_REQUIRE_EQUAL(

version

, ssl.seqloc->GetInt().GetId().GetOther().GetVersion());

1040

BOOST_REQUIRE(!ssl.mask);

1045

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1046

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1048

BOOST_REQUIRE(

b

.IsNa());

1049  bool

found_gi =

false

, found_accession =

false

;

1052

BOOST_REQUIRE_EQUAL(

GI_CONST

(kGi), (*id)->GetGi());

1056

(*id)->GetOther().AsFastaString(os);

1059

found_accession =

true

;

1062

BOOST_REQUIRE(found_gi);

1063

BOOST_REQUIRE(found_accession);

1067

BOOST_REQUIRE_EQUAL(kStop+1,

b

.GetInst().GetLength());

1081  const bool

is_protein(

false

);

1093

BOOST_REQUIRE(

source

->End() ==

false

);

1095

blast::SSeqLoc ssl = seqs.front();

1096

BOOST_REQUIRE(

source

->End() ==

true

);

1098

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1101

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1102

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1104

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1105

BOOST_REQUIRE_EQUAL(

kStart

, ssl.seqloc->GetInt().GetFrom());

1107

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1108

BOOST_REQUIRE_EQUAL(kStop, ssl.seqloc->GetInt().GetTo());

1110

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1111

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Other

, ssl.seqloc->GetInt().GetId().Which());

1112  const string

accession(

"NC_000001"

);

1113

BOOST_REQUIRE_EQUAL(accession,

1114

ssl.seqloc->GetInt().GetId().GetOther().GetAccession());

1115

BOOST_REQUIRE(!ssl.mask);

1119

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1120

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1122

BOOST_REQUIRE(

b

.IsNa());

1124

BOOST_REQUIRE_EQUAL(accession,

b

.GetId().front()->GetOther().GetAccession());

1127  const TSeqPos

length(248956422);

1128

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

1142  const bool

is_protein(

false

);

1147

vector< pair<string, long> > accession_lengths;

1148

accession_lengths.push_back(make_pair(

string

(

"NC_000001"

), 248956422L));

1149

accession_lengths.push_back(make_pair(

string

(

"NC_000010.9"

), 135374737L));

1150

accession_lengths.push_back(make_pair(

string

(

"NC_000011.8"

), 134452384L));

1151

accession_lengths.push_back(make_pair(

string

(

"NC_000012.10"

), 132349534L));

1153  const size_t

kNumQueries(accession_lengths.size());

1156

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

1157

BOOST_REQUIRE(

source

->End() ==

true

);

1161

BOOST_REQUIRE_EQUAL((

size_t

)0, (

size_t

)cached_queries.size());

1162

BOOST_REQUIRE(

source

->End() ==

true

);

1165  for

(

size_t i

= 0;

i

< kNumQueries;

i

++) {

1167

blast::SSeqLoc& ssl = query_vector[

i

];

1168

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetStrand());

1169

BOOST_REQUIRE_EQUAL((

TSeqPos

)accession_lengths[

i

].second - 1,

1170

ssl.seqloc->GetInt().GetTo());

1172

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1174

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Other

, ssl.seqloc->GetInt().GetId().Which());

1178  case

0: accession.assign(

"NC_000001"

);

version

= 0;

break

;

1179  case

1: accession.assign(

"NC_000010"

);

version

= 9;

break

;

1180  case

2: accession.assign(

"NC_000011"

);

version

= 8;

break

;

1181  case

3: accession.assign(

"NC_000012"

);

version

= 10;

break

;

1185

BOOST_REQUIRE_EQUAL(accession,

1186

ssl.seqloc->GetInt().GetId().GetOther().GetAccession());

1188

BOOST_REQUIRE_EQUAL(

version

,

1189

ssl.seqloc->GetInt().GetId().GetOther().GetVersion());

1191

BOOST_REQUIRE(!ssl.mask);

1197

BOOST_REQUIRE_EQUAL(kNumQueries, bioseqs->

GetSeq_set

().size());

1204  typedef

vector< pair<string, int> > TStringIntVector;

1205

TStringIntVector accession_lengths;

1206

accession_lengths.push_back(make_pair(

string

(

"P01012.2"

), 386));

1207

accession_lengths.push_back(make_pair(

string

(

"1OVA-A"

), 386));

1209

accession_lengths.push_back(make_pair(

string

(

"pdb|1OVA-A"

), 386));

1211

accession_lengths.push_back(make_pair(

string

(

"prf||0705172A"

), 385));

1213

accession_lengths.push_back(make_pair(

string

(

"sp|P01012.2"

), 386));

1219  ITERATE

(TStringIntVector, itr, accession_lengths) {

1220

user_input += itr->first +

"\n"

;

1222

istringstream instream(user_input);

1224  const bool

is_protein(

true

);

1229  const size_t

kNumQueries(accession_lengths.size());

1232

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

1233

BOOST_REQUIRE(

source

->End() ==

true

);

1237

BOOST_REQUIRE_EQUAL((

size_t

)0, (

size_t

)cached_queries.size());

1238

BOOST_REQUIRE(

source

->End() ==

true

);

1241  for

(

size_t i

= 0;

i

< kNumQueries;

i

++) {

1243  const string

& accession = accession_lengths[

i

].first;

1245

blast::SSeqLoc& ssl = query_vector[

i

];

1246

oss <<

"Accession "

<< accession <<

" difference in lengths: " 1247

<< ((

TSeqPos

)accession_lengths[

i

].second - 1) <<

" vs. " 1248

<< ssl.seqloc->GetInt().GetTo();

1250

BOOST_REQUIRE_MESSAGE(((

TSeqPos

)accession_lengths[

i

].second - 1) ==

1251

ssl.seqloc->GetInt().GetTo(),

msg

);

1253

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1259

BOOST_REQUIRE_EQUAL(kNumQueries, bioseqs->

GetSeq_set

().size());

1266  const bool

is_protein(

false

);

1272

BOOST_REQUIRE(

source

->End() ==

false

);

1274

blast::SSeqLoc ssl = seqs.front();

1275

BOOST_REQUIRE(

source

->End() ==

true

);

1277

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1280

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1281

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1283

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1284

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

1286

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1287  const TSeqPos

length = 247249719;

1288

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1290

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1291

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetInt().GetId().Which());

1293

BOOST_REQUIRE_EQUAL(gi, ssl.seqloc->GetInt().GetId().GetGi());

1295

BOOST_REQUIRE(!ssl.mask);

1299

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1300

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1302

BOOST_REQUIRE(

b

.IsNa());

1303

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

,

b

.GetId().front()->Which());

1304

BOOST_REQUIRE_EQUAL(gi,

b

.GetId().front()->GetGi());

1307

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

1314  const bool

is_protein(

false

);

1319

vector< pair<TIntId, long> > gi_length;

1320

gi_length.push_back(make_pair(89161185, 247249719L));

1321

gi_length.push_back(make_pair(555, 624L));

1322

gi_length.push_back(make_pair(557, 489L));

1324  const size_t

kNumQueries(gi_length.size());

1326

BOOST_REQUIRE(

source

->End() ==

false

);

1328

BOOST_REQUIRE(

source

->End() ==

true

);

1330  for

(

size_t i

= 0;

i

< kNumQueries;

i

++) {

1331

blast::SSeqLoc ssl = seqs[

i

];

1332

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1334

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1335

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1337

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1338

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

1340

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1341  const TSeqPos

length = gi_length[

i

].second;

1342

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1344

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1346

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetInt().GetId().Which());

1347  const TIntId

gi = gi_length[

i

].first;

1348

BOOST_REQUIRE_EQUAL(

GI_FROM

(

TIntId

, gi), ssl.seqloc->GetInt().GetId().GetGi());

1350

BOOST_REQUIRE(!ssl.mask);

1355

BOOST_REQUIRE_EQUAL(kNumQueries, bioseqs->

GetSeq_set

().size());

1357

CBioseq_set::TSeq_set::const_iterator itr = bioseqs->

GetSeq_set

().begin();

1358

CBioseq_set::TSeq_set::const_iterator end = bioseqs->

GetSeq_set

().end();

1359  for

(

size_t i

= 0;

i

< kNumQueries;

i

++, ++itr) {

1360

BOOST_REQUIRE(itr != end);

1361

BOOST_REQUIRE((*itr)->IsSeq());

1362  const CBioseq

&

b

= (*itr)->GetSeq();

1363

BOOST_REQUIRE(

b

.IsNa());

1364

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

,

b

.GetId().front()->Which());

1368

BOOST_REQUIRE_EQUAL((

long

)gi_length[

i

].second, (

long

)

b

.GetInst().GetLength());

1378  const bool

is_protein(

false

);

1381  const size_t

kNumQueries(96);

1383

BOOST_REQUIRE(

source

->End() ==

false

);

1387

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

1396  const bool

kParseID(

true

);

1400  const size_t

kNumQueries(96);

1402

BOOST_REQUIRE(

source

->End() ==

false

);

1406

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

1409

BOOST_REQUIRE_EQUAL(query_vector[0].seqloc->GetId()->AsFastaString(),

string

(

"lcl|seq#474_A03_564_c_T3+40.ab1"

));

1410

BOOST_REQUIRE_EQUAL(query_vector[1].seqloc->GetId()->AsFastaString(),

string

(

"lcl|seq#474_A01_564_a_T3+40.ab1"

));

1411

BOOST_REQUIRE_EQUAL(query_vector[2].seqloc->GetId()->AsFastaString(),

string

(

"lcl|seq#474_A02_564_b_T3+40.ab1"

));

1419  const bool

kParseID(

true

);

1428

BOOST_REQUIRE_EQUAL(query_vector[0].seqloc->GetId()->AsFastaString(),

string

(

"lcl|mylocalID555"

));

1437  const bool

is_protein(

false

);

1440  const size_t

kNumQueries(6);

1442

BOOST_REQUIRE(

source

->End() ==

false

);

1446

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

1447

BOOST_REQUIRE(

source

->End() ==

true

);

1448  TSeqPos

query_lengths[] = { 1920, 1, 130, 0, 2, 1552 };

1452

BOOST_REQUIRE_EQUAL(query_lengths[

i

],

1454

query_vector[

i

].scope));

1460

BOOST_REQUIRE(warnings.find(

"following sequences had no sequence data:"

)

1466

BOOST_REQUIRE(warnings.find(

"following sequences had no sequence data:"

)

1474  const bool

is_protein(

false

);

1481

BOOST_REQUIRE(

source

->End() ==

false

);

1483

vector< pair<int, long> > ti_lengths;

1484

ti_lengths.push_back(make_pair(12345, 657L));

1485

ti_lengths.push_back(make_pair(12347, 839L));

1486

ti_lengths.push_back(make_pair(12348, 658L));

1487

ti_lengths.push_back(make_pair(10000, 670L));

1489  const size_t

kNumQueries(ti_lengths.size());

1491

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

1492

BOOST_REQUIRE(

source

->End() ==

true

);

1496

BOOST_REQUIRE_EQUAL((

size_t

)0, (

size_t

)cached_queries.size());

1497

BOOST_REQUIRE(

source

->End() ==

true

);

1500  const string

db(

"ti"

);

1501  for

(

size_t i

= 0;

i

< kNumQueries;

i

++) {

1503  const

blast::SSeqLoc& ssl = query_vector[

i

];

1504

BOOST_REQUIRE(ssl.seqloc->IsInt());

1506

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetStrand());

1507

BOOST_REQUIRE_EQUAL((

TSeqPos

)ti_lengths[

i

].second - 1, seqint.

GetTo

());

1509

BOOST_REQUIRE(seqint.

IsSetId

() ==

true

);

1513

BOOST_REQUIRE_EQUAL(ti_lengths[

i

].

first

,

1515

BOOST_REQUIRE(!ssl.mask);

1520

BOOST_REQUIRE_EQUAL(kNumQueries, bioseqs->

GetSeq_set

().size());

1527  const bool

is_protein(

false

);

1534

BOOST_REQUIRE(

source

->End() ==

false

);

1536

blast::SSeqLoc ssl = seqs.front();

1537

BOOST_REQUIRE(

source

->End() ==

true

);

1539

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1542

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1543

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1545

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1546

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

1548

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1550

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1552

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1554  const string

db(

"ti"

);

1555

BOOST_REQUIRE_EQUAL(db, ssl.seqloc->GetInt().GetId().GetGeneral().GetDb());

1556

BOOST_REQUIRE(ssl.seqloc->GetInt().GetId().GetGeneral().GetTag().IsId());

1557  const int

ti(12345);

1558

BOOST_REQUIRE_EQUAL(ti, ssl.seqloc->GetInt().GetId().GetGeneral().GetTag().GetId());

1560

BOOST_REQUIRE(!ssl.mask);

1564

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1565

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1567

BOOST_REQUIRE(

b

.IsNa());

1569

BOOST_REQUIRE_EQUAL(db,

b

.GetId().back()->GetGeneral().GetDb());

1570

BOOST_REQUIRE_EQUAL(ti,

b

.GetId().back()->GetGeneral().GetTag().GetId());

1573

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

1580  const bool

is_protein(

false

);

1587

vector< pair<string, long> > gi_accessions;

1588

gi_accessions.push_back(make_pair(

string

(

"89161215"

), 111583154L));

1589

gi_accessions.push_back(make_pair(

string

(

"89161217"

), 155407050L));

1590

gi_accessions.push_back(make_pair(

string

(

"89161219"

), 11133097L));

1591

gi_accessions.push_back(make_pair(

string

(

"NC_000001"

), 248956422L));

1592

gi_accessions.push_back(make_pair(

string

(

"NC_000010.9"

), 135374737L));

1593

gi_accessions.push_back(make_pair(

string

(

"gnl|ti|12345"

), 657L));

1594

gi_accessions.push_back(make_pair(

string

(

"NC_000011.8"

), 134452384L));

1595

gi_accessions.push_back(make_pair(

string

(

"NC_000012.10"

), 132349534L));

1597  const size_t

kNumQueries(gi_accessions.size());

1600

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

1601

BOOST_REQUIRE(

source

->End() ==

true

);

1605

BOOST_REQUIRE_EQUAL((

size_t

)0, (

size_t

)cached_queries.size());

1606

BOOST_REQUIRE(

source

->End() ==

true

);

1609  for

(

size_t i

= 0;

i

< kNumQueries;

i

++) {

1611

blast::SSeqLoc& ssl = query_vector[

i

];

1612

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetStrand());

1613

BOOST_REQUIRE_EQUAL((

TSeqPos

)gi_accessions[

i

].second - 1,

1614

ssl.seqloc->GetInt().GetTo());

1616  const string

&

id

= gi_accessions[

i

].first;

1618

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1622

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetInt().GetId().Which());

1623

BOOST_REQUIRE_EQUAL(gi, ssl.seqloc->GetInt().GetId().GetGi());

1624

}

else if

(

i

== 5) {

1626

ssl.seqloc->GetInt().GetId().Which());

1627  const string

db(

"ti"

);

1628

BOOST_REQUIRE_EQUAL(db, ssl.seqloc->GetInt().GetId().GetGeneral().GetDb());

1629

BOOST_REQUIRE(ssl.seqloc->GetInt().GetId().GetGeneral().GetTag().IsId());

1630  const int

ti(12345);

1631

BOOST_REQUIRE_EQUAL(ti,

1632

ssl.seqloc->GetInt().GetId().

1633

GetGeneral().GetTag().

GetId

());

1635

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Other

, ssl.seqloc->GetInt().GetId().Which());

1640  case

3: accession.assign(

"NC_000001"

);

version

= 0;

break

;

1641  case

4: accession.assign(

"NC_000010"

);

version

= 9;

break

;

1642  case

6: accession.assign(

"NC_000011"

);

version

= 8;

break

;

1643  case

7: accession.assign(

"NC_000012"

);

version

= 10;

break

;

1647

BOOST_REQUIRE_EQUAL(accession,

1648

ssl.seqloc->GetInt().GetId().GetOther().GetAccession());

1650

BOOST_REQUIRE_EQUAL(

version

,

1651

ssl.seqloc->GetInt().GetId().GetOther().GetVersion());

1654

BOOST_REQUIRE(!ssl.mask);

1660

BOOST_REQUIRE_EQUAL(kNumQueries, bioseqs->

GetSeq_set

().size());

1668  char buffer

[2048] = {

'\0'

};

1669

unique_ptr<string> retval(

new string

);

1675  return

retval.release();

1680  const char

* fname(

"data/accession.txt"

);

1689

BOOST_REQUIRE(

source

->End() ==

false

);

1691

blast::SSeqLoc ssl = seqs.front();

1694

BOOST_REQUIRE(

source

->End() ==

true

);

1696

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1698

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1699

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1701

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1702

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

1704

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1705  const TSeqPos

length(248956422);

1706

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1708

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1710

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Other

, ssl.seqloc->GetInt().GetId().Which());

1711  const string

accession(

"NC_000001"

);

1712

BOOST_REQUIRE_EQUAL(accession,

1713

ssl.seqloc->GetInt().GetId().GetOther().GetAccession());

1715

BOOST_REQUIRE(!ssl.mask);

1719

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1720

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1722

BOOST_REQUIRE(

b

.IsNa());

1724

BOOST_REQUIRE_EQUAL(accession,

b

.GetId().front()->GetOther().GetAccession());

1727

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

1735

unique_ptr<string> user_input(

new string

(

" 1945386 \n "

));

1742

BOOST_REQUIRE(

source

->End() ==

false

);

1744

BOOST_REQUIRE(

source

->End() ==

true

);

1745

blast::SSeqLoc ssl = seqs.front();

1747

BOOST_REQUIRE(

source

->End() ==

true

);

1749

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1751

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1752

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1754

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1755

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

1757

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1759

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1761

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1764  const string

gb_name =

"HSU93236"

;

1765  const string

gb_accession =

"U93236"

;

1766  const int

gb_version = 1;

1768

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetInt().GetId().Which());

1769

BOOST_REQUIRE_EQUAL(gi, ssl.seqloc->GetInt().GetId().GetGi());

1773

BOOST_REQUIRE_EQUAL(gb_name, ssl.seqloc->GetInt().GetId().GetGenbank().GetName());

1774

BOOST_REQUIRE_EQUAL(gb_accession, ssl.seqloc->GetInt().GetId().GetGenbank().GetAccession());

1775

BOOST_REQUIRE_EQUAL(gb_version, ssl.seqloc->GetInt().GetId().GetGenbank().GetVersion());

1778

BOOST_REQUIRE(!ssl.mask);

1782

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1783

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1785

BOOST_REQUIRE(

b

.IsNa());

1788

BOOST_REQUIRE(

id

.

NotNull

());

1791

BOOST_REQUIRE_EQUAL(gi, id->

GetGi

());

1801

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

1808

unique_ptr<string> user_input(

new string

(

" X65215.1 "

));

1816

BOOST_REQUIRE(

source

.End() ==

false

);

1818

blast::SSeqLoc ssl = seqs.front();

1820

BOOST_REQUIRE(

source

.End() ==

true

);

1822

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1824

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1825

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

1827

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1828

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

1830

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1832

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1834

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1838  const string

accession =

"X65215"

;

1841

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetInt().GetId().Which());

1842

BOOST_REQUIRE_EQUAL(gi, ssl.seqloc->GetInt().GetId().GetGi());

1845

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Embl

, ssl.seqloc->GetInt().GetId().Which());

1846

BOOST_REQUIRE_EQUAL(accession, ssl.seqloc->GetInt().GetId().GetEmbl().GetAccession());

1847

BOOST_REQUIRE_EQUAL(

version

, ssl.seqloc->GetInt().GetId().GetEmbl().GetVersion());

1850

BOOST_REQUIRE(!ssl.mask);

1854

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1855

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1857

BOOST_REQUIRE(

b

.IsNa());

1858  bool

found_gi =

false

, found_accession =

false

;

1861

BOOST_REQUIRE_EQUAL(

GI_CONST

(555), (*id)->GetGi());

1865

(*id)->GetEmbl().AsFastaString(os);

1868

found_accession =

true

;

1871

BOOST_REQUIRE(found_gi);

1872

BOOST_REQUIRE(found_accession);

1875

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

1881  const char

* fname(

"data/aa.129295"

);

1890

BOOST_REQUIRE(

source

.End() ==

false

);

1892

blast::SSeqLoc ssl = seqs.front();

1894

BOOST_REQUIRE(

source

.End() ==

true

);

1896

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

1898

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

1899

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_unknown

, (

int

)ssl.seqloc->GetInt().GetStrand());

1901

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

1902

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

1904

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

1906

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1908

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

1909

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Local

, ssl.seqloc->GetInt().GetId().Which());

1912

BOOST_REQUIRE(!ssl.mask);

1915

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

1916

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

1918

BOOST_REQUIRE(

b

.IsAa());

1921

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

1929  const bool

is_protein(

true

);

1933

iconfig.

SetRange

().SetFrom(start);

1938

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

1940

BOOST_REQUIRE_EQUAL(start, ssl.seqloc->GetInt().GetFrom());

1941

BOOST_REQUIRE_EQUAL(stop, ssl.seqloc->GetInt().GetTo());

1950  const bool

is_protein(

true

);

1954

iconfig.

SetRange

().SetFrom(start);

1958

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

1960

BOOST_REQUIRE_EQUAL(start, ssl.seqloc->GetInt().GetFrom());

1961

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

1970  const bool

is_protein(

true

);

1977  try

{

source

->GetNextSeqLocBatch(scope).front(); }

1980

BOOST_REQUIRE(

msg

.find(

"Invalid sequence range"

) !=

NPOS

);

1984

BOOST_REQUIRE(

false

);

1991  const bool

is_protein(

true

);

1993

iconfig.

SetRange

().SetFrom(1000);

1997  try

{

source

->GetNextSeqLocBatch(scope).front(); }

2000

BOOST_REQUIRE(

msg

.find(

"Invalid from coordinate"

) !=

NPOS

);

2004

BOOST_REQUIRE(

false

);

2011  const bool

is_protein(

true

);

2015

iconfig.

SetRange

().SetTo(length);

2019

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

2021

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

2023

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

2024

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_unknown

, (

int

)ssl.seqloc->GetInt().GetStrand());

2026

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

2027

BOOST_REQUIRE_EQUAL((

TSeqPos

)10, ssl.seqloc->GetInt().GetFrom());

2029

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

2030

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

2037  const bool

is_protein(

true

);

2041

iconfig.

SetRange

().SetTo(length*2);

2045

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

2047

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

2049

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

2050

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_unknown

, (

int

)ssl.seqloc->GetInt().GetStrand());

2052

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

2053

BOOST_REQUIRE_EQUAL((

TSeqPos

)10, ssl.seqloc->GetInt().GetFrom());

2055

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

2056

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

2063  const bool

is_protein(

true

);

2070  const string

name =

"OVAX_CHICK"

;

2071  const string

accession =

"P01013"

;

2072  const string

release =

"reviewed"

;

2073

blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front();

2077

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetId()->Which());

2078

BOOST_REQUIRE_EQUAL(gi, ssl.seqloc->GetId()->GetGi());

2079

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, ssl.seqloc->GetInt().GetId().Which());

2080

BOOST_REQUIRE_EQUAL(gi, ssl.seqloc->GetInt().GetId().GetGi());

2084

BOOST_REQUIRE_EQUAL(name, ssl.seqloc->GetId()->GetSwissprot().GetName());

2085

BOOST_REQUIRE_EQUAL(accession, ssl.seqloc->GetId()->GetSwissprot().GetAccession());

2086

BOOST_REQUIRE_EQUAL(release, ssl.seqloc->GetId()->GetSwissprot().GetRelease());

2088

BOOST_REQUIRE_EQUAL(name, ssl.seqloc->GetInt().GetId().GetSwissprot().GetName());

2089

BOOST_REQUIRE_EQUAL(accession, ssl.seqloc->GetInt().GetId().GetSwissprot().GetAccession());

2090

BOOST_REQUIRE_EQUAL(release, ssl.seqloc->GetInt().GetId().GetSwissprot().GetRelease());

2098  const bool

is_protein(

true

);

2104  bool

caught_exception(

false

);

2105  try

{ blast::SSeqLoc ssl =

source

->GetNextSeqLocBatch(scope).front(); }

2108

BOOST_REQUIRE(

msg

.find(

"Cannot assign nucleotide strand to protein"

)

2111

caught_exception =

true

;

2113

BOOST_REQUIRE(caught_exception);

2114

BOOST_REQUIRE(

source

->End() ==

true

);

2121  const bool

is_protein(

false

);

2126  const size_t

kNumQueries(2);

2129

BOOST_REQUIRE_EQUAL(kNumQueries, query_vector.size());

2130

BOOST_REQUIRE(

source

->End() ==

true

);

2134

BOOST_REQUIRE_EQUAL((

size_t

)0, (

size_t

)cached_queries.size());

2135

BOOST_REQUIRE(

source

->End() ==

true

);

2138

blast::SSeqLoc ssl = query_vector.front();

2141

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetStrand());

2143

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

2144

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

2147

ssl = query_vector.back();

2150

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetStrand());

2152

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

2153

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

2155

BOOST_REQUIRE(!ssl.mask);

2161  const char

* fname(

"data/nt.cat"

);

2162  const bool

is_protein(

false

);

2175  const

blast::SSeqLoc& ssl = *itr;

2176

BOOST_REQUIRE_EQUAL((

int

)strand, (

int

)ssl.seqloc->GetStrand());

2177

BOOST_REQUIRE_EQUAL((

int

)strand, (

int

)ssl.seqloc->GetInt().GetStrand());

2191  const

blast::SSeqLoc& ssl = *itr;

2192

BOOST_REQUIRE_EQUAL((

int

)strand, (

int

)ssl.seqloc->GetStrand());

2193

BOOST_REQUIRE_EQUAL((

int

)strand, (

int

)ssl.seqloc->GetInt().GetStrand());

2203  const bool

is_protein(

false

);

2213

blast::TSeqLocVector::iterator itr = seqs.begin();

2214

blast::SSeqLoc ssl = *itr;

2215

BOOST_REQUIRE(ssl.mask);

2216

BOOST_REQUIRE(ssl.mask->IsPacked_int());

2219

BOOST_REQUIRE_EQUAL((

size_t

)2, masklocs.size());

2220

BOOST_REQUIRE_EQUAL((

TSeqPos

)126, masklocs.front()->GetFrom());

2221

BOOST_REQUIRE_EQUAL((

TSeqPos

)167, masklocs.front()->GetTo());

2223

BOOST_REQUIRE(masklocs.front()->CanGetStrand());

2224

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_plus

, (

int

)masklocs.front()->GetStrand());

2226

BOOST_REQUIRE_EQUAL((

TSeqPos

)330, masklocs.back()->GetFrom());

2227

BOOST_REQUIRE_EQUAL((

TSeqPos

)356, masklocs.back()->GetTo());

2229

BOOST_REQUIRE(masklocs.back()->CanGetStrand());

2230

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_plus

, (

int

)masklocs.back()->GetStrand());

2233

BOOST_REQUIRE(ssl.mask);

2234

BOOST_REQUIRE(ssl.mask->IsNull());

2241  const bool

is_protein(

false

);

2248

BOOST_REQUIRE( !seqs->

Empty

() );

2249

BOOST_REQUIRE_EQUAL((

int

)2, (

int

)seqs->size());

2251

BOOST_REQUIRE( !

query

->GetMaskedRegions().empty());

2254  query

->GetMaskedRegions().ConvertToCPacked_seqint();

2256

CPacked_seqint::Tdata::const_iterator itr = masks->Get().begin();

2257

BOOST_REQUIRE_EQUAL((

size_t

)4, masklocs.size());

2261

BOOST_REQUIRE_EQUAL((

TSeqPos

)126, (*itr)->GetFrom());

2262

BOOST_REQUIRE_EQUAL((

TSeqPos

)167, (*itr)->GetTo());

2263

BOOST_REQUIRE((*itr)->CanGetStrand());

2264

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_plus

, (

int

)(*itr)->GetStrand());

2266

BOOST_REQUIRE_EQUAL((

TSeqPos

)126, (*itr)->GetFrom());

2267

BOOST_REQUIRE_EQUAL((

TSeqPos

)167, (*itr)->GetTo());

2268

BOOST_REQUIRE((*itr)->CanGetStrand());

2269

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_minus

, (

int

)(*itr)->GetStrand());

2272

BOOST_REQUIRE_EQUAL((

TSeqPos

)330, (*itr)->GetFrom());

2273

BOOST_REQUIRE_EQUAL((

TSeqPos

)356, (*itr)->GetTo());

2274

BOOST_REQUIRE((*itr)->CanGetStrand());

2275

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_plus

, (

int

)(*itr)->GetStrand());

2277

BOOST_REQUIRE_EQUAL((

TSeqPos

)330, (*itr)->GetFrom());

2278

BOOST_REQUIRE_EQUAL((

TSeqPos

)356, (*itr)->GetTo());

2279

BOOST_REQUIRE((*itr)->CanGetStrand());

2280

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_minus

, (

int

)(*itr)->GetStrand());

2283

BOOST_REQUIRE(itr == masks->Get().end());

2286

BOOST_REQUIRE(

query

->GetMaskedRegions().empty());

2293  const bool

is_protein(

true

);

2299

BOOST_REQUIRE(

source

->End());

2300

BOOST_REQUIRE_EQUAL((

size_t

)19, v.size());

2307  const bool

is_protein(

true

);

2311

iconfig.

SetRange

().SetFrom(start).SetTo(stop);

2319

BOOST_REQUIRE_EQUAL(start, itr->seqloc->GetInt().GetFrom());

2320

BOOST_REQUIRE_EQUAL(stop, itr->seqloc->GetInt().GetTo());

2328  const bool

is_protein(

true

);

2337

v =

source

->GetNextSeqLocBatch(scope);

2338

BOOST_REQUIRE_EQUAL((

size_t

)7, v.size());

2339

BOOST_REQUIRE_EQUAL((

TSeqPos

)530, v[0].seqloc->GetInt().GetTo());

2341  string

name =

"G11A_ORYSA"

;

2342  string

accession =

"P47997"

;

2343  string

release =

"reviewed"

;

2346

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, v[0].seqloc->GetInt().GetId().Which());

2347

BOOST_REQUIRE_EQUAL(gi, v[0].seqloc->GetInt().GetId().GetGi());

2348

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, v[0].seqloc->GetId()->Which());

2349

BOOST_REQUIRE_EQUAL(gi, v[0].seqloc->GetId()->GetGi());

2353

BOOST_REQUIRE_EQUAL(name, v[0].seqloc->GetInt().GetId().GetSwissprot().GetName());

2354

BOOST_REQUIRE_EQUAL(accession, v[0].seqloc->GetInt().GetId().GetSwissprot().GetAccession());

2355

BOOST_REQUIRE_EQUAL(release, v[0].seqloc->GetInt().GetId().GetSwissprot().GetRelease());

2357

BOOST_REQUIRE_EQUAL(name, v[0].seqloc->GetId()->GetSwissprot().GetName());

2358

BOOST_REQUIRE_EQUAL(accession, v[0].seqloc->GetId()->GetSwissprot().GetAccession());

2359

BOOST_REQUIRE_EQUAL(release, v[0].seqloc->GetId()->GetSwissprot().GetRelease());

2362

v =

source

->GetNextSeqLocBatch(scope);

2363

BOOST_REQUIRE_EQUAL((

size_t

)8, v.size());

2364

BOOST_REQUIRE_EQUAL((

TSeqPos

)445, v[0].seqloc->GetInt().GetTo());

2366

name =

"KCC1_YEAST"

;

2367

accession =

"P27466"

;

2368

release =

"reviewed"

;

2371

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, v[0].seqloc->GetInt().GetId().Which());

2372

BOOST_REQUIRE_EQUAL(gi, v[0].seqloc->GetInt().GetId().GetGi());

2373

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, v[0].seqloc->GetId()->Which());

2374

BOOST_REQUIRE_EQUAL(gi, v[0].seqloc->GetId()->GetGi());

2378

BOOST_REQUIRE_EQUAL(name, v[0].seqloc->GetInt().GetId().GetSwissprot().GetName());

2379

BOOST_REQUIRE_EQUAL(accession, v[0].seqloc->GetInt().GetId().GetSwissprot().GetAccession());

2380

BOOST_REQUIRE_EQUAL(release, v[0].seqloc->GetInt().GetId().GetSwissprot().GetRelease());

2382

BOOST_REQUIRE_EQUAL(name, v[0].seqloc->GetId()->GetSwissprot().GetName());

2383

BOOST_REQUIRE_EQUAL(accession, v[0].seqloc->GetId()->GetSwissprot().GetAccession());

2384

BOOST_REQUIRE_EQUAL(release, v[0].seqloc->GetId()->GetSwissprot().GetRelease());

2387

v =

source

->GetNextSeqLocBatch(scope);

2388

BOOST_REQUIRE_EQUAL((

size_t

)4, v.size());

2389

BOOST_REQUIRE_EQUAL((

TSeqPos

)688, v[0].seqloc->GetInt().GetTo());

2391

name =

"ARK1_HUMAN"

;

2392

accession =

"P25098"

;

2393

release =

"reviewed"

;

2396

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, v[0].seqloc->GetInt().GetId().Which());

2397

BOOST_REQUIRE_EQUAL(gi, v[0].seqloc->GetInt().GetId().GetGi());

2398

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Gi

, v[0].seqloc->GetId()->Which());

2399

BOOST_REQUIRE_EQUAL(gi, v[0].seqloc->GetId()->GetGi());

2403

BOOST_REQUIRE_EQUAL(name, v[0].seqloc->GetInt().GetId().GetSwissprot().GetName());

2404

BOOST_REQUIRE_EQUAL(accession, v[0].seqloc->GetInt().GetId().GetSwissprot().GetAccession());

2405

BOOST_REQUIRE_EQUAL(release, v[0].seqloc->GetInt().GetId().GetSwissprot().GetRelease());

2407

BOOST_REQUIRE_EQUAL(name, v[0].seqloc->GetId()->GetSwissprot().GetName());

2408

BOOST_REQUIRE_EQUAL(accession, v[0].seqloc->GetId()->GetSwissprot().GetAccession());

2409

BOOST_REQUIRE_EQUAL(release, v[0].seqloc->GetId()->GetSwissprot().GetRelease());

2412

BOOST_REQUIRE(

source

->End());

2419  const bool

is_protein(

false

);

2425

BOOST_REQUIRE(

source

->End());

2426

BOOST_REQUIRE_EQUAL((

size_t

)1, v.size());

2433  const bool

is_protein(

false

);

2443  string input

(

"gb|ABZI01000088\ngb|ABZN01000067"

);

2444

istringstream instream(

input

);

2446  const bool

is_protein(

false

);

2452

BOOST_REQUIRE(

source

->End() ==

false

);

2454

BOOST_REQUIRE(

source

->End() ==

true

);

2455

BOOST_REQUIRE_EQUAL(2u, seqs.size());

2462  string input

(

"gb|ABZN01000067\ngb|ABZI01000088"

);

2463

istringstream instream(

input

);

2465  const bool

is_protein(

false

);

2471

BOOST_REQUIRE(

source

->End() ==

false

);

2473

BOOST_REQUIRE(

source

->End() ==

true

);

2474

BOOST_REQUIRE_EQUAL(2u, seqs.size());

2481  string input

(

"gb|ABZN01000067"

);

2483

istringstream instream(

input

);

2485  const bool

is_protein(

false

);

2491

BOOST_REQUIRE(

source

->End() ==

false

);

2493

BOOST_REQUIRE(

source

->End() ==

true

);

2494

BOOST_REQUIRE_EQUAL(1u, seqs.size());

2501  string input

(

"gb|ABZI01000088"

);

2503

istringstream instream(

input

);

2505  const bool

is_protein(

false

);

2511

BOOST_REQUIRE(

source

->End() ==

false

);

2513

BOOST_REQUIRE(

source

->End() ==

true

);

2514

BOOST_REQUIRE_EQUAL(1u, seqs.size());

2521  string

pdb_mol(

"1QCF"

);

2522  string

pdb_chain(

"A"

);

2523  string

pdb(pdb_mol +

'_'

+ pdb_chain);

2524

istringstream instream(pdb);

2526  const bool

is_protein(

true

);

2532

BOOST_REQUIRE(

source

->End() ==

false

);

2534

blast::SSeqLoc ssl = seqs.front();

2536

BOOST_REQUIRE(

source

->End() ==

true

);

2538

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

2540

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

2541

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_unknown

, (

int

)ssl.seqloc->GetInt().GetStrand());

2543

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

2544

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

2546

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

2548

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

2550

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

2551

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Pdb

, ssl.seqloc->GetInt().GetId().Which());

2553

BOOST_REQUIRE_EQUAL(pdb_mol, ssl.seqloc->GetInt().GetId().GetPdb().GetMol().Get());

2555

BOOST_REQUIRE(!ssl.mask);

2559

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

2560

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

2562

BOOST_REQUIRE(!

b

.IsNa());

2564

BOOST_REQUIRE_EQUAL(pdb_mol,

b

.GetId().front()->GetPdb().GetMol().Get());

2567

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

2573  string

wgs_master(

"NZ_ABFD00000000.2"

);

2574

istringstream instream(wgs_master);

2576  const bool

is_protein(

false

);

2588  const bool

is_protein(

false

);

2596

blast::SSeqLoc ssl = seqs.front();

2597

BOOST_CHECK(

source

->End() ==

true

);

2601  const string

kSeqData =

2602  "AGCACCACGACTGCTAACCGTAACGCCAGGTGTATAACCTAATGCTTCTTTACAGACTGAAATTGATGCATCTGCATCTC" 2603  "TTCATTTGTCACAACCGAAATA"

;

2605

BOOST_CHECK(ssl.seqloc->IsInt());

2606

BOOST_REQUIRE(ssl.seqloc->GetId()->IsGeneral());

2608

ssl.seqloc->GetId()->GetGeneral().GetType());

2610

BOOST_CHECK(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

2611

BOOST_CHECK_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

2613

BOOST_CHECK(ssl.seqloc->GetInt().IsSetTo() ==

true

);

2614

BOOST_CHECK_EQUAL(kSeqData.size()-1, ssl.seqloc->GetInt().GetTo());

2616  const CSeq_id

* seqid = ssl.seqloc->GetId();

2620

BOOST_CHECK_EQUAL(kSeqData.size(), sv.

size

());

2623

oss <<

"Base number "

<<

i

+1 <<

" differs: got '" 2624

<< (char)sv[

i

] <<

"', expected '"

<< kSeqData[

i

]

2627

BOOST_CHECK_MESSAGE((

char

)sv[

i

] == kSeqData[

i

],

msg

);

2628

BOOST_CHECK_NE(

'-'

, (

char

)sv[

i

]);

2634

BOOST_CHECK_EQUAL(inst.

GetLength

(), kSeqData.size());

2639  for

(

size_t i

= 0;

i

< seq.size();

i

++) {

2641

oss <<

"Base number "

<<

i

+1 <<

" differs: got '" 2642

<< (char)sv[

i

] <<

"', expected '"

<< kSeqData[

i

]

2645

BOOST_CHECK_MESSAGE((

char

)sv[

i

] == kSeqData[

i

],

msg

);

2646

BOOST_CHECK_NE(

'-'

, (

char

)seq[

i

]);

2653  string

pdb_mol(

"1IQR"

);

2654  string

pdb_chain(

"A"

);

2656  for

(

int i

= 0;

i

< 2;

i

++) {

2660

pdb.assign(pdb_mol +

'|'

+ pdb_chain);

2662

pdb.assign(pdb_mol +

"_"

+ pdb_chain);

2664

istringstream instream(pdb);

2666  const bool

is_protein(

true

);

2672

BOOST_REQUIRE(

source

->End() ==

false

);

2674

blast::SSeqLoc ssl = seqs.front();

2675

BOOST_REQUIRE(

source

->End() ==

true

);

2677

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

2679

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

2680

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_unknown

, (

int

)ssl.seqloc->GetInt().GetStrand());

2682

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

2683

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

2685

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

2687

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

2689

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

2690

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Pdb

, ssl.seqloc->GetInt().GetId().Which());

2692

BOOST_REQUIRE_EQUAL(pdb_mol,

2693

ssl.seqloc->GetInt().GetId().GetPdb().GetMol().Get());

2695

BOOST_REQUIRE(!ssl.mask);

2699

BOOST_REQUIRE_EQUAL((

size_t

)1, bioseqs->

GetSeq_set

().size());

2700

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

2702

BOOST_REQUIRE(!

b

.IsNa());

2704

BOOST_REQUIRE_EQUAL(pdb_mol,

b

.GetId().front()->GetPdb().GetMol().Get());

2707

BOOST_REQUIRE_EQUAL(length,

b

.GetInst().GetLength());

2719  const bool

is_protein(

false

);

2724

BOOST_REQUIRE(

source

->End() ==

false

);

2726

blast::SSeqLoc ssl = seqs.front();

2727

BOOST_REQUIRE(

source

->End() ==

true

);

2729

BOOST_REQUIRE(ssl.seqloc->IsInt() ==

true

);

2732

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetStrand() ==

true

);

2733

BOOST_REQUIRE_EQUAL((

int

)

eNa_strand_both

, (

int

)ssl.seqloc->GetInt().GetStrand());

2735

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetFrom() ==

true

);

2736

BOOST_REQUIRE_EQUAL((

TSeqPos

)0, ssl.seqloc->GetInt().GetFrom());

2738

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetTo() ==

true

);

2740

BOOST_REQUIRE_EQUAL(length-1, ssl.seqloc->GetInt().GetTo());

2742

BOOST_REQUIRE(ssl.seqloc->GetInt().IsSetId() ==

true

);

2743

BOOST_REQUIRE_EQUAL(

CSeq_id::e_Local

, ssl.seqloc->GetInt().GetId().Which());

2744

BOOST_REQUIRE(!ssl.mask);

2748

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->IsSeq());

2749

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->GetSeq().CanGetInst());

2750

BOOST_REQUIRE(bioseqs->

GetSeq_set

().front()->GetSeq().GetInst().CanGetRepr());

2752

bioseqs->

GetSeq_set

().front()->GetSeq().GetInst().GetRepr());

2756 template

<

typename

T>

2803

BOOST_REQUIRE_EQUAL(0

U

,

r

.GetFrom());

2804

BOOST_REQUIRE_EQUAL(9U,

r

.GetTo());

2805

BOOST_REQUIRE_EQUAL(10U,

r

.GetToOpen());

2817  "ref|NT_026437.13|"

:

"gi|568802206"

);

2818  const string input

(

"NT_026437.13"

);

2819  typedef

vector<pair<SDataLoaderConfig::EConfigOpts, string> > TVecOpts;

2825

blast::SDataLoaderConfig dlconfig(

false

);

2826  if

(

config

->second ==

"BLASTDB"

) {

2827

dlconfig.m_BlastDbName =

"9606_genomic"

;

2829

dlconfig.OptimizeForWholeLargeSequenceRetrieval();

2830

blast::CBlastInputSourceConfig input_config(dlconfig);

2838

BOOST_REQUIRE_EQUAL(1U, query_loc.size());

2839  string

fasta_id =

id

.AsFastaString();

2840  string

fasta_query = query_loc[0].seqloc->GetId()->AsFastaString();

2841  if

(fasta_id != fasta_query) {

2842

BOOST_CHECK_EQUAL(fasta_id, fasta_query);

2843

BOOST_CHECK_MESSAGE(fasta_id == fasta_query,

2844  "Failed using "

+

config

->second +

" data loader"

);

2861

BOOST_REQUIRE(bioseq.IsSetDescr());

2862  for

(

auto

desc : bioseq.GetDescr().Get()) {

2865  if

(!desc->GetUser().IsSetType() ||

2866

!desc->GetUser().GetType().IsStr() ||

2867

desc->GetUser().GetType().GetStr() !=

"Mapping"

) {

2871

BOOST_REQUIRE(desc->GetUser().HasField(

"has_pair"

));

2887  if

(it->IsTitle()) {

2888

vector<string> tokens;

2890

retval = (

string

)

"lcl|"

+ tokens[0];

2895  if

(retval.empty()) {

2906

BOOST_REQUIRE(istr);

2907

unordered_map<string, int> ref_flags = {

2923  input

.GetNextSeqBatch(*queries);

2924

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

2932

BOOST_REQUIRE_MESSAGE(

flags

==

expected

, (

string

)

"Segment flag for "

+

2933  id

+

" is different from expected "

+

2939

BOOST_REQUIRE_EQUAL(ref_flags.size(),

count

);

2946

BOOST_REQUIRE(istr1);

2947

BOOST_REQUIRE(istr2);

2948

unordered_map<string, int> ref_flags = {

2963  input

.GetNextSeqBatch(*queries);

2964

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

2972

BOOST_REQUIRE_MESSAGE(

flags

==

expected

, (

string

)

"Segment flag for "

+

2973  id

+

" is different from expected "

+

2979

BOOST_REQUIRE_EQUAL(ref_flags.size(),

count

);

2991  input

.GetNextSeqBatch(*queries);

2992

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

2996  if

(it->GetSeq().IsSetDescr()) {

3003

(

string

)

"Segment flag for "

+

3004  id

+

" is different from expected "

+

3011

BOOST_REQUIRE_EQUAL(6u,

count

);

3017

BOOST_REQUIRE(istr);

3018

unordered_map<string, int> ref_flags = {

3033  input

.GetNextSeqBatch(*queries);

3034

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

3042

BOOST_REQUIRE_MESSAGE(

flags

==

expected

, (

string

)

"Segment flag for "

+

3043  id

+

" is different from expected "

+

3049

BOOST_REQUIRE_EQUAL(ref_flags.size(),

count

);

3056

BOOST_REQUIRE(istr1);

3057

BOOST_REQUIRE(istr2);

3058

unordered_map<string, int> ref_flags = {

3072  input

.GetNextSeqBatch(*queries);

3073

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

3081

BOOST_REQUIRE_MESSAGE(

flags

==

expected

, (

string

)

"Segment flag for "

+

3082  id

+

" is different from expected "

+

3088

BOOST_REQUIRE_EQUAL(ref_flags.size(),

count

);

3095

BOOST_REQUIRE(istr);

3096

unordered_map<string, int> ref_flags = {

3108  input

.GetNextSeqBatch(*queries);

3109

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

3113  string id

= it->GetSeq().GetFirstId()->AsFastaString();

3117

BOOST_REQUIRE_MESSAGE(

flags

==

expected

, (

string

)

"Segment flag for "

+

3118  id

+

" is different from expected "

+

3124

BOOST_REQUIRE_EQUAL(ref_flags.size(),

count

);

3131

BOOST_REQUIRE(istr1);

3132

BOOST_REQUIRE(istr2);

3133

unordered_map<string, int> ref_flags = {

3145  input

.GetNextSeqBatch(*queries);

3148

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

3152  string id

= it->GetSeq().GetFirstId()->AsFastaString();

3156

BOOST_REQUIRE_MESSAGE(

flags

==

expected

, (

string

)

"Segment flag for "

+

3157  id

+

" is different from expected "

+

3163

BOOST_REQUIRE_EQUAL(ref_flags.size(),

count

);

3170

BOOST_REQUIRE(istr);

3171

unordered_map<string, int> ref_flags = {

3184  input

.GetNextSeqBatch(*queries);

3185

BOOST_REQUIRE_EQUAL(queries->

GetSeq_set

().size(), 6u);

3193

BOOST_REQUIRE_MESSAGE(

flags

==

expected

, (

string

)

"Segment flag for "

+

3194  id

+

" is different from expected "

+

3200

BOOST_REQUIRE_EQUAL(ref_flags.size(),

count

);

3213

CString2Args(

const string

& cmd_line_args) {

3214

x_Init(cmd_line_args);

3221  void

Reset(

const string

& cmd_line_args) {

3223

x_Init(cmd_line_args);

3229  return

arg_desc->CreateArgs(ncbi_args);

3235  struct

empty_string_remover

3237  bool

operator() (

const string

&

str

) {

3238  return str

.empty();

3243 

vector<string> x_TokenizeCmdLine(

const string

& cmd_line_args) {

3244

vector<string> retval;

3246

vector<string>::iterator new_end =

remove_if

(retval.begin(),

3248

empty_string_remover());

3249

retval.erase(new_end, retval.end());

3254  char

* x_ToCString(

const string

&

str

) {

3255  char

* retval =

new char

[

str

.size()+1];

3256

strncpy(retval,

str

.c_str(),

str

.size());

3257

retval[

str

.size()] =

'\0'

;

3262  for

(

size_t i

= 0;

i

< m_Argc;

i

++) {

3263  delete

[] m_Argv[

i

];

3268  void

x_Init(

const string

& cmd_line_args) {

3269  const string

program_name(

"./blastinput_unit_test"

);

3270

vector<string> args = x_TokenizeCmdLine(cmd_line_args);

3271

m_Argc = args.size() + 1;

3272

m_Argv =

new char

*[m_Argc];

3273

m_Argv[0] = x_ToCString(program_name);

3274  for

(

size_t i

= 0;

i

< args.size();

i

++) {

3275

m_Argv[

i

+1] = x_ToCString(args[

i

]);

3288

CString2Args s2a(

"-matrix BLOSUM80 -db ecoli "

);

3289

unique_ptr<CArgs> args(s2a.CreateCArgs(psiblast_args));

3299

CString2Args s2a(

"-db ecoli "

);

3300

unique_ptr<CArgs> args(s2a.CreateCArgs(rpsblast_args));

3308

CString2Args s2a(

"-remote -num_threads 2"

);

3310  typedef

vector< CRef<CBlastAppArgs> > TArgClasses;

3311

vector< CRef<CBlastAppArgs> > arg_classes;

3320

unique_ptr<CArgs> args;

3321

BOOST_REQUIRE_THROW(args.reset(s2a.CreateCArgs(**itr)),

3327

unique_ptr<CArgs> args;

3331

CString2Args s2a(

"-db ecoli -template_type coding "

);

3332

BOOST_REQUIRE_THROW(args.reset(s2a.CreateCArgs(blastn_args)),

3335

s2a.Reset(

"-db ecoli -template_length 21 "

);

3336

BOOST_REQUIRE_THROW(args.reset(s2a.CreateCArgs(blastn_args)),

3340

s2a.Reset(

"-db ecoli -template_type coding -template_length 16"

);

3341

BOOST_REQUIRE_NO_THROW(args.reset(s2a.CreateCArgs(blastn_args)));

3344

s2a.Reset(

"-db ecoli -word_size 32 -template_type optimal -template_length 16"

);

3345

BOOST_REQUIRE_NO_THROW(args.reset(s2a.CreateCArgs(blastn_args)));

3351

unique_ptr<CArgs> args;

3355

CString2Args s2a(

"-db ecoli -perc_identity 104.3"

);

3356

BOOST_REQUIRE_THROW(args.reset(s2a.CreateCArgs(blast_args)),

3360

s2a.Reset(

"-db ecoli -perc_identity 75.0 "

);

3361

BOOST_REQUIRE_NO_THROW(args.reset(s2a.CreateCArgs(blast_args)));

3365

unique_ptr<CArgs> args;

3368

CString2Args s2a(

"-db ecoli -no_greedy"

);

3369

BOOST_REQUIRE_NO_THROW(args.reset(s2a.CreateCArgs(blast_args)));

3377  typedef

vector< CRef<CBlastAppArgs> > TArgClasses;

3378

vector< CRef<CBlastAppArgs> > arg_classes;

3387

unique_ptr<CArgs> args;

3389

CString2Args s2a(

"-db ecoli -culling_limit -4"

);

3390

BOOST_REQUIRE_THROW(args.reset(s2a.CreateCArgs(**itr)),

3394

s2a.Reset(

"-db ecoli -culling_limit 0"

);

3395

BOOST_REQUIRE_NO_THROW(args.reset(s2a.CreateCArgs(**itr)));

3416

unique_ptr<CArgs> args;

3420

CString2Args s2a(

"-db ecoli -qcov_hsp_perc 100.3"

);

3421

BOOST_REQUIRE_THROW(args.reset(s2a.CreateCArgs(blast_args)),

3425

s2a.Reset(

"-db ecoli -qcov_hsp_perc 15"

);

3426

BOOST_REQUIRE_NO_THROW(args.reset(s2a.CreateCArgs(blast_args)));

3430

unique_ptr<CArgs> args;

3434

CString2Args s2a(

"-db ecoli -max_hsps 0"

);

3435

BOOST_REQUIRE_THROW(args.reset(s2a.CreateCArgs(blast_args)),

3439

s2a.Reset(

"-db ecoli -max_hsps 5"

);

3440

BOOST_REQUIRE_NO_THROW(args.reset(s2a.CreateCArgs(blast_args)));

User-defined methods of the data storage class.

@ eExtreme_Positional

numerical value

static const char * kFileName

Interface for reading SRA sequences into blast input.

Interface for converting sources of sequence data into blast sequence input.

Auxiliary classes/functions for BLAST input library.

void CheckForEmptySequences(const TSeqLocVector &sequences, string &warnings)

Inspect the sequences parameter for empty sequences.

TSeqRange ParseSequenceRange(const string &range_str, const char *error_prefix=NULL)

Parse and extract a sequence range from argument provided to this function.

int GetQueryBatchSize(EProgram program, bool is_ungapped=false, bool remote=false, bool use_default=true, string task="", bool mt_mode=false)

Retrieve the appropriate batch size for the specified task.

Declares the CAutoNcbiConfigFile class.

Definitions and functions associated with the BlastQueryInfo structure.

@ eFirstSegment

The first sequence of a pair with both sequences read and accepted.

@ eBlastn

Nucl-Nucl (traditional blastn)

static CRef< CBlastInput > s_DeclareBlastInput(CNcbiIstream &input_file, const CBlastInputSourceConfig &iconfig, int batch_size=kMax_Int)

static string * s_FileContents2String(const char *file_name)

static string s_GetSequenceId(const CBioseq &bioseq)

BOOST_AUTO_TEST_CASE(ReadAccession_MismatchNuclProt)

BOOST_AUTO_TEST_CASE_TIMEOUT(ReadSingleAccession_RetrieveLargeSequence, kTimeOutLargeSeq)

BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)

static void s_ReadAndTestQueryFromString(const string &input, TSeqPos expected_length, bool is_protein)

const int kTimeOutLargeSeq

static void s_ReadAndTestQueryFromString_CFastaReader(const string &input, TSeqPos expected_length)

const int kTimeOutLargeSeqWithRange

Main argument class for BLASTN application.

Main argument class for BLASTP application.

static int s_GetSegmentFlags(const CBioseq &bioseq)

Main argument class for BLASTX application.

void remove_if(Container &c, Predicate *__pred)

Class representing a text or binary file containing sequences in ASN.1 format as a collection of Seq-...

CAutoEnvironmentVariable –.

Auxiliary class to write temporary NCBI configuration files in the local directory for the purpose of...

const CSeq_id * GetFirstId() const

TSeqPos GetLength(void) const

Base command line argument class for a generic BLAST command line binary.

CRef< CBlastOptionsHandle > SetOptions(const CArgs &args)

Extract the command line arguments into a CBlastOptionsHandle object.

CArgDescriptions * SetCommandLine()

Set the command line arguments.

Defines BLAST error codes (user errors included)

Class representing a text file containing sequences in fasta format.

Class that centralizes the configuration data for sequences to be converted.

void SetRetrieveSeqData(bool value)

Turn on or off the retrieval of sequence data.

void SetLowercaseMask(bool mask)

Turn lowercase masking on/off.

void SetRange(const TSeqRange &r)

Set range for all sequences.

objects::ENa_strand GetStrand() const

Retrieve the current strand value.

void SetBelieveDeflines(bool believe)

Turn parsing of sequence IDs on/off.

void SetSeqLenThreshold2Guess(unsigned int val)

Set the sequence length threshold to guess the molecule type.

void SetStrand(objects::ENa_strand strand)

Set the strand to a specified value.

bool GetBelieveDeflines() const

Retrieve current sequence ID parsing status.

SDataLoaderConfig & SetDataLoaderConfig()

Retrieve the data loader configuration object for manipulation.

bool GetLowercaseMask() const

Retrieve lowercase mask status.

Generalized converter from an abstract source of biological sequence data to collections of blast inp...

TSeqLocVector GetAllSeqLocs(CScope &scope)

Read and convert all the sequences from the source.

Class whose purpose is to create CScope objects which have data loaders added with different prioriti...

CRef< objects::CScope > NewScope()

Create a new, properly configured CScope.

Handles command line arguments for blastn binary.

Handles command line arguments for blastp binary.

Handles command line arguments for blastx binary.

Base class for reading FASTA sequences.

Defines user input exceptions.

@ eInvalidStrand

Invalid strand specification.

@ eSequenceMismatch

Expected sequence type isn't what was expected.

@ eInvalidRange

Invalid range specification.

@ eEmptyUserInput

No input was provided.

@ eSeqIdNotFound

The sequence ID cannot be resolved.

Simple implementation of ILineReader for regions of memory (such as memory-mapped files).

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

Handle command line arguments for psiblast binary Programs supported: psiblast, phi-blastn,...

Handles command line arguments for blastp binary.

Argument class to specify the supported tasks a given program.

Handles command line arguments for Tblastn binary.

Handles command line arguments for blastx binary.

const CUser_field & GetField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const

Access a named field in this user field.

@ eProblem_ModifierFoundButNoneExpected

std::ofstream out("events_result.xml")

main entry point for tests

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

static const char * expected[]

static const char * str(char *buf, int n)

CRef< objects::CBioseq_set > TSeqLocVector2Bioseqs(const TSeqLocVector &input)

Convert a TSeqLocVector to a CBioseq_set.

bool IsLocalId(const objects::CSeq_id *seqid)

Returns true if the CSeq_id is a local id.

static set< string > GetTasks(ETaskSets choice=eAll)

Retrieve the set of supported tasks.

const CBlastOptions & GetOptions() const

Return the object which this object is a handle for.

ECompoAdjustModes GetCompositionBasedStats() const

bool GetSegFiltering() const

const char * GetMatrixName() const

@ eProtProt

Protein-protein tasks.

@ eNuclNucl

Nucleotide-nucleotide tasks.

#define GI_FROM(T, value)

unsigned int TSeqPos

Type for sequence locations and lengths.

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)

Set the threshold severity for posting the messages.

void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")

Set diagnostic stream.

@ eDiag_Warning

Warning message.

void Set(const string &name, const string &value)

Set an environment variable by name.

TErrCode GetErrCode(void) const

Get error code.

virtual const char * what(void) const noexcept

Standard report (includes full backlog).

const string & GetFileName(void) const

Return used file name (generated or given in the constructor).

const TPrim & Get(void) const

virtual CRef< CSeq_entry > ReadOneSeq(ILineErrorListener *pMessageListener=nullptr)

Read a single effective sequence, which may turn out to be a segmented set.

CSeqIdGenerator & SetIDGenerator(void)

long TFlags

binary OR of EFlags

void IgnoreProblem(ILineError::EProblem problem)

@ fNoParseID

Generate an ID (whole defline -> title)

@ fQuickIDCheck

Just check local IDs' first characters.

@ fDLOptional

Don't require a leading defline.

@ fHyphensIgnoreAndWarn

When a hyphen is encountered in seq data, ignore it but warn.

@ fDisableNoResidues

If no residues found do not raise an error.

@ fNoSplit

Don't split out ambiguous sequence regions.

@ fAssumeNuc

Assume nucs unless accns indicate otherwise.

const string AsFastaString(void) const

static int BestRank(const CRef< CSeq_id > &id)

static bool PreferAccessionOverGi(void)

Check if the option to prefer accession.version over GI is enabled (SeqId/PreferAccessionOverGi or SE...

@ eFormat

Contents not parsable as expected.

const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)

If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...

TSeqPos GetLength(const CSeq_id &id, CScope *scope)

Get sequence length if scope not null, else return max possible TSeqPos.

static CRef< CObjectManager > GetInstance(void)

Return the existing object manager or create one.

void RevokeAllDataLoaders(void)

Revoke all registered data loaders, even if they were still used.

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

CObjectManager & GetObjectManager(void)

Get object manager controlling this scope.

CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const

Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.

@ eCoding_Iupac

Set coding to printable coding (Iupacna or Iupacaa)

bool IsProtein(void) const

void SetIupacCoding(void)

Set coding to either Iupacaa or Iupacna depending on molecule type.

void Reset(void)

Reset reference object.

bool NotEmpty(void) const THROWS_NONE

Check if CRef is not empty – pointing to an object and has a non-null value.

bool Empty(void) const THROWS_NONE

Check if CRef is empty – not pointing to any object, which means having a null value.

IO_PREFIX::ofstream CNcbiOfstream

Portable alias for ofstream.

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)

Find the pattern in the string.

static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)

Replace occurrences of a substring within a string.

@ fConvErr_NoThrow

Do not throw an exception on error.

C::value_type FindBestChoice(const C &container, F score_func)

Find the best choice (lowest score) for values in a container.

X * NotNull(X *object)

Check for not null value (after C malloc, strdup etc.).

const TTag & GetTag(void) const

Get the Tag member data.

const TData & GetData(void) const

Get the Data member data.

const TDb & GetDb(void) const

Get the Db member data.

bool IsInt(void) const

Check if variant Int is selected.

TInt GetInt(void) const

Get the variant data.

TId GetId(void) const

Get the variant data.

const TGenbank & GetGenbank(void) const

Get the variant data.

const TName & GetName(void) const

Get the Name member data.

list< CRef< CSeq_interval > > Tdata

ENa_strand

strand of nucleic acid

const TId & GetId(void) const

Get the Id member data.

E_Choice Which(void) const

Which variant is currently selected.

TGi GetGi(void) const

Get the variant data.

TVersion GetVersion(void) const

Get the Version member data.

const TGeneral & GetGeneral(void) const

Get the variant data.

bool IsSetId(void) const

WARNING: this used to be optional Check if a value has been assigned to Id data member.

TTo GetTo(void) const

Get the To member data.

const TAccession & GetAccession(void) const

Get the Accession member data.

@ eNa_strand_both

in forward orientation

@ e_Other

for historical reasons, 'other' = 'refseq'

@ e_General

for other databases

@ e_Gi

GenInfo Integrated Database.

const TSeq & GetSeq(void) const

Get the variant data.

bool CanGetSeq_set(void) const

Check if it is safe to call GetSeq_set method.

const TSeq_set & GetSeq_set(void) const

Get the Seq_set member data.

list< CRef< CSeqdesc > > Tdata

bool IsSetSeq_data(void) const

the sequence Check if a value has been assigned to Seq_data data member.

bool IsNcbieaa(void) const

Check if variant Ncbieaa is selected.

const TInst & GetInst(void) const

Get the Inst member data.

const TIupacna & GetIupacna(void) const

Get the variant data.

const TTitle & GetTitle(void) const

Get the variant data.

const Tdata & Get(void) const

Get the member data.

TLength GetLength(void) const

Get the Length member data.

list< CRef< CSeq_id > > TId

const TNcbieaa & GetNcbieaa(void) const

Get the variant data.

bool IsSetDescr(void) const

descriptors Check if a value has been assigned to Descr data member.

EMol

molecule class in living organism

bool IsTitle(void) const

Check if variant Title is selected.

const TSeq_data & GetSeq_data(void) const

Get the Seq_data member data.

const TDescr & GetDescr(void) const

Get the Descr member data.

bool IsIupacna(void) const

Check if variant Iupacna is selected.

@ eRepr_delta

sequence made by changes (delta) to others

@ eRepr_raw

continuous sequence

@ e_User

user defined object

constexpr bool empty(list< Ts... >) noexcept

const string version

version string

double value_type

The numeric datatype used by the parser.

const CharType(& source)[N]

Defines unified interface to application:

double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)

Main argument class for PSI-BLAST application.

BOOST_AUTO_TEST_SUITE(psiblast_iteration)

Main argument class for RPSBLAST application.

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

CRef< objects::CObjectManager > om

Definition of SSeqLoc structure.

vector< SSeqLoc > TSeqLocVector

Vector of sequence locations.

Configuration structure for the CBlastScopeSource.

string m_BlastDbName

Name of the BLAST database to use (non-empty if m_UseBlastDbs is true)

void OptimizeForWholeLargeSequenceRetrieval(bool value=true)

Configures the BLAST database data loader to optimize the retrieval of *entire* large sequences.

@ eUseBlastDbDataLoader

Use the local BLAST database loader first, if this fails, use the remote BLAST database data loader.

@ eUseGenbankDataLoader

Use the Genbank data loader.

SDubiousShortSequence(const string &seq, CSeq_inst::EMol mol_type)

TSeqPos GetLength() const

Main argument class for TBLASTN application.

Main argument class for TBLASTX application.

Utility stuff for more convenient using of Boost.Test library.

static string kStart("Start")


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4