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
1059 if ( args[
"WebCubbyUser"] ) {
1060 #ifdef HAVE_PUBSEQ_OS
1065 if ( genbank_readers ==
"psg" ) {
1072 #ifdef HAVE_PUBSEQ_OS
1096 if ( args[
"lds_dir"] || args[
"lds_db"] ) {
1097 string lds_db, lds_dir;
1098 if ( args[
"lds_db"] ) {
1099 lds_db = args[
"lds_db"].AsString();
1100 if ( args[
"lds_dir"] ) {
1101 lds_dir = args[
"lds_dir"].AsString();
1105 lds_dir = args[
"lds_dir"].AsString();
1108 if ( !
CDirEntry(lds_db).Exists() && !lds_dir.empty() ) {
1116 if ( args[
"blast"] || args[
"blast_type"] ) {
1118 if ( args[
"blast"] ) {
1119 db = args[
"blast"].AsString();
1125 if ( args[
"blast_type"] ) {
1126 string s = args[
"blast_type"].AsString();
1127 if ( s.size() > 0 && s[0] ==
'p' ) {
1130 else if ( s.size() > 0 && s[0] ==
'n' ) {
1136 if ( args[
"csra"] ) {
1148 string old_param =
GetConfig().
Get(
"CSRA",
"ACCESSIONS");
1149 GetRWConfig().
Set(
"CSRA",
"ACCESSIONS", args[
"csra"].AsString());
1154 if (args[
"other_loaders"]) {
1155 vector<string>
names;
1161 if ( args[
"bam"] ) {
1162 vector<string> bams;
1164 for (
auto& bam : bams ) {
1166 string old_param1 =
GetConfig().
Get(
"BAM_LOADER",
"MAPPER_FILE");
1168 if ( args[
"mapfile"] ) {
1169 GetConfig().
Set(
"BAM_LOADER",
"MAPPER_FILE", args[
"mapfile"].AsString());
1173 GetConfig().
Set(
"BAM_LOADER",
"MAPPER_FILE", old_param1);
1181 ITERATE ( vector<string>, it, other_loaders ) {
1188 if ( args[
"file"] ) {
1191 if ( used_memory_check ) {
1197 if ( args[
"bfile"] ) {
1203 if ( args[
"annot_file"] ) {
1210 if ( args[
"annot_bfile"] ) {
1216 if ( args[
"bioseq_file"] ) {
1223 if ( args[
"bioseq_bfile"] ) {
1229 if ( args[
"submit_file"] ) {
1236 if ( args[
"submit_bfile"] ) {
1246 if ( args[
"align_file"] ) {
1249 while (
in.HaveMoreData() ) {
1252 annot->
SetData().SetAlign().push_back(align);
1258 if ( args[
"align_bfile"] ) {
1261 while (
in.HaveMoreData() ) {
1264 annot->
SetData().SetAlign().push_back(align);
1270 if ( args[
"blob_id"] ) {
1271 string str = args[
"blob_id"].AsString();
1272 vector<string> keys;
1274 if ( keys.size() < 2 || keys.size() > 3 ) {
1275 ERR_FATAL(
"Bad blob_id: "<<
str<<
". Should be sat/satkey(/subsat)?");
1278 ERR_FATAL(
"Cannot load by blob_id without Genbank loader");
1280 int sat, satkey, subsat = 0;
1283 if ( keys.size() == 3 ) {
1290 ERR_FATAL(
"Genbank entry with blob_id "<<
str<<
" not found");
1298 string gb_blob_id, seq_blob_id;
1299 if ( get_blob_id ) {
1304 ERR_POST(
"Cannot find blob id of "<<idh<<
" from GenBank");
1311 ERR_POST(
"Cannot blob id of "<<idh<<
": "<<exc);
1319 if ( get_blob_id ) {
1321 ERR_POST(
"Cannot find blob id of "<<idh);
1328 seq_blob_id = loader->GetName()+
'/'+seq_blob_id;
1332 if ( !gb_blob_id.empty() && gb_blob_id != seq_blob_id ) {
1337 bool error = !handle;
1343 if ( handle && args[
"get_title"] ) {
1344 NcbiCout <<
"Title: \"" << sequence::CDeflineGenerator().GenerateDefline(handle) <<
"\""
1351 if ( handle && get_synonyms ) {
1360 if ( handle && print_tse ) {
1363 NcbiCout <<
"-------------------- TSE --------------------\n";
1365 NcbiCout <<
"-------------------- END --------------------\n";
1367 if ( handle && print_seq ) {
1368 NcbiCout <<
"-------------------- SEQ --------------------\n";
1370 NcbiCout <<
"-------------------- END --------------------\n";
1377 bool plus_strand = args[
"plus_strand"];
1378 bool minus_strand = args[
"minus_strand"];
1379 bool ignore_strand = args[
"ignore_strand"];
1383 if ( plus_strand || minus_strand || args[
"range_from"] || args[
"range_to"] ) {
1384 if ( args[
"range_from"] ) {
1385 range_from = args[
"range_from"].AsInteger();
1390 if ( args[
"range_to"] ) {
1391 range_to = args[
"range_to"].AsInteger();
1397 range_loc->
SetInt().SetId(*search_id);
1398 range_loc->
SetInt().SetFrom(range_from);
1399 range_loc->
SetInt().SetTo(range_to);
1400 range.SetFrom(range_from).SetTo(range_to);
1402 if ( plus_strand ) {
1405 else if ( minus_strand ) {
1409 else if ( range_loc ) {
1411 range_from =
range.GetFrom();
1412 range_to =
range.GetTo();
1416 range_from = range_to = 0;
1417 range_loc = whole_loc;
1421 if ( args[
"range_loc"] ) {
1426 if ( args[
"overlap"].AsString() ==
"totalrange" )
1428 if ( args[
"overlap"].AsString() ==
"intervals" )
1430 bool no_map = args[
"no_map"];
1432 string table_field_name;
1433 if ( args[
"table_field_name"] )
1434 table_field_name = args[
"table_field_name"].AsString();
1435 int table_field_id = -1;
1436 if ( args[
"table_field_id"] )
1437 table_field_id = args[
"table_field_id"].AsInteger();
1438 bool modify = args[
"modify"];
1444 vector<CRef<CPrefetchRequest> > prefetch_snp;
1445 vector<CRef<CPrefetchRequest> > prefetch_seq;
1448 for (
int pass = 0; pass < repeat_count; ++pass ) {
1455 if ( pass && pause ) {
1460 if ( args[
"range_step"] && range_loc != whole_loc ) {
1461 TSeqPos step = args[
"range_step"].AsInteger();
1464 range_loc->
SetInt().SetFrom(range_from);
1465 range_loc->
SetInt().SetTo(range_to);
1476 if ( handle && get_seg_labels ) {
1477 x_Pause(
"getting seq map labels", pause_key);
1481 if ( exact_depth ) {
1492 for ( ; seg; ++seg ) {
1503 if ( handle && !only_features ) {
1508 NcbiCout <<
" "<<bit->GetSeqId()->DumpAsFasta()<<
1519 x_Pause(
"getting seq data", pause_key);
1523 if ( seq_vector_tse ) {
1534 if ( check_seq_data ) {
1542 sout += seq_vect[
i];
1554 char c = seq_vect[0];
1558 ERR_POST(
" cannot get last byte: Exception: "<<exc.
what());
1561 char c = seq_vect[seq_vect.
size()-1];
1565 ERR_POST(
" cannot get last byte: Exception: "<<exc.
what());
1569 if ( whole_sequence ) {
1575 if (
size <= 20u ) {
1585 ERR_POST(
"GetSeqData() failed: "<<exc);
1589 if ( scan_whole_sequence ) {
1597 if ( check_gaps && it.IsInGap() ) {
1598 NcbiCout <<
"Gap " << it.GetGapSizeForward()
1599 <<
" at "<<it.GetPos()<<
": ";
1601 it.GetGapSeq_literal();
1608 pos += it.GetGapSizeForward();
1612 if ( (pos & 0xffff) == 0 ) {
1626 ERR_POST(
"sequence scan failed at "<<pos<<
": "<<exc);
1631 if ( scan_whole_sequence2 ) {
1638 for ( ; pos < seq_vect.
size(); ++pos ) {
1639 if ( check_gaps && seq_vect.
IsInGap(pos) ) {
1642 <<
" at "<<pos<<
": ";
1654 if ( (pos & 0xffff) == 0 ) {
1667 ERR_POST(
"sequence scan failed at "<<pos<<
": "<<exc);
1675 x_Pause(
"getting seq desc", pause_key);
1676 for (
CSeqdesc_CI desc_it(handle, desc_type); desc_it; ++desc_it) {
1677 if ( print_descr ) {
1685 x_Pause(
"getting entry desc", pause_key);
1687 if ( print_descr ) {
1700 NcbiCout <<
"Seq_annot count (recursive):\t"
1709 NcbiCout <<
"Seq_annot count (non-recurs):\t"
1718 NcbiCout <<
"Seq_annot count (up to TSE):\t"
1725 NcbiCout <<
"Seq_annot count (TSE, recursive):\t"
1734 NcbiCout <<
"Seq_annot count (TSE, non-recurs):\t"
1757 if ( args[
"max_search_segments"] ) {
1759 if ( args[
"max_search_segments_action"] ) {
1760 const string& action = args[
"max_search_segments_action"].AsString();
1761 if ( action ==
"throw" ) {
1764 else if ( action ==
"log" ) {
1767 else if ( action ==
"ignore" ) {
1772 if ( args[
"max_search_time"] ) {
1775 if ( args[
"filter_bits"] ) {
1776 if ( args[
"filter_mask"] ) {
1778 args[
"filter_mask"].AsInt8());
1784 if ( args[
"exclude_if_gene_is_suppressed"] ) {
1787 if ( no_feat_policy ) {
1791 if ( only_feat_policy ) {
1797 if ( handle && externals_only ) {
1801 if ( added_annot ) {
1804 else if ( added_entry ) {
1807 else if ( handle ) {
1811 if ( include_allnamed ) {
1814 if ( include_unnamed ) {
1817 ITERATE ( vector<string>, it, include_named ) {
1820 ITERATE ( vector<string>, it, include_named_accs ) {
1826 ITERATE ( vector<string>, it, exclude_named ) {
1834 string sel_msg =
"any";
1835 if ( args[
"feat_type"] ) {
1836 feat_type = GetVariant<CSeqFeatData>(args[
"feat_type"]);
1840 if ( args[
"feat_subtype"] ) {
1845 if ( args[
"exclude_feat_type"] ) {
1850 if ( args[
"exclude_feat_subtype"] ) {
1855 if (args[
"snp_scale"]) {
1861 typedef int TTableField;
1862 unique_ptr< CTableFieldHandle<TTableField> > table_field;
1863 if ( table_field_id >= 0 ) {
1866 else if ( !table_field_name.empty() ) {
1872 if ( prefetch_manager ) {
1877 prefetch_seq.clear();
1878 prefetch_snp.clear();
1879 TSeqPos step = args[
"range_step"].AsInteger();
1880 for (
int i = 0;
i < 2; ++
i ) {
1881 TSeqPos from = range_from + step/2*
i;
1883 prefetch_snp.push_back
1889 prefetch_seq.push_back
1898 if ( get_types || get_names ) {
1907 <<
" (" << setw(2) <<
t <<
") "
1928 ITERATE ( vector<string>, it, include_named_accs ) {
1954 ITERATE ( vector<string>,
i, include_named_accs ) {
1958 scope, *range_loc, &sel2);
1960 if ( name.IsNamed() ) {
1961 NcbiCout <<
"Named annot: " << name.GetName()
1981 CFeat_CI it(scope, *range_loc, sel);
1983 if (
i->IsNamed() ) {
1984 NcbiCout <<
"Named annot: " <<
i->GetName()
2005 if (
i->IsNamed() ) {
2006 NcbiCout <<
"Named annot: " <<
i->GetName()
2027 if (
i->IsNamed() ) {
2028 NcbiCout <<
"Named annot: " <<
i->GetName()
2049 if (
i->IsNamed() ) {
2050 NcbiCout <<
"Named annot: " <<
i->GetName()
2071 if (
i->IsNamed() ) {
2072 NcbiCout <<
"Named annot: " <<
i->GetName()
2087 if ( !skip_features ) {
2088 if ( count_types ) {
2091 if ( count_subtypes ) {
2095 if ( handle && print_features && print_mapper ) {
2099 if ( handle && args[
"feat_id"] ) {
2100 int feat_id = args[
"feat_id"].AsInteger();
2101 vector<CSeq_feat_Handle> feats;
2103 for (
int t = 0;
t < 4; ++
t ) {
2107 << feat_id <<
" +type:";
2112 << feat_id <<
" +subtype:";
2117 << feat_id <<
" +type:";
2122 << feat_id <<
" +subtype:";
2126 if ( print_features ) {
2128 ITERATE ( vector<CSeq_feat_Handle>, it, feats ) {
2137 if ( handle && args[
"feat_id_str"] ) {
2138 string feat_id = args[
"feat_id_str"].AsString();
2139 vector<CSeq_feat_Handle> feats;
2141 for (
int t = 0;
t < 4; ++
t ) {
2145 << feat_id <<
" +type:";
2150 << feat_id <<
" +subtype:";
2155 << feat_id <<
" +type:";
2160 << feat_id <<
" +subtype:";
2164 if ( print_features ) {
2166 ITERATE ( vector<CSeq_feat_Handle>, it, feats ) {
2176 int matches = 0, mismatches = 0;
2177 vector<CConstRef<CSeq_feat> > feats;
2178 vector<CMappedFeat> mapped_feats;
2179 vector<CConstRef<CSeq_loc> > mapped_locs;
2181 x_Pause(
"getting features", pause_key);
2184 CFeat_CI it(scope, *range_loc, base_sel);
2186 NcbiCout <<
"***** Max search segments limit is reached *****" <<
NcbiEndl;
2194 if ( count_types ) {
2197 if ( count_subtypes ) {
2201 if ( print_annot_desc ) {
2204 if ( get_mapped_location )
2206 if ( get_original_feature )
2208 if ( get_mapped_feature ) {
2246 if ( sort_seq_feat ) {
2249 if ( save_mapped_feat ) {
2250 mapped_feats.push_back(*it);
2254 if ( table_field.get() &&
2257 if ( table_field->TryGet(it,
value) ) {
2260 value = table_field->Get(it);
2264 if ( print_features ) {
2297 NcbiCout <<
"Mapped orig location:\n" <<
2301 NcbiCout <<
"Mapped iter location:\n"<<
2323 if ( handle && print_features &&
2326 using namespace sequence;
2345 NcbiCout <<
"GetBestGeneForMrna: ";
2366 if ( print_features &&
2368 using namespace sequence;
2390 if ( print_features &&
2392 using namespace sequence;
2420 NcbiCout <<
"Reverse CSeq_feat_Handle lookup failed."
2425 NcbiCout <<
"Reverse CSeq_feat_Handle differs: "
2431 NcbiCout <<
"Feat count (loc range, " << sel_msg <<
"):\t"
2432 << count <<
" in " <<
sw.
Elapsed() <<
" secs "
2434 if ( print_annot_desc ) {
2435 for (
auto& annot : annots ) {
2436 if ( annot.Seq_annot_IsSetDesc() ) {
2447 if ( sort_seq_feat && !feats.empty() ) {
2448 NcbiCout <<
"Sorting " << feats.size() <<
" features..."
2450 vector<CConstRef<CSeq_feat> > sorted_feats = feats;
2453 if ( sorted_feats != feats ) {
2454 NcbiCout <<
"Sorted features are in another order."
2456 for (
size_t i = 0;
i < sorted_feats.size(); ++
i ) {
2457 if ( feats[
i] != sorted_feats[
i] ) {
2465 catch ( exception& exc ) {
2466 NcbiCout <<
"Exception while sorting: " << exc.what()
2470 if ( save_mapped_feat ) {
2471 for (
size_t i = 0;
i < mapped_feats.size(); ++
i ) {
2475 << mapped_feats[
i].GetMappedFeature();
2479 if ( count_types ) {
2480 ITERATE ( vector<int>, vit, types_counts ) {
2491 if ( count_subtypes ) {
2492 ITERATE ( vector<int>, vit, subtypes_counts ) {
2499 setw(3) << subtype <<
2506 feature::CFeatTree feat_tree;
2507 feat_tree.SetFeatIdMode(feat_id_mode);
2508 feat_tree.SetSNPStrandMode(snp_strand_mode);
2511 if ( tse_feat_tree ) {
2515 it2 =
CFeat_CI(scope, *range_loc, base_sel);
2517 feat_tree.AddFeatures(it2);
2530 list<CMappedFeat> q;
2532 ITERATE ( list<CMappedFeat>, pit, q ) {
2534 vector<CMappedFeat> cc =
2535 feat_tree.GetChildren(parent);
2537 ITERATE ( vector<CMappedFeat>, cit, cc ) {
2544 CMappedFeat gene = feat_tree.GetBestGene(child, feat_tree.eBestGene_OverlappedOnly);
2545 if ( gene != gene1 ) {
2546 if ( gene && !by_gene.count(gene) ) {
2552 if ( gene2 != gene1 ) {
2574 NcbiCout <<
"Children of "<<index[*fit] <<
": ";
2591 if ( !by_gene.
empty() ) {
2601 if ( verify_tree ) {
2617 size_t no_product_count = 0;
2619 for (
CFeat_CI it(scope, *range_loc, sel); it; ++it ) {
2625 cds_vect =
CSeqVector(it->GetLocation(), scope,
2629 if ( it->IsSetProduct() ) {
2630 cds_vect =
CSeqVector(it->GetProduct(), scope,
2641 " len=" << cds_vect.
size() <<
" data=";
2643 if ( cds_vect.
size() == 0 ) {
2645 it->GetOriginalFeature().GetLocation();
2647 it->GetMappedFeature().GetLocation();
2656 it->GetMappedFeature().GetLocation().CheckId(mapped_id);
2665 sout += cds_vect[
i];
2671 NcbiCout <<
"Feat count (loc range, cds):\t" << count
2674 if ( no_product_count ) {
2675 NcbiCout <<
"*** no product on " << no_product_count <<
" cds"
2689 if ( !skip_features && handle ) {
2690 for (
CFeat_CI it(handle,
range, range_strand, base_sel); it; ++it ) {
2693 NcbiCout <<
"Feat count (bh range, " << sel_msg <<
"):\t"
2694 << count <<
" in " <<
sw.
Elapsed() <<
" secs"
2698 if ( !only_features ) {
2699 if ( handle && whole_tse ) {
2706 NcbiCout <<
"Feat count (Seq):\t" << count
2715 NcbiCout <<
"Feat count (TSE):\t" << count
2720 if ( !skip_graphs ) {
2726 CGraph_CI it(scope, *range_loc, base_sel);
2734 if ( print_annot_desc ) {
2738 if ( get_mapped_location )
2740 if ( get_original_feature )
2742 if ( get_mapped_feature )
2744 if ( print_graph_stats ) {
2754 actual_size = vv.size();
2755 asn_max =
g.GetMax();
2756 actual_max = *max_element((
const Uint1*)vv.data(),
2757 (
const Uint1*)vv.data()+actual_size);
2758 for (
auto c : vv ) {
2760 sum.
AddChars((
const char*)&v,
sizeof(v));
2763 <<
" sum: "<<accumulate(vv.begin(), vv.end(), 0ull);
2768 actual_size = vv.size();
2769 asn_max =
g.GetMax();
2770 actual_max = *max_element(vv.data(), vv.data()+actual_size);
2771 sum.
AddChars((
const char*)vv.data(), actual_size*
sizeof(vv[0]));
2773 <<
" sum: "<<accumulate(vv.begin(), vv.end(), 0ull);
2780 if ( actual_size !=
size_t(graph.
GetNumval()) ) {
2783 if ( actual_max != asn_max ) {
2787 if ( print_graphs ) {
2793 NcbiCout <<
"Graph count (loc range):\t" << count
2796 if ( print_annot_desc ) {
2797 for (
auto& annot : annots ) {
2798 if ( annot.Seq_annot_IsSetDesc() ) {
2805 if ( !skip_alignments ) {
2809 CAlign_CI it(scope, *range_loc, base_sel);
2817 if ( get_mapped_alignments ) {
2820 if ( print_alignments ) {
2824 << it.GetOriginalSeq_align();
2828 for (
auto& uoref : align.
GetExt() ) {
2832 cout <<
"Haplotype: "<<field->GetInt()<<endl;
2838 NcbiCout <<
"Align count (loc range):\t" << count
2843 if ( args[
"search_annots"] ) {
2847 for (
CAnnot_CI it(scope, *range_loc, base_sel); it; ++it) {
2850 NcbiCout <<
"Annot count (loc range):\t" << count
2855 if ( !skip_tables ) {
2862 for (
CAnnot_CI it(scope, *range_loc, sel); it; ++it) {
2867 table_counts[annot.
GetName()].first += 1;
2868 table_counts[annot.
GetName()].second += rows;
2869 if ( args[
"print_seq_table"] ) {
2874 if ( table_field.get() ) {
2875 for (
size_t row = 0;
row < rows; ++
row ) {
2877 if ( table_field->TryGet(annot,
row,
value) ) {
2885 for (
auto& c : table_counts ) {
2886 if ( c.first.IsNamed() ) {
2887 NcbiCout <<
"Named " << c.first.GetName();
2892 NcbiCout <<
" " << c.second.first <<
" Seq-table(s) with "
2893 << c.second.second <<
" rows."
2896 NcbiCout <<
"Table count (loc range):\t" << count
2900 if ( !skip_tables ) {
2905 for (
CSeq_table_CI it(scope, *range_loc, base_sel); it; ++it) {
2908 if ( args[
"print_seq_table"] ) {
2915 table_counts[annot.
GetName()].first += 1;
2916 table_counts[annot.
GetName()].second += rows;
2923 if ( it.IsMapped() ) {
2929 if ( table_field.get() ) {
2930 for (
size_t row = 0;
row < rows; ++
row ) {
2932 if ( table_field->TryGet(annot,
row,
value) ) {
2940 for (
auto& c : table_counts ) {
2941 if ( c.first.IsNamed() ) {
2942 NcbiCout <<
"Named " << c.first.GetName();
2947 NcbiCout <<
" " << c.second.first <<
" Seq-table(s) with "
2948 << c.second.second <<
" rows."
2951 NcbiCout <<
"Table count (loc range):\t" << count
2956 if ( !skip_features ) {
2962 for (
CAnnot_CI it(scope, *range_loc, sel); it; ++it) {
2966 NcbiCout <<
"Locs count (loc range):\t" << count
2971 if ( !save_NA_prefix.empty() ) {
2976 const string& acc = *nit;
2986 for (
CAnnot_CI it(handle, sel); it; ++it ) {
2992 string name = save_NA_prefix+acc;
3005 if ( handle && scan_gaps ) {
3011 cout <<
"Scanning gaps up to level "<<max_level<<endl;
3013 size_t gap_count = 0;
3016 sel.
SetRange(range_from, range_length);
3018 for (
size_t level = 0; level < max_level; ++level ) {
3019 bool has_refs =
false;
3028 cout <<
"level "<<level
3029 <<
" @" << seg.GetPosition() <<
"-" << seg.GetEndPosition()
3030 <<
" len=" << seg.GetLength() <<
": gap"
3034 cout <<
"Scanned level " << level <<
" in " << sw2.
Elapsed() <<
" secs"
3040 cout <<
"Found " << gap_count <<
" gaps in " <<
sw.
Elapsed() <<
" secs"
3044 if ( handle && scan_seq_map ) {
3049 TSeqPos actual_length = actual_end; actual_length -= range_from;
3054 for (
size_t level = 0; level < max_level; ++level) {
3058 if ( exact_depth ) {
3069 for ( ; seg; ++seg ) {
3104 _ASSERT(
"Unexpected END segment" && 0);
3108 _ASSERT(
"Unexpected segment type" && 0);
3114 _VERIFY(level || total_length == actual_length);
3118 for ( --seg; seg; --seg ) {
3122 _VERIFY(total_length == new_length);
3126 for ( ++seg; seg; ++seg ) {
3130 _VERIFY(total_length == new_length);
3135 _ASSERT(begin.GetPosition() == 0);
3142 total_length += iter.GetLength();
3149 total_length += iter.GetLength();
3166 <<
" = " << seq.
GetResult().substr(0, 10) <<
"..."
3170 if ( handle && args[
"feat_id"] ) {
3175 NcbiCout <<
"Feature with id " << id;
3176 if ( print_features ) {
3186 NcbiCout <<
"Feature with id " << oid;
3187 if ( print_features ) {
3195 if ( handle && modify ) {
3212 _ASSERT(pseh == pseh.GetEditHandle());
3213 pseh.GetEditHandle().AttachBioseq(*newseq);
3221 if ( dump_seq_id ) {
3223 cout <<
"Got CSeq_id_Mapper bytes: "<<bytes<<endl;
3227 if ( args[
"reset_scope"] ) {
3230 cout <<
"Scope reset" << endl;
3235 if ( used_memory_check ) {
3236 if ( args[
"reset_scope"] ) {
3243 if ( handle && args[
"reset_scope"] ) {
3250 cout <<
"Exception: " << exc.
what() << endl;
3259 return handle && !
error? 0: 1;
3278 int main(
int argc,
const char* argv[])
3280 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)
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).
static CNcbiApplication * Instance(void)
Singleton method.
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]
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
static const char * str(char *buf, int n)
#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
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.
void SetData(TData &value)
Assign a value to Data data member.
const TId & GetId(void) const
Get the Id member data.
@ 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
const GenericPointer< typename T::ValueType > T2 value
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)
#define row(bind, expected)
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)