94 #ifdef HAVE_LIBSQLITE3
96 #elif defined(HAVE_LDS2)
122 virtual void Init(
void);
123 virtual int Run (
void);
124 virtual void Exit(
void);
133 # define eGi eInteger
134 # define AsGi AsInteger
148 arg_desc->AddOptionalKey(
"gi",
"SeqEntryID",
149 "GI id of the Seq-Entry to fetch",
151 arg_desc->AddOptionalKey(
"id",
"SeqEntryID",
152 "Seq-id of the Seq-Entry to fetch",
154 arg_desc->AddOptionalKey(
"asn_id",
"SeqEntryID",
155 "ASN.1 of Seq-id of the Seq-Entry to fetch",
157 arg_desc->AddOptionalKey(
"blob_id",
"BlobId",
158 "sat/satkey of Genbank entry to load",
160 arg_desc->AddOptionalKey(
"file",
"SeqEntryFile",
161 "file with Seq-entry to load (text ASN.1)",
163 arg_desc->AddOptionalKey(
"bfile",
"SeqEntryFile",
164 "file with Seq-entry to load (binary ASN.1)",
167 arg_desc->AddOptionalKey(
"annot_file",
"SeqAnnotFile",
168 "file with Seq-annot to load (text ASN.1)",
170 arg_desc->AddOptionalKey(
"annot_bfile",
"SeqAnnotFile",
171 "file with Seq-annot to load (binary ASN.1)",
173 arg_desc->AddOptionalKey(
"bioseq_file",
"SeqAnnotFile",
174 "file with Bioseq to load (text ASN.1)",
176 arg_desc->AddOptionalKey(
"bioseq_bfile",
"SeqAnnotFile",
177 "file with Bioseq to load (binary ASN.1)",
179 arg_desc->AddOptionalKey(
"submit_file",
"SeqSubmitFile",
180 "file with Seq-submit to load (text ASN.1)",
182 arg_desc->AddOptionalKey(
"submit_bfile",
"SeqSubmitFile",
183 "file with Seq-submit to load (binary ASN.1)",
185 arg_desc->AddOptionalKey(
"align_file",
"SeqAlignFile",
186 "file with Seq-aligns to load (text ASN.1)",
188 arg_desc->AddOptionalKey(
"align_bfile",
"SeqAlignFile",
189 "file with Seq-aligns to load (binary ASN.1)",
191 arg_desc->AddDefaultKey(
"count",
"RepeatCount",
192 "repeat test work RepeatCount times",
194 arg_desc->AddDefaultKey(
"pause",
"Pause",
195 "pause between tests in seconds",
197 arg_desc->AddFlag(
"pause_key",
"pause and wait for ENTER between tests");
199 arg_desc->AddDefaultKey(
"resolve",
"ResolveMethod",
200 "Method of segments resolution",
202 arg_desc->SetConstraint(
"resolve",
204 "none",
"tse",
"all"));
205 arg_desc->AddDefaultKey(
"missing",
"UnresolvableIdMethod",
206 "Method of treating unresolvable ids",
208 arg_desc->SetConstraint(
"missing",
210 "ignore",
"search",
"fail"));
211 arg_desc->AddOptionalKey(
"snp_scale",
"SNPScaleLimit",
214 arg_desc->SetConstraint(
"snp_scale",
216 "unit",
"contig",
"supercontig",
"chromosome"));
218 arg_desc->AddFlag(
"limit_tse",
"Limit annotations from sequence TSE only");
219 arg_desc->AddFlag(
"externals",
"Search for external features only");
221 arg_desc->AddOptionalKey(
"loader",
"Loader",
222 "Use specified GenBank loader readers (\"-\" means no GenBank",
224 arg_desc->AddOptionalKey(
"WebCubbyUser",
"WebCubbyUser",
225 "Set WebCubbyUser for authorized access",
228 arg_desc->AddOptionalKey(
"lds_dir",
"LDSDir",
229 "Use local data storage loader from the specified firectory",
231 arg_desc->AddOptionalKey(
"lds_db",
"LDSDB",
232 "Use local data storage loader from the specified LDS2 DB",
235 arg_desc->AddOptionalKey(
"blast",
"Blast",
236 "Use BLAST data loader from the specified DB",
238 arg_desc->AddOptionalKey(
"blast_type",
"BlastType",
239 "Use BLAST data loader type (default: eUnknown)",
241 arg_desc->SetConstraint(
"blast_type",
243 "protein",
"p",
"nucleotide",
"n"));
244 arg_desc->AddOptionalKey(
"csra",
"cSRA",
245 "Add cSRA accessions (comma separated)",
254 arg_desc->AddOptionalKey(
"bam",
"BAM",
257 arg_desc->AddOptionalKey(
"mapfile",
"BAMMapFile",
258 "BAM Seq-id map file",
260 arg_desc->AddOptionalKey(
"other_loaders",
"OtherLoaders",
261 "Extra data loaders as plugins (comma separated)",
264 arg_desc->AddFlag(
"get_ids",
"Get sequence ids");
265 arg_desc->AddFlag(
"get_synonyms",
"Get sequence synonyms ids");
266 arg_desc->AddFlag(
"get_blob_id",
"Get sequence blob id");
267 arg_desc->AddFlag(
"get_gi",
"Get sequence gi");
268 arg_desc->AddFlag(
"get_acc",
"Get sequence accession");
269 arg_desc->AddFlag(
"get_label",
"Get Label");
270 arg_desc->AddFlag(
"get_taxid",
"Get TaxId");
271 arg_desc->AddFlag(
"get_bestid",
"Get BestId");
272 arg_desc->AddFlag(
"get_title",
"Get sequence title");
273 arg_desc->AddFlag(
"get_state",
"Get sequence state");
275 arg_desc->AddFlag(
"seq_map",
"scan SeqMap on full depth");
276 arg_desc->AddFlag(
"scan_gaps",
"scan sequence gaps");
277 arg_desc->AddFlag(
"seg_labels",
"get labels of all segments in Delta");
278 arg_desc->AddFlag(
"whole_sequence",
"load whole sequence");
279 arg_desc->AddFlag(
"scan_whole_sequence",
"scan whole sequence");
280 arg_desc->AddFlag(
"scan_whole_sequence2",
"scan whole sequence w/o iterator");
281 arg_desc->AddFlag(
"check_gaps",
"check sequence gaps during scanning");
282 arg_desc->AddFlag(
"whole_tse",
"perform some checks on whole TSE");
283 arg_desc->AddFlag(
"print_tse",
"print TSE with sequence");
284 arg_desc->AddFlag(
"print_seq",
"print sequence");
285 arg_desc->AddOptionalKey(
"desc_type",
"DescType",
286 "look only descriptors of specified type",
288 arg_desc->AddFlag(
"print_descr",
"print all found descriptors");
289 arg_desc->AddFlag(
"skip_features",
"do not search for feature");
290 arg_desc->AddFlag(
"print_cds",
"print CDS");
291 arg_desc->AddFlag(
"print_features",
"print all found features");
292 arg_desc->AddFlag(
"print_mapper",
293 "print retult of CSeq_loc_Mapper "
294 "(when -print_features is set)");
295 arg_desc->AddFlag(
"only_features",
"do only one scan of features");
296 arg_desc->AddFlag(
"by_product",
"Search features by their product");
297 arg_desc->AddFlag(
"count_types",
298 "print counts of different feature types");
299 arg_desc->AddFlag(
"count_subtypes",
300 "print counts of different feature subtypes");
301 arg_desc->AddFlag(
"get_types",
302 "print only types of features found");
303 arg_desc->AddFlag(
"get_names",
304 "print only Seq-annot names of features found");
305 arg_desc->AddFlag(
"get_cost",
306 "print cost of loading");
307 arg_desc->AddOptionalKey(
"range_from",
"RangeFrom",
308 "features starting at this point on the sequence",
310 arg_desc->AddOptionalKey(
"range_to",
"RangeTo",
311 "features ending at this point on the sequence",
313 arg_desc->AddOptionalKey(
"range_step",
"RangeStep",
314 "shift range by this value between iterations",
316 arg_desc->AddFlag(
"plus_strand",
317 "use plus strand of the sequence");
318 arg_desc->AddFlag(
"minus_strand",
319 "use minus strand of the sequence");
320 arg_desc->AddFlag(
"ignore_strand",
321 "ignore strand of feature location");
322 arg_desc->AddOptionalKey(
"range_loc",
"RangeLoc",
323 "features on this Seq-loc in ASN.1 text format",
325 arg_desc->AddDefaultKey(
"overlap",
"Overlap",
326 "Method of overlap location check",
328 arg_desc->SetConstraint(
"overlap",
330 "totalrange",
"intervals"));
331 arg_desc->AddFlag(
"no_map",
"Do not map features to master sequence");
333 arg_desc->AddFlag(
"get_mapped_location",
"get mapped location");
334 arg_desc->AddFlag(
"get_original_feature",
"get original location");
335 arg_desc->AddFlag(
"get_mapped_feature",
"get mapped feature");
336 arg_desc->AddFlag(
"get_feat_handle",
"reverse lookup of feature handle");
337 arg_desc->AddFlag(
"sort_seq_feat",
"sort CSeq_feat objects");
338 arg_desc->AddFlag(
"save_mapped_feat",
"save and check CMappedFeat objects");
339 arg_desc->AddFlag(
"check_cds",
"check correctness cds");
340 arg_desc->AddFlag(
"check_seq_data",
"check availability of seq_data");
341 arg_desc->AddFlag(
"seq_vector_tse",
"use TSE as a base for CSeqVector");
342 arg_desc->AddFlag(
"search_annots",
"Search all matching Seq-annots");
343 arg_desc->AddFlag(
"skip_graphs",
"do not search for graphs");
344 arg_desc->AddFlag(
"print_graphs",
"print all found Seq-graphs");
345 arg_desc->AddFlag(
"print_graph_stats",
"print short stats of found Seq-graphs");
346 arg_desc->AddFlag(
"skip_alignments",
"do not search for alignments");
347 arg_desc->AddFlag(
"print_alignments",
"print all found Seq-aligns");
348 arg_desc->AddFlag(
"get_mapped_alignments",
"get mapped alignments");
349 arg_desc->AddFlag(
"print_annot_desc",
"print all found Seq-annot descriptors");
350 arg_desc->AddFlag(
"reverse",
"reverse order of features");
351 arg_desc->AddFlag(
"labels",
"compare features by labels too");
352 arg_desc->AddFlag(
"no_sort",
"do not sort features");
353 arg_desc->AddDefaultKey(
"max_feat",
"MaxFeat",
354 "Max number of features to iterate",
356 arg_desc->AddOptionalKey(
"max_search_segments",
"MaxSearchSegments",
357 "Max number of empty segments to search",
359 arg_desc->AddOptionalKey(
"max_search_segments_action",
"MaxSearchSegmentsAction",
360 "Action on max number of empty segments limit",
362 arg_desc->SetConstraint(
"max_search_segments_action",
364 "throw",
"log",
"ignore"));
365 arg_desc->AddOptionalKey(
"max_search_time",
"MaxSearchTime",
366 "Max time to search for a first annotation",
368 arg_desc->AddDefaultKey(
"depth",
"depth",
369 "Max depth of segments to iterate",
371 arg_desc->AddFlag(
"adaptive",
"Use adaptive depth of segments");
372 arg_desc->AddFlag(
"no-feat-policy",
"Ignore feature fetch policy");
373 arg_desc->AddFlag(
"only-feat-policy",
"Adaptive by feature fetch policy only");
374 arg_desc->AddFlag(
"exact_depth",
"Use exact depth of segments");
375 arg_desc->AddFlag(
"unnamed",
376 "include features from unnamed Seq-annots");
377 arg_desc->AddOptionalKey(
"named",
"NamedAnnots",
378 "include features from named Seq-annots "
379 "(comma separated list)",
381 arg_desc->AddOptionalKey(
"named_acc",
"NamedAnnotAccession",
382 "include features with named annot accession "
383 "(comma separated list)",
385 arg_desc->AddFlag(
"allnamed",
386 "include features from all named Seq-annots");
387 arg_desc->AddFlag(
"nosnp",
388 "exclude snp features - only unnamed Seq-annots");
389 arg_desc->AddOptionalKey(
"exclude_named",
"ExcludeNamedAnnots",
390 "exclude features from named Seq-annots"
391 "(comma separated list)",
393 arg_desc->AddFlag(
"noexternal",
394 "include external annotations");
395 arg_desc->AddOptionalKey(
"feat_type",
"FeatType",
396 "Type of features to select",
398 arg_desc->AddOptionalKey(
"feat_subtype",
"FeatSubType",
399 "Subtype of features to select",
401 arg_desc->AddOptionalKey(
"exclude_feat_type",
"ExcludeFeatType",
402 "Type of features to exclude",
404 arg_desc->AddOptionalKey(
"exclude_feat_subtype",
"ExcludeFeatSubType",
405 "Subtype of features to exclude",
407 arg_desc->AddOptionalKey(
"feat_id",
"FeatId",
408 "Feat-id of features to search",
410 arg_desc->AddOptionalKey(
"feat_id_str",
"FeatIdStr",
411 "String Feat-id of features to search",
413 arg_desc->AddOptionalKey(
"filter_bits",
"FilterBits",
414 "Filter SNP features by bits",
416 arg_desc->AddOptionalKey(
"filter_mask",
"FilterMask",
417 "Mask for filter SNP features by bits",
419 arg_desc->AddFlag(
"exclude_if_gene_is_suppressed",
"Exclude features with suppressed gene");
420 arg_desc->AddFlag(
"make_tree",
"make feature tree");
421 arg_desc->AddDefaultKey(
"feat_id_mode",
"feat_id_mode",
422 "CFeatTree xref by feat id mode",
425 arg_desc->SetConstraint(
"feat_id_mode",
427 "ignore",
"by_type",
"always"));
428 arg_desc->AddDefaultKey(
"snp_strand_mode",
"snp_strand_mode",
429 "CFeatTree SNP strand mode",
432 arg_desc->SetConstraint(
"snp_strand_mode",
435 arg_desc->AddFlag(
"tse_feat_tree",
"use all TSE features for the tree");
437 arg_desc->AddFlag(
"print_tree",
"print feature tree");
438 arg_desc->AddFlag(
"verify_tree",
"verify feature tree");
439 arg_desc->AddFlag(
"dump_seq_id",
"dump CSeq_id_Handle usage");
440 arg_desc->AddFlag(
"used_memory_check",
"exit(0) after loading sequence");
441 arg_desc->AddFlag(
"reset_scope",
"reset scope before exiting");
442 arg_desc->AddFlag(
"modify",
"try to modify Bioseq object");
443 arg_desc->AddFlag(
"skip_tables",
"do not search for Seq-tables");
444 arg_desc->AddOptionalKey(
"table_field_name",
"table_field_name",
445 "Table Seq-feat field name to retrieve",
447 arg_desc->AddOptionalKey(
"table_field_id",
"table_field_id",
448 "Table Seq-feat field id to retrieve",
450 arg_desc->AddFlag(
"print_seq_table",
"print all found Seq-tables");
452 arg_desc->AddOptionalKey(
"save_NA",
"save_NA_prefix",
453 "Save named annotations blobs",
457 string prog_description =
"Example of the C++ object manager usage\n";
458 arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
459 prog_description,
false);
474 typedef typename C::E_Choice E_Choice;
479 if ( C::SelectionName(E_Choice(e)) ==
value.AsString() ) {
492 for (
int j = 0; j < 2; ++j ) {
493 out <<
"0123456789ABCDEF"[(c>>4)&15];
505 ITERATE ( vector<CSeq_id_Handle>,
i, v ) {
506 if (
i != v.begin() ) {
602 << setw(10) <<
range.GetTo()
614 out <<
id->AsFastaString();
671 NcbiCout << p1 <<
"-F[" << index[
key] <<
"]: " << feat <<
"\n";
674 if ( ++it2 != cc.
end() ) {
687 vector<CMappedFeat> cc = feat_tree.GetChildren(parent);
688 ITERATE ( vector<CMappedFeat>, it, cc ) {
698 NcbiCout <<
"s_VerifyTree("<<parent<<
"): "
699 <<
"null from GetBestOverlappingFeat("<<*it<<
")"
704 NcbiCout <<
"s_VerifyTree("<<parent<<
"): "
707 <<
"GetBestOverlappingFeat("<<*it<<
"): "
713 NcbiCout <<
"s_VerifyTree("<<parent<<
"): "
714 <<
"GetBestOverlappingFeat("<<*it<<
"): "
715 <<
"exception: " << exc.
what()
727 NcbiCout <<
"s_VerifyTree("<<parent<<
"): "
728 <<
"null from GetBestParentForFeat("<<*it<<
")"
733 NcbiCout <<
"s_VerifyTree("<<parent<<
"): "
736 <<
"GetBestParentForFeat("<<*it<<
"): "
742 NcbiCout <<
"s_VerifyTree("<<parent<<
"): "
743 <<
"GetBestParentForFeat("<<*it<<
"): "
744 <<
"exception: " << exc.
what()
779 out <<
" confidential";
791 if ( args[
"get_gi"] ) {
796 if ( args[
"get_acc"] ) {
804 if ( args[
"get_label"] ) {
809 if ( args[
"get_taxid"] ) {
814 if ( args[
"get_bestid"] ) {
824 if ( args[
"get_state"] ) {
831 vector<CSeq_id_Handle> ids = scope.
GetIds(idh);
832 ITERATE ( vector<CSeq_id_Handle>, it, ids ) {
839 ERR_POST(
"GetIds(): Exception: "<<exc);
855 switch ( data.
Which() ) {
889 else if ( args[
"id"] ) {
890 id.Reset(
new CSeq_id(args[
"id"].AsString()));
893 else if ( args[
"asn_id"] ) {
895 string text = args[
"asn_id"].AsString();
900 string h =
in.ReadFileHeader();
901 if ( h ==
"Seq-id" ) {
902 in.ReadObject(&*
id, CSeq_id::GetTypeInfo());
904 else if ( h ==
"Seq-loc" ) {
906 in.ReadObject(&*range_loc, CSeq_loc::GetTypeInfo());
910 ERR_FATAL(
"Unknown asn_id type: "<<args[
"asn_id"].AsString());
914 ERR_FATAL(
"One of -gi, -id or -asn_id arguments is required");
918 if ( args[
"resolve"].AsString() ==
"all" )
920 if ( args[
"resolve"].AsString() ==
"none" )
922 if ( args[
"resolve"].AsString() ==
"tse" )
925 if ( args[
"missing"].AsString() ==
"ignore" )
927 if ( args[
"missing"].AsString() ==
"search" )
929 if ( args[
"missing"].AsString() ==
"fail" )
931 bool externals_only = args[
"externals"];
932 bool limit_tse = args[
"limit_tse"];
934 int repeat_count = args[
"count"].AsInteger();
935 int pause = args[
"pause"].AsInteger();
936 bool pause_key = args[
"pause_key"];
937 bool only_features = args[
"only_features"];
938 bool by_product = args[
"by_product"];
939 bool count_types = args[
"count_types"];
940 bool count_subtypes = args[
"count_subtypes"];
941 bool get_types = args[
"get_types"];
942 bool get_names = args[
"get_names"];
943 if ( get_types || get_names ) {
944 only_features =
true;
946 if ( count_types || count_subtypes ) {
947 only_features =
true;
949 bool get_cost = args[
"get_cost"];
950 bool print_tse = args[
"print_tse"];
951 bool print_seq = args[
"print_seq"];
952 bool print_descr = args[
"print_descr"];
954 GetVariant<CSeqdesc>(args[
"desc_type"]);
955 bool print_cds = args[
"print_cds"];
956 bool print_features = args[
"print_features"];
957 bool print_mapper = args[
"print_mapper"];
958 bool get_mapped_location = args[
"get_mapped_location"];
959 bool get_original_feature = args[
"get_original_feature"];
960 bool get_mapped_feature = args[
"get_mapped_feature"];
961 bool get_feat_handle = args[
"get_feat_handle"];
962 bool print_graphs = args[
"print_graphs"];
963 bool print_graph_stats = args[
"print_graph_stats"];
964 bool print_alignments = args[
"print_alignments"];
965 bool print_annot_desc = args[
"print_annot_desc"];
967 bool check_seq_data = args[
"check_seq_data"];
968 bool seq_vector_tse = args[
"seq_vector_tse"];
969 bool skip_features = args[
"skip_features"];
970 bool skip_graphs = args[
"skip_graphs"];
971 bool skip_alignments = args[
"skip_alignments"];
972 bool skip_tables = args[
"skip_tables"];
973 bool get_mapped_alignments = args[
"get_mapped_alignments"];
977 if ( args[
"no_sort"] )
979 bool sort_seq_feat = args[
"sort_seq_feat"];
980 bool save_mapped_feat = args[
"save_mapped_feat"];
981 bool labels = args[
"labels"];
982 int max_feat = args[
"max_feat"].AsInteger();
983 int depth = args[
"depth"].AsInteger();
984 bool adaptive = args[
"adaptive"];
985 bool no_feat_policy = args[
"no-feat-policy"];
986 bool only_feat_policy = args[
"only-feat-policy"];
987 bool exact_depth = args[
"exact_depth"];
988 bool nosnp = args[
"nosnp"];
989 bool include_unnamed = args[
"unnamed"];
990 bool include_allnamed = args[
"allnamed"];
991 bool noexternal = args[
"noexternal"];
992 bool whole_tse = args[
"whole_tse"];
993 bool whole_sequence = args[
"whole_sequence"];
994 bool scan_whole_sequence = args[
"scan_whole_sequence"];
995 bool scan_whole_sequence2 = args[
"scan_whole_sequence2"];
996 bool check_gaps = args[
"check_gaps"];
997 bool dump_seq_id = args[
"dump_seq_id"];
998 bool used_memory_check = args[
"used_memory_check"];
999 bool get_synonyms = args[
"get_synonyms"];
1000 bool get_ids = args[
"get_ids"];
1001 bool get_blob_id = args[
"get_blob_id"];
1002 bool make_tree = args[
"make_tree"];
1003 bool tse_feat_tree = args[
"tse_feat_tree"];
1004 feature::CFeatTree::EFeatIdMode feat_id_mode =
1005 feature::CFeatTree::eFeatId_by_type;
1006 if ( args[
"feat_id_mode"].AsString() ==
"ignore" ) {
1007 feat_id_mode = feature::CFeatTree::eFeatId_ignore;
1009 else if ( args[
"feat_id_mode"].AsString() ==
"always" ) {
1010 feat_id_mode = feature::CFeatTree::eFeatId_always;
1012 feature::CFeatTree::ESNPStrandMode snp_strand_mode =
1013 feature::CFeatTree::eSNPStrand_both;
1014 if ( args[
"snp_strand_mode"].AsString() ==
"same" ) {
1015 snp_strand_mode = feature::CFeatTree::eSNPStrand_same;
1017 else if ( args[
"snp_strand_mode"].AsString() ==
"both" ) {
1018 snp_strand_mode = feature::CFeatTree::eSNPStrand_both;
1020 bool print_tree = args[
"print_tree"];
1021 bool verify_tree = args[
"verify_tree"];
1022 vector<string> include_named;
1023 if ( args[
"named"] ) {
1024 NStr::Split(args[
"named"].AsString(),
",", include_named);
1026 vector<string> exclude_named;
1027 if ( args[
"exclude_named"] ) {
1028 NStr::Split(args[
"exclude_named"].AsString(),
",", exclude_named);
1030 vector<string> include_named_accs;
1031 if ( args[
"named_acc"] ) {
1032 NStr::Split(args[
"named_acc"].AsString(),
",", include_named_accs);
1034 string save_NA_prefix = args[
"save_NA"]? args[
"save_NA"].AsString():
"";
1035 bool scan_seq_map = args[
"seq_map"];
1036 bool scan_gaps = args[
"scan_gaps"];
1037 bool get_seg_labels = args[
"seg_labels"];
1039 vector<int> types_counts, subtypes_counts;
1045 vector<string> other_loaders;
1046 if ( args[
"loader"] ) {
1047 string genbank_readers = args[
"loader"].AsString();
1048 if ( genbank_readers !=
"-" ) {
1052 #ifdef HAVE_PUBSEQ_OS
1058 if ( args[
"WebCubbyUser"] ) {
1066 #ifdef HAVE_PUBSEQ_OS
1090 if ( args[
"lds_dir"] || args[
"lds_db"] ) {
1091 string lds_db, lds_dir;
1092 if ( args[
"lds_db"] ) {
1093 lds_db = args[
"lds_db"].AsString();
1094 if ( args[
"lds_dir"] ) {
1095 lds_dir = args[
"lds_dir"].AsString();
1099 lds_dir = args[
"lds_dir"].AsString();
1102 if ( !
CDirEntry(lds_db).Exists() && !lds_dir.empty() ) {
1110 if ( args[
"blast"] || args[
"blast_type"] ) {
1112 if ( args[
"blast"] ) {
1113 db = args[
"blast"].AsString();
1119 if ( args[
"blast_type"] ) {
1120 string s = args[
"blast_type"].AsString();
1121 if ( s.size() > 0 && s[0] ==
'p' ) {
1124 else if ( s.size() > 0 && s[0] ==
'n' ) {
1130 if ( args[
"csra"] ) {
1142 string old_param =
GetConfig().
Get(
"CSRA",
"ACCESSIONS");
1143 GetRWConfig().
Set(
"CSRA",
"ACCESSIONS", args[
"csra"].AsString());
1148 if (args[
"other_loaders"]) {
1149 vector<string>
names;
1155 if ( args[
"bam"] ) {
1156 vector<string> bams;
1158 for (
auto& bam : bams ) {
1160 string old_param1 =
GetConfig().
Get(
"BAM_LOADER",
"MAPPER_FILE");
1162 if ( args[
"mapfile"] ) {
1163 GetConfig().
Set(
"BAM_LOADER",
"MAPPER_FILE", args[
"mapfile"].AsString());
1167 GetConfig().
Set(
"BAM_LOADER",
"MAPPER_FILE", old_param1);
1175 ITERATE ( vector<string>, it, other_loaders ) {
1182 if ( args[
"file"] ) {
1185 if ( used_memory_check ) {
1191 if ( args[
"bfile"] ) {
1197 if ( args[
"annot_file"] ) {
1204 if ( args[
"annot_bfile"] ) {
1210 if ( args[
"bioseq_file"] ) {
1217 if ( args[
"bioseq_bfile"] ) {
1223 if ( args[
"submit_file"] ) {
1230 if ( args[
"submit_bfile"] ) {
1240 if ( args[
"align_file"] ) {
1243 while (
in.HaveMoreData() ) {
1246 annot->
SetData().SetAlign().push_back(align);
1252 if ( args[
"align_bfile"] ) {
1255 while (
in.HaveMoreData() ) {
1258 annot->
SetData().SetAlign().push_back(align);
1264 if ( args[
"blob_id"] ) {
1265 string str = args[
"blob_id"].AsString();
1266 vector<string> keys;
1268 if ( keys.size() < 2 || keys.size() > 3 ) {
1269 ERR_FATAL(
"Bad blob_id: "<<
str<<
". Should be sat/satkey(/subsat)?");
1272 ERR_FATAL(
"Cannot load by blob_id without Genbank loader");
1274 int sat, satkey, subsat = 0;
1277 if ( keys.size() == 3 ) {
1284 ERR_FATAL(
"Genbank entry with blob_id "<<
str<<
" not found");
1292 string gb_blob_id, seq_blob_id;
1293 if ( get_blob_id ) {
1298 ERR_POST(
"Cannot find blob id of "<<idh<<
" from GenBank");
1305 ERR_POST(
"Cannot blob id of "<<idh<<
": "<<exc);
1313 if ( get_blob_id ) {
1315 ERR_POST(
"Cannot find blob id of "<<idh);
1322 seq_blob_id = loader->GetName()+
'/'+seq_blob_id;
1326 if ( !gb_blob_id.empty() && gb_blob_id != seq_blob_id ) {
1331 bool error = !handle;
1337 if ( handle && args[
"get_title"] ) {
1338 NcbiCout <<
"Title: \"" << sequence::CDeflineGenerator().GenerateDefline(handle) <<
"\""
1345 if ( handle && get_synonyms ) {
1354 if ( handle && print_tse ) {
1357 NcbiCout <<
"-------------------- TSE --------------------\n";
1359 NcbiCout <<
"-------------------- END --------------------\n";
1361 if ( handle && print_seq ) {
1362 NcbiCout <<
"-------------------- SEQ --------------------\n";
1364 NcbiCout <<
"-------------------- END --------------------\n";
1371 bool plus_strand = args[
"plus_strand"];
1372 bool minus_strand = args[
"minus_strand"];
1373 bool ignore_strand = args[
"ignore_strand"];
1377 if ( plus_strand || minus_strand || args[
"range_from"] || args[
"range_to"] ) {
1378 if ( args[
"range_from"] ) {
1379 range_from = args[
"range_from"].AsInteger();
1384 if ( args[
"range_to"] ) {
1385 range_to = args[
"range_to"].AsInteger();
1391 range_loc->
SetInt().SetId(*search_id);
1392 range_loc->
SetInt().SetFrom(range_from);
1393 range_loc->
SetInt().SetTo(range_to);
1394 range.SetFrom(range_from).SetTo(range_to);
1396 if ( plus_strand ) {
1399 else if ( minus_strand ) {
1403 else if ( range_loc ) {
1405 range_from =
range.GetFrom();
1406 range_to =
range.GetTo();
1410 range_from = range_to = 0;
1411 range_loc = whole_loc;
1415 if ( args[
"range_loc"] ) {
1420 if ( args[
"overlap"].AsString() ==
"totalrange" )
1422 if ( args[
"overlap"].AsString() ==
"intervals" )
1424 bool no_map = args[
"no_map"];
1426 string table_field_name;
1427 if ( args[
"table_field_name"] )
1428 table_field_name = args[
"table_field_name"].AsString();
1429 int table_field_id = -1;
1430 if ( args[
"table_field_id"] )
1431 table_field_id = args[
"table_field_id"].AsInteger();
1432 bool modify = args[
"modify"];
1438 vector<CRef<CPrefetchRequest> > prefetch_snp;
1439 vector<CRef<CPrefetchRequest> > prefetch_seq;
1442 for (
int pass = 0; pass < repeat_count; ++pass ) {
1449 if ( pass && pause ) {
1454 if ( args[
"range_step"] && range_loc != whole_loc ) {
1455 TSeqPos step = args[
"range_step"].AsInteger();
1458 range_loc->
SetInt().SetFrom(range_from);
1459 range_loc->
SetInt().SetTo(range_to);
1470 if ( handle && get_seg_labels ) {
1471 x_Pause(
"getting seq map labels", pause_key);
1475 if ( exact_depth ) {
1486 for ( ; seg; ++seg ) {
1497 if ( handle && !only_features ) {
1502 NcbiCout <<
" "<<bit->GetSeqId()->DumpAsFasta()<<
1513 x_Pause(
"getting seq data", pause_key);
1517 if ( seq_vector_tse ) {
1528 if ( check_seq_data ) {
1536 sout += seq_vect[
i];
1548 char c = seq_vect[0];
1552 ERR_POST(
" cannot get last byte: Exception: "<<exc.
what());
1555 char c = seq_vect[seq_vect.
size()-1];
1559 ERR_POST(
" cannot get last byte: Exception: "<<exc.
what());
1563 if ( whole_sequence ) {
1569 if (
size <= 20u ) {
1579 ERR_POST(
"GetSeqData() failed: "<<exc);
1583 if ( scan_whole_sequence ) {
1591 if ( check_gaps && it.IsInGap() ) {
1592 NcbiCout <<
"Gap " << it.GetGapSizeForward()
1593 <<
" at "<<it.GetPos()<<
": ";
1595 it.GetGapSeq_literal();
1602 pos += it.GetGapSizeForward();
1606 if ( (pos & 0xffff) == 0 ) {
1620 ERR_POST(
"sequence scan failed at "<<pos<<
": "<<exc);
1625 if ( scan_whole_sequence2 ) {
1632 for ( ; pos < seq_vect.
size(); ++pos ) {
1633 if ( check_gaps && seq_vect.
IsInGap(pos) ) {
1636 <<
" at "<<pos<<
": ";
1648 if ( (pos & 0xffff) == 0 ) {
1661 ERR_POST(
"sequence scan failed at "<<pos<<
": "<<exc);
1669 x_Pause(
"getting seq desc", pause_key);
1670 for (
CSeqdesc_CI desc_it(handle, desc_type); desc_it; ++desc_it) {
1671 if ( print_descr ) {
1679 x_Pause(
"getting entry desc", pause_key);
1681 if ( print_descr ) {
1694 NcbiCout <<
"Seq_annot count (recursive):\t"
1703 NcbiCout <<
"Seq_annot count (non-recurs):\t"
1712 NcbiCout <<
"Seq_annot count (up to TSE):\t"
1719 NcbiCout <<
"Seq_annot count (TSE, recursive):\t"
1728 NcbiCout <<
"Seq_annot count (TSE, non-recurs):\t"
1751 if ( args[
"max_search_segments"] ) {
1753 if ( args[
"max_search_segments_action"] ) {
1754 const string& action = args[
"max_search_segments_action"].AsString();
1755 if ( action ==
"throw" ) {
1758 else if ( action ==
"log" ) {
1761 else if ( action ==
"ignore" ) {
1766 if ( args[
"max_search_time"] ) {
1769 if ( args[
"filter_bits"] ) {
1770 if ( args[
"filter_mask"] ) {
1772 args[
"filter_mask"].AsInt8());
1778 if ( args[
"exclude_if_gene_is_suppressed"] ) {
1781 if ( no_feat_policy ) {
1785 if ( only_feat_policy ) {
1791 if ( handle && externals_only ) {
1795 if ( added_annot ) {
1798 else if ( added_entry ) {
1801 else if ( handle ) {
1805 if ( include_allnamed ) {
1808 if ( include_unnamed ) {
1811 ITERATE ( vector<string>, it, include_named ) {
1814 ITERATE ( vector<string>, it, include_named_accs ) {
1820 ITERATE ( vector<string>, it, exclude_named ) {
1828 string sel_msg =
"any";
1829 if ( args[
"feat_type"] ) {
1830 feat_type = GetVariant<CSeqFeatData>(args[
"feat_type"]);
1834 if ( args[
"feat_subtype"] ) {
1839 if ( args[
"exclude_feat_type"] ) {
1844 if ( args[
"exclude_feat_subtype"] ) {
1849 if (args[
"snp_scale"]) {
1855 typedef int TTableField;
1856 unique_ptr< CTableFieldHandle<TTableField> > table_field;
1857 if ( table_field_id >= 0 ) {
1860 else if ( !table_field_name.empty() ) {
1866 if ( prefetch_manager ) {
1871 prefetch_seq.clear();
1872 prefetch_snp.clear();
1873 TSeqPos step = args[
"range_step"].AsInteger();
1874 for (
int i = 0;
i < 2; ++
i ) {
1875 TSeqPos from = range_from + step/2*
i;
1877 prefetch_snp.push_back
1883 prefetch_seq.push_back
1892 if ( get_types || get_names ) {
1901 <<
" (" << setw(2) <<
t <<
") "
1922 ITERATE ( vector<string>, it, include_named_accs ) {
1948 ITERATE ( vector<string>,
i, include_named_accs ) {
1952 scope, *range_loc, &sel2);
1954 if ( name.IsNamed() ) {
1955 NcbiCout <<
"Named annot: " << name.GetName()
1975 CFeat_CI it(scope, *range_loc, sel);
1977 if (
i->IsNamed() ) {
1978 NcbiCout <<
"Named annot: " <<
i->GetName()
1999 if (
i->IsNamed() ) {
2000 NcbiCout <<
"Named annot: " <<
i->GetName()
2021 if (
i->IsNamed() ) {
2022 NcbiCout <<
"Named annot: " <<
i->GetName()
2043 if (
i->IsNamed() ) {
2044 NcbiCout <<
"Named annot: " <<
i->GetName()
2065 if (
i->IsNamed() ) {
2066 NcbiCout <<
"Named annot: " <<
i->GetName()
2081 if ( !skip_features ) {
2082 if ( count_types ) {
2085 if ( count_subtypes ) {
2089 if ( handle && print_features && print_mapper ) {
2093 if ( handle && args[
"feat_id"] ) {
2094 int feat_id = args[
"feat_id"].AsInteger();
2095 vector<CSeq_feat_Handle> feats;
2097 for (
int t = 0;
t < 4; ++
t ) {
2101 << feat_id <<
" +type:";
2106 << feat_id <<
" +subtype:";
2111 << feat_id <<
" +type:";
2116 << feat_id <<
" +subtype:";
2120 if ( print_features ) {
2122 ITERATE ( vector<CSeq_feat_Handle>, it, feats ) {
2131 if ( handle && args[
"feat_id_str"] ) {
2132 string feat_id = args[
"feat_id_str"].AsString();
2133 vector<CSeq_feat_Handle> feats;
2135 for (
int t = 0;
t < 4; ++
t ) {
2139 << feat_id <<
" +type:";
2144 << feat_id <<
" +subtype:";
2149 << feat_id <<
" +type:";
2154 << feat_id <<
" +subtype:";
2158 if ( print_features ) {
2160 ITERATE ( vector<CSeq_feat_Handle>, it, feats ) {
2170 int matches = 0, mismatches = 0;
2171 vector<CConstRef<CSeq_feat> > feats;
2172 vector<CMappedFeat> mapped_feats;
2173 vector<CConstRef<CSeq_loc> > mapped_locs;
2175 x_Pause(
"getting features", pause_key);
2178 CFeat_CI it(scope, *range_loc, base_sel);
2180 NcbiCout <<
"***** Max search segments limit is reached *****" <<
NcbiEndl;
2188 if ( count_types ) {
2191 if ( count_subtypes ) {
2195 if ( print_annot_desc ) {
2198 if ( get_mapped_location )
2200 if ( get_original_feature )
2202 if ( get_mapped_feature ) {
2240 if ( sort_seq_feat ) {
2243 if ( save_mapped_feat ) {
2244 mapped_feats.push_back(*it);
2248 if ( table_field.get() &&
2251 if ( table_field->TryGet(it,
value) ) {
2254 value = table_field->Get(it);
2258 if ( print_features ) {
2291 NcbiCout <<
"Mapped orig location:\n" <<
2295 NcbiCout <<
"Mapped iter location:\n"<<
2317 if ( handle && print_features &&
2320 using namespace sequence;
2339 NcbiCout <<
"GetBestGeneForMrna: ";
2360 if ( print_features &&
2362 using namespace sequence;
2384 if ( print_features &&
2386 using namespace sequence;
2414 NcbiCout <<
"Reverse CSeq_feat_Handle lookup failed."
2419 NcbiCout <<
"Reverse CSeq_feat_Handle differs: "
2425 NcbiCout <<
"Feat count (loc range, " << sel_msg <<
"):\t"
2426 << count <<
" in " <<
sw.
Elapsed() <<
" secs "
2428 if ( print_annot_desc ) {
2429 for (
auto& annot : annots ) {
2430 if ( annot.Seq_annot_IsSetDesc() ) {
2441 if ( sort_seq_feat && !feats.empty() ) {
2442 NcbiCout <<
"Sorting " << feats.size() <<
" features..."
2444 vector<CConstRef<CSeq_feat> > sorted_feats = feats;
2447 if ( sorted_feats != feats ) {
2448 NcbiCout <<
"Sorted features are in another order."
2450 for (
size_t i = 0;
i < sorted_feats.size(); ++
i ) {
2451 if ( feats[
i] != sorted_feats[
i] ) {
2459 catch ( exception& exc ) {
2460 NcbiCout <<
"Exception while sorting: " << exc.what()
2464 if ( save_mapped_feat ) {
2465 for (
size_t i = 0;
i < mapped_feats.size(); ++
i ) {
2469 << mapped_feats[
i].GetMappedFeature();
2473 if ( count_types ) {
2474 ITERATE ( vector<int>, vit, types_counts ) {
2485 if ( count_subtypes ) {
2486 ITERATE ( vector<int>, vit, subtypes_counts ) {
2493 setw(3) << subtype <<
2500 feature::CFeatTree feat_tree;
2501 feat_tree.SetFeatIdMode(feat_id_mode);
2502 feat_tree.SetSNPStrandMode(snp_strand_mode);
2505 if ( tse_feat_tree ) {
2509 it2 =
CFeat_CI(scope, *range_loc, base_sel);
2511 feat_tree.AddFeatures(it2);
2524 list<CMappedFeat> q;
2526 ITERATE ( list<CMappedFeat>, pit, q ) {
2528 vector<CMappedFeat> cc =
2529 feat_tree.GetChildren(parent);
2531 ITERATE ( vector<CMappedFeat>, cit, cc ) {
2538 CMappedFeat gene = feat_tree.GetBestGene(child, feat_tree.eBestGene_OverlappedOnly);
2539 if ( gene != gene1 ) {
2540 if ( gene && !by_gene.count(gene) ) {
2546 if ( gene2 != gene1 ) {
2568 NcbiCout <<
"Children of "<<index[*fit] <<
": ";
2585 if ( !by_gene.
empty() ) {
2595 if ( verify_tree ) {
2611 size_t no_product_count = 0;
2613 for (
CFeat_CI it(scope, *range_loc, sel); it; ++it ) {
2619 cds_vect =
CSeqVector(it->GetLocation(), scope,
2623 if ( it->IsSetProduct() ) {
2624 cds_vect =
CSeqVector(it->GetProduct(), scope,
2635 " len=" << cds_vect.
size() <<
" data=";
2637 if ( cds_vect.
size() == 0 ) {
2639 it->GetOriginalFeature().GetLocation();
2641 it->GetMappedFeature().GetLocation();
2650 it->GetMappedFeature().GetLocation().CheckId(mapped_id);
2659 sout += cds_vect[
i];
2665 NcbiCout <<
"Feat count (loc range, cds):\t" << count
2668 if ( no_product_count ) {
2669 NcbiCout <<
"*** no product on " << no_product_count <<
" cds"
2683 if ( !skip_features && handle ) {
2684 for (
CFeat_CI it(handle,
range, range_strand, base_sel); it; ++it ) {
2687 NcbiCout <<
"Feat count (bh range, " << sel_msg <<
"):\t"
2688 << count <<
" in " <<
sw.
Elapsed() <<
" secs"
2692 if ( !only_features ) {
2693 if ( handle && whole_tse ) {
2700 NcbiCout <<
"Feat count (Seq):\t" << count
2709 NcbiCout <<
"Feat count (TSE):\t" << count
2714 if ( !skip_graphs ) {
2720 CGraph_CI it(scope, *range_loc, base_sel);
2728 if ( print_annot_desc ) {
2732 if ( get_mapped_location )
2734 if ( get_original_feature )
2736 if ( get_mapped_feature )
2738 if ( print_graph_stats ) {
2748 actual_size = vv.size();
2749 asn_max =
g.GetMax();
2750 actual_max = *max_element((
const Uint1*)vv.data(),
2751 (
const Uint1*)vv.data()+actual_size);
2752 for (
auto c : vv ) {
2754 sum.
AddChars((
const char*)&v,
sizeof(v));
2757 <<
" sum: "<<accumulate(vv.begin(), vv.end(), 0ull);
2762 actual_size = vv.size();
2763 asn_max =
g.GetMax();
2764 actual_max = *max_element(vv.data(), vv.data()+actual_size);
2765 sum.
AddChars((
const char*)vv.data(), actual_size*
sizeof(vv[0]));
2767 <<
" sum: "<<accumulate(vv.begin(), vv.end(), 0ull);
2774 if ( actual_size !=
size_t(graph.
GetNumval()) ) {
2777 if ( actual_max != asn_max ) {
2781 if ( print_graphs ) {
2787 NcbiCout <<
"Graph count (loc range):\t" << count
2790 if ( print_annot_desc ) {
2791 for (
auto& annot : annots ) {
2792 if ( annot.Seq_annot_IsSetDesc() ) {
2799 if ( !skip_alignments ) {
2803 CAlign_CI it(scope, *range_loc, base_sel);
2811 if ( get_mapped_alignments ) {
2814 if ( print_alignments ) {
2818 << it.GetOriginalSeq_align();
2822 for (
auto& uoref : align.
GetExt() ) {
2826 cout <<
"Haplotype: "<<field->GetInt()<<endl;
2832 NcbiCout <<
"Align count (loc range):\t" << count
2837 if ( args[
"search_annots"] ) {
2841 for (
CAnnot_CI it(scope, *range_loc, base_sel); it; ++it) {
2844 NcbiCout <<
"Annot count (loc range):\t" << count
2849 if ( !skip_tables ) {
2856 for (
CAnnot_CI it(scope, *range_loc, sel); it; ++it) {
2861 table_counts[annot.
GetName()].first += 1;
2862 table_counts[annot.
GetName()].second += rows;
2863 if ( args[
"print_seq_table"] ) {
2868 if ( table_field.get() ) {
2869 for (
size_t row = 0; row < rows; ++row ) {
2871 if ( table_field->TryGet(annot, row,
value) ) {
2872 NcbiCout <<
"table field["<<row<<
"]: "
2879 for (
auto& c : table_counts ) {
2880 if ( c.first.IsNamed() ) {
2881 NcbiCout <<
"Named " << c.first.GetName();
2886 NcbiCout <<
" " << c.second.first <<
" Seq-table(s) with "
2887 << c.second.second <<
" rows."
2890 NcbiCout <<
"Table count (loc range):\t" << count
2894 if ( !skip_tables ) {
2899 for (
CSeq_table_CI it(scope, *range_loc, base_sel); it; ++it) {
2902 if ( args[
"print_seq_table"] ) {
2909 table_counts[annot.
GetName()].first += 1;
2910 table_counts[annot.
GetName()].second += rows;
2917 if ( it.IsMapped() ) {
2923 if ( table_field.get() ) {
2924 for (
size_t row = 0; row < rows; ++row ) {
2926 if ( table_field->TryGet(annot, row,
value) ) {
2927 NcbiCout <<
"table field["<<row<<
"]: "
2934 for (
auto& c : table_counts ) {
2935 if ( c.first.IsNamed() ) {
2936 NcbiCout <<
"Named " << c.first.GetName();
2941 NcbiCout <<
" " << c.second.first <<
" Seq-table(s) with "
2942 << c.second.second <<
" rows."
2945 NcbiCout <<
"Table count (loc range):\t" << count
2950 if ( !skip_features ) {
2956 for (
CAnnot_CI it(scope, *range_loc, sel); it; ++it) {
2960 NcbiCout <<
"Locs count (loc range):\t" << count
2965 if ( !save_NA_prefix.empty() ) {
2970 const string& acc = *nit;
2980 for (
CAnnot_CI it(handle, sel); it; ++it ) {
2986 string name = save_NA_prefix+acc;
2999 if ( handle && scan_gaps ) {
3005 cout <<
"Scanning gaps up to level "<<max_level<<endl;
3007 size_t gap_count = 0;
3010 sel.
SetRange(range_from, range_length);
3012 for (
size_t level = 0; level < max_level; ++level ) {
3013 bool has_refs =
false;
3022 cout <<
"level "<<level
3023 <<
" @" << seg.GetPosition() <<
"-" << seg.GetEndPosition()
3024 <<
" len=" << seg.GetLength() <<
": gap"
3028 cout <<
"Scanned level " << level <<
" in " << sw2.
Elapsed() <<
" secs"
3034 cout <<
"Found " << gap_count <<
" gaps in " <<
sw.
Elapsed() <<
" secs"
3038 if ( handle && scan_seq_map ) {
3043 TSeqPos actual_length = actual_end; actual_length -= range_from;
3048 for (
size_t level = 0; level < max_level; ++level) {
3052 if ( exact_depth ) {
3063 for ( ; seg; ++seg ) {
3098 _ASSERT(
"Unexpected END segment" && 0);
3102 _ASSERT(
"Unexpected segment type" && 0);
3108 _VERIFY(level || total_length == actual_length);
3112 for ( --seg; seg; --seg ) {
3116 _VERIFY(total_length == new_length);
3120 for ( ++seg; seg; ++seg ) {
3124 _VERIFY(total_length == new_length);
3129 _ASSERT(begin.GetPosition() == 0);
3136 total_length += iter.GetLength();
3143 total_length += iter.GetLength();
3160 <<
" = " << seq.
GetResult().substr(0, 10) <<
"..."
3164 if ( handle && args[
"feat_id"] ) {
3169 NcbiCout <<
"Feature with id " << id;
3170 if ( print_features ) {
3180 NcbiCout <<
"Feature with id " << oid;
3181 if ( print_features ) {
3189 if ( handle && modify ) {
3206 _ASSERT(pseh == pseh.GetEditHandle());
3207 pseh.GetEditHandle().AttachBioseq(*newseq);
3215 if ( dump_seq_id ) {
3217 cout <<
"Got CSeq_id_Mapper bytes: "<<bytes<<endl;
3221 if ( args[
"reset_scope"] ) {
3224 cout <<
"Scope reset" << endl;
3229 if ( used_memory_check ) {
3230 if ( args[
"reset_scope"] ) {
3237 if ( handle && args[
"reset_scope"] ) {
3244 cout <<
"Exception: " << exc.
what() << endl;
3253 return handle && !
error? 0: 1;
3272 int main(
int argc,
const char* argv[])
3274 int ret =
CDemoApp().AppMain(argc, argv);
User-defined methods of the data storage class.
bool check_cds(const DataBlk &entry, Parser::EFormat format)
Data loader implementation that uses the blast databases.
Checksum and hash calculation classes.
const TAnnotNames & GetAnnotNames(void) const
bool MaxSearchSegmentsLimitIsReached(void) const
vector< SAnnotTypeSelector > TAnnotTypes
size_t GetSize(void) const
Uint8 GetCostOfLoadingInBytes(void) const
Get collected cost of loading requested data in bytes.
CSeq_annot_Handle GetAnnot(void) const
const TAnnotTypes & GetAnnotTypes(void) const
double GetCostOfLoadingInSeconds(void) const
Get collected cost of loading requested data in seconds.
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, const string &dbname="nr", const EDbType dbtype=eUnknown, bool use_fixed_size_slices=true, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
EDbType
Describes the type of blast database to use.
@ eNucleotide
nucleotide database
@ eProtein
protein database
@ eUnknown
protein is attempted first, then nucleotide
CChecksum – Checksum calculator.
Derive our application class from CwxNCBIApp and use it together with standard CNCBIwxApplication.
virtual void Init(void)
Initialize the application.
virtual int Run(void)
Run the application.
void GetIds(CScope &scope, const CSeq_id_Handle &idh)
virtual void Exit(void)
Cleanup on application exit.
virtual TNamedAnnotNames GetNamedAnnotAccessions(const CSeq_id_Handle &idh)=0
TBlobId GetBlobIdFromSatSatKey(int sat, int sat_key, int sub_sat=0) const
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
void SetHUPIncluded(bool include_hup=true, const string &web_cookie=NcbiEmptyString)
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
Argument-less loader - for compatibility only, unusable.
Class for managing LDS2 database and related data files.
void AddDataDir(const string &data_dir, EDirMode mode=eDir_Recurse)
Add data directory.
void UpdateData(void)
Rescan all indexed files, check for modifications, update the database.
@ eDir_Recurse
Automatically scan sub-directories (default).
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
CObjectIStreamAsnBinary –.
CPrefetchSeqData(const CBioseq_Handle &bioseq, const CRange< TSeqPos > &range, ENa_strand strand, CBioseq_Handle::EVectorCoding vector_coding)
CRange< TSeqPos > m_Range
const string & GetResult(void) const
CBioseq_Handle::EVectorCoding m_VectorCoding
virtual bool Execute(CRef< CPrefetchRequest > token)
CPrefetchSeqData(const CBioseq_Handle &bioseq, const CRange< TSeqPos > &range, ENa_strand strand, CSeq_data::E_Choice encoding)
const string & GetSequence(void) const
CSeq_data::E_Choice m_Encoding
static E_Choice GetTypeFromSubtype(ESubtype subtype)
static CSeq_id_Handle GetSeq_id_Handle(const const_iterator &iter)
TBlobId GetBlobId(void) const
TSeq_feat_Handles GetFeaturesWithId(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
CSeq_feat_Handle GetFeatureWithId(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
CConstRef< TObject > GetCompleteObject(void) const
TSeq_feat_Handles GetFeaturesWithXref(CSeqFeatData::E_Choice type, TFeatureIdInt id) const
CDataLoader * GetDataLoader(void) const
const CSeq_submit & GetTopLevelSeq_submit() const
Return reference to top-level Seq-submit object Throw an exception if it's not available.
ETopLevelObjectType GetTopLevelObjectType() const
Get type of top level object added to scope.
CConstRef< CUser_field > GetFieldRef(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
iterator_bool insert(const value_type &val)
iterator_bool insert(const value_type &val)
const_iterator end() const
parent_type::const_iterator const_iterator
Include a standard set of the NCBI C++ Toolkit most basic headers.
static unsigned char depth[2 *(256+1+29)+1]
static const struct name_t names[]
std::ofstream out("events_result.xml")
main entry point for tests
#define GI_FROM(T, value)
const CNcbiRegistry & GetConfig(void) const
Get the application's cached configuration parameters (read-only).
unsigned int TSeqPos
Type for sequence locations and lengths.
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
CNcbiRegistry & GetRWConfig(void)
Get the application's cached configuration parameters, accessible for read-write for an application's...
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
@ fBinary
Open as binary file; for eInputFile, eOutputFile, eIOFile.
@ eInt8
Convertible into an integer number (Int8 only)
@ eInputFile
Name of file (must exist and be readable)
@ eDouble
Convertible into a floating point number (double)
@ eString
An arbitrary string.
@ eInteger
Convertible into an integer number (int or Int8)
Uint4 GetChecksum(void) const
Return calculated checksum.
void AddChars(const char *str, size_t len)
Update current control sum with data provided.
void DBAPI_RegisterDriver_FTDS(void)
#define ERR_FATAL(message)
Posting fatal error and abort.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#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)
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
#define MSerial_AsnBinary
const TPrim & Get(void) const
C * SerialClone(const C &src)
Create on heap a clone of the source object.
#define MSerial_AsnText
I/O stream manipulators –.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
static ESNPScaleLimit GetSNPScaleLimit_Value(const string &name)
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
string AsString(void) const
static CRef< CSeq_id_Mapper > GetInstance(void)
string GetLabel(const CSeq_id &id)
size_t Dump(CNcbiOstream &out, EDumpDetails details=eDumpTotalBytes) const
@ fLabel_Version
Show the version.
@ eContent
Untagged human-readable accession or the like.
ENa_strand GetStrand(void) const
Get the location's strand.
TRange GetTotalRange(void) const
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
CMappedFeat GetBestParentForFeat(const CMappedFeat &feat, CSeqFeatData::ESubtype parent_subtype, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
CMappedFeat GetBestGeneForMrna(const CMappedFeat &mrna_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
CMappedFeat GetBestGeneForFeat(const CMappedFeat &feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
CMappedFeat GetBestOverlappingFeat(const CMappedFeat &feat, CSeqFeatData::ESubtype need_subtype, sequence::EOverlapType overlap_type, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
CMappedFeat GetBestCdsForMrna(const CMappedFeat &mrna_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)
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,...
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
CSeq_id_Handle GetIdHandle(const CSeq_loc &loc, CScope *scope)
@ fCompareOverlapping
Check if seq-locs are overlapping.
@ eOverlap_Contained
2nd contained within 1st extremes
string GetAccessionForGi(TGi gi, CScope &scope, EAccessionVersion use_version=eWithAccessionVersion, EGetIdType flags=0)
Retrieve the accession for a given GI.
@ eWithoutAccessionVersion
accession only, even if version is available
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
@ eGetId_ForceGi
return only a gi-based seq-id
TIds GetIds(const CSeq_id &id, TGetFlags flags=0)
Get "native" bioseq ids without filtering and matching.
CBioseq_Handle GetBioseqHandleFromTSE(const CSeq_id &id, const CTSE_Handle &tse)
Get bioseq handle for sequence withing one TSE.
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
static void Wait(CRef< CPrefetchRequest > token)
string ToString(void) const
void ResetHistory(EActionIfLocked action=eKeepIfLocked)
Clean all unused TSEs from the scope's cache and release the memory.
TLoader * GetLoader(void) const
Get pointer to the loader.
void AddDataLoader(const string &loader_name, TPriority pri=kPriority_Default)
Add data loader by name.
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
virtual bool Execute(CRef< CPrefetchRequest > token)
void RemoveFromHistory(const CTSE_Handle &tse, EActionIfLocked action=eKeepIfLocked)
Remove single TSE from the scope's history.
CSeq_id_Handle GetAccVer(const CSeq_id_Handle &idh, TGetFlags flags=0)
Get accession.version Seq-id Returns null CSeq_id_Handle if the sequence is not found or if it doesn'...
TTaxId GetTaxId(const CSeq_id &id, TGetFlags flags=0)
Get taxonomy id of bioseq Return -1 if sequence is not found Return 0 if sequence doesn't have taxono...
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...
CSeq_entry_Handle GetSeq_entryHandle(CDataLoader *loader, const TBlobId &blob_id, EMissing action=eMissing_Default)
Get Seq-entry handle by its blob-id, with possible loading.
CSeq_entry_Handle AddSeq_submit(CSeq_submit &submit, TPriority pri=kPriority_Default)
Add Seq-submit, return its CSeq_entry_Handle.
string GetName(void) const
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
string GetLabel(const CSeq_id &id, TGetFlags flags=0)
Get short description of bioseq, usually "accession.version" Returns empty string if the sequence is ...
const CFeat_CI & GetResult(void) const
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
CDataLoader * RegisterDataLoader(TPluginManagerParamTree *params=0, const string &driver_name=kEmptyStr)
Add data loader using plugin manager.
CSeq_annot_Handle AddSeq_annot(CSeq_annot &annot, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add Seq-annot, return its CSeq_annot_Handle.
CConstRef< CSynonymsSet > GetSynonyms(const CSeq_id &id)
Get bioseq synonyms, resolving to the bioseq in this scope.
static CRef< CPrefetchRequest > GetFeat_CI(CPrefetchManager &manager, const CBioseq_Handle &bioseq, const CRange< TSeqPos > &range, ENa_strand strand, const SAnnotSelector &sel)
const CBioseq_Handle & GetBioseqHandle(void) const
CBioseq_Handle::TBioseqStateFlags GetSequenceState(const CSeq_id &id, TGetFlags flags=0)
Get sequence GenBank state Return (fState_not_found|fState_no_data) if sequence is not found.
CRef< CPrefetchRequest > AddAction(TPriority priority, IPrefetchAction *action, IPrefetchListener *listener=0)
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
@ eSeqMap_Up
map from segments to the top level bioseq
bool IsSetExcept(void) const
bool GetExcept(void) const
const CFeat_id & GetId(void) const
const CSeq_feat::TXref & GetXref(void) const
bool IsSetComment(void) const
const CTSE_Handle & GetTSE_Handle(void) const
Get CTSE_Handle of containing TSE.
bool GetPseudo(void) const
TBioseqStateFlags GetState(void) const
Get state of the bioseq.
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
const CSeq_submit & GetTopLevelSeq_submit(void) const
void SelectNone(void) const
Make this Seq-entry to be empty.
bool IsSetDbxref(void) const
CConstRef< TObject > GetCompleteObject(void) const
virtual CConstRef< CSeq_feat > GetSeq_feat(void) const
bool IsSetExp_ev(void) const
CSeq_feat::EExp_ev GetExp_ev(void) const
const CTSE_Handle & GetTSE_Handle(void) const
const CSeqFeatData & GetData(void) const
TSeqPos GetBioseqLength(void) const
bool IsSetTitle(void) const
bool IsSetXref(void) const
const CTSE_Handle & GetTSE_Handle(void) const
bool IsSetExcept_text(void) const
const CSubmit_block & GetTopLevelSubmit_block(void) const
bool IsSetProduct(void) const
void Remove(ERemoveMode mode=eRemoveSeq_entry) const
TSeq SelectSeq(CBioseq &seq) const
Make the empty Seq-entry be in seq state with specified Bioseq object.
EVectorCoding
CSeqVector constructor flags.
const string & GetComment(void) const
CSeq_entry_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
size_t GetSeq_tableNumRows(void) const
const CUser_object & GetExt(void) const
bool IsTopLevelSeq_submit(void) const
Seq-submit access functions.
CBioseq_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
const string & GetExcept_text(void) const
void Reset(void)
Reset handle and make it not to point to any bioseq.
CSeq_annot_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
CConstRef< TObject > GetCompleteObject(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
const string & GetTitle(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const
const CSeq_feat::TDbxref & GetDbxref(void) const
bool IsSetQual(void) const
CSeqFeatData::ESubtype GetFeatSubtype(void) const
bool IsTableFeat(void) const
Check if this is non-SNP table feature.
const CSeqMap & GetSeqMap(void) const
Get sequence map.
const string & GetName(void) const
CSeqFeatData::E_Choice GetFeatType(void) const
bool IsSetPseudo(void) const
bool IsPlainFeat(void) const
Check if this is plain feature.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
const CSeq_feat::TQual & GetQual(void) const
CSeq_entry_Handle GetParentEntry(void) const
Get parent Seq-entry handle.
bool IsSetExt(void) const
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
TSeqPos GetEndPosition(void) const
return end position of current segment in sequence (exclusive)
SSeqMapSelector & SetResolveCount(size_t res_cnt)
Set max depth of resolving seq-map.
SAnnotSelector & IncludeFeatSubtype(TFeatSubtype subtype)
Include feature subtype in the search.
SAnnotSelector & SetFeatType(TFeatType type)
Set feature type (also set annotation type to feat)
SAnnotSelector & SetExactDepth(bool value=true)
SetExactDepth() specifies that annotations will be searched on the segment level specified by SetReso...
const CSeq_data & GetRefData(void) const
will allow any data segments, user should check for position and strand
SAnnotSelector & ExcludeFeatSubtype(TFeatSubtype subtype)
Exclude feature subtype from the search.
ESortOrder
Flag to indicate sorting method.
SAnnotSelector & SetAllNamedAnnots(void)
Look for all named Seq-annots Resets the filter, and then excludes unnamed annots.
const CSeq_align & GetOriginalSeq_align(void) const
Get original alignment.
SAnnotSelector & SetCollectTypes(bool value=true)
Collect available annot types rather than annots.
SAnnotSelector & ExcludeFeatType(TFeatType type)
Exclude feature type from the search.
bool IsIncludedAnyNamedAnnotAccession(void) const
check if any named annot accession is included in the search
bool IsSetPartial(void) const
SAnnotSelector & SetSearchExternal(const CTSE_Handle &tse)
Set all flags for searching standard GenBank external annotations.
TSeqPos GetRefPosition(void) const
SAnnotSelector & SetMaxSearchSegmentsAction(EMaxSearchSegmentsAction action)
SAnnotSelector & SetResolveMethod(EResolveMethod resolve_method)
SetResolveMethod() controls visibility of subsegments depending on whether it's packaged together wit...
const CSeq_loc & GetLocation(void) const
SAnnotSelector & SetByProduct(bool byProduct=true)
Set flag indicating if the features should be searched by their product rather than location.
bool GetPartial(void) const
SAnnotSelector & ResetAnnotsNames(void)
Select annotations from all Seq-annots.
SSeqMapSelector & SetFlags(TFlags flags)
Select segment type(s)
SAnnotSelector & SetOverlapType(EOverlapType overlap_type)
Set overlap type.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
SAnnotSelector & SetAdaptiveDepth(bool value=true)
SetAdaptiveDepth() requests to restrict subsegment resolution depending on annotations found on lower...
SAnnotSelector & SetNoMapping(bool value=true)
SAnnotSelector & SetExcludeIfGeneIsSuppressed(bool exclude=true)
Exclude features with empty gene xref: xref { { data gene { } } }.
SAnnotSelector & SetAdaptiveDepthFlags(TAdaptiveDepthFlags flags)
SetAdaptiveDepthFlags() sets flags for adaptive depth heuristics.
SAnnotSelector & SetLimitSeqAnnot(const CSeq_annot_Handle &limit)
Limit annotations to those from the seq-annot only.
SAnnotSelector & SetResolveDepth(int depth)
SetResolveDepth sets the limit of subsegment resolution in searching annotations.
SAnnotSelector & SetFeatComparator(IFeatComparator *comparator)
SAnnotSelector & IncludeNamedAnnotAccession(const string &acc, int zoom_level=0)
const CSeq_graph & GetMappedGraph(void) const
Graph mapped to the master sequence.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
SAnnotSelector & SetExcludeExternal(bool exclude=true)
External annotations for the Object Manger are annotations located in top level Seq-entry different f...
SAnnotSelector & SetCollectNames(bool value=true)
Collect available annot names rather than annots.
EOverlapType
Flag to indicate location overlapping method.
const CSeq_feat & GetMappedFeature(void) const
Feature mapped to the master sequence.
SAnnotSelector & IncludeFeatType(TFeatType type)
Include feature type in the search.
EUnresolvedFlag
Flag to indicate handling of unresolved seq-ids.
SAnnotSelector & SetSNPScaleLimit(TSNPScaleLimit value)
bool GetRefMinusStrand(void) const
TAdaptiveDepthFlags GetAdaptiveDepthFlags(void) const
GetAdaptiveDepthFlags() returns current set of adaptive depth heuristics flags.
const CSeq_loc & GetProduct(void) const
CSeqMap::ESegmentType GetType(void) const
EResolveMethod
Flag to indicate references resolution method.
SAnnotSelector & SetAnnotType(TAnnotType type)
Set annotation type (feat, align, graph)
SAnnotSelector & SetMaxSearchTime(TMaxSearchTime max_time)
Set maximum time (in seconds) to search before giving up.
SSeqMapSelector & SetRange(TSeqPos start, TSeqPos length)
Set range for iterator.
SAnnotSelector & SetMaxSize(TMaxSize max_size)
Set maximum number of annotations to find.
CSeq_id_Handle GetRefSeqid(void) const
The following function makes sense only when the segment is a reference to another seq.
SAnnotSelector & SetBitFilter(TBitFilter filter_bits, TBitFilter filter_mask=TBitFilter(-1))
TRange GetRange(void) const
Get range for mapped seq-feat's location.
SAnnotSelector & AddNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to look for.
SAnnotSelector & SetUnresolvedFlag(EUnresolvedFlag flag)
Set method of handling unresolved seq-ids.
const CSeq_graph & GetOriginalGraph(void) const
Get original graph with unmapped location/product.
SAnnotSelector & SetCollectCostOfLoading(bool value=true)
Collect cost of loading requested data.
TSeqPos GetRefEndPosition(void) const
SAnnotSelector & ExcludeNamedAnnots(const CAnnotName &name)
Add named annot to set of annots names to exclude.
const CSeq_loc & GetLoc(void) const
SAnnotSelector & SetLimitTSE(const CTSE_Handle &limit)
Limit annotations to those from the TSE only.
SAnnotSelector & SetIgnoreStrand(bool value=true)
Ignore strand when testing for range overlap.
SAnnotSelector & SetSortOrder(ESortOrder sort_order)
Set sort order of annotations.
TSeqPos GetPosition(void) const
return position of current segment in sequence
SAnnotSelector & AddUnnamedAnnots(void)
Add unnamed annots to set of annots names to look for.
SAnnotSelector & SetMaxSearchSegments(TMaxSearchSegments max_segments)
Set maximum number of empty segments to search before giving up.
SAnnotSelector & ResetNamedAnnotAccessions(void)
Add named annot accession (NA*) in the search.
TSeqPos GetLength(void) const
return length of current segment
CConstRef< CSeq_literal > GetRefGapLiteral(void) const
return CSeq_literal with gap data, or null if either the segment is not a gap, or an unspecified gap
SAnnotSelector & SetLimitSeqEntry(const CSeq_entry_Handle &limit)
Limit annotations to those from the seq-entry only.
CSeq_id_Handle GetLocationId(void) const
@ eSortOrder_Reverse
decresing end, decreasing length
@ eSortOrder_Normal
default - increasing start, decreasing length
@ eSortOrder_None
do not sort annotations for faster retrieval
@ eOverlap_Intervals
default - overlapping of individual intervals
@ eOverlap_TotalRange
overlapping of total ranges only
@ eIgnoreUnresolved
Ignore unresolved ids (default)
@ eSearchUnresolved
Search annotations for unresolvable IDs.
@ eFailUnresolved
Throw exception for unresolved ids.
@ eResolve_TSE
default - search only on segments in the same TSE
@ eResolve_All
Search annotations for all referenced sequences.
@ eResolve_None
Do not search annotations on segments.
@ eMaxSearchSegmentsSilent
@ eMaxSearchSegmentsThrow
const_iterator begin(CScope *scope) const
STL style methods.
const_iterator end(CScope *scope) const
bool IsInGap(TSeqPos pos) const
true if sequence at 0-based position 'pos' has gap Note: this method is not MT-safe,...
bool CanGetRange(TSeqPos start, TSeqPos stop) const
Check if the sequence data is available for the interval [start, stop).
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
CConstRef< CSeq_literal > GetGapSeq_literal(TSeqPos pos) const
returns gap Seq-literal object ref returns null if it's not a gap or an unspecified gap
TMutex & GetMutex(void) const
Get mutex for a few non-MT-safe methods to make them MT-safe at a cost of performance.
void SetCoding(TCoding coding)
CSeqMap_CI ResolvedRangeIterator(CScope *scope, TSeqPos from, TSeqPos length, ENa_strand strand=eNa_strand_plus, size_t maxResolve=size_t(-1), TFlags flags=fDefaultFlags) const
Iterate segments in the range with specified strand coordinates.
TSeqPos GetGapSizeForward(TSeqPos pos) const
returns number of gap symbols ahead including base at position 'pos' returns 0 if the position is not...
@ eSeqData
real sequence data
@ eSeqRef
reference to Bioseq
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
void Reset(void)
Reset reference object.
uint8_t Uint1
1-byte (8-bit) unsigned integer
position_type GetToOpen(void) const
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
bool Set(const string §ion, const string &name, const string &value, TFlags flags=0, const string &comment=kEmptyStr)
Set the configuration parameter value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
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 bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
@ fSplit_ByPattern
Require full delimiter strings.
double Restart(void)
Return time elapsed since first Start() or last Restart() call (in seconds).
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
@ eStart
Start timer immediately after creating.
void CONNECT_Init(const IRWRegistry *reg=0, CRWLock *lock=0, TConnectInitFlags flag=eConnectInit_OwnNothing, FSSLSetup ssl=0)
Init [X]CONNECT library with the specified "reg" and "lock" (ownership for either or both can be deta...
static const char label[]
TFrom GetFrom(void) const
Get the From member data.
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
bool IsSetLocus(void) const
Official gene symbol Check if a value has been assigned to Locus data member.
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
const TLocus & GetLocus(void) const
Get the Locus member data.
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant data.
const TType & GetType(void) const
Get the Type member data.
TId & SetId(void)
Select the variant.
EField_id
identification of the column data in the objects described by the table known column data types posit...
const TExt & GetExt(void) const
Get the Ext member data.
vector< CRef< CDbtag > > TDbxref
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
const TGene & GetGene(void) const
Get the variant data.
TPartial GetPartial(void) const
Get the Partial member data.
vector< CRef< CSeqFeatXref > > TXref
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
vector< CRef< CGb_qual > > TQual
@ e_not_set
No variant selected.
@ e_MaxChoice
== e_Variation+1
ENa_strand
strand of nucleic acid
const TInt & GetInt(void) const
Get the variant data.
const TGraph & GetGraph(void) const
Get the Graph member data.
const TTitle & GetTitle(void) const
Get the Title member data.
const TByte & GetByte(void) const
Get the variant data.
bool IsByte(void) const
Check if variant Byte is selected.
const TLoc & GetLoc(void) const
Get the Loc member data.
TNumval GetNumval(void) const
Get the Numval member data.
bool IsSetTitle(void) const
Check if a value has been assigned to Title data member.
const TIupacaa & GetIupacaa(void) const
Get the variant data.
void SetData(TData &value)
Assign a value to Data data member.
const TIupacna & GetIupacna(void) const
Get the variant data.
const TId & GetId(void) const
Get the Id member data.
const TNcbi2na & GetNcbi2na(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
@ e_not_set
No variant selected.
@ e_Ncbi2na
2 bit nucleic acid code
@ e_Iupacna
IUPAC 1 letter nuc acid code.
@ e_Ncbi8na
8 bit extended nucleic acid code
@ e_Ncbi4na
4 bit nucleic acid code
@ e_Iupacaa
IUPAC 1 letter amino acid code.
@ e_not_set
No variant selected.
@ e_Locs
used for communication between tools
const TSub & GetSub(void) const
Get the Sub member data.
static void hex(unsigned char c)
static void text(MDB_val *v)
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
void SleepSec(unsigned long sec, EInterruptOnSignal onsignal=eRestartOnSignal)
Sleep.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
std::istream & in(std::istream &in_, double &x_)
CSeq_id_Handle s_Normalize(const CSeq_id_Handle &id, CScope &scope)
map< CMappedFeat, TOrderedFeatures > TOrderedTree
TSeqPos s_GetLength(const CSeq_data &data)
map< TFeatureKey, size_t > TFeatureIndex
bool s_VerifyTree(feature::CFeatTree &feat_tree, const CMappedFeat &parent)
CNcbiOstream & operator<<(CNcbiOstream &out, const vector< char > &v)
set< TFeatureKey > TOrderedFeatures
C::E_Choice GetVariant(const CArgValue &value)
int main(int argc, const char *argv[])
void s_PrintTree(const string &p1, const string &p2, TOrderedTree &tree, TFeatureKey key, TFeatureIndex &index)
TFeatureKey s_GetFeatureKey(const CMappedFeat &child)
CAtomicCounter newCObjects
pair< string, CMappedFeat > TFeatureKey
void x_Pause(const char *msg, bool pause_key)
static const char * prefix[]
static pcre_uint8 * buffer
void GenBankReaders_Register_Pubseq2(void)
void GenBankReaders_Register_Pubseq(void)
static const char * str(char *buf, int n)
Compare objects pointed to by (smart) pointer.
PStateFlags(CBioseq_Handle::TBioseqStateFlags state)
CBioseq_Handle::TBioseqStateFlags state
Selector used in CSeqMap methods returning iterators.
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)