From 3cce4167a5b99fda4b9b372ee73494ed36dbcd59 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 6 Dec 2012 12:06:15 -0800 Subject: [PATCH] Imported Upstream version 0.12.7 --- AUTHORS | 19 + COPYING | 114 + MANUAL | 1671 + MANUAL.markdown | 2362 + Makefile | 329 + NEWS | 562 + SeqAn-1.1/GPL.txt | 674 + SeqAn-1.1/LGPL.txt | 165 + SeqAn-1.1/README.txt | 29 + SeqAn-1.1/platform_linux_gcc.h | 26 + SeqAn-1.1/platform_windows_mingw.h | 10 + SeqAn-1.1/platform_windows_vs.h | 13 + SeqAn-1.1/seqan/basic.h | 115 + SeqAn-1.1/seqan/basic/basic_aggregates.h | 689 + .../seqan/basic/basic_allocator_interface.h | 236 + .../seqan/basic/basic_allocator_multipool.h | 230 + .../seqan/basic/basic_allocator_simple.h | 210 + .../seqan/basic/basic_allocator_singlepool.h | 299 + .../seqan/basic/basic_allocator_to_std.h | 178 + .../seqan/basic/basic_alphabet_interface.h | 917 + .../seqan/basic/basic_alphabet_interface2.h | 178 + SeqAn-1.1/seqan/basic/basic_alphabet_simple.h | 1296 + .../seqan/basic/basic_alphabet_simple_tabs.h | 439 + .../seqan/basic/basic_alphabet_trait_basic.h | 733 + SeqAn-1.1/seqan/basic/basic_compare.h | 60 + SeqAn-1.1/seqan/basic/basic_converter.h | 117 + SeqAn-1.1/seqan/basic/basic_counted_ptr.h | 116 + SeqAn-1.1/seqan/basic/basic_debug.h | 385 + SeqAn-1.1/seqan/basic/basic_definition.h | 405 + SeqAn-1.1/seqan/basic/basic_forwards.h | 71 + .../seqan/basic/basic_generated_forwards.h | 1941 + SeqAn-1.1/seqan/basic/basic_holder.h | 1120 + SeqAn-1.1/seqan/basic/basic_host.h | 171 + SeqAn-1.1/seqan/basic/basic_iterator.h | 732 + .../seqan/basic/basic_iterator_adapt_std.h | 436 + .../seqan/basic/basic_iterator_adaptor.h | 524 + SeqAn-1.1/seqan/basic/basic_iterator_base.h | 221 + .../seqan/basic/basic_iterator_position.h | 450 + SeqAn-1.1/seqan/basic/basic_iterator_simple.h | 117 + SeqAn-1.1/seqan/basic/basic_metaprogramming.h | 293 + SeqAn-1.1/seqan/basic/basic_operator.h | 32 + SeqAn-1.1/seqan/basic/basic_pointer.h | 103 + SeqAn-1.1/seqan/basic/basic_profile.h | 503 + SeqAn-1.1/seqan/basic/basic_proxy.h | 606 + SeqAn-1.1/seqan/basic/basic_tag.h | 173 + SeqAn-1.1/seqan/basic/basic_transport.h | 196 + SeqAn-1.1/seqan/basic/basic_type.h | 624 + SeqAn-1.1/seqan/basic/basic_volatile_ptr.h | 159 + SeqAn-1.1/seqan/file.h | 89 + SeqAn-1.1/seqan/file/chunk_collector.h | 534 + SeqAn-1.1/seqan/file/cstream.h | 283 + SeqAn-1.1/seqan/file/file_array.h | 427 + SeqAn-1.1/seqan/file/file_base.h | 697 + SeqAn-1.1/seqan/file/file_format.h | 686 + SeqAn-1.1/seqan/file/file_format_cgviz.h | 226 + SeqAn-1.1/seqan/file/file_format_fasta.h | 520 + .../seqan/file/file_format_fasta_align.h | 320 + SeqAn-1.1/seqan/file/file_format_guess.h | 103 + SeqAn-1.1/seqan/file/file_format_raw.h | 345 + SeqAn-1.1/seqan/file/file_forwards.h | 44 + .../seqan/file/file_generated_forwards.h | 1155 + SeqAn-1.1/seqan/file/meta.h | 36 + SeqAn-1.1/seqan/file/stream.h | 430 + SeqAn-1.1/seqan/file/stream_algorithms.h | 208 + SeqAn-1.1/seqan/find.h | 78 + SeqAn-1.1/seqan/find/find_base.h | 806 + .../seqan/find/find_generated_forwards.h | 838 + SeqAn-1.1/seqan/find/find_horspool.h | 483 + SeqAn-1.1/seqan/find/find_multi.h | 143 + SeqAn-1.1/seqan/find/find_multiple_shiftand.h | 418 + SeqAn-1.1/seqan/find/find_score.h | 451 + SeqAn-1.1/seqan/find/find_set_horspool.h | 286 + SeqAn-1.1/seqan/index.h | 113 + SeqAn-1.1/seqan/index/index_base.h | 954 + SeqAn-1.1/seqan/index/index_find.h | 268 + .../seqan/index/index_generated_forwards.h | 2648 + SeqAn-1.1/seqan/index/index_manual_forwards.h | 55 + SeqAn-1.1/seqan/index/index_qgram_find.h | 82 + SeqAn-1.1/seqan/index/index_sa_lss.h | 427 + SeqAn-1.1/seqan/index/shape_base.h | 607 + SeqAn-1.1/seqan/index/shape_gapped.h | 593 + SeqAn-1.1/seqan/index/shape_predefined.h | 114 + SeqAn-1.1/seqan/platform.h | 27 + SeqAn-1.1/seqan/sequence.h | 65 + SeqAn-1.1/seqan/sequence/lexical.h | 787 + SeqAn-1.1/seqan/sequence/segment_base.h | 1181 + SeqAn-1.1/seqan/sequence/segment_infix.h | 794 + SeqAn-1.1/seqan/sequence/segment_prefix.h | 595 + SeqAn-1.1/seqan/sequence/segment_suffix.h | 583 + SeqAn-1.1/seqan/sequence/sequence_forwards.h | 52 + .../sequence/sequence_generated_forwards.h | 1557 + SeqAn-1.1/seqan/sequence/sequence_interface.h | 1516 + SeqAn-1.1/seqan/sequence/sequence_multiple.h | 2286 + SeqAn-1.1/seqan/sequence/sequence_shortcuts.h | 197 + SeqAn-1.1/seqan/sequence/std_string.h | 691 + SeqAn-1.1/seqan/sequence/string_alloc.h | 467 + SeqAn-1.1/seqan/sequence/string_array.h | 237 + SeqAn-1.1/seqan/sequence/string_base.h | 1695 + SeqAn-1.1/seqan/sequence/string_cstyle.h | 808 + SeqAn-1.1/seqan/sequence/string_packed.h | 1262 + SeqAn-1.1/seqan/sequence/string_pointer.h | 842 + SeqAn-1.1/seqan/sequence/string_stack.h | 532 + .../seqan/sequence/string_value_expand.h | 514 + TUTORIAL | 152 + VERSION | 1 + aligner.h | 2008 + aligner_0mm.h | 382 + aligner_1mm.h | 494 + aligner_23mm.h | 691 + aligner_metrics.h | 336 + aligner_seed_mm.h | 1390 + alphabet.c | 239 + alphabet.h | 252 + annot.cpp | 30 + annot.h | 62 + assert_helpers.h | 259 + auto_array.h | 38 + binary_sa_search.h | 76 + bitpack.h | 34 + bitset.h | 527 + blockwise_sa.h | 902 + bowtie_build_main.cpp | 57 + bowtie_inspect.cpp | 529 + bowtie_main.cpp | 57 + ccnt_lut.cpp | 302 + chaincat.cpp | 37 + color.cpp | 114 + color.h | 27 + color_dec.cpp | 347 + color_dec.h | 31 + diff_sample.h | 982 + doc/README | 4 + doc/manual.html | 4350 + doc/strip_markdown.pl | 39 + doc/style.css | 140 + ebwt.cpp | 66 + ebwt.h | 4496 + ebwt_build.cpp | 637 + ebwt_search.cpp | 3002 + ebwt_search_backtrack.h | 3201 + ebwt_search_util.cpp | 44 + ebwt_search_util.h | 375 + edit.cpp | 16 + edit.h | 90 + endian_swap.h | 78 + filebuf.h | 567 + formats.h | 57 + genomes/NC_008253.fna | 70557 ++++++++++++++++ hit.cpp | 378 + hit.h | 2095 + hit_set.cpp | 72 + hit_set.h | 483 + indexes/e_coli.1.ebwt | Bin 0 -> 1476941 bytes indexes/e_coli.2.ebwt | Bin 0 -> 617372 bytes indexes/e_coli.3.ebwt | Bin 0 -> 17 bytes indexes/e_coli.4.ebwt | Bin 0 -> 1234730 bytes indexes/e_coli.README | 4 + indexes/e_coli.rev.1.ebwt | Bin 0 -> 1476941 bytes indexes/e_coli.rev.2.ebwt | Bin 0 -> 617372 bytes log.cpp | 7 + log.h | 31 + mm.h | 29 + multikey_qsort.h | 1145 + pat.cpp | 147 + pat.h | 3133 + pool.h | 401 + qual.cpp | 66 + qual.h | 201 + random_source.h | 61 + random_test.cpp | 48 + range.h | 50 + range_cache.h | 546 + range_chaser.h | 296 + range_source.h | 2555 + reads/e_coli_1000.fa | 2000 + reads/e_coli_1000.fq | 4000 + reads/e_coli_1000.raw | 1000 + reads/e_coli_10000snp.fa | 20000 +++++ reads/e_coli_10000snp.fq | 40000 +++++++++ reads/e_coli_1000_1.fa | 2000 + reads/e_coli_1000_1.fq | 4000 + reads/e_coli_1000_2.fa | 2000 + reads/e_coli_1000_2.fq | 4000 + ref_aligner.cpp | 65 + ref_aligner.h | 5119 ++ ref_read.cpp | 298 + ref_read.h | 285 + reference.h | 724 + refmap.cpp | 64 + refmap.h | 64 + row_chaser.h | 187 + sam.cpp | 359 + sam.h | 181 + scripts/best_verify.pl | 198 + scripts/bs_mapability.pl | 222 + scripts/build_test.sh | 14 + scripts/colorize_fasta.pl | 46 + scripts/colorize_fastq.pl | 45 + scripts/convert_quals.pl | 114 + scripts/fastq_to_tabbed.pl | 112 + scripts/gen_2b_occ_lookup.pl | 87 + scripts/gen_dnamasks2colormask.pl | 31 + scripts/gen_occ_lookup.pl | 238 + scripts/gen_solqual_lookup.pl | 61 + scripts/make_a_thaliana_tair.sh | 54 + scripts/make_b_taurus_UMD3.sh | 89 + scripts/make_c_elegans_ws200.sh | 48 + scripts/make_canFam2.sh | 61 + scripts/make_d_melanogaster_fb5_22.sh | 52 + scripts/make_e_coli.sh | 46 + scripts/make_galGal3.sh | 74 + scripts/make_h_sapiens_ncbi36.sh | 80 + scripts/make_h_sapiens_ncbi37.sh | 104 + scripts/make_hg18.sh | 121 + scripts/make_hg19.sh | 165 + scripts/make_m_musculus_ncbi37.sh | 72 + scripts/make_mm8.sh | 103 + scripts/make_mm9.sh | 104 + scripts/make_rn4.sh | 97 + scripts/make_s_cerevisiae.sh | 47 + scripts/mapability.pl | 191 + scripts/pe_verify.pl | 356 + scripts/random_bowtie_tests.pl | 1197 + scripts/random_bowtie_tests.sh | 37 + scripts/random_bowtie_tests_p.sh | 28 + scripts/reconcile_alignments.pl | 330 + scripts/reconcile_alignments_pe.pl | 482 + search_1mm_phase1.c | 67 + search_1mm_phase2.c | 31 + search_23mm_phase1.c | 47 + search_23mm_phase2.c | 43 + search_23mm_phase3.c | 67 + search_exact.c | 27 + search_globals.h | 24 + search_seeded_phase1.c | 89 + search_seeded_phase2.c | 99 + search_seeded_phase3.c | 144 + search_seeded_phase4.c | 94 + sequence_io.h | 174 + shmem.cpp | 37 + shmem.h | 146 + spinlock.h | 127 + str_util.h | 28 + threading.h | 74 + timer.h | 63 + tokenize.h | 50 + word_io.h | 142 + zbox.h | 76 + 248 files changed, 256128 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 MANUAL create mode 100644 MANUAL.markdown create mode 100644 Makefile create mode 100644 NEWS create mode 100644 SeqAn-1.1/GPL.txt create mode 100644 SeqAn-1.1/LGPL.txt create mode 100644 SeqAn-1.1/README.txt create mode 100644 SeqAn-1.1/platform_linux_gcc.h create mode 100644 SeqAn-1.1/platform_windows_mingw.h create mode 100644 SeqAn-1.1/platform_windows_vs.h create mode 100644 SeqAn-1.1/seqan/basic.h create mode 100644 SeqAn-1.1/seqan/basic/basic_aggregates.h create mode 100644 SeqAn-1.1/seqan/basic/basic_allocator_interface.h create mode 100644 SeqAn-1.1/seqan/basic/basic_allocator_multipool.h create mode 100644 SeqAn-1.1/seqan/basic/basic_allocator_simple.h create mode 100644 SeqAn-1.1/seqan/basic/basic_allocator_singlepool.h create mode 100644 SeqAn-1.1/seqan/basic/basic_allocator_to_std.h create mode 100644 SeqAn-1.1/seqan/basic/basic_alphabet_interface.h create mode 100644 SeqAn-1.1/seqan/basic/basic_alphabet_interface2.h create mode 100644 SeqAn-1.1/seqan/basic/basic_alphabet_simple.h create mode 100644 SeqAn-1.1/seqan/basic/basic_alphabet_simple_tabs.h create mode 100644 SeqAn-1.1/seqan/basic/basic_alphabet_trait_basic.h create mode 100644 SeqAn-1.1/seqan/basic/basic_compare.h create mode 100644 SeqAn-1.1/seqan/basic/basic_converter.h create mode 100644 SeqAn-1.1/seqan/basic/basic_counted_ptr.h create mode 100644 SeqAn-1.1/seqan/basic/basic_debug.h create mode 100644 SeqAn-1.1/seqan/basic/basic_definition.h create mode 100644 SeqAn-1.1/seqan/basic/basic_forwards.h create mode 100644 SeqAn-1.1/seqan/basic/basic_generated_forwards.h create mode 100644 SeqAn-1.1/seqan/basic/basic_holder.h create mode 100644 SeqAn-1.1/seqan/basic/basic_host.h create mode 100644 SeqAn-1.1/seqan/basic/basic_iterator.h create mode 100644 SeqAn-1.1/seqan/basic/basic_iterator_adapt_std.h create mode 100644 SeqAn-1.1/seqan/basic/basic_iterator_adaptor.h create mode 100644 SeqAn-1.1/seqan/basic/basic_iterator_base.h create mode 100644 SeqAn-1.1/seqan/basic/basic_iterator_position.h create mode 100644 SeqAn-1.1/seqan/basic/basic_iterator_simple.h create mode 100644 SeqAn-1.1/seqan/basic/basic_metaprogramming.h create mode 100644 SeqAn-1.1/seqan/basic/basic_operator.h create mode 100644 SeqAn-1.1/seqan/basic/basic_pointer.h create mode 100644 SeqAn-1.1/seqan/basic/basic_profile.h create mode 100644 SeqAn-1.1/seqan/basic/basic_proxy.h create mode 100644 SeqAn-1.1/seqan/basic/basic_tag.h create mode 100644 SeqAn-1.1/seqan/basic/basic_transport.h create mode 100644 SeqAn-1.1/seqan/basic/basic_type.h create mode 100644 SeqAn-1.1/seqan/basic/basic_volatile_ptr.h create mode 100644 SeqAn-1.1/seqan/file.h create mode 100644 SeqAn-1.1/seqan/file/chunk_collector.h create mode 100644 SeqAn-1.1/seqan/file/cstream.h create mode 100644 SeqAn-1.1/seqan/file/file_array.h create mode 100644 SeqAn-1.1/seqan/file/file_base.h create mode 100644 SeqAn-1.1/seqan/file/file_format.h create mode 100644 SeqAn-1.1/seqan/file/file_format_cgviz.h create mode 100644 SeqAn-1.1/seqan/file/file_format_fasta.h create mode 100644 SeqAn-1.1/seqan/file/file_format_fasta_align.h create mode 100644 SeqAn-1.1/seqan/file/file_format_guess.h create mode 100644 SeqAn-1.1/seqan/file/file_format_raw.h create mode 100644 SeqAn-1.1/seqan/file/file_forwards.h create mode 100644 SeqAn-1.1/seqan/file/file_generated_forwards.h create mode 100644 SeqAn-1.1/seqan/file/meta.h create mode 100644 SeqAn-1.1/seqan/file/stream.h create mode 100644 SeqAn-1.1/seqan/file/stream_algorithms.h create mode 100644 SeqAn-1.1/seqan/find.h create mode 100644 SeqAn-1.1/seqan/find/find_base.h create mode 100644 SeqAn-1.1/seqan/find/find_generated_forwards.h create mode 100644 SeqAn-1.1/seqan/find/find_horspool.h create mode 100644 SeqAn-1.1/seqan/find/find_multi.h create mode 100644 SeqAn-1.1/seqan/find/find_multiple_shiftand.h create mode 100644 SeqAn-1.1/seqan/find/find_score.h create mode 100644 SeqAn-1.1/seqan/find/find_set_horspool.h create mode 100644 SeqAn-1.1/seqan/index.h create mode 100644 SeqAn-1.1/seqan/index/index_base.h create mode 100644 SeqAn-1.1/seqan/index/index_find.h create mode 100644 SeqAn-1.1/seqan/index/index_generated_forwards.h create mode 100644 SeqAn-1.1/seqan/index/index_manual_forwards.h create mode 100644 SeqAn-1.1/seqan/index/index_qgram_find.h create mode 100644 SeqAn-1.1/seqan/index/index_sa_lss.h create mode 100644 SeqAn-1.1/seqan/index/shape_base.h create mode 100644 SeqAn-1.1/seqan/index/shape_gapped.h create mode 100644 SeqAn-1.1/seqan/index/shape_predefined.h create mode 100644 SeqAn-1.1/seqan/platform.h create mode 100644 SeqAn-1.1/seqan/sequence.h create mode 100644 SeqAn-1.1/seqan/sequence/lexical.h create mode 100644 SeqAn-1.1/seqan/sequence/segment_base.h create mode 100644 SeqAn-1.1/seqan/sequence/segment_infix.h create mode 100644 SeqAn-1.1/seqan/sequence/segment_prefix.h create mode 100644 SeqAn-1.1/seqan/sequence/segment_suffix.h create mode 100644 SeqAn-1.1/seqan/sequence/sequence_forwards.h create mode 100644 SeqAn-1.1/seqan/sequence/sequence_generated_forwards.h create mode 100644 SeqAn-1.1/seqan/sequence/sequence_interface.h create mode 100644 SeqAn-1.1/seqan/sequence/sequence_multiple.h create mode 100644 SeqAn-1.1/seqan/sequence/sequence_shortcuts.h create mode 100644 SeqAn-1.1/seqan/sequence/std_string.h create mode 100644 SeqAn-1.1/seqan/sequence/string_alloc.h create mode 100644 SeqAn-1.1/seqan/sequence/string_array.h create mode 100644 SeqAn-1.1/seqan/sequence/string_base.h create mode 100644 SeqAn-1.1/seqan/sequence/string_cstyle.h create mode 100644 SeqAn-1.1/seqan/sequence/string_packed.h create mode 100644 SeqAn-1.1/seqan/sequence/string_pointer.h create mode 100644 SeqAn-1.1/seqan/sequence/string_stack.h create mode 100644 SeqAn-1.1/seqan/sequence/string_value_expand.h create mode 100644 TUTORIAL create mode 100644 VERSION create mode 100644 aligner.h create mode 100644 aligner_0mm.h create mode 100644 aligner_1mm.h create mode 100644 aligner_23mm.h create mode 100644 aligner_metrics.h create mode 100644 aligner_seed_mm.h create mode 100644 alphabet.c create mode 100644 alphabet.h create mode 100644 annot.cpp create mode 100644 annot.h create mode 100644 assert_helpers.h create mode 100644 auto_array.h create mode 100644 binary_sa_search.h create mode 100644 bitpack.h create mode 100644 bitset.h create mode 100644 blockwise_sa.h create mode 100644 bowtie_build_main.cpp create mode 100644 bowtie_inspect.cpp create mode 100644 bowtie_main.cpp create mode 100644 ccnt_lut.cpp create mode 100644 chaincat.cpp create mode 100644 color.cpp create mode 100644 color.h create mode 100644 color_dec.cpp create mode 100644 color_dec.h create mode 100644 diff_sample.h create mode 100644 doc/README create mode 100644 doc/manual.html create mode 100644 doc/strip_markdown.pl create mode 100644 doc/style.css create mode 100644 ebwt.cpp create mode 100644 ebwt.h create mode 100644 ebwt_build.cpp create mode 100644 ebwt_search.cpp create mode 100644 ebwt_search_backtrack.h create mode 100644 ebwt_search_util.cpp create mode 100644 ebwt_search_util.h create mode 100644 edit.cpp create mode 100644 edit.h create mode 100644 endian_swap.h create mode 100644 filebuf.h create mode 100644 formats.h create mode 100644 genomes/NC_008253.fna create mode 100644 hit.cpp create mode 100644 hit.h create mode 100644 hit_set.cpp create mode 100644 hit_set.h create mode 100644 indexes/e_coli.1.ebwt create mode 100644 indexes/e_coli.2.ebwt create mode 100644 indexes/e_coli.3.ebwt create mode 100644 indexes/e_coli.4.ebwt create mode 100644 indexes/e_coli.README create mode 100644 indexes/e_coli.rev.1.ebwt create mode 100644 indexes/e_coli.rev.2.ebwt create mode 100644 log.cpp create mode 100644 log.h create mode 100644 mm.h create mode 100644 multikey_qsort.h create mode 100644 pat.cpp create mode 100644 pat.h create mode 100644 pool.h create mode 100644 qual.cpp create mode 100644 qual.h create mode 100644 random_source.h create mode 100644 random_test.cpp create mode 100644 range.h create mode 100644 range_cache.h create mode 100644 range_chaser.h create mode 100644 range_source.h create mode 100644 reads/e_coli_1000.fa create mode 100644 reads/e_coli_1000.fq create mode 100644 reads/e_coli_1000.raw create mode 100644 reads/e_coli_10000snp.fa create mode 100644 reads/e_coli_10000snp.fq create mode 100644 reads/e_coli_1000_1.fa create mode 100644 reads/e_coli_1000_1.fq create mode 100644 reads/e_coli_1000_2.fa create mode 100644 reads/e_coli_1000_2.fq create mode 100644 ref_aligner.cpp create mode 100644 ref_aligner.h create mode 100644 ref_read.cpp create mode 100644 ref_read.h create mode 100644 reference.h create mode 100644 refmap.cpp create mode 100644 refmap.h create mode 100644 row_chaser.h create mode 100644 sam.cpp create mode 100644 sam.h create mode 100755 scripts/best_verify.pl create mode 100755 scripts/bs_mapability.pl create mode 100755 scripts/build_test.sh create mode 100755 scripts/colorize_fasta.pl create mode 100755 scripts/colorize_fastq.pl create mode 100755 scripts/convert_quals.pl create mode 100755 scripts/fastq_to_tabbed.pl create mode 100755 scripts/gen_2b_occ_lookup.pl create mode 100755 scripts/gen_dnamasks2colormask.pl create mode 100755 scripts/gen_occ_lookup.pl create mode 100755 scripts/gen_solqual_lookup.pl create mode 100755 scripts/make_a_thaliana_tair.sh create mode 100755 scripts/make_b_taurus_UMD3.sh create mode 100755 scripts/make_c_elegans_ws200.sh create mode 100755 scripts/make_canFam2.sh create mode 100755 scripts/make_d_melanogaster_fb5_22.sh create mode 100755 scripts/make_e_coli.sh create mode 100755 scripts/make_galGal3.sh create mode 100755 scripts/make_h_sapiens_ncbi36.sh create mode 100755 scripts/make_h_sapiens_ncbi37.sh create mode 100755 scripts/make_hg18.sh create mode 100755 scripts/make_hg19.sh create mode 100755 scripts/make_m_musculus_ncbi37.sh create mode 100755 scripts/make_mm8.sh create mode 100755 scripts/make_mm9.sh create mode 100755 scripts/make_rn4.sh create mode 100755 scripts/make_s_cerevisiae.sh create mode 100755 scripts/mapability.pl create mode 100755 scripts/pe_verify.pl create mode 100755 scripts/random_bowtie_tests.pl create mode 100755 scripts/random_bowtie_tests.sh create mode 100755 scripts/random_bowtie_tests_p.sh create mode 100755 scripts/reconcile_alignments.pl create mode 100755 scripts/reconcile_alignments_pe.pl create mode 100644 search_1mm_phase1.c create mode 100644 search_1mm_phase2.c create mode 100644 search_23mm_phase1.c create mode 100644 search_23mm_phase2.c create mode 100644 search_23mm_phase3.c create mode 100644 search_exact.c create mode 100644 search_globals.h create mode 100644 search_seeded_phase1.c create mode 100644 search_seeded_phase2.c create mode 100644 search_seeded_phase3.c create mode 100644 search_seeded_phase4.c create mode 100644 sequence_io.h create mode 100644 shmem.cpp create mode 100644 shmem.h create mode 100644 spinlock.h create mode 100644 str_util.h create mode 100644 threading.h create mode 100644 timer.h create mode 100644 tokenize.h create mode 100644 word_io.h create mode 100644 zbox.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..32fe374 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,19 @@ +Bowtie authors +Primary contact + +Ben Langmead and Cole Trapnell wrote Bowtie. The SeqAn-1.1 library is +used in Bowtie and some of its sources are included in Bowtie source +releases; its authors are Andreas Doring, David Weese, Tobias Rausch, +and Knut Reinert. A DLL from the pthreads for Win32 library is +distributed with the Win32 version of Bowtie. The pthreads for Win32 +library and the GnuWin32 package have many contributors (see their +respective web sites). + +Websites: + + Bowtie: http://bowtie-bio.sf.net + SeqAn: http://www.seqan.de + pthreads for Win32: http://sourceware.org/pthreads-win32 + GnuWin32: http://gnuwin32.sf.net + +December 2009 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..7cb8b7b --- /dev/null +++ b/COPYING @@ -0,0 +1,114 @@ +The Artistic License + +Preamble + +The intent of this document is to state the conditions under which a +Package may be copied, such that the Copyright Holder maintains some +semblance of artistic control over the development of the package, +while giving the users of the package the right to use and distribute +the Package in a more-or-less customary fashion, plus the right to +make reasonable modifications. + +Definitions: + * "Package" refers to the collection of files distributed by the + Copyright Holder, and derivatives of that collection of files + created through textual modification. + * "Standard Version" refers to such a Package if it has not been + modified, or has been modified in accordance with the wishes of + the Copyright Holder. + * "Copyright Holder" is whoever is named in the copyright or + copyrights for the package. + * "You" is you, if you're thinking about copying or distributing + this Package. + * "Reasonable copying fee" is whatever you can justify on the + basis of media cost, duplication charges, time of people + involved, and so on. (You will not be required to justify it to + the Copyright Holder, but only to the computing community at + large as a market that must bear the fee.) + * "Freely Available" means that no fee is charged for the item + itself, though there may be fees involved in handling the + item. It also means that recipients of the item may redistribute + it under the same conditions they received it. + +1. You may make and give away verbatim copies of the source form of + the Standard Version of this Package without restriction, provided + that you duplicate all of the original copyright notices and + associated disclaimers. + +2. You may apply bug fixes, portability fixes and other modifications + derived from the Public Domain or from the Copyright Holder. A + Package modified in such a way shall still be considered the + Standard Version. + +3. You may otherwise modify your copy of this Package in any way, + provided that you insert a prominent notice in each changed file + stating how and when you changed that file, and provided that you + do at least ONE of the following: + + a) place your modifications in the Public Domain or otherwise make + them Freely Available, such as by posting said modifications to + Usenet or an equivalent medium, or placing the modifications on a + major archive site such as ftp.uu.net, or by allowing the + Copyright Holder to include your modifications in the Standard + Version of the Package. + + b) use the modified Package only within your corporation or + organization. + + c) rename any non-standard executables so the names do not + conflict with standard executables, which must also be provided, + and provide a separate manual page for each non-standard + executable that clearly documents how it differs from the Standard + Version. + + d) make other distribution arrangements with the Copyright Holder. + +4. You may distribute the programs of this Package in object code or + executable form, provided that you do at least ONE of the + following: + + a) distribute a Standard Version of the executables and library + files, together with instructions (in the manual page or + equivalent) on where to get the Standard Version. + + b) accompany the distribution with the machine-readable source of + the Package with your modifications. + + c) accompany any non-standard executables with their corresponding + Standard Version executables, giving the non-standard executables + non-standard names, and clearly documenting the differences in + manual pages (or equivalent), together with instructions on where + to get the Standard Version. + + d) make other distribution arrangements with the Copyright Holder. + +5. You may charge a reasonable copying fee for any distribution of + this Package. You may charge any fee you choose for support of this + Package. You may not charge a fee for this Package itself. However, + you may distribute this Package in aggregate with other (possibly + commercial) programs as part of a larger (possibly commercial) + software distribution provided that you do not advertise this + Package as a product of your own. + +6. The scripts and library files supplied as input to or produced as + output from the programs of this Package do not automatically fall + under the copyright of this Package, but belong to whomever + generated them, and may be sold commercially, and may be aggregated + with this Package. + +7. C or perl subroutines supplied by you and linked into this Package + shall not be considered part of this Package. + +8. The name of the Copyright Holder may not be used to endorse or + promote products derived from this software without specific prior + written permission. + +9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES + OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + +The End +This license is approved by the Open Source Initiative +(www.opensource.org) for certifying software as OSI Certified Open +Source. + diff --git a/MANUAL b/MANUAL new file mode 100644 index 0000000..9a56cc8 --- /dev/null +++ b/MANUAL @@ -0,0 +1,1671 @@ + +What is Bowtie? +=============== + +[Bowtie] is an ultrafast, memory-efficient short read aligner geared +toward quickly aligning large sets of short DNA sequences (reads) to +large genomes. It aligns 35-base-pair reads to the human genome at a +rate of 25 million reads per hour on a typical workstation. Bowtie +indexes the genome with a [Burrows-Wheeler] index to keep its memory +footprint small: for the human genome, the index is typically about +2.2 GB (for unpaired alignment) or 2.9 GB (for paired-end or colorspace +alignment). Multiple processors can be used simultaneously to achieve +greater alignment speed. Bowtie can also output alignments in the +standard [SAM] format, allowing Bowtie to interoperate with other tools +supporting SAM, including the [SAMtools] consensus, SNP, and indel +callers. Bowtie runs on the command line under Windows, Mac OS X, +Linux, and Solaris. + +[Bowtie] also forms the basis for other tools, including [TopHat]: a +fast splice junction mapper for RNA-seq reads, [Cufflinks]: a tool for +transcriptome assembly and isoform quantitiation from RNA-seq reads, +[Crossbow]: a cloud-computing software tool for large-scale +resequencing data,and [Myrna]: a cloud computing tool for calculating +differential gene expression in large RNA-seq datasets. + +If you use [Bowtie] for your published research, please cite the +[Bowtie paper]. + +[Bowtie]: http://bowtie-bio.sf.net +[Burrows-Wheeler]: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform +[SAM]: http://samtools.sourceforge.net/SAM1.pdf +[SAMtools]: http://samtools.sourceforge.net/ +[TopHat]: http://tophat.cbcb.umd.edu/ +[Cufflinks]: http://cufflinks.cbcb.umd.edu/ +[Crossbow]: http://bowtie-bio.sf.net/crossbow +[Myrna]: http://bowtie-bio.sf.net/myrna +[Bowtie paper]: http://genomebiology.com/2009/10/3/R25 + +What isn't Bowtie? +================== + +Bowtie is not a general-purpose alignment tool like [MUMmer], [BLAST] +or [Vmatch]. Bowtie works best when aligning short reads to large +genomes, though it supports arbitrarily small reference sequences (e.g. +amplicons) and reads as long as 1024 bases. Bowtie is designed to be +extremely fast for sets of short reads where (a) many of the reads have +at least one good, valid alignment, (b) many of the reads are +relatively high-quality, and (c) the number of alignments reported per +read is small (close to 1). + +Bowtie does not yet report gapped alignments; this is future work. + +[MUMmer]: http://mummer.sourceforge.net/ +[BLAST]: http://blast.ncbi.nlm.nih.gov/Blast.cgi +[Vmatch]: http://www.vmatch.de/ + +Obtaining Bowtie +================ + +You may download either Bowtie sources or binaries for your platform +from the [Download] section of the Sourceforge project site. Binaries +are currently available for Intel architectures (`i386` and `x86_64`) +running Linux, Windows, and Mac OS X. + +Building from source +-------------------- + +Building Bowtie from source requires a GNU-like environment that +includes GCC, GNU Make and other basics. It should be possible to +build Bowtie on a vanilla Linux or Mac installation. Bowtie can also +be built on Windows using [Cygwin] or [MinGW]. We recommend +[TDM's MinGW Build]. If using [MinGW], you must also have [MSYS] +installed. + +To build Bowtie, extract the sources, change to the extracted +directory, and run GNU `make` (usually with the command `make`, but +sometimes with `gmake`) with no arguments. If building with [MinGW], +run `make` from the [MSYS] command line. + +To support the `-p` (multithreading) option, Bowtie needs the +`pthreads` library. To compile Bowtie without `pthreads` (which +disables `-p`), use `make BOWTIE_PTHREADS=0`. + +[Cygwin]: http://www.cygwin.com/ +[MinGW]: http://www.mingw.org/ +[TDM's MinGW Build]: http://www.tdragon.net/recentgcc/ +[MSYS]: http://www.mingw.org/wiki/msys +[Download]: https://sourceforge.net/projects/bowtie-bio/files/bowtie/ + +The `bowtie` aligner +==================== + +`bowtie` takes an index and a set of reads as input and outputs a list +of alignments. Alignments are selected according to a combination of +the `-v`/`-n`/`-e`/`-l` options (plus the `-I`/`-X`/`--fr`/`--rf`/ +`--ff` options for paired-end alignment), which define which alignments +are legal, and the `-k`/`-a`/`-m`/`-M`/`--best`/`--strata` options +which define which and how many legal alignments should be reported. + +By default, Bowtie enforces an alignment policy similar to [Maq]'s +default quality-aware policy (`-n` 2 `-l` 28 `-e` 70). See [the -n +alignment mode] section of the manual for details about this mode. But +Bowtie can also enforce a simpler end-to-end k-difference policy (e.g. +with `-v` 2). See [the -v alignment mode] section of the manual for +details about that mode. [The -n alignment mode] and [the -v alignment +mode] are mutually exclusive. + +Bowtie works best when aligning short reads to large genomes (e.g. +human or mouse), though it supports arbitrarily small reference +sequences and reads as long as 1024 bases. Bowtie is designed to be +very fast for sets of short reads where a) many reads have at least one +good, valid alignment, b) many reads are relatively high-quality, c) +the number of alignments reported per read is small (close to 1). +These criteria are generally satisfied in the context of modern +short-read analyses such as RNA-seq, ChIP-seq, other types of -seq, and +mammalian resequencing. You may observe longer running times in other +research contexts. + +If `bowtie` is too slow for your application, try some of the +performance-tuning hints described in the [Performance Tuning] section +below. + +Alignments involving one or more ambiguous reference characters (`N`, +`-`, `R`, `Y`, etc.) are considered invalid by Bowtie. This is true +only for ambiguous characters in the reference; alignments involving +ambiguous characters in the read are legal, subject to the alignment +policy. Ambiguous characters in the read mismatch all other +characters. Alignments that "fall off" the reference sequence are not +considered valid. + +The process by which `bowtie` chooses an alignment to report is +randomized in order to avoid "mapping bias" - the phenomenon whereby +an aligner systematically fails to report a particular class of good +alignments, causing spurious "holes" in the comparative assembly. +Whenever `bowtie` reports a subset of the valid alignments that exist, +it makes an effort to sample them randomly. This randomness flows +from a simple seeded pseudo-random number generator and is +deterministic in the sense that Bowtie will always produce the same +results for the same read when run with the same initial "seed" value +(see `--seed` option). + +In the default mode, `bowtie` can exhibit strand bias. Strand bias +occurs when input reference and reads are such that (a) some reads +align equally well to sites on the forward and reverse strands of the +reference, and (b) the number of such sites on one strand is different +from the number on the other strand. When this happens for a given +read, `bowtie` effectively chooses one strand or the other with 50% +probability, then reports a randomly-selected alignment for that read +from among the sites on the selected strand. This tends to overassign +alignments to the sites on the strand with fewer sites and underassign +to sites on the strand with more sites. The effect is mitigated, +though it may not be eliminated, when reads are longer or when +paired-end reads are used. Running Bowtie in `--best` mode +eliminates strand bias by forcing Bowtie to select one strand or the +other with a probability that is proportional to the number of best +sites on the strand. + +Gapped alignments are not currently supported, but support is planned +for a future release. + +[Maq]: http://maq.sf.net + +The `-n` alignment mode +----------------------- + +When the `-n` option is specified (which is the default), `bowtie` +determines which alignments are valid according to the following +policy, which is similar to [Maq]'s default policy. + + 1. Alignments may have no more than `N` mismatches (where `N` is a + number 0-3, set with `-n`) in the first `L` bases (where `L` is a + number 5 or greater, set with `-l`) on the high-quality (left) end + of the read. The first `L` bases are called the "seed". + + 2. The sum of the [Phred quality] values at *all* mismatched positions + (not just in the seed) may not exceed `E` (set with `-e`). Where + qualities are unavailable (e.g. if the reads are from a FASTA + file), the [Phred quality] defaults to 40. + +The `-n` option is mutually exclusive with the `-v` option. + +If there are many possible alignments satisfying these criteria, Bowtie +gives preference to alignments with fewer mismatches and where the sum +from criterion 2 is smaller. When the `--best` option is specified, +Bowtie guarantees the reported alignment(s) are "best" in terms of +these criteria (criterion 1 has priority), and that the alignments are +reported in best-to-worst order. Bowtie is somewhat slower when +`--best` is specified. + +Note that [Maq] internally rounds base qualities to the nearest 10 and +rounds qualities greater than 30 to 30. To maintain compatibility, +Bowtie does the same. Rounding can be suppressed with the +`--nomaqround` option. + +Bowtie is not fully sensitive in `-n` 2 and `-n` 3 modes by default. +In these modes Bowtie imposes a "backtracking limit" to limit effort +spent trying to find valid alignments for low-quality reads unlikely to +have any. This may cause bowtie to miss some legal 2- and 3-mismatch +alignments. The limit is set to a reasonable default (125 without +`--best`, 800 with `--best`), but the user may decrease or increase the +limit using the `--maxbts` and/or `-y` options. `-y` mode is +relatively slow but guarantees full sensitivity. + +[Maq]: http://maq.sf.net +[Phred quality]: http://en.wikipedia.org/wiki/FASTQ_format#Variations + +The `-v` alignment mode +----------------------- + +In `-v` mode, alignments may have no more than `V` mismatches, where +`V` may be a number from 0 through 3 set using the `-v` option. +Quality values are ignored. The `-v` option is mutually exclusive with +the `-n` option. + +If there are many legal alignments, Bowtie gives preference to +alignments with fewer mismatches. When the `--best` option is +specified, Bowtie guarantees the reported alignment(s) are "best" in +terms of the number of mismatches, and that the alignments are reported +in best-to-worst order. Bowtie is somewhat slower when `--best` is +specified. + +Strata +------ + +In [the -n alignment mode], an alignment's "stratum" is defined as the +number of mismatches in the "seed" region, i.e. the leftmost `L` bases, +where `L` is set with the `-l` option. In [the -v alignment mode], an +alignment's stratum is defined as the total number of mismatches in the +entire alignment. Some of Bowtie's options (e.g. `--strata` and `-m` +use the notion of "stratum" to limit or expand the scope of reportable +alignments. + +Reporting Modes +--------------- + +With the `-k`, `-a`, `-m`, `-M`, `--best` and `--strata` options, the +user can flexibily select which alignments are reported. Below we +demonstrate a few ways in which these options can be combined. All +examples are using the `e_coli` index packaged with Bowtie. The +`--suppress` option is used to keep the output concise and some +output is elided for clarity. + + Example 1: `-a` + + $ ./bowtie -a -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + +Specifying `-a` instructs bowtie to report *all* valid alignments, +subject to the alignment policy: `-v` 2. In this case, bowtie finds +5 inexact hits in the E. coli genome; 1 hit (the 2nd one listed) +has 1 mismatch, and the other 4 hits have 2 mismatches. Four are on +the reverse reference strand and one is on the forward strand. Note +that they are not listed in best-to-worst order. + + Example 2: `-k 3` + + $ ./bowtie -k 3 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + +Specifying `-k` 3 instructs bowtie to report up to 3 valid +alignments. In this case, a total of 5 valid alignments exist (see +[Example 1]); `bowtie` reports 3 out of those 5. `-k` can be set to +any integer greater than 0. + + Example 3: `-k 6` + + $ ./bowtie -k 6 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + +Specifying `-k` 6 instructs bowtie to report up to 6 valid +alignments. In this case, a total of 5 valid alignments exist, so +`bowtie` reports all 5. + + Example 4: default (`-k 1`) + + $ ./bowtie -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + +Leaving the reporting options at their defaults causes `bowtie` to +report the first valid alignment it encounters. Because `--best` was +not specified, we are not guaranteed that bowtie will report the best +alignment, and in this case it does not (the 1-mismatch alignment from +the previous example would have been better). The default reporting +mode is equivalent to `-k` 1. + + Example 5: `-a --best` + + $ ./bowtie -a --best -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + +Specifying `-a` `--best` results in the same alignments being printed +as if just `-a` had been specified, but they are guaranteed to be +reported in best-to-worst order. + + Example 6: `-a --best --strata` + + $ ./bowtie -a --best --strata -v 2 --suppress 1,5,6,7 e_coli -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + +Specifying `--strata` in addition to `-a` and `--best` causes +`bowtie` to report only those alignments in the best alignment +"stratum". The alignments in the best stratum are those having the +least number of mismatches (or mismatches just in the "seed" portion of +the alignment in the case of `-n` mode). Note that if `--strata` +is specified, `--best` must also be specified. + + Example 7: `-a -m 3` + + $ ./bowtie -a -m 3 -v 2 e_coli -c ATGCATCATGCGCCAT + No alignments + +Specifying `-m` 3 instructs bowtie to refrain from reporting any +alignments for reads having more than 3 reportable alignments. The +`-m` option is useful when the user would like to guarantee that +reported alignments are "unique", for some definition of unique. + +Example 1 showed that the read has 5 reportable alignments when `-a` +and `-v` 2 are specified, so the `-m` 3 limit causes bowtie to +output no alignments. + + Example 8: `-a -m 5` + + $ ./bowtie -a -m 5 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + +Specifying `-m` 5 instructs bowtie to refrain from reporting any +alignments for reads having more than 5 reportable alignments. Since +the read has exactly 5 reportable alignments, the `-m` 5 limit allows +`bowtie` to print them as usual. + + Example 9: `-a -m 3 --best --strata` + + $ ./bowtie -a -m 3 --best --strata -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + +Specifying `-m` 3 instructs bowtie to refrain from reporting any +alignments for reads having more than 3 reportable alignments. As we +saw in Example 6, the read has only 1 reportable alignment when `-a`, +`--best` and `--strata` are specified, so the `-m` 3 limit allows +`bowtie` to print that alignment as usual. + +Intuitively, the `-m` option, when combined with the `--best` and +`--strata` options, guarantees a principled, though weaker form of +"uniqueness." A stronger form of uniqueness is enforced when `-m` is +specified but `--best` and `--strata` are not. + +Paired-end Alignment +-------------------- + +`bowtie` can align paired-end reads when properly paired read files are +specified using the `-1` and `-2` options (for pairs of raw, FASTA, or +FASTQ read files), or using the `--12` option (for Tab-delimited read +files). A valid paired-end alignment satisfies these criteria: + +1. Both mates have a valid alignment according to the alignment policy + defined by the `-v`/`-n`/`-e`/`-l` options. +2. The relative orientation and position of the mates satisfy the + constraints defined by the `-I`/`-X`/`--fr`/`--rf`/`--ff` + options. + +Policies governing which paired-end alignments are reported for a +given read are specified using the `-k`, `-a` and `-m` options as +usual. The `--strata` and `--best` options do not apply in +paired-end mode. + +A paired-end alignment is reported as a pair of mate alignments, both +on a separate line, where the alignment for each mate is formatted the +same as an unpaired (singleton) alignment. The alignment for the mate +that occurs closest to the beginning of the reference sequence (the +"upstream" mate) is always printed before the alignment for the +downstream mate. Reads files containing paired-end reads will +sometimes name the reads according to whether they are the #1 or #2 +mates by appending a `/1` or `/2` suffix to the read name. If no such +suffix is present in Bowtie's input, the suffix will be added when +Bowtie prints read names in alignments (except in `-S` "SAM" mode, +where mate information is encoded in the `FLAGS` field instead). + +Finding a valid paired-end alignment where both mates align to +repetitive regions of the reference can be very time-consuming. By +default, Bowtie avoids much of this cost by imposing a limit on the +number of "tries" it makes to match an alignment for one mate with a +nearby alignment for the other. The default limit is 100. This causes +`bowtie` to miss some valid paired-end alignments where both mates lie +in repetitive regions, but the user may use the `--pairtries` or +`-y` options to increase Bowtie's sensitivity as desired. + +Paired-end alignments where one mate's alignment is entirely contained +within the other's are considered invalid. + +When colospace alignment is enabled via `-C`, the default setting for +paired-end orientation is `--ff`. This is because most SOLiD datasets +have that orientation. When colorspace alignment is not enabled +(default), the default setting for orientation is `--fr`, since most +Illumina datasets have this orientation. The default can be overriden +in either case. + +Because Bowtie uses an in-memory representation of the original +reference string when finding paired-end alignments, its memory +footprint is larger when aligning paired-end reads. For example, the +human index has a memory footprint of about 2.2 GB in single-end mode +and 2.9 GB in paired-end mode. Note that paired-end and unpaired +alignment incur the same memory footprint in colorspace (e.g. human +incurs about 2.9 GB) + +Colorspace Alignment +-------------------- + +As of version 0.12.0, `bowtie` can align colorspace reads against a +colorspace index when `-C` is specified. Colorspace is the +characteristic output format of Applied Biosystems' SOLiD system. In a +colorspace read, each character is a color rather than a nucleotide, +where a color encodes a class of dinucleotides. E.g. the color blue +encodes any of the dinucleotides: AA, CC, GG, TT. Colorspace has the +advantage of (often) being able to distinguish sequencing errors from +SNPs once the read has been aligned. See ABI's [Principles of Di-Base +Sequencing] document for details. + + Colorspace reads + +All input formats (FASTA `-f`, FASTQ `-q`, raw `-r`, tab-delimited +`--12`, command-line `-c`) are compatible with colorspace (`-C`). +When `-C` is specified, read sequences are treated as colors. Colors +may be encoded either as numbers (`0`=blue, `1`=green, `2`=orange, +`3`=red) or as characters `A/C/G/T` (`A`=blue, `C`=green, `G`=orange, +`T`=red). + +Some reads include a primer base as the first character; e.g.: + + >1_53_33_F3 + T2213120002010301233221223311331 + >1_53_70_F3 + T2302111203131231130300111123220 + ... + +Here, `T` is the primer base. `bowtie` detects and handles primer +bases properly (i.e., the primer base and the adjacent color are both +trimmed away prior to alignment) as long as the rest of the read is +encoded as numbers. + +`bowtie` also handles input in the form of parallel `.csfasta` and +`_QV.qual` files. Use `-f` to specify the `.csfasta` files and `-Q` +(for unpaired reads) or `--Q1`/`--Q2` (for paired-end reads) to +specify the corresponding `_QV.qual` files. It is not necessary to +first convert to FASTQ, though `bowtie` also handles FASTQ-formatted +colorspace reads (with `-q`, the default). + + Building a colorspace index + +A colorspace index is built in the same way as a normal index except +that `-C` must be specified when running `bowtie-build`. If the user +attempts to use `bowtie` without `-C` to align against an index that +was built with `-C` (or vice versa), `bowtie` prints an error message +and quits. + + Decoding colorspace alignments + +Once a colorspace read is aligned, Bowtie decodes the alignment into +nucleotides and reports the decoded nucleotide sequence. A principled +decoding scheme is necessary because many different possible decodings +are usually possible. Finding the true decoding with 100% certainty +requires knowing all variants (e.g. SNPs) in the subject's genome +beforehand, which is usually not possible. Instead, `bowtie` employs +the approximate decoding scheme described in the [BWA paper]. This +scheme attempts to distinguish variants from sequencing errors +according to their relative likelihood under a model that considers the +quality values of the colors and the (configurable) global likelihood +of a SNP. + +Quality values are also "decoded" so that each reported quality value +is a function of the two color qualities overlapping it. Bowtie again +adopts the scheme described in the [BWA paper], i.e., the decoded +nucleotide quality is either the sum of the overlapping color qualities +(when both overlapping colors correspond to bases that match in the +alignment), the quality of the matching color minus the quality of the +mismatching color, or 0 (when both overlapping colors correspond to +mismatches). + +For accurate decoding, `--snpphred`/`--snpfrac` should be set according +to the user's best guess of the SNP frequency in the subject. The +`--snpphred` parameter sets the SNP penalty directly (on the [Phred +quality] scale), whereas `--snpfrac` allows the user to specify the +fraction of sites expected to be SNPs; the fraction is then converted +to a [Phred quality] internally. For the purpose of decoding, the SNP +fraction is defined in terms of SNPs per *haplotype* base. Thus, if +the genome is diploid, heterozygous SNPs have half the weight of +homozygous SNPs + +Note that in `-S`/`--sam` mode, the decoded nucleotide sequence is +printed for alignments, but the original color sequence (with `A`=blue, +`C`=green, `G`=orange, `T`=red) is printed for unaligned reads without +any reported alignments. As always, the `--un`, `--max` and `--al` +parameters print reads exactly as they appeared in the input file. + + Paired-end colorspace alignment + +Like other platforms, SOLiD supports generation of paired-end reads. +When colorspace alignment is enabled, the default paired-end +orientation setting is `--ff`. This is because most SOLiD datasets +have that orientation. + +Note that SOLiD-generated read files can have "orphaned" mates; i.e. +mates without a correpsondingly-named mate in the other file. To avoid +problems due to orphaned mates, SOLiD paired-end output should first be +converted to `.csfastq` files with unpaired mates omitted. This can be +accomplished using, for example, [Galaxy]'s conversion tool (click +"NGS: QC and manipulation", then "SOLiD-to-FASTQ" in the left-hand +sidebar). + +[Principles of Di-Base Sequencing]: http://tinyurl.com/ygnb2gn +[BWA paper]: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/25/14/1754 + +Performance Tuning +------------------ + +1. Use 64-bit bowtie if possible + + The 64-bit version of Bowtie is substantially (usually more then + 50%) faster than the 32-bit version, owing to its use of 64-bit + arithmetic. If possible, download the 64-bit binaries for Bowtie + and run on a 64-bit computer. If you are building Bowtie from + sources, you may need to pass the `-m64` option to `g++` to compile + the 64-bit version; you can do this by including `BITS=64` in the + arguments to the `make` command; e.g.: `make BITS=64 bowtie`. To + determine whether your version of bowtie is 64-bit or 32-bit, run + `bowtie --version`. + +2. If your computer has multiple processors/cores, use `-p` + + The `-p` option causes Bowtie to launch a specified number of + parallel search threads. Each thread runs on a different + processor/core and all threads find alignments in parallel, + increasing alignment throughput by approximately a multiple of the + number of threads (though in practice, speedup is somewhat worse + than linear). + +3. If reporting many alignments per read, try tweaking + `bowtie-build --offrate` + + If you are using the `-k`, `-a` or `-m` options and Bowtie is + reporting many alignments per read (an average of more than about + 10 per read) and you have some memory to spare, using an index with + a denser SA sample can speed things up considerably. + + To do this, specify a smaller-than-default `-o`/`--offrate` value + when running `bowtie-build`. A denser SA sample yields a larger + index, but is also particularly effective at speeding up alignment + when many alignments are reported per read. For example, + decreasing the index's `-o`/`--offrate` by 1 could as much as + double alignment performance, and decreasing by 2 could quadruple + alignment performance, etc. + + On the other hand, decreasing `-o`/`--offrate` increases the size + of the Bowtie index, both on disk and in memory when aligning + reads. At the default `-o`/`--offrate` of 5, the SA sample for the + human genome occupies about 375 MB of memory when aligning reads. + Decreasing the `-o`/`--offrate` by 1 doubles the memory taken by + the SA sample, and decreasing by 2 quadruples the memory taken, + etc. + +4. If bowtie "thrashes", try increasing `bowtie --offrate` + + If `bowtie` runs very slow on a relatively low-memory machine + (having less than about 4 GB of memory), then try setting `bowtie` + `-o`/`--offrate` to a *larger* value than the value used to build + the index. For example, `bowtie-build`'s default `-o`/`--offrate` + is 5 and all pre-built indexes available from the Bowtie website + are built with `-o`/`--offrate` 5; so if `bowtie` thrashes when + querying such an index, try using `bowtie` `--offrate` 6. If + `bowtie` still thrashes, try `bowtie` `--offrate` 7, etc. A higher + `-o`/`--offrate` causes `bowtie` to use a sparser sample of the + suffix array than is stored in the index; this saves memory but + makes alignment reporting slower (which is especially slow when + using `-a` or large `-k` or `-m`). + +Command Line +------------ + +Usage: + + bowtie [options]* {-1 -2 | --12 | } [] + + Main arguments + + + +The basename of the index to be searched. The basename is the name of +any of the index files up to but not including the final `.1.ebwt` / +`.rev.1.ebwt` / etc. `bowtie` looks for the specified index first in +the current directory, then in the `indexes` subdirectory under the +directory where the `bowtie` executable is located, then looks in the +directory specified in the `BOWTIE_INDEXES` environment variable. + + + +Comma-separated list of files containing the #1 mates (filename usually +includes `_1`), or, if `-c` is specified, the mate sequences +themselves. E.g., this might be `flyA_1.fq,flyB_1.fq`, or, if `-c` +is specified, this might be `GGTCATCCT,ACGGGTCGT`. Sequences specified +with this option must correspond file-for-file and read-for-read with +those specified in ``. Reads may be a mix of different lengths. +If `-` is specified, `bowtie` will read the #1 mates from the "standard +in" filehandle. + + + +Comma-separated list of files containing the #2 mates (filename usually +includes `_2`), or, if `-c` is specified, the mate sequences +themselves. E.g., this might be `flyA_2.fq,flyB_2.fq`, or, if `-c` +is specified, this might be `GGTCATCCT,ACGGGTCGT`. Sequences specified +with this option must correspond file-for-file and read-for-read with +those specified in ``. Reads may be a mix of different lengths. +If `-` is specified, `bowtie` will read the #2 mates from the "standard +in" filehandle. + + + +Comma-separated list of files containing a mix of unpaired and +paired-end reads in Tab-delimited format. Tab-delimited format is a +1-read-per-line format where unpaired reads consist of a read name, +sequence and quality string each separated by tabs. A paired-end read +consists of a read name, sequnce of the #1 mate, quality values of the +#1 mate, sequence of the #2 mate, and quality values of the #2 mate +separated by tabs. Quality values can be expressed using any of the +scales supported in FASTQ files. Reads may be a mix of different +lengths and paired-end and unpaired reads may be intermingled in the +same file. If `-` is specified, `bowtie` will read the Tab-delimited +reads from the "standard in" filehandle. + + + +A comma-separated list of files containing unpaired reads to be +aligned, or, if `-c` is specified, the unpaired read sequences +themselves. E.g., this might be +`lane1.fq,lane2.fq,lane3.fq,lane4.fq`, or, if `-c` is specified, this +might be `GGTCATCCT,ACGGGTCGT`. Reads may be a mix of different +lengths. If `-` is specified, Bowtie gets the reads from the "standard +in" filehandle. + + + +File to write alignments to. By default, alignments are written to the +"standard out" filehandle (i.e. the console). + + Options + + Input + + -q + +The query input files (specified either as `` and ``, or as +``) are FASTQ files (usually having extension `.fq` or `.fastq`). +This is the default. See also: `--solexa-quals` and +`--integer-quals`. + + -f + +The query input files (specified either as `` and ``, or as +``) are FASTA files (usually having extension `.fa`, `.mfa`, `.fna` +or similar). All quality values are assumed to be 40 on the [Phred +quality] scale. + + -r + +The query input files (specified either as `` and ``, or as +``) are Raw files: one sequence per line, without quality values or +names. All quality values are assumed to be 40 on the [Phred quality] +scale. + + -c + +The query sequences are given on command line. I.e. ``, `` and +`` are comma-separated lists of reads rather than lists of +read files. + + -C/--color + +Align in colorspace. Read characters are interpreted as colors. The +index specified must be a colorspace index (i.e. built with +`bowtie-build` `-C`, or `bowtie` will print an error message and quit. +See [Colorspace alignment] for more details. + + -Q/--quals + +Comma-separated list of files containing quality values for +corresponding unpaired CSFASTA reads. Use in combination with `-C` +and `-f`. `--integer-quals` is set automatically when `-Q`/`--quals` +is specified. + + --Q1 + +Comma-separated list of files containing quality values for +corresponding CSFASTA #1 mates. Use in combination with `-C`, `-f`, +and `-1`. `--integer-quals` is set automatically when `--Q1` +is specified. + + --Q2 + +Comma-separated list of files containing quality values for +corresponding CSFASTA #2 mates. Use in combination with `-C`, `-f`, +and `-2`. `--integer-quals` is set automatically when `--Q2` +is specified. + + -s/--skip + +Skip (i.e. do not align) the first `` reads or pairs in the input. + + -u/--qupto + +Only align the first `` reads or read pairs from the input (after +the `-s`/`--skip` reads or pairs have been skipped). Default: no +limit. + + -5/--trim5 + +Trim `` bases from high-quality (left) end of each read before +alignment (default: 0). + + -3/--trim3 + +Trim `` bases from low-quality (right) end of each read before +alignment (default: 0). + + --phred33-quals + +Input qualities are ASCII chars equal to the [Phred quality] plus 33. +Default: on. + + --phred64-quals + +Input qualities are ASCII chars equal to the [Phred quality] plus 64. +Default: off. + + --solexa-quals + +Convert input qualities from [Solexa][Phred quality] (which can be +negative) to [Phred][Phred quality] (which can't). This is usually the +right option for use with (unconverted) reads emitted by GA Pipeline +versions prior to 1.3. Default: off. + + --solexa1.3-quals + +Same as `--phred64-quals`. This is usually the right option for use +with (unconverted) reads emitted by GA Pipeline version 1.3 or later. +Default: off. + + --integer-quals + +Quality values are represented in the read input file as +space-separated ASCII integers, e.g., `40 40 30 40`..., rather than +ASCII characters, e.g., `II?I`.... Integers are treated as being on +the [Phred quality] scale unless `--solexa-quals` is also specified. +Default: off. + + Alignment + + -v + +Report alignments with at most `` mismatches. `-e` and `-l` +options are ignored and quality values have no effect on what +alignments are valid. `-v` is mutually exclusive with `-n`. + + -n/--seedmms + +Maximum number of mismatches permitted in the "seed", i.e. the first +`L` base pairs of the read (where `L` is set with `-l`/`--seedlen`). +This may be 0, 1, 2 or 3 and the default is 2. This option is mutually +exclusive with the `-v` option. + + -e/--maqerr + +Maximum permitted total of quality values at *all* mismatched read +positions throughout the entire alignment, not just in the "seed". The +default is 70. Like [Maq], `bowtie` rounds quality values to the +nearest 10 and saturates at 30; rounding can be disabled with +`--nomaqround`. + + -l/--seedlen + +The "seed length"; i.e., the number of bases on the high-quality end of +the read to which the `-n` ceiling applies. The lowest permitted +setting is 5 and the default is 28. `bowtie` is faster for larger +values of `-l`. + + --nomaqround + +[Maq] accepts quality values in the [Phred quality] scale, but +internally rounds values to the nearest 10, with a maximum of 30. By +default, `bowtie` also rounds this way. `--nomaqround` prevents this +rounding in `bowtie`. + + -I/--minins + +The minimum insert size for valid paired-end alignments. E.g. if `-I +60` is specified and a paired-end alignment consists of two 20-bp +alignments in the appropriate orientation with a 20-bp gap between +them, that alignment is considered valid (as long as `-X` is also +satisfied). A 19-bp gap would not be valid in that case. If trimming +options `-3` or `-5` are also used, the `-I` constraint is +applied with respect to the untrimmed mates. Default: 0. + + -X/--maxins + +The maximum insert size for valid paired-end alignments. E.g. if `-X +100` is specified and a paired-end alignment consists of two 20-bp +alignments in the proper orientation with a 60-bp gap between them, +that alignment is considered valid (as long as `-I` is also +satisfied). A 61-bp gap would not be valid in that case. If trimming +options `-3` or `-5` are also used, the `-X` constraint is applied +with respect to the untrimmed mates, not the trimmed mates. Default: +250. + + --fr/--rf/--ff + +The upstream/downstream mate orientations for a valid paired-end +alignment against the forward reference strand. E.g., if `--fr` is +specified and there is a candidate paired-end alignment where mate1 +appears upstream of the reverse complement of mate2 and the insert +length constraints are met, that alignment is valid. Also, if mate2 +appears upstream of the reverse complement of mate1 and all other +constraints are met, that too is valid. `--rf` likewise requires that +an upstream mate1 be reverse-complemented and a downstream mate2 be +forward-oriented. ` --ff` requires both an upstream mate1 and a +downstream mate2 to be forward-oriented. Default: `--fr` when `-C` +(colorspace alignment) is not specified, `--ff` when `-C` is specified. + + --nofw/--norc + +If `--nofw` is specified, `bowtie` will not attempt to align against +the forward reference strand. If `--norc` is specified, `bowtie` will +not attempt to align against the reverse-complement reference strand. +For paired-end reads using `--fr` or `--rf` modes, `--nofw` and +`--norc` apply to the forward and reverse-complement pair orientations. +I.e. specifying `--nofw` and `--fr` will only find reads in the R/F +orientation where mate 2 occurs upstream of mate 1 with respect to the +forward reference strand. + + --maxbts + +The maximum number of backtracks permitted when aligning a read in +`-n` 2 or `-n` 3 mode (default: 125 without `--best`, 800 with +`--best`). A "backtrack" is the introduction of a speculative +substitution into the alignment. Without this limit, the default +parameters will sometimes require that `bowtie` try 100s or 1,000s of +backtracks to align a read, especially if the read has many low-quality +bases and/or has no valid alignments, slowing bowtie down +significantly. However, this limit may cause some valid alignments to +be missed. Higher limits yield greater sensitivity at the expensive of +longer running times. See also: `-y`/`--tryhard`. + + --pairtries + +For paired-end alignment, this is the maximum number of attempts +`bowtie` will make to match an alignment for one mate up with an +alignment for the opposite mate. Most paired-end alignments require +only a few such attempts, but pairs where both mates occur in highly +repetitive regions of the reference can require significantly more. +Setting this to a higher number allows `bowtie` to find more paired- +end alignments for repetitive pairs at the expense of speed. The +default is 100. See also: `-y`/`--tryhard`. + + -y/--tryhard + +Try as hard as possible to find valid alignments when they exist, +including paired-end alignments. This is equivalent to specifying very +high values for the `--maxbts` and `--pairtries` options. This +mode is generally much slower than the default settings, but can be +useful for certain problems. This mode is slower when (a) the +reference is very repetitive, (b) the reads are low quality, or (c) not +many reads have valid alignments. + + --chunkmbs + +The number of megabytes of memory a given thread is given to store path +descriptors in `--best` mode. Best-first search must keep track of +many paths at once to ensure it is always extending the path with the +lowest cumulative cost. Bowtie tries to minimize the memory impact of +the descriptors, but they can still grow very large in some cases. If +you receive an error message saying that chunk memory has been +exhausted in `--best` mode, try adjusting this parameter up to +dedicate more memory to the descriptors. Default: 64. + + Reporting + + -k + +Report up to `` valid alignments per read or pair (default: 1). +Validity of alignments is determined by the alignment policy (combined +effects of `-n`, `-v`, `-l`, and `-e`). If more than one valid +alignment exists and the `--best` and `--strata` options are +specified, then only those alignments belonging to the best alignment +"stratum" will be reported. Bowtie is designed to be very fast for +small `-k` but bowtie can become significantly slower as `-k` +increases. If you would like to use Bowtie for larger values of +`-k`, consider building an index with a denser suffix-array sample, +i.e. specify a smaller `-o`/`--offrate` when invoking `bowtie-build` +for the relevant index (see the [Performance tuning] section for +details). + + -a/--all + +Report all valid alignments per read or pair (default: off). Validity +of alignments is determined by the alignment policy (combined effects +of `-n`, `-v`, `-l`, and `-e`). If more than one valid alignment +exists and the `--best` and `--strata` options are specified, then only +those alignments belonging to the best alignment "stratum" will be +reported. Bowtie is designed to be very fast for small `-k` but bowtie +can become significantly slower if `-a`/`--all` is specified. If you +would like to use Bowtie with `-a`, consider building an index with a +denser suffix-array sample, i.e. specify a smaller `-o`/`--offrate` +when invoking `bowtie-build` for the relevant index (see the +[Performance tuning] section for details). + + -m + +Suppress all alignments for a particular read or pair if more than +`` reportable alignments exist for it. Reportable alignments are +those that would be reported given the `-n`, `-v`, `-l`, `-e`, `-k`, +`-a`, `--best`, and `--strata` options. Default: no limit. Bowtie is +designed to be very fast for small `-m` but bowtie can become +significantly slower for larger values of `-m`. If you would like to +use Bowtie for larger values of `-k`, consider building an index with a +denser suffix-array sample, i.e. specify a smaller `-o`/`--offrate` when +invoking `bowtie-build` for the relevant index (see the [Performance +tuning] section for details). + + -M + +Behaves like `-m` except that if a read has more than `` +reportable alignments, one is reported at random. In [default +output mode], the selected alignment's 7th column is set to ``+1 to +indicate the read has at least ``+1 valid alignments. In +`-S`/`--sam` mode, the selected alignment is given a `MAPQ` (mapping +quality) of 0 and the `XM:I` field is set to ``+1. This option +requires `--best`; if specified without `--best`, `--best` is enabled +automatically. + + --best + +Make Bowtie guarantee that reported singleton alignments are "best" in +terms of stratum (i.e. number of mismatches, or mismatches in the seed +in the case of `-n` mode) and in terms of the quality values at the +mismatched position(s). Stratum always trumps quality; e.g. a +1-mismatch alignment where the mismatched position has [Phred quality] +40 is preferred over a 2-mismatch alignment where the mismatched +positions both have [Phred quality] 10. When `--best` is not +specified, Bowtie may report alignments that are sub-optimal in terms +of stratum and/or quality (though an effort is made to report the best +alignment). `--best` mode also removes all strand bias. Note that +`--best` does not affect which alignments are considered "valid" by +`bowtie`, only which valid alignments are reported by `bowtie`. When +`--best` is specified and multiple hits are allowed (via `-k` or +`-a`), the alignments for a given read are guaranteed to appear in +best-to-worst order in `bowtie`'s output. `bowtie` is somewhat slower +when `--best` is specified. + + --strata + +If many valid alignments exist and are reportable (e.g. are not +disallowed via the `-k` option) and they fall into more than one +alignment "stratum", report only those alignments that fall into the +best stratum. By default, Bowtie reports all reportable alignments +regardless of whether they fall into multiple strata. When +`--strata` is specified, `--best` must also be specified. + + Output + + -t/--time + +Print the amount of wall-clock time taken by each phase. + + -B/--offbase + +When outputting alignments, number the first base of a reference +sequence as ``. Default: 0. + + --quiet + +Print nothing besides alignments. + + --refout + +Write alignments to a set of files named `refXXXXX.map`, where `XXXXX` +is the 0-padded index of the reference sequence aligned to. This can +be a useful way to break up work for downstream analyses when dealing +with, for example, large numbers of reads aligned to the assembled +human genome. If `` is also specified, it will be ignored. + + --refidx + +When a reference sequence is referred to in a reported alignment, refer +to it by 0-based index (its offset into the list of references that +were indexed) rather than by name. + + --al + +Write all reads for which at least one alignment was reported to a file +with name ``. Written reads will appear as they did in the +input, without any of the trimming or translation of quality values +that may have taken place within `bowtie`. Paired-end reads will be +written to two parallel files with `_1` and `_2` inserted in the +filename, e.g., if `` is `aligned.fq`, the #1 and #2 mates +that fail to align will be written to `aligned_1.fq` and `aligned_2.fq` +respectively. + + --un + +Write all reads that could not be aligned to a file with name +``. Written reads will appear as they did in the input, +without any of the trimming or translation of quality values that may +have taken place within Bowtie. Paired-end reads will be written to +two parallel files with `_1` and `_2` inserted in the filename, e.g., +if `` is `unaligned.fq`, the #1 and #2 mates that fail to +align will be written to `unaligned_1.fq` and `unaligned_2.fq` +respectively. Unless `--max` is also specified, reads with a number +of valid alignments exceeding the limit set with the `-m` option are +also written to ``. + + --max + +Write all reads with a number of valid alignments exceeding the limit +set with the `-m` option to a file with name ``. Written +reads will appear as they did in the input, without any of the trimming +or translation of quality values that may have taken place within +`bowtie`. Paired-end reads will be written to two parallel files with +`_1` and `_2` inserted in the filename, e.g., if `` is +`max.fq`, the #1 and #2 mates that exceed the `-m` limit will be +written to `max_1.fq` and `max_2.fq` respectively. These reads are not +written to the file specified with `--un`. + + --suppress + +Suppress columns of output in the [default output mode]. E.g. if +`--suppress 1,5,6` is specified, the read name, read sequence, and read +quality fields will be omitted. See [Default Bowtie output] for field +descriptions. This option is ignored if the output mode is +`-S`/`--sam`. + + --fullref + +Print the full refernce sequence name, including whitespace, in +alignment output. By default `bowtie` prints everything up to but not +including the first whitespace. + + Colorspace + + --snpphred + +When decoding colorspace alignments, use `` as the SNP penalty. +This should be set to the user's best guess of the true ratio of SNPs +per base in the subject genome, converted to the [Phred quality] scale. +E.g., if the user expects about 1 SNP every 1,000 positions, +`--snpphred` should be set to 30 (which is also the default). To +specify the fraction directly, use `--snpfrac`. + + --snpfrac + +When decoding colorspace alignments, use `` as the estimated ratio +of SNPs per base. For best decoding results, this should be set to the +user's best guess of the true ratio. `bowtie` internally converts the +ratio to a [Phred quality], and behaves as if that quality had been set +via the `--snpphred` option. Default: 0.001. + + --col-cseq + +If reads are in colorspace and the [default output mode] is active, +`--col-cseq` causes the reads' color sequence to appear in the +read-sequence column (column 5) instead of the decoded nucleotide +sequence. See the [Decoding colorspace alignments] section for details +about decoding. This option is ignored in `-S`/`--sam` mode. + + --col-cqual + +If reads are in colorspace and the [default output mode] is active, +`--col-cqual` causes the reads' original (color) quality sequence to +appear in the quality column (column 6) instead of the decoded +qualities. See the [Colorspace alignment] section for details about +decoding. This option is ignored in `-S`/`--sam` mode. + + --col-keepends + +When decoding colorpsace alignments, `bowtie` trims off a nucleotide +and quality from the left and right edges of the alignment. This is +because those nucleotides are supported by only one color, in contrast +to the middle nucleotides which are supported by two. Specify +`--col-keepends` to keep the extreme-end nucleotides and qualities. + + SAM + + -S/--sam + +Print alignments in [SAM] format. See the [SAM output] section of the +manual for details. To suppress all SAM headers, use `--sam-nohead` +in addition to `-S/--sam`. To suppress just the `@SQ` headers (e.g. if +the alignment is against a very large number of reference sequences), +use `--sam-nosq` in addition to `-S/--sam`. `bowtie` does not write +BAM files directly, but SAM output can be converted to BAM on the fly +by piping `bowtie`'s output to `samtools view`. `-S`/`--sam` is not +compatible with `--refout`. + + --mapq + +If an alignment is non-repetitive (according to `-m`, `--strata` and +other options) set the `MAPQ` (mapping quality) field to this value. +See the [SAM Spec][SAM] for details about the `MAPQ` field Default: 255. + + --sam-nohead + +Suppress header lines (starting with `@`) when output is `-S`/`--sam`. +This must be specified *in addition to* `-S`/`--sam`. `--sam-nohead` +is ignored unless `-S`/`--sam` is also specified. + + --sam-nosq + +Suppress `@SQ` header lines when output is `-S`/`--sam`. This must be +specified *in addition to* `-S`/`--sam`. `--sam-nosq` is ignored +unless `-S`/`--sam` is also specified. + + --sam-RG + +Add `` (usually of the form `TAG:VAL`, e.g. `ID:IL7LANE2`) as a +field on the `@RG` header line. Specify `--sam-RG` multiple times to +set multiple fields. See the [SAM Spec][SAM] for details about what fields +are legal. Note that, if any `@RG` fields are set using this option, +the `ID` and `SM` fields must both be among them to make the `@RG` line +legal according to the [SAM Spec][SAM]. `--sam-RG` is ignored unless +`-S`/`--sam` is also specified. + + Performance + + -o/--offrate + +Override the offrate of the index with ``. If `` is greater +than the offrate used to build the index, then some row markings are +discarded when the index is read into memory. This reduces the memory +footprint of the aligner but requires more time to calculate text +offsets. `` must be greater than the value used to build the +index. + + -p/--threads + +Launch `` parallel search threads (default: 1). Threads will run +on separate processors/cores and synchronize when parsing reads and +outputting alignments. Searching for alignments is highly parallel, +and speedup is fairly close to linear. This option is only available +if `bowtie` is linked with the `pthreads` library (i.e. if +`BOWTIE_PTHREADS=0` is not specified at build time). + + --mm + +Use memory-mapped I/O to load the index, rather than normal C file I/O. +Memory-mapping the index allows many concurrent `bowtie` processes on +the same computer to share the same memory image of the index (i.e. you +pay the memory overhead just once). This facilitates memory-efficient +parallelization of `bowtie` in situations where using `-p` is not +possible. + + --shmem + +Use shared memory to load the index, rather than normal C file I/O. +Using shared memory allows many concurrent bowtie processes on the same +computer to share the same memory image of the index (i.e. you pay the +memory overhead just once). This facilitates memory-efficient +parallelization of `bowtie` in situations where using `-p` is not +desirable. Unlike `--mm`, `--shmem` installs the index into shared +memory permanently, or until the user deletes the shared memory chunks +manually. See your operating system documentation for details on how +to manually list and remove shared memory chunks (on Linux and Mac OS +X, these commands are `ipcs` and `ipcrm`). You may also need to +increase your OS's maximum shared-memory chunk size to accomodate +larger indexes; see your OS documentation. + + Other + + --seed + +Use `` as the seed for pseudo-random number generator. + + --verbose + +Print verbose output (for debugging). + + --version + +Print version information and quit. + + -h/--help + +Print usage information and quit. + +Default `bowtie` output +----------------------- + +`bowtie` outputs one alignment per line. Each line is a collection of +8 fields separated by tabs; from left to right, the fields are: + +1. Name of read that aligned + +2. Reference strand aligned to, `+` for forward strand, `-` for + reverse + +3. Name of reference sequence where alignment occurs, or numeric ID if + no name was provided + +4. 0-based offset into the forward reference strand where leftmost + character of the alignment occurs + +5. Read sequence (reverse-complemented if orientation is `-`). + + If the read was in colorspace, then the sequence shown in this + column is the sequence of *decoded nucleotides*, not the original + colors. See the [Colorspace alignment] section for details about + decoding. To display colors instead, use the `--col-cseq` option. + +6. ASCII-encoded read qualities (reversed if orientation is `-`). The + encoded quality values are on the Phred scale and the encoding is + ASCII-offset by 33 (ASCII char `!`). + + If the read was in colorspace, then the qualities shown in this + column are the *decoded qualities*, not the original qualities. + See the [Colorspace alignment] section for details about decoding. + To display colors instead, use the `--col-cqual` option. + +7. If `-M` was specified and the prescribed ceiling was exceeded for + this read, this column contains the value of the ceiling, + indicating that at least that many valid alignments were found in + addition to the one reported. + + Otherwise, this column contains the number of other instances where + the same sequence aligned against the same reference characters as + were aligned against in the reported alignment. This is *not* the + number of other places the read aligns with the same number of + mismatches. The number in this column is generally not a good + proxy for that number (e.g., the number in this column may be '0' + while the number of other alignments with the same number of + mismatches might be large). + +8. Comma-separated list of mismatch descriptors. If there are no + mismatches in the alignment, this field is empty. A single + descriptor has the format offset:reference-base>read-base. The + offset is expressed as a 0-based offset from the high-quality (5') + end of the read. + +SAM `bowtie` output +------------------- + +Following is a brief description of the [SAM] format as output by +`bowtie` when the `-S`/`--sam` option is specified. For more +details, see the [SAM format specification][SAM]. + +When `-S`/`--sam` is specified, `bowtie` prints a SAM header with +`@HD`, `@SQ` and `@PG` lines. When one or more `--sam-RG` arguments +are specified, `bowtie` will also print an `@RG` line that includes all +user-specified `--sam-RG` tokens separated by tabs. + +Each subsequnt line corresponds to a read or an alignment. Each line +is a collection of at least 12 fields separated by tabs; from left to +right, the fields are: + +1. Name of read that aligned + +2. Sum of all applicable flags. Flags relevant to Bowtie are: + + 1 + + The read is one of a pair + + 2 + + The alignment is one end of a proper paired-end alignment + + 4 + + The read has no reported alignments + + 8 + + The read is one of a pair and has no reported alignments + + 16 + + The alignment is to the reverse reference strand + + 32 + + The other mate in the paired-end alignment is aligned to the + reverse reference strand + + 64 + + The read is the first mate in a pair + + 128 + + The read is the second mate in a pair + + Thus, an unpaired read that aligns to the reverse reference strand + will have flag 16. A paired-end read that aligns and is the first + mate in the pair will have flag 83 (= 64 + 16 + 2 + 1). + +3. Name of reference sequence where alignment occurs, or ordinal ID + if no name was provided + +4. 1-based offset into the forward reference strand where leftmost + character of the alignment occurs + +5. Mapping quality + +6. CIGAR string representation of alignment + +7. Name of reference sequence where mate's alignment occurs. Set to + `=` if the mate's reference sequence is the same as this + alignment's, or `*` if there is no mate. + +8. 1-based offset into the forward reference strand where leftmost + character of the mate's alignment occurs. Offset is 0 if there is + no mate. + +9. Inferred insert size. Size is negative if the mate's alignment + occurs upstream of this alignment. Size is 0 if there is no mate. + +10. Read sequence (reverse-complemented if aligned to the reverse + strand) + +11. ASCII-encoded read qualities (reverse-complemented if the read + aligned to the reverse strand). The encoded quality values are on + the [Phred quality] scale and the encoding is ASCII-offset by 33 + (ASCII char `!`), similarly to a [FASTQ] file. + +12. Optional fields. Fields are tab-separated. For descriptions of + all possible optional fields, see the SAM format specification. + `bowtie` outputs some of these optional fields for each alignment, + depending on the type of the alignment: + + NM:i: + + Aligned read has an edit distance of ``. + + CM:i: + + Aligned read has an edit distance of `` in colorspace. This + field is present in addition to the `NM` field in `-C`/`--color` + mode, but is omitted otherwise. + + MD:Z: + + For aligned reads, `` is a string representation of the + mismatched reference bases in the alignment. See [SAM] format + specification for details. For colorspace alignments, `` + describes the decoded *nucleotide* alignment, not the colorspace + alignment. + + XA:i: + + Aligned read belongs to stratum ``. See [Strata] for definition. + + XM:i: + + For a read with no reported alignments, `` is 0 if the read had + no alignments. If `-m` was specified and the read's alignments + were supressed because the `-m` ceiling was exceeded, `` equals + the `-m` ceiling + 1, to indicate that there were at least that + many valid alignments (but all were suppressed). In `-M` mode, if + the alignment was randomly selected because the `-M` ceiling was + exceeded, `` equals the `-M` ceiling + 1, to indicate that there + were at least that many valid alignments (of which one was reported + at random). + +[SAM format specification]: http://samtools.sf.net/SAM1.pdf +[FASTQ]: http://en.wikipedia.org/wiki/FASTQ_format + +The `bowtie-build` indexer +========================== + +`bowtie-build` builds a Bowtie index from a set of DNA sequences. +`bowtie-build` outputs a set of 6 files with suffixes +`.1.ebwt`, `.2.ebwt`, `.3.ebwt`, `.4.ebwt`, `.rev.1.ebwt`, and +`.rev.2.ebwt`. These files together constitute the index: they are all +that is needed to align reads to that reference. The original sequence +files are no longer used by Bowtie once the index is built. + +Use of Karkkainen's [blockwise algorithm] allows `bowtie-build` to +trade off between running time and memory usage. `bowtie-build` has +three options governing how it makes this trade: `-p`/`--packed`, +`--bmax`/`--bmaxdivn`, and `--dcv`. By default, `bowtie-build` will +automatically search for the settings that yield the best + running time without exhausting memory. This behavior can be disabled + using the `-a`/`--noauto` option. + +The indexer provides options pertaining to the "shape" of the index, +e.g. `--offrate` governs the fraction of [Burrows-Wheeler] rows that +are "marked" (i.e., the density of the suffix-array sample; see the +original [FM Index] paper for details). All of these options are +potentially profitable trade-offs depending on the application. They +have been set to defaults that are reasonable for most cases according +to our experiments. See [Performance Tuning] for details. + +Because `bowtie-build` uses 32-bit pointers internally, it can handle +up to a theoretical maximum of 2^32-1 (somewhat more than 4 billion) +characters in an index, though, with other constraints, the actual +ceiling is somewhat less than that. If your reference exceeds 2^32-1 +characters, `bowtie-build` will print an error message and abort. To +resolve this, divide your reference sequences into smaller batches +and/or chunks and build a separate index for each. + +If your computer has more than 3-4 GB of memory and you would like to +exploit that fact to make index building faster, use a 64-bit version +of the `bowtie-build` binary. The 32-bit version of the binary is +restricted to using less than 4 GB of memory. If a 64-bit pre-built +binary does not yet exist for your platform on the sourceforge download +site, you will need to build one from source. + +The Bowtie index is based on the [FM Index] of Ferragina and Manzini, +which in turn is based on the [Burrows-Wheeler] transform. The +algorithm used to build the index is based on the [blockwise algorithm] +of Karkkainen. + +[Blockwise algorithm]: http://portal.acm.org/citation.cfm?id=1314852 +[FM Index]: http://portal.acm.org/citation.cfm?id=796543 +[Burrows-Wheeler]: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform + +Command Line +------------ + +Usage: + + bowtie-build [options]* + + Main arguments + + + +A comma-separated list of FASTA files containing the reference +sequences to be aligned to, or, if `-c` is specified, the sequences +themselves. E.g., `` might be +`chr1.fa,chr2.fa,chrX.fa,chrY.fa`, or, if `-c` is specified, this might +be `GGTCATCCT,ACGGGTCGT,CCGTTCTATGCGGCTTA`. + + + +The basename of the index files to write. By default, `bowtie-build` +writes files named `NAME.1.ebwt`, `NAME.2.ebwt`, `NAME.3.ebwt`, +`NAME.4.ebwt`, `NAME.rev.1.ebwt`, and `NAME.rev.2.ebwt`, where `NAME` +is ``. + + Options + + -f + +The reference input files (specified as ``) are FASTA +files (usually having extension `.fa`, `.mfa`, `.fna` or similar). + + -c + +The reference sequences are given on the command line. I.e. +`` is a comma-separated list of sequences rather than a +list of FASTA files. + + -C/--color + +Build a colorspace index, to be queried using `bowtie` `-C`. + + -a/--noauto + +Disable the default behavior whereby `bowtie-build` automatically +selects values for the `--bmax`, `--dcv` and `--packed` parameters +according to available memory. Instead, user may specify values for +those parameters. If memory is exhausted during indexing, an error +message will be printed; it is up to the user to try new parameters. + + -p/--packed + +Use a packed (2-bits-per-nucleotide) representation for DNA strings. +This saves memory but makes indexing 2-3 times slower. Default: off. +This is configured automatically by default; use `-a`/`--noauto` to +configure manually. + + --bmax + +The maximum number of suffixes allowed in a block. Allowing more +suffixes per block makes indexing faster, but increases peak memory +usage. Setting this option overrides any previous setting for +`--bmax`, or `--bmaxdivn`. Default (in terms of the `--bmaxdivn` +parameter) is `--bmaxdivn` 4. This is configured automatically by +default; use `-a`/`--noauto` to configure manually. + + --bmaxdivn + +The maximum number of suffixes allowed in a block, expressed as a +fraction of the length of the reference. Setting this option overrides +any previous setting for `--bmax`, or `--bmaxdivn`. Default: +`--bmaxdivn` 4. This is configured automatically by default; use +`-a`/`--noauto` to configure manually. + + --dcv + +Use `` as the period for the difference-cover sample. A larger +period yields less memory overhead, but may make suffix sorting slower, +especially if repeats are present. Must be a power of 2 no greater +than 4096. Default: 1024. This is configured automatically by +default; use `-a`/`--noauto` to configure manually. + + --nodc + +Disable use of the difference-cover sample. Suffix sorting becomes +quadratic-time in the worst case (where the worst case is an extremely +repetitive reference). Default: off. + + -r/--noref + +Do not build the `NAME.3.ebwt` and `NAME.4.ebwt` portions of the index, +which contain a bitpacked version of the reference sequences and are +used for paired-end alignment. + + -3/--justref + +Build *only* the `NAME.3.ebwt` and `NAME.4.ebwt` portions of the index, +which contain a bitpacked version of the reference sequences and are +used for paired-end alignment. + + -o/--offrate + +To map alignments back to positions on the reference sequences, it's +necessary to annotate ("mark") some or all of the [Burrows-Wheeler] +rows with their corresponding location on the genome. `-o`/`--offrate` +governs how many rows get marked: the indexer will mark every 2^`` +rows. Marking more rows makes reference-position lookups faster, but +requires more memory to hold the annotations at runtime. The default +is 5 (every 32nd row is marked; for human genome, annotations occupy +about 340 megabytes). + + -t/--ftabchars + +The ftab is the lookup table used to calculate an initial +[Burrows-Wheeler] range with respect to the first `` characters +of the query. A larger `` yields a larger lookup table but faster +query times. The ftab has size 4^(``+1) bytes. The default +setting is 10 (ftab is 4MB). + + --ntoa + +Convert Ns in the reference sequence to As before building the index. +By default, Ns are simply excluded from the index and `bowtie` will not +report alignments that overlap them. + + --big --little + +Endianness to use when serializing integers to the index file. +Default: little-endian (recommended for Intel- and AMD-based +architectures). + + --seed + +Use `` as the seed for pseudo-random number generator. + + --cutoff + +Index only the first `` bases of the reference sequences +(cumulative across sequences) and ignore the rest. + + -q/--quiet + +`bowtie-build` is verbose by default. With this option `bowtie-build` +will print only error messages. + + -h/--help + +Print usage information and quit. + + --version + +Print version information and quit. + +The `bowtie-inspect` index inspector +==================================== + +`bowtie-inspect` extracts information from a Bowtie index about what +kind of index it is and what reference sequences were used to build it. +When run without any options, the tool will output a FASTA file +containing the sequences of the original references (with all +non-`A`/`C`/`G`/`T` characters converted to `N`s). It can also be used +to extract just the reference sequence names using the `-n`/`--names` +option or a more verbose summary using the `-s`/`--summary` option. + +Command Line +------------ + +Usage: + + bowtie-inspect [options]* + + Main arguments + + + +The basename of the index to be inspected. The basename is name of any +of the index files but with the `.X.ebwt` or `.rev.X.ebwt` suffix +omitted. `bowtie-inspect` first looks in the current directory for the +index files, then looks in the `indexes` subdirectory under the +directory where the currently-running `bowtie` executable is located, +then looks in the directory specified in the `BOWTIE_INDEXES` +environment variable. + + Options + + -a/--across + +When printing FASTA output, output a newline character every `` +bases (default: 60). + + -n/--names + +Print reference sequence names, one per line, and quit. + + -s/--summary + +Print a summary that includes information about index settings, as well +as the names and lengths of the input sequences. The summary has this +format: + + Colorspace <0 or 1> + SA-Sample 1 in + FTab-Chars + Sequence-1 + Sequence-2 + ... + Sequence-N + +Fields are separated by tabs. + + -e/--ebwt-ref + +By default, when `bowtie-inspect` is run without `-s` or `-n`, it +recreates the reference nucleotide sequences using the bit-encoded +reference nucleotides kept in the `.3.ebwt` and `.4.ebwt` index files. +When `-e/--ebwt-ref` is specified, `bowtie-inspect` recreates the +reference sequences from the Burrows-Wheeler-transformed reference +sequence in the `.1.ebwt` file instead. The reference recreation +process is much slower when `-e/--ebwt-ref` is specified. Also, when +`-e/--ebwt-ref` is specified and the index is in colorspace, the +reference is printed in colors (A=blue, C=green, G=orange, T=red). + + -v/--verbose + +Print verbose output (for debugging). + + --version + +Print version information and quit. + + -h/--help + +Print usage information and quit. + diff --git a/MANUAL.markdown b/MANUAL.markdown new file mode 100644 index 0000000..065c1c6 --- /dev/null +++ b/MANUAL.markdown @@ -0,0 +1,2362 @@ + + +What is Bowtie? +=============== + +[Bowtie] is an ultrafast, memory-efficient short read aligner geared +toward quickly aligning large sets of short DNA sequences (reads) to +large genomes. It aligns 35-base-pair reads to the human genome at a +rate of 25 million reads per hour on a typical workstation. Bowtie +indexes the genome with a [Burrows-Wheeler] index to keep its memory +footprint small: for the human genome, the index is typically about +2.2 GB (for unpaired alignment) or 2.9 GB (for paired-end or colorspace +alignment). Multiple processors can be used simultaneously to achieve +greater alignment speed. Bowtie can also output alignments in the +standard [SAM] format, allowing Bowtie to interoperate with other tools +supporting SAM, including the [SAMtools] consensus, SNP, and indel +callers. Bowtie runs on the command line under Windows, Mac OS X, +Linux, and Solaris. + +[Bowtie] also forms the basis for other tools, including [TopHat]: a +fast splice junction mapper for RNA-seq reads, [Cufflinks]: a tool for +transcriptome assembly and isoform quantitiation from RNA-seq reads, +[Crossbow]: a cloud-computing software tool for large-scale +resequencing data,and [Myrna]: a cloud computing tool for calculating +differential gene expression in large RNA-seq datasets. + +If you use [Bowtie] for your published research, please cite the +[Bowtie paper]. + +[Bowtie]: http://bowtie-bio.sf.net +[Burrows-Wheeler]: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform +[SAM]: http://samtools.sourceforge.net/SAM1.pdf +[SAMtools]: http://samtools.sourceforge.net/ +[TopHat]: http://tophat.cbcb.umd.edu/ +[Cufflinks]: http://cufflinks.cbcb.umd.edu/ +[Crossbow]: http://bowtie-bio.sf.net/crossbow +[Myrna]: http://bowtie-bio.sf.net/myrna +[Bowtie paper]: http://genomebiology.com/2009/10/3/R25 + +What isn't Bowtie? +================== + +Bowtie is not a general-purpose alignment tool like [MUMmer], [BLAST] +or [Vmatch]. Bowtie works best when aligning short reads to large +genomes, though it supports arbitrarily small reference sequences (e.g. +amplicons) and reads as long as 1024 bases. Bowtie is designed to be +extremely fast for sets of short reads where (a) many of the reads have +at least one good, valid alignment, (b) many of the reads are +relatively high-quality, and (c) the number of alignments reported per +read is small (close to 1). + +Bowtie does not yet report gapped alignments; this is future work. + +[MUMmer]: http://mummer.sourceforge.net/ +[BLAST]: http://blast.ncbi.nlm.nih.gov/Blast.cgi +[Vmatch]: http://www.vmatch.de/ + +Obtaining Bowtie +================ + +You may download either Bowtie sources or binaries for your platform +from the [Download] section of the Sourceforge project site. Binaries +are currently available for Intel architectures (`i386` and `x86_64`) +running Linux, Windows, and Mac OS X. + +Building from source +-------------------- + +Building Bowtie from source requires a GNU-like environment that +includes GCC, GNU Make and other basics. It should be possible to +build Bowtie on a vanilla Linux or Mac installation. Bowtie can also +be built on Windows using [Cygwin] or [MinGW]. We recommend +[TDM's MinGW Build]. If using [MinGW], you must also have [MSYS] +installed. + +To build Bowtie, extract the sources, change to the extracted +directory, and run GNU `make` (usually with the command `make`, but +sometimes with `gmake`) with no arguments. If building with [MinGW], +run `make` from the [MSYS] command line. + +To support the [`-p`] (multithreading) option, Bowtie needs the +`pthreads` library. To compile Bowtie without `pthreads` (which +disables [`-p`]), use `make BOWTIE_PTHREADS=0`. + +[Cygwin]: http://www.cygwin.com/ +[MinGW]: http://www.mingw.org/ +[TDM's MinGW Build]: http://www.tdragon.net/recentgcc/ +[MSYS]: http://www.mingw.org/wiki/msys +[Download]: https://sourceforge.net/projects/bowtie-bio/files/bowtie/ + +The `bowtie` aligner +==================== + +`bowtie` takes an index and a set of reads as input and outputs a list +of alignments. Alignments are selected according to a combination of +the [`-v`]/[`-n`]/[`-e`]/[`-l`] options (plus the [`-I`]/[`-X`]/[`--fr`]/[`--rf`]/ +[`--ff`] options for paired-end alignment), which define which alignments +are legal, and the [`-k`]/[`-a`]/[`-m`]/[`-M`]/[`--best`]/[`--strata`] options +which define which and how many legal alignments should be reported. + +By default, Bowtie enforces an alignment policy similar to [Maq]'s +default quality-aware policy ([`-n`] 2 [`-l`] 28 [`-e`] 70). See [the -n +alignment mode] section of the manual for details about this mode. But +Bowtie can also enforce a simpler end-to-end k-difference policy (e.g. +with [`-v`] 2). See [the -v alignment mode] section of the manual for +details about that mode. [The -n alignment mode] and [the -v alignment +mode] are mutually exclusive. + +Bowtie works best when aligning short reads to large genomes (e.g. +human or mouse), though it supports arbitrarily small reference +sequences and reads as long as 1024 bases. Bowtie is designed to be +very fast for sets of short reads where a) many reads have at least one +good, valid alignment, b) many reads are relatively high-quality, c) +the number of alignments reported per read is small (close to 1). +These criteria are generally satisfied in the context of modern +short-read analyses such as RNA-seq, ChIP-seq, other types of -seq, and +mammalian resequencing. You may observe longer running times in other +research contexts. + +If `bowtie` is too slow for your application, try some of the +performance-tuning hints described in the [Performance Tuning] section +below. + +Alignments involving one or more ambiguous reference characters (`N`, +`-`, `R`, `Y`, etc.) are considered invalid by Bowtie. This is true +only for ambiguous characters in the reference; alignments involving +ambiguous characters in the read are legal, subject to the alignment +policy. Ambiguous characters in the read mismatch all other +characters. Alignments that "fall off" the reference sequence are not +considered valid. + +The process by which `bowtie` chooses an alignment to report is +randomized in order to avoid "mapping bias" - the phenomenon whereby +an aligner systematically fails to report a particular class of good +alignments, causing spurious "holes" in the comparative assembly. +Whenever `bowtie` reports a subset of the valid alignments that exist, +it makes an effort to sample them randomly. This randomness flows +from a simple seeded pseudo-random number generator and is +deterministic in the sense that Bowtie will always produce the same +results for the same read when run with the same initial "seed" value +(see [`--seed`] option). + +In the default mode, `bowtie` can exhibit strand bias. Strand bias +occurs when input reference and reads are such that (a) some reads +align equally well to sites on the forward and reverse strands of the +reference, and (b) the number of such sites on one strand is different +from the number on the other strand. When this happens for a given +read, `bowtie` effectively chooses one strand or the other with 50% +probability, then reports a randomly-selected alignment for that read +from among the sites on the selected strand. This tends to overassign +alignments to the sites on the strand with fewer sites and underassign +to sites on the strand with more sites. The effect is mitigated, +though it may not be eliminated, when reads are longer or when +paired-end reads are used. Running Bowtie in [`--best`] mode +eliminates strand bias by forcing Bowtie to select one strand or the +other with a probability that is proportional to the number of best +sites on the strand. + +Gapped alignments are not currently supported, but support is planned +for a future release. + +[the -n alignment mode]: #the--n-alignment-mode +[the -v alignment mode]: #the--v-alignment-mode +[High Performance Tips]: #high-performance-tips +[Maq]: http://maq.sf.net + +The `-n` alignment mode +----------------------- + +When the [`-n`] option is specified (which is the default), `bowtie` +determines which alignments are valid according to the following +policy, which is similar to [Maq]'s default policy. + + 1. Alignments may have no more than `N` mismatches (where `N` is a + number 0-3, set with [`-n`]) in the first `L` bases (where `L` is a + number 5 or greater, set with [`-l`]) on the high-quality (left) end + of the read. The first `L` bases are called the "seed". + + 2. The sum of the [Phred quality] values at *all* mismatched positions + (not just in the seed) may not exceed `E` (set with [`-e`]). Where + qualities are unavailable (e.g. if the reads are from a FASTA + file), the [Phred quality] defaults to 40. + +The [`-n`] option is mutually exclusive with the [`-v`] option. + +If there are many possible alignments satisfying these criteria, Bowtie +gives preference to alignments with fewer mismatches and where the sum +from criterion 2 is smaller. When the [`--best`] option is specified, +Bowtie guarantees the reported alignment(s) are "best" in terms of +these criteria (criterion 1 has priority), and that the alignments are +reported in best-to-worst order. Bowtie is somewhat slower when +[`--best`] is specified. + +Note that [Maq] internally rounds base qualities to the nearest 10 and +rounds qualities greater than 30 to 30. To maintain compatibility, +Bowtie does the same. Rounding can be suppressed with the +[`--nomaqround`] option. + +Bowtie is not fully sensitive in [`-n`] 2 and [`-n`] 3 modes by default. +In these modes Bowtie imposes a "backtracking limit" to limit effort +spent trying to find valid alignments for low-quality reads unlikely to +have any. This may cause bowtie to miss some legal 2- and 3-mismatch +alignments. The limit is set to a reasonable default (125 without +[`--best`], 800 with [`--best`]), but the user may decrease or increase the +limit using the [`--maxbts`] and/or [`-y`] options. [`-y`] mode is +relatively slow but guarantees full sensitivity. + +[Maq]: http://maq.sf.net +[Phred quality]: http://en.wikipedia.org/wiki/FASTQ_format#Variations + +The `-v` alignment mode +----------------------- + +In [`-v`] mode, alignments may have no more than `V` mismatches, where +`V` may be a number from 0 through 3 set using the [`-v`] option. +Quality values are ignored. The [`-v`] option is mutually exclusive with +the [`-n`] option. + +If there are many legal alignments, Bowtie gives preference to +alignments with fewer mismatches. When the [`--best`] option is +specified, Bowtie guarantees the reported alignment(s) are "best" in +terms of the number of mismatches, and that the alignments are reported +in best-to-worst order. Bowtie is somewhat slower when [`--best`] is +specified. + +Strata +------ + +In [the -n alignment mode], an alignment's "stratum" is defined as the +number of mismatches in the "seed" region, i.e. the leftmost `L` bases, +where `L` is set with the [`-l`] option. In [the -v alignment mode], an +alignment's stratum is defined as the total number of mismatches in the +entire alignment. Some of Bowtie's options (e.g. [`--strata`] and [`-m`] +use the notion of "stratum" to limit or expand the scope of reportable +alignments. + +Reporting Modes +--------------- + +With the [`-k`], [`-a`], [`-m`], [`-M`], [`--best`] and [`--strata`] options, the +user can flexibily select which alignments are reported. Below we +demonstrate a few ways in which these options can be combined. All +examples are using the `e_coli` index packaged with Bowtie. The +[`--suppress`] option is used to keep the output concise and some +output is elided for clarity. + +### Example 1: `-a` + + $ ./bowtie -a -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + +Specifying [`-a`] instructs bowtie to report *all* valid alignments, +subject to the alignment policy: [`-v`] 2. In this case, bowtie finds +5 inexact hits in the E. coli genome; 1 hit (the 2nd one listed) +has 1 mismatch, and the other 4 hits have 2 mismatches. Four are on +the reverse reference strand and one is on the forward strand. Note +that they are not listed in best-to-worst order. + +### Example 2: `-k 3` + + $ ./bowtie -k 3 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + +Specifying [`-k`] 3 instructs bowtie to report up to 3 valid +alignments. In this case, a total of 5 valid alignments exist (see +[Example 1]); `bowtie` reports 3 out of those 5. [`-k`] can be set to +any integer greater than 0. + +[Example 1]: #example-1 + +### Example 3: `-k 6` + + $ ./bowtie -k 6 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + +Specifying [`-k`] 6 instructs bowtie to report up to 6 valid +alignments. In this case, a total of 5 valid alignments exist, so +`bowtie` reports all 5. + +### Example 4: default (`-k 1`) + + $ ./bowtie -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + +Leaving the reporting options at their defaults causes `bowtie` to +report the first valid alignment it encounters. Because [`--best`] was +not specified, we are not guaranteed that bowtie will report the best +alignment, and in this case it does not (the 1-mismatch alignment from +the previous example would have been better). The default reporting +mode is equivalent to [`-k`] 1. + +### Example 5: `-a --best` + + $ ./bowtie -a --best -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + +Specifying [`-a`] [`--best`] results in the same alignments being printed +as if just [`-a`] had been specified, but they are guaranteed to be +reported in best-to-worst order. + +### Example 6: `-a --best --strata` + + $ ./bowtie -a --best --strata -v 2 --suppress 1,5,6,7 e_coli -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + +Specifying [`--strata`] in addition to [`-a`] and [`--best`] causes +`bowtie` to report only those alignments in the best alignment +"stratum". The alignments in the best stratum are those having the +least number of mismatches (or mismatches just in the "seed" portion of +the alignment in the case of [`-n`] mode). Note that if [`--strata`] +is specified, [`--best`] must also be specified. + +### Example 7: `-a -m 3` + + $ ./bowtie -a -m 3 -v 2 e_coli -c ATGCATCATGCGCCAT + No alignments + +Specifying [`-m`] 3 instructs bowtie to refrain from reporting any +alignments for reads having more than 3 reportable alignments. The +[`-m`] option is useful when the user would like to guarantee that +reported alignments are "unique", for some definition of unique. + +Example 1 showed that the read has 5 reportable alignments when [`-a`] +and [`-v`] 2 are specified, so the [`-m`] 3 limit causes bowtie to +output no alignments. + +### Example 8: `-a -m 5` + + $ ./bowtie -a -m 5 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + - gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G + - gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T + + gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T + +Specifying [`-m`] 5 instructs bowtie to refrain from reporting any +alignments for reads having more than 5 reportable alignments. Since +the read has exactly 5 reportable alignments, the [`-m`] 5 limit allows +`bowtie` to print them as usual. + +### Example 9: `-a -m 3 --best --strata` + + $ ./bowtie -a -m 3 --best --strata -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT + - gi|110640213|ref|NC_008253.1| 2852852 8:T>A + +Specifying [`-m`] 3 instructs bowtie to refrain from reporting any +alignments for reads having more than 3 reportable alignments. As we +saw in Example 6, the read has only 1 reportable alignment when [`-a`], +[`--best`] and [`--strata`] are specified, so the [`-m`] 3 limit allows +`bowtie` to print that alignment as usual. + +Intuitively, the [`-m`] option, when combined with the [`--best`] and +[`--strata`] options, guarantees a principled, though weaker form of +"uniqueness." A stronger form of uniqueness is enforced when [`-m`] is +specified but [`--best`] and [`--strata`] are not. + +Paired-end Alignment +-------------------- + +`bowtie` can align paired-end reads when properly paired read files are +specified using the [`-1`](#command-line) and [`-2`](#command-line) options (for pairs of raw, FASTA, or +FASTQ read files), or using the [`--12`](#command-line) option (for Tab-delimited read +files). A valid paired-end alignment satisfies these criteria: + +1. Both mates have a valid alignment according to the alignment policy + defined by the [`-v`]/[`-n`]/[`-e`]/[`-l`] options. +2. The relative orientation and position of the mates satisfy the + constraints defined by the [`-I`]/[`-X`]/[`--fr`]/[`--rf`]/[`--ff`] + options. + +Policies governing which paired-end alignments are reported for a +given read are specified using the [`-k`], [`-a`] and [`-m`] options as +usual. The [`--strata`] and [`--best`] options do not apply in +paired-end mode. + +A paired-end alignment is reported as a pair of mate alignments, both +on a separate line, where the alignment for each mate is formatted the +same as an unpaired (singleton) alignment. The alignment for the mate +that occurs closest to the beginning of the reference sequence (the +"upstream" mate) is always printed before the alignment for the +downstream mate. Reads files containing paired-end reads will +sometimes name the reads according to whether they are the #1 or #2 +mates by appending a `/1` or `/2` suffix to the read name. If no such +suffix is present in Bowtie's input, the suffix will be added when +Bowtie prints read names in alignments (except in [`-S`] "SAM" mode, +where mate information is encoded in the `FLAGS` field instead). + +Finding a valid paired-end alignment where both mates align to +repetitive regions of the reference can be very time-consuming. By +default, Bowtie avoids much of this cost by imposing a limit on the +number of "tries" it makes to match an alignment for one mate with a +nearby alignment for the other. The default limit is 100. This causes +`bowtie` to miss some valid paired-end alignments where both mates lie +in repetitive regions, but the user may use the [`--pairtries`] or +[`-y`] options to increase Bowtie's sensitivity as desired. + +Paired-end alignments where one mate's alignment is entirely contained +within the other's are considered invalid. + +When colospace alignment is enabled via [`-C`], the default setting for +paired-end orientation is [`--ff`]. This is because most SOLiD datasets +have that orientation. When colorspace alignment is not enabled +(default), the default setting for orientation is [`--fr`], since most +Illumina datasets have this orientation. The default can be overriden +in either case. + +Because Bowtie uses an in-memory representation of the original +reference string when finding paired-end alignments, its memory +footprint is larger when aligning paired-end reads. For example, the +human index has a memory footprint of about 2.2 GB in single-end mode +and 2.9 GB in paired-end mode. Note that paired-end and unpaired +alignment incur the same memory footprint in colorspace (e.g. human +incurs about 2.9 GB) + +Colorspace Alignment +-------------------- + +[Colorspace alignment]: #colorspace-alignment + +As of version 0.12.0, `bowtie` can align colorspace reads against a +colorspace index when [`-C`] is specified. Colorspace is the +characteristic output format of Applied Biosystems' SOLiD system. In a +colorspace read, each character is a color rather than a nucleotide, +where a color encodes a class of dinucleotides. E.g. the color blue +encodes any of the dinucleotides: AA, CC, GG, TT. Colorspace has the +advantage of (often) being able to distinguish sequencing errors from +SNPs once the read has been aligned. See ABI's [Principles of Di-Base +Sequencing] document for details. + +### Colorspace reads + +All input formats (FASTA [`-f`], FASTQ [`-q`], raw [`-r`], tab-delimited +[`--12`](#command-line), command-line [`-c`]) are compatible with colorspace ([`-C`]). +When [`-C`] is specified, read sequences are treated as colors. Colors +may be encoded either as numbers (`0`=blue, `1`=green, `2`=orange, +`3`=red) or as characters `A/C/G/T` (`A`=blue, `C`=green, `G`=orange, +`T`=red). + +Some reads include a primer base as the first character; e.g.: + + >1_53_33_F3 + T2213120002010301233221223311331 + >1_53_70_F3 + T2302111203131231130300111123220 + ... + +Here, `T` is the primer base. `bowtie` detects and handles primer +bases properly (i.e., the primer base and the adjacent color are both +trimmed away prior to alignment) as long as the rest of the read is +encoded as numbers. + +`bowtie` also handles input in the form of parallel `.csfasta` and +`_QV.qual` files. Use [`-f`] to specify the `.csfasta` files and [`-Q`] +(for unpaired reads) or [`--Q1`]/[`--Q2`] (for paired-end reads) to +specify the corresponding `_QV.qual` files. It is not necessary to +first convert to FASTQ, though `bowtie` also handles FASTQ-formatted +colorspace reads (with [`-q`], the default). + +### Building a colorspace index + +A colorspace index is built in the same way as a normal index except +that [`-C`](#bowtie-build-options-C) must be specified when running `bowtie-build`. If the user +attempts to use `bowtie` without [`-C`] to align against an index that +was built with [`-C`] (or vice versa), `bowtie` prints an error message +and quits. + +### Decoding colorspace alignments + +Once a colorspace read is aligned, Bowtie decodes the alignment into +nucleotides and reports the decoded nucleotide sequence. A principled +decoding scheme is necessary because many different possible decodings +are usually possible. Finding the true decoding with 100% certainty +requires knowing all variants (e.g. SNPs) in the subject's genome +beforehand, which is usually not possible. Instead, `bowtie` employs +the approximate decoding scheme described in the [BWA paper]. This +scheme attempts to distinguish variants from sequencing errors +according to their relative likelihood under a model that considers the +quality values of the colors and the (configurable) global likelihood +of a SNP. + +Quality values are also "decoded" so that each reported quality value +is a function of the two color qualities overlapping it. Bowtie again +adopts the scheme described in the [BWA paper], i.e., the decoded +nucleotide quality is either the sum of the overlapping color qualities +(when both overlapping colors correspond to bases that match in the +alignment), the quality of the matching color minus the quality of the +mismatching color, or 0 (when both overlapping colors correspond to +mismatches). + +For accurate decoding, [`--snpphred`]/[`--snpfrac`] should be set according +to the user's best guess of the SNP frequency in the subject. The +[`--snpphred`] parameter sets the SNP penalty directly (on the [Phred +quality] scale), whereas [`--snpfrac`] allows the user to specify the +fraction of sites expected to be SNPs; the fraction is then converted +to a [Phred quality] internally. For the purpose of decoding, the SNP +fraction is defined in terms of SNPs per *haplotype* base. Thus, if +the genome is diploid, heterozygous SNPs have half the weight of +homozygous SNPs + +Note that in [`-S`/`--sam`] mode, the decoded nucleotide sequence is +printed for alignments, but the original color sequence (with `A`=blue, +`C`=green, `G`=orange, `T`=red) is printed for unaligned reads without +any reported alignments. As always, the [`--un`], [`--max`] and [`--al`] +parameters print reads exactly as they appeared in the input file. + +### Paired-end colorspace alignment + +Like other platforms, SOLiD supports generation of paired-end reads. +When colorspace alignment is enabled, the default paired-end +orientation setting is [`--ff`]. This is because most SOLiD datasets +have that orientation. + +Note that SOLiD-generated read files can have "orphaned" mates; i.e. +mates without a correpsondingly-named mate in the other file. To avoid +problems due to orphaned mates, SOLiD paired-end output should first be +converted to `.csfastq` files with unpaired mates omitted. This can be +accomplished using, for example, [Galaxy]'s conversion tool (click +"NGS: QC and manipulation", then "SOLiD-to-FASTQ" in the left-hand +sidebar). + +[Principles of Di-Base Sequencing]: http://tinyurl.com/ygnb2gn +[Decoding colorspace alignments]: #decoding-colorspace-alignments +[BWA paper]: http://bioinformatics.oxfordjournals.org/cgi/content/abstract/25/14/1754 + +Performance Tuning +------------------ + +[Performance tuning]: #performance-tuning + +1. Use 64-bit bowtie if possible + + The 64-bit version of Bowtie is substantially (usually more then + 50%) faster than the 32-bit version, owing to its use of 64-bit + arithmetic. If possible, download the 64-bit binaries for Bowtie + and run on a 64-bit computer. If you are building Bowtie from + sources, you may need to pass the `-m64` option to `g++` to compile + the 64-bit version; you can do this by including `BITS=64` in the + arguments to the `make` command; e.g.: `make BITS=64 bowtie`. To + determine whether your version of bowtie is 64-bit or 32-bit, run + `bowtie --version`. + +2. If your computer has multiple processors/cores, use `-p` + + The [`-p`] option causes Bowtie to launch a specified number of + parallel search threads. Each thread runs on a different + processor/core and all threads find alignments in parallel, + increasing alignment throughput by approximately a multiple of the + number of threads (though in practice, speedup is somewhat worse + than linear). + +3. If reporting many alignments per read, try tweaking + `bowtie-build --offrate` + + If you are using the [`-k`], [`-a`] or [`-m`] options and Bowtie is + reporting many alignments per read (an average of more than about + 10 per read) and you have some memory to spare, using an index with + a denser SA sample can speed things up considerably. + + To do this, specify a smaller-than-default [`-o`/`--offrate`](#bowtie-build-options-o) value + when running `bowtie-build`. A denser SA sample yields a larger + index, but is also particularly effective at speeding up alignment + when many alignments are reported per read. For example, + decreasing the index's [`-o`/`--offrate`](#bowtie-build-options-o) by 1 could as much as + double alignment performance, and decreasing by 2 could quadruple + alignment performance, etc. + + On the other hand, decreasing [`-o`/`--offrate`](#bowtie-build-options-o) increases the size + of the Bowtie index, both on disk and in memory when aligning + reads. At the default [`-o`/`--offrate`](#bowtie-build-options-o) of 5, the SA sample for the + human genome occupies about 375 MB of memory when aligning reads. + Decreasing the [`-o`/`--offrate`](#bowtie-build-options-o) by 1 doubles the memory taken by + the SA sample, and decreasing by 2 quadruples the memory taken, + etc. + +4. If bowtie "thrashes", try increasing `bowtie --offrate` + + If `bowtie` runs very slow on a relatively low-memory machine + (having less than about 4 GB of memory), then try setting `bowtie` + [`-o`/`--offrate`] to a *larger* value than the value used to build + the index. For example, `bowtie-build`'s default [`-o`/`--offrate`](#bowtie-build-options-o) + is 5 and all pre-built indexes available from the Bowtie website + are built with [`-o`/`--offrate`](#bowtie-build-options-o) 5; so if `bowtie` thrashes when + querying such an index, try using `bowtie` [`--offrate`] 6. If + `bowtie` still thrashes, try `bowtie` [`--offrate`] 7, etc. A higher + [`-o`/`--offrate`] causes `bowtie` to use a sparser sample of the + suffix array than is stored in the index; this saves memory but + makes alignment reporting slower (which is especially slow when + using [`-a`] or large [`-k`] or [`-m`]). + +Command Line +------------ + +Usage: + + bowtie [options]* {-1 -2 | --12 | } [] + +### Main arguments + +
+ + + + + +The basename of the index to be searched. The basename is the name of +any of the index files up to but not including the final `.1.ebwt` / +`.rev.1.ebwt` / etc. `bowtie` looks for the specified index first in +the current directory, then in the `indexes` subdirectory under the +directory where the `bowtie` executable is located, then looks in the +directory specified in the `BOWTIE_INDEXES` environment variable. + +
+ + + + + +Comma-separated list of files containing the #1 mates (filename usually +includes `_1`), or, if [`-c`] is specified, the mate sequences +themselves. E.g., this might be `flyA_1.fq,flyB_1.fq`, or, if [`-c`] +is specified, this might be `GGTCATCCT,ACGGGTCGT`. Sequences specified +with this option must correspond file-for-file and read-for-read with +those specified in ``. Reads may be a mix of different lengths. +If `-` is specified, `bowtie` will read the #1 mates from the "standard +in" filehandle. + +
+ + + + + +Comma-separated list of files containing the #2 mates (filename usually +includes `_2`), or, if [`-c`] is specified, the mate sequences +themselves. E.g., this might be `flyA_2.fq,flyB_2.fq`, or, if [`-c`] +is specified, this might be `GGTCATCCT,ACGGGTCGT`. Sequences specified +with this option must correspond file-for-file and read-for-read with +those specified in ``. Reads may be a mix of different lengths. +If `-` is specified, `bowtie` will read the #2 mates from the "standard +in" filehandle. + +
+ + + + + +Comma-separated list of files containing a mix of unpaired and +paired-end reads in Tab-delimited format. Tab-delimited format is a +1-read-per-line format where unpaired reads consist of a read name, +sequence and quality string each separated by tabs. A paired-end read +consists of a read name, sequnce of the #1 mate, quality values of the +#1 mate, sequence of the #2 mate, and quality values of the #2 mate +separated by tabs. Quality values can be expressed using any of the +scales supported in FASTQ files. Reads may be a mix of different +lengths and paired-end and unpaired reads may be intermingled in the +same file. If `-` is specified, `bowtie` will read the Tab-delimited +reads from the "standard in" filehandle. + +
+ + + + + +A comma-separated list of files containing unpaired reads to be +aligned, or, if [`-c`] is specified, the unpaired read sequences +themselves. E.g., this might be +`lane1.fq,lane2.fq,lane3.fq,lane4.fq`, or, if [`-c`] is specified, this +might be `GGTCATCCT,ACGGGTCGT`. Reads may be a mix of different +lengths. If `-` is specified, Bowtie gets the reads from the "standard +in" filehandle. + +
+ + + + + +File to write alignments to. By default, alignments are written to the +"standard out" filehandle (i.e. the console). + +
+ +### Options + +#### Input + + +
+ +[`-q`]: #bowtie-options-q + + -q + + + +The query input files (specified either as `` and ``, or as +``) are FASTQ files (usually having extension `.fq` or `.fastq`). +This is the default. See also: [`--solexa-quals`] and +[`--integer-quals`]. + +
+ +[`-f`]: #bowtie-options-f + + -f + + + +The query input files (specified either as `` and ``, or as +``) are FASTA files (usually having extension `.fa`, `.mfa`, `.fna` +or similar). All quality values are assumed to be 40 on the [Phred +quality] scale. + +
+ +[`-r`]: #bowtie-options-r + + -r + + + +The query input files (specified either as `` and ``, or as +``) are Raw files: one sequence per line, without quality values or +names. All quality values are assumed to be 40 on the [Phred quality] +scale. + +
+ +[`-c`]: #bowtie-options-c + + -c + + + +The query sequences are given on command line. I.e. ``, `` and +`` are comma-separated lists of reads rather than lists of +read files. + +
+ +[`-C`]: #bowtie-options-C +[`-C`/`--color`]: #bowtie-options-C + + -C/--color + + + +Align in colorspace. Read characters are interpreted as colors. The +index specified must be a colorspace index (i.e. built with +`bowtie-build` [`-C`](#bowtie-build-options-C), or `bowtie` will print an error message and quit. +See [Colorspace alignment] for more details. + +
+ +[`-Q`]: #bowtie-options-Q +[`-Q`/`--quals`]: #bowtie-options-Q + + -Q/--quals + + + +Comma-separated list of files containing quality values for +corresponding unpaired CSFASTA reads. Use in combination with [`-C`] +and [`-f`]. [`--integer-quals`] is set automatically when `-Q`/`--quals` +is specified. + +
+ +[`--Q1`]: #bowtie-options-Q1 + + --Q1 + + + +Comma-separated list of files containing quality values for +corresponding CSFASTA #1 mates. Use in combination with [`-C`], [`-f`], +and [`-1`](#command-line). [`--integer-quals`] is set automatically when `--Q1` +is specified. + +
+ +[`--Q2`]: #bowtie-options-Q2 + + --Q2 + + + +Comma-separated list of files containing quality values for +corresponding CSFASTA #2 mates. Use in combination with [`-C`], [`-f`], +and [`-2`](#command-line). [`--integer-quals`] is set automatically when `--Q2` +is specified. + +
+ +[`-s`/`--skip`]: #bowtie-options-s +[`-s`]: #bowtie-options-s + + -s/--skip + + + +Skip (i.e. do not align) the first `` reads or pairs in the input. + +
+ +[`-u`/`--qupto`]: #bowtie-options-u +[`-u`]: #bowtie-options-u + + -u/--qupto + + + +Only align the first `` reads or read pairs from the input (after +the [`-s`/`--skip`] reads or pairs have been skipped). Default: no +limit. + +
+ +[`-5`/`--trim5`]: #bowtie-options-5 +[`-5`]: #bowtie-options-5 + + -5/--trim5 + + + +Trim `` bases from high-quality (left) end of each read before +alignment (default: 0). + +
+ +[`-3`/`--trim3`]: #bowtie-options-3 +[`-3`]: #bowtie-options-3 + + -3/--trim3 + + + +Trim `` bases from low-quality (right) end of each read before +alignment (default: 0). + +
+ +[`--phred33-quals`]: #bowtie-options-phred33-quals + + --phred33-quals + + + +Input qualities are ASCII chars equal to the [Phred quality] plus 33. +Default: on. + +
+ +[`--phred64-quals`]: #bowtie-options-phred64-quals + + --phred64-quals + + + +Input qualities are ASCII chars equal to the [Phred quality] plus 64. +Default: off. + +
+ +[`--solexa-quals`]: #bowtie-options-solexa-quals + + --solexa-quals + + + +Convert input qualities from [Solexa][Phred quality] (which can be +negative) to [Phred][Phred quality] (which can't). This is usually the +right option for use with (unconverted) reads emitted by GA Pipeline +versions prior to 1.3. Default: off. + +
+ +[`--solexa1.3-quals`]: #bowtie-options-solexa1.3-quals + + --solexa1.3-quals + + + +Same as [`--phred64-quals`]. This is usually the right option for use +with (unconverted) reads emitted by GA Pipeline version 1.3 or later. +Default: off. + +
+ +[`--integer-quals`]: #bowtie-options-integer-quals + + --integer-quals + + + +Quality values are represented in the read input file as +space-separated ASCII integers, e.g., `40 40 30 40`..., rather than +ASCII characters, e.g., `II?I`.... Integers are treated as being on +the [Phred quality] scale unless [`--solexa-quals`] is also specified. +Default: off. + +
+ +#### Alignment + + + +
+ +[`-v`]: #bowtie-options-v + + -v + + + +Report alignments with at most `` mismatches. [`-e`] and [`-l`] +options are ignored and quality values have no effect on what +alignments are valid. [`-v`] is mutually exclusive with [`-n`]. + +
+ +[`-n`/`--seedmms`]: #bowtie-options-n +[`-n`]: #bowtie-options-n + + -n/--seedmms + + + +Maximum number of mismatches permitted in the "seed", i.e. the first +`L` base pairs of the read (where `L` is set with [`-l`/`--seedlen`]). +This may be 0, 1, 2 or 3 and the default is 2. This option is mutually +exclusive with the [`-v`] option. + +
+ +[`-e`/`--maqerr`]: #bowtie-options-e +[`-e`]: #bowtie-options-e + + -e/--maqerr + + + +Maximum permitted total of quality values at *all* mismatched read +positions throughout the entire alignment, not just in the "seed". The +default is 70. Like [Maq], `bowtie` rounds quality values to the +nearest 10 and saturates at 30; rounding can be disabled with +[`--nomaqround`]. + +
+ +[`-l`/`--seedlen`]: #bowtie-options-l +[`-l`]: #bowtie-options-l + + -l/--seedlen + + + +The "seed length"; i.e., the number of bases on the high-quality end of +the read to which the [`-n`] ceiling applies. The lowest permitted +setting is 5 and the default is 28. `bowtie` is faster for larger +values of [`-l`]. + +
+ +[`--nomaqround`]: #bowtie-options-nomaqround + + --nomaqround + + + +[Maq] accepts quality values in the [Phred quality] scale, but +internally rounds values to the nearest 10, with a maximum of 30. By +default, `bowtie` also rounds this way. [`--nomaqround`] prevents this +rounding in `bowtie`. + +
+ +[`-I`/`--minins`]: #bowtie-options-I +[`-I`]: #bowtie-options-I + + -I/--minins + + + +The minimum insert size for valid paired-end alignments. E.g. if `-I +60` is specified and a paired-end alignment consists of two 20-bp +alignments in the appropriate orientation with a 20-bp gap between +them, that alignment is considered valid (as long as [`-X`] is also +satisfied). A 19-bp gap would not be valid in that case. If trimming +options [`-3`] or [`-5`] are also used, the [`-I`] constraint is +applied with respect to the untrimmed mates. Default: 0. + +
+ +[`-X`/`--maxins`]: #bowtie-options-X +[`-X`]: #bowtie-options-X + + -X/--maxins + + + +The maximum insert size for valid paired-end alignments. E.g. if `-X +100` is specified and a paired-end alignment consists of two 20-bp +alignments in the proper orientation with a 60-bp gap between them, +that alignment is considered valid (as long as [`-I`] is also +satisfied). A 61-bp gap would not be valid in that case. If trimming +options [`-3`] or [`-5`] are also used, the `-X` constraint is applied +with respect to the untrimmed mates, not the trimmed mates. Default: +250. + +
+ +[`--fr`/`--rf`/`--ff`]: #bowtie-options-fr +[`--fr`]: #bowtie-options-fr +[`--rf`]: #bowtie-options-fr +[`--ff`]: #bowtie-options-fr + + --fr/--rf/--ff + + + +The upstream/downstream mate orientations for a valid paired-end +alignment against the forward reference strand. E.g., if `--fr` is +specified and there is a candidate paired-end alignment where mate1 +appears upstream of the reverse complement of mate2 and the insert +length constraints are met, that alignment is valid. Also, if mate2 +appears upstream of the reverse complement of mate1 and all other +constraints are met, that too is valid. `--rf` likewise requires that +an upstream mate1 be reverse-complemented and a downstream mate2 be +forward-oriented. ` --ff` requires both an upstream mate1 and a +downstream mate2 to be forward-oriented. Default: `--fr` when [`-C`] +(colorspace alignment) is not specified, `--ff` when [`-C`] is specified. + +
+ +[`--nofw`]: #bowtie-options-nofw + + --nofw/--norc + + + +If `--nofw` is specified, `bowtie` will not attempt to align against +the forward reference strand. If `--norc` is specified, `bowtie` will +not attempt to align against the reverse-complement reference strand. +For paired-end reads using [`--fr`] or [`--rf`] modes, `--nofw` and +`--norc` apply to the forward and reverse-complement pair orientations. +I.e. specifying `--nofw` and [`--fr`] will only find reads in the R/F +orientation where mate 2 occurs upstream of mate 1 with respect to the +forward reference strand. + +
+ +[`--maxbts`]: #bowtie-options-maxbts + + --maxbts + + + +The maximum number of backtracks permitted when aligning a read in +[`-n`] 2 or [`-n`] 3 mode (default: 125 without [`--best`], 800 with +[`--best`]). A "backtrack" is the introduction of a speculative +substitution into the alignment. Without this limit, the default +parameters will sometimes require that `bowtie` try 100s or 1,000s of +backtracks to align a read, especially if the read has many low-quality +bases and/or has no valid alignments, slowing bowtie down +significantly. However, this limit may cause some valid alignments to +be missed. Higher limits yield greater sensitivity at the expensive of +longer running times. See also: [`-y`/`--tryhard`]. + +
+ +[`--pairtries`]: #bowtie-options-pairtries + + --pairtries + + + +For paired-end alignment, this is the maximum number of attempts +`bowtie` will make to match an alignment for one mate up with an +alignment for the opposite mate. Most paired-end alignments require +only a few such attempts, but pairs where both mates occur in highly +repetitive regions of the reference can require significantly more. +Setting this to a higher number allows `bowtie` to find more paired- +end alignments for repetitive pairs at the expense of speed. The +default is 100. See also: [`-y`/`--tryhard`]. + +
+ +[`-y`/`--tryhard`]: #bowtie-options-y +[`-y`]: #bowtie-options-y + + -y/--tryhard + + + +Try as hard as possible to find valid alignments when they exist, +including paired-end alignments. This is equivalent to specifying very +high values for the [`--maxbts`] and [`--pairtries`] options. This +mode is generally much slower than the default settings, but can be +useful for certain problems. This mode is slower when (a) the +reference is very repetitive, (b) the reads are low quality, or (c) not +many reads have valid alignments. + +
+ +[`--chunkmbs`]: #bowtie-options-chunkmbs + + --chunkmbs + + + +The number of megabytes of memory a given thread is given to store path +descriptors in [`--best`] mode. Best-first search must keep track of +many paths at once to ensure it is always extending the path with the +lowest cumulative cost. Bowtie tries to minimize the memory impact of +the descriptors, but they can still grow very large in some cases. If +you receive an error message saying that chunk memory has been +exhausted in [`--best`] mode, try adjusting this parameter up to +dedicate more memory to the descriptors. Default: 64. + +
+ +#### Reporting + + +
+ +[`-k`]: #bowtie-options-k + + -k + + + +Report up to `` valid alignments per read or pair (default: 1). +Validity of alignments is determined by the alignment policy (combined +effects of [`-n`], [`-v`], [`-l`], and [`-e`]). If more than one valid +alignment exists and the [`--best`] and [`--strata`] options are +specified, then only those alignments belonging to the best alignment +"stratum" will be reported. Bowtie is designed to be very fast for +small [`-k`] but bowtie can become significantly slower as [`-k`] +increases. If you would like to use Bowtie for larger values of +[`-k`], consider building an index with a denser suffix-array sample, +i.e. specify a smaller [`-o`/`--offrate`](#bowtie-build-options-o) when invoking `bowtie-build` +for the relevant index (see the [Performance tuning] section for +details). + +
+ +[`-a`/`--all`]: #bowtie-options-a +[`-a`]: #bowtie-options-a + + -a/--all + + + +Report all valid alignments per read or pair (default: off). Validity +of alignments is determined by the alignment policy (combined effects +of [`-n`], [`-v`], [`-l`], and [`-e`]). If more than one valid alignment +exists and the [`--best`] and [`--strata`] options are specified, then only +those alignments belonging to the best alignment "stratum" will be +reported. Bowtie is designed to be very fast for small [`-k`] but bowtie +can become significantly slower if [`-a`/`--all`] is specified. If you +would like to use Bowtie with [`-a`], consider building an index with a +denser suffix-array sample, i.e. specify a smaller [`-o`/`--offrate`](#bowtie-build-options-o) +when invoking `bowtie-build` for the relevant index (see the +[Performance tuning] section for details). + +
+ +[`-m`]: #bowtie-options-m + + -m + + + +Suppress all alignments for a particular read or pair if more than +`` reportable alignments exist for it. Reportable alignments are +those that would be reported given the [`-n`], [`-v`], [`-l`], [`-e`], [`-k`], +[`-a`], [`--best`], and [`--strata`] options. Default: no limit. Bowtie is +designed to be very fast for small [`-m`] but bowtie can become +significantly slower for larger values of [`-m`]. If you would like to +use Bowtie for larger values of [`-k`], consider building an index with a +denser suffix-array sample, i.e. specify a smaller [`-o`/`--offrate`](#bowtie-build-options-o) when +invoking `bowtie-build` for the relevant index (see the [Performance +tuning] section for details). + +
+ +[`-M`]: #bowtie-options-M + + -M + + + +Behaves like [`-m`] except that if a read has more than `` +reportable alignments, one is reported at random. In [default +output mode], the selected alignment's 7th column is set to ``+1 to +indicate the read has at least ``+1 valid alignments. In +[`-S`/`--sam`] mode, the selected alignment is given a `MAPQ` (mapping +quality) of 0 and the `XM:I` field is set to ``+1. This option +requires [`--best`]; if specified without [`--best`], [`--best`] is enabled +automatically. + +[default output mode]: #default-bowtie-output + +
+ +[`--best`]: #bowtie-options-best + + --best + + + +Make Bowtie guarantee that reported singleton alignments are "best" in +terms of stratum (i.e. number of mismatches, or mismatches in the seed +in the case of [`-n`] mode) and in terms of the quality values at the +mismatched position(s). Stratum always trumps quality; e.g. a +1-mismatch alignment where the mismatched position has [Phred quality] +40 is preferred over a 2-mismatch alignment where the mismatched +positions both have [Phred quality] 10. When [`--best`] is not +specified, Bowtie may report alignments that are sub-optimal in terms +of stratum and/or quality (though an effort is made to report the best +alignment). [`--best`] mode also removes all strand bias. Note that +[`--best`] does not affect which alignments are considered "valid" by +`bowtie`, only which valid alignments are reported by `bowtie`. When +[`--best`] is specified and multiple hits are allowed (via [`-k`] or +[`-a`]), the alignments for a given read are guaranteed to appear in +best-to-worst order in `bowtie`'s output. `bowtie` is somewhat slower +when [`--best`] is specified. + +
+ +[`--strata`]: #bowtie-options-strata + + --strata + + + +If many valid alignments exist and are reportable (e.g. are not +disallowed via the [`-k`] option) and they fall into more than one +alignment "stratum", report only those alignments that fall into the +best stratum. By default, Bowtie reports all reportable alignments +regardless of whether they fall into multiple strata. When +[`--strata`] is specified, [`--best`] must also be specified. + +
+ +#### Output + + + + +
+ +[`-t`/`--time`]: #bowtie-options-t +[`-t`]: #bowtie-options-t + + -t/--time + + + +Print the amount of wall-clock time taken by each phase. + +
+ +[`-B`/`--offbase`]: #bowtie-options-B +[`-B`]: #bowtie-options-B + + -B/--offbase + + + +When outputting alignments, number the first base of a reference +sequence as ``. Default: 0. + +
+ +[`--quiet`]: #bowtie-options-quiet + + --quiet + + + +Print nothing besides alignments. + +
+ +[`--refout`]: #bowtie-options-refout + + --refout + + + +Write alignments to a set of files named `refXXXXX.map`, where `XXXXX` +is the 0-padded index of the reference sequence aligned to. This can +be a useful way to break up work for downstream analyses when dealing +with, for example, large numbers of reads aligned to the assembled +human genome. If `` is also specified, it will be ignored. + +
+ +[`--refidx`]: #bowtie-options-refidx + + --refidx + + + +When a reference sequence is referred to in a reported alignment, refer +to it by 0-based index (its offset into the list of references that +were indexed) rather than by name. + +
+ +[`--al`]: #bowtie-options-al + + --al + + + +Write all reads for which at least one alignment was reported to a file +with name ``. Written reads will appear as they did in the +input, without any of the trimming or translation of quality values +that may have taken place within `bowtie`. Paired-end reads will be +written to two parallel files with `_1` and `_2` inserted in the +filename, e.g., if `` is `aligned.fq`, the #1 and #2 mates +that fail to align will be written to `aligned_1.fq` and `aligned_2.fq` +respectively. + +
+ +[`--un`]: #bowtie-options-un + + --un + + + +Write all reads that could not be aligned to a file with name +``. Written reads will appear as they did in the input, +without any of the trimming or translation of quality values that may +have taken place within Bowtie. Paired-end reads will be written to +two parallel files with `_1` and `_2` inserted in the filename, e.g., +if `` is `unaligned.fq`, the #1 and #2 mates that fail to +align will be written to `unaligned_1.fq` and `unaligned_2.fq` +respectively. Unless [`--max`] is also specified, reads with a number +of valid alignments exceeding the limit set with the [`-m`] option are +also written to ``. + +
+ +[`--max`]: #bowtie-options-max + + --max + + + +Write all reads with a number of valid alignments exceeding the limit +set with the [`-m`] option to a file with name ``. Written +reads will appear as they did in the input, without any of the trimming +or translation of quality values that may have taken place within +`bowtie`. Paired-end reads will be written to two parallel files with +`_1` and `_2` inserted in the filename, e.g., if `` is +`max.fq`, the #1 and #2 mates that exceed the [`-m`] limit will be +written to `max_1.fq` and `max_2.fq` respectively. These reads are not +written to the file specified with [`--un`]. + +
+ +[`--suppress`]: #bowtie-options-suppress + + --suppress + + + +Suppress columns of output in the [default output mode]. E.g. if +`--suppress 1,5,6` is specified, the read name, read sequence, and read +quality fields will be omitted. See [Default Bowtie output] for field +descriptions. This option is ignored if the output mode is +[`-S`/`--sam`]. + +
+ +[`--fullref`]: #bowtie-options-fullref + + --fullref + + + +Print the full refernce sequence name, including whitespace, in +alignment output. By default `bowtie` prints everything up to but not +including the first whitespace. + +
+ +#### Colorspace + + + + + + + +
+ +[`--snpphred`]: #bowtie-options-snpphred + + --snpphred + + + +When decoding colorspace alignments, use `` as the SNP penalty. +This should be set to the user's best guess of the true ratio of SNPs +per base in the subject genome, converted to the [Phred quality] scale. +E.g., if the user expects about 1 SNP every 1,000 positions, +`--snpphred` should be set to 30 (which is also the default). To +specify the fraction directly, use [`--snpfrac`]. + +
+ +[`--snpfrac`]: #bowtie-options-snpfrac + + --snpfrac + + + +When decoding colorspace alignments, use `` as the estimated ratio +of SNPs per base. For best decoding results, this should be set to the +user's best guess of the true ratio. `bowtie` internally converts the +ratio to a [Phred quality], and behaves as if that quality had been set +via the [`--snpphred`] option. Default: 0.001. + +
+ +[`--col-cseq`]: #bowtie-options-col-cseq + + --col-cseq + + + +If reads are in colorspace and the [default output mode] is active, +`--col-cseq` causes the reads' color sequence to appear in the +read-sequence column (column 5) instead of the decoded nucleotide +sequence. See the [Decoding colorspace alignments] section for details +about decoding. This option is ignored in [`-S`/`--sam`] mode. + +
+ +[`--col-cqual`]: #bowtie-options-col-cqual + + --col-cqual + + + +If reads are in colorspace and the [default output mode] is active, +`--col-cqual` causes the reads' original (color) quality sequence to +appear in the quality column (column 6) instead of the decoded +qualities. See the [Colorspace alignment] section for details about +decoding. This option is ignored in [`-S`/`--sam`] mode. + +
+ +[`--col-keepends`]: #bowtie-options-col-keepends + + --col-keepends + + + +When decoding colorpsace alignments, `bowtie` trims off a nucleotide +and quality from the left and right edges of the alignment. This is +because those nucleotides are supported by only one color, in contrast +to the middle nucleotides which are supported by two. Specify +`--col-keepends` to keep the extreme-end nucleotides and qualities. + +
+ +#### SAM + + + +
+ +[`-S`/`--sam`]: #bowtie-options-S +[`-S`]: #bowtie-options-S + + -S/--sam + + + +Print alignments in [SAM] format. See the [SAM output] section of the +manual for details. To suppress all SAM headers, use [`--sam-nohead`] +in addition to `-S/--sam`. To suppress just the `@SQ` headers (e.g. if +the alignment is against a very large number of reference sequences), +use [`--sam-nosq`] in addition to `-S/--sam`. `bowtie` does not write +BAM files directly, but SAM output can be converted to BAM on the fly +by piping `bowtie`'s output to `samtools view`. [`-S`/`--sam`] is not +compatible with [`--refout`]. + +[SAM output]: #sam-bowtie-output + +
+ +[`--mapq`]: #bowtie-options-mapq + + --mapq + + + +If an alignment is non-repetitive (according to [`-m`], [`--strata`] and +other options) set the `MAPQ` (mapping quality) field to this value. +See the [SAM Spec][SAM] for details about the `MAPQ` field Default: 255. + +
+ +[`--sam-nohead`]: #bowtie-options-sam-nohead + + --sam-nohead + + + +Suppress header lines (starting with `@`) when output is [`-S`/`--sam`]. +This must be specified *in addition to* [`-S`/`--sam`]. `--sam-nohead` +is ignored unless [`-S`/`--sam`] is also specified. + +
+ +[`--sam-nosq`]: #bowtie-options-sam-nosq + + --sam-nosq + + + +Suppress `@SQ` header lines when output is [`-S`/`--sam`]. This must be +specified *in addition to* [`-S`/`--sam`]. `--sam-nosq` is ignored +unless [`-S`/`--sam`] is also specified. + +
+ +[`--sam-RG`]: #bowtie-options-sam-RG + + --sam-RG + + + +Add `` (usually of the form `TAG:VAL`, e.g. `ID:IL7LANE2`) as a +field on the `@RG` header line. Specify `--sam-RG` multiple times to +set multiple fields. See the [SAM Spec][SAM] for details about what fields +are legal. Note that, if any `@RG` fields are set using this option, +the `ID` and `SM` fields must both be among them to make the `@RG` line +legal according to the [SAM Spec][SAM]. `--sam-RG` is ignored unless +[`-S`/`--sam`] is also specified. + +
+ +#### Performance + + + +
+ +[`-o`/`--offrate`]: #bowtie-options-o +[`-o`]: #bowtie-options-o +[`--offrate`]: #bowtie-options-o + + -o/--offrate + + + +Override the offrate of the index with ``. If `` is greater +than the offrate used to build the index, then some row markings are +discarded when the index is read into memory. This reduces the memory +footprint of the aligner but requires more time to calculate text +offsets. `` must be greater than the value used to build the +index. + +
+ +[`-p`/`--threads`]: #bowtie-options-p +[`-p`]: #bowtie-options-p + + -p/--threads + + + +Launch `` parallel search threads (default: 1). Threads will run +on separate processors/cores and synchronize when parsing reads and +outputting alignments. Searching for alignments is highly parallel, +and speedup is fairly close to linear. This option is only available +if `bowtie` is linked with the `pthreads` library (i.e. if +`BOWTIE_PTHREADS=0` is not specified at build time). + +
+ +[`--mm`]: #bowtie-options-mm + + --mm + + + +Use memory-mapped I/O to load the index, rather than normal C file I/O. +Memory-mapping the index allows many concurrent `bowtie` processes on +the same computer to share the same memory image of the index (i.e. you +pay the memory overhead just once). This facilitates memory-efficient +parallelization of `bowtie` in situations where using [`-p`] is not +possible. + +
+ +[`--shmem`]: #bowtie-options-shmem + + --shmem + + + +Use shared memory to load the index, rather than normal C file I/O. +Using shared memory allows many concurrent bowtie processes on the same +computer to share the same memory image of the index (i.e. you pay the +memory overhead just once). This facilitates memory-efficient +parallelization of `bowtie` in situations where using [`-p`] is not +desirable. Unlike [`--mm`], `--shmem` installs the index into shared +memory permanently, or until the user deletes the shared memory chunks +manually. See your operating system documentation for details on how +to manually list and remove shared memory chunks (on Linux and Mac OS +X, these commands are `ipcs` and `ipcrm`). You may also need to +increase your OS's maximum shared-memory chunk size to accomodate +larger indexes; see your OS documentation. + +
+ +#### Other + +
+ +[`--seed`]: #bowtie-options-seed + + --seed + + + +Use `` as the seed for pseudo-random number generator. + +
+ +[`--verbose`]: #bowtie-options-verbose + + --verbose + + + +Print verbose output (for debugging). + +
+ +[`--version`]: #bowtie-options-version + + --version + + + +Print version information and quit. + +
+ + -h/--help + + + +Print usage information and quit. + +
+ +Default `bowtie` output +----------------------- + +[Default Bowtie output]: #default-bowtie-output + +`bowtie` outputs one alignment per line. Each line is a collection of +8 fields separated by tabs; from left to right, the fields are: + +1. Name of read that aligned + +2. Reference strand aligned to, `+` for forward strand, `-` for + reverse + +3. Name of reference sequence where alignment occurs, or numeric ID if + no name was provided + +4. 0-based offset into the forward reference strand where leftmost + character of the alignment occurs + +5. Read sequence (reverse-complemented if orientation is `-`). + + If the read was in colorspace, then the sequence shown in this + column is the sequence of *decoded nucleotides*, not the original + colors. See the [Colorspace alignment] section for details about + decoding. To display colors instead, use the [`--col-cseq`] option. + +6. ASCII-encoded read qualities (reversed if orientation is `-`). The + encoded quality values are on the Phred scale and the encoding is + ASCII-offset by 33 (ASCII char `!`). + + If the read was in colorspace, then the qualities shown in this + column are the *decoded qualities*, not the original qualities. + See the [Colorspace alignment] section for details about decoding. + To display colors instead, use the [`--col-cqual`] option. + +7. If [`-M`] was specified and the prescribed ceiling was exceeded for + this read, this column contains the value of the ceiling, + indicating that at least that many valid alignments were found in + addition to the one reported. + + Otherwise, this column contains the number of other instances where + the same sequence aligned against the same reference characters as + were aligned against in the reported alignment. This is *not* the + number of other places the read aligns with the same number of + mismatches. The number in this column is generally not a good + proxy for that number (e.g., the number in this column may be '0' + while the number of other alignments with the same number of + mismatches might be large). + +8. Comma-separated list of mismatch descriptors. If there are no + mismatches in the alignment, this field is empty. A single + descriptor has the format offset:reference-base>read-base. The + offset is expressed as a 0-based offset from the high-quality (5') + end of the read. + +SAM `bowtie` output +------------------- + +Following is a brief description of the [SAM] format as output by +`bowtie` when the [`-S`/`--sam`] option is specified. For more +details, see the [SAM format specification][SAM]. + +When [`-S`/`--sam`] is specified, `bowtie` prints a SAM header with +`@HD`, `@SQ` and `@PG` lines. When one or more [`--sam-RG`] arguments +are specified, `bowtie` will also print an `@RG` line that includes all +user-specified [`--sam-RG`] tokens separated by tabs. + +Each subsequnt line corresponds to a read or an alignment. Each line +is a collection of at least 12 fields separated by tabs; from left to +right, the fields are: + +1. Name of read that aligned + +2. Sum of all applicable flags. Flags relevant to Bowtie are: + +
+ + 1 + + + + The read is one of a pair + +
+ + 2 + + + + The alignment is one end of a proper paired-end alignment + +
+ + 4 + + + + The read has no reported alignments + +
+ + 8 + + + + The read is one of a pair and has no reported alignments + +
+ + 16 + + + + The alignment is to the reverse reference strand + +
+ + 32 + + + + The other mate in the paired-end alignment is aligned to the + reverse reference strand + +
+ + 64 + + + + The read is the first (#1) mate in a pair + +
+ + 128 + + + + The read is the second (#2) mate in a pair + +
+ + Thus, an unpaired read that aligns to the reverse reference strand + will have flag 16. A paired-end read that aligns and is the first + mate in the pair will have flag 83 (= 64 + 16 + 2 + 1). + +3. Name of reference sequence where alignment occurs, or ordinal ID + if no name was provided + +4. 1-based offset into the forward reference strand where leftmost + character of the alignment occurs + +5. Mapping quality + +6. CIGAR string representation of alignment + +7. Name of reference sequence where mate's alignment occurs. Set to + `=` if the mate's reference sequence is the same as this + alignment's, or `*` if there is no mate. + +8. 1-based offset into the forward reference strand where leftmost + character of the mate's alignment occurs. Offset is 0 if there is + no mate. + +9. Inferred insert size. Size is negative if the mate's alignment + occurs upstream of this alignment. Size is 0 if there is no mate. + +10. Read sequence (reverse-complemented if aligned to the reverse + strand) + +11. ASCII-encoded read qualities (reverse-complemented if the read + aligned to the reverse strand). The encoded quality values are on + the [Phred quality] scale and the encoding is ASCII-offset by 33 + (ASCII char `!`), similarly to a [FASTQ] file. + +12. Optional fields. Fields are tab-separated. For descriptions of + all possible optional fields, see the SAM format specification. + `bowtie` outputs some of these optional fields for each alignment, + depending on the type of the alignment: + +
+ + NM:i: + + + + Aligned read has an edit distance of ``. + +
+ + CM:i: + + + + Aligned read has an edit distance of `` in colorspace. This + field is present in addition to the `NM` field in [`-C`/`--color`] + mode, but is omitted otherwise. + +
+ + MD:Z: + + + + For aligned reads, `` is a string representation of the + mismatched reference bases in the alignment. See [SAM] format + specification for details. For colorspace alignments, `` + describes the decoded *nucleotide* alignment, not the colorspace + alignment. + +
+ + XA:i: + + + + Aligned read belongs to stratum ``. See [Strata] for definition. + +[Strata]: #strata + +
+ + XM:i: + + + + For a read with no reported alignments, `` is 0 if the read had + no alignments. If [`-m`] was specified and the read's alignments + were supressed because the [`-m`] ceiling was exceeded, `` equals + the [`-m`] ceiling + 1, to indicate that there were at least that + many valid alignments (but all were suppressed). In [`-M`] mode, if + the alignment was randomly selected because the [`-M`] ceiling was + exceeded, `` equals the [`-M`] ceiling + 1, to indicate that there + were at least that many valid alignments (of which one was reported + at random). + +
+ +[SAM format specification]: http://samtools.sf.net/SAM1.pdf +[FASTQ]: http://en.wikipedia.org/wiki/FASTQ_format +[`-S`/`--sam`]: #bowtie-options-S +[`-m`]: #bowtie-options-m + +The `bowtie-build` indexer +========================== + +`bowtie-build` builds a Bowtie index from a set of DNA sequences. +`bowtie-build` outputs a set of 6 files with suffixes +`.1.ebwt`, `.2.ebwt`, `.3.ebwt`, `.4.ebwt`, `.rev.1.ebwt`, and +`.rev.2.ebwt`. These files together constitute the index: they are all +that is needed to align reads to that reference. The original sequence +files are no longer used by Bowtie once the index is built. + +Use of Karkkainen's [blockwise algorithm] allows `bowtie-build` to +trade off between running time and memory usage. `bowtie-build` has +three options governing how it makes this trade: [`-p`/`--packed`], +[`--bmax`]/[`--bmaxdivn`], and [`--dcv`]. By default, `bowtie-build` will +automatically search for the settings that yield the best + running time without exhausting memory. This behavior can be disabled + using the [`-a`/`--noauto`] option. + +The indexer provides options pertaining to the "shape" of the index, +e.g. [`--offrate`](#bowtie-build-options-o) governs the fraction of [Burrows-Wheeler] rows that +are "marked" (i.e., the density of the suffix-array sample; see the +original [FM Index] paper for details). All of these options are +potentially profitable trade-offs depending on the application. They +have been set to defaults that are reasonable for most cases according +to our experiments. See [Performance Tuning] for details. + +Because `bowtie-build` uses 32-bit pointers internally, it can handle +up to a theoretical maximum of 2^32-1 (somewhat more than 4 billion) +characters in an index, though, with other constraints, the actual +ceiling is somewhat less than that. If your reference exceeds 2^32-1 +characters, `bowtie-build` will print an error message and abort. To +resolve this, divide your reference sequences into smaller batches +and/or chunks and build a separate index for each. + +If your computer has more than 3-4 GB of memory and you would like to +exploit that fact to make index building faster, use a 64-bit version +of the `bowtie-build` binary. The 32-bit version of the binary is +restricted to using less than 4 GB of memory. If a 64-bit pre-built +binary does not yet exist for your platform on the sourceforge download +site, you will need to build one from source. + +The Bowtie index is based on the [FM Index] of Ferragina and Manzini, +which in turn is based on the [Burrows-Wheeler] transform. The +algorithm used to build the index is based on the [blockwise algorithm] +of Karkkainen. + +[Blockwise algorithm]: http://portal.acm.org/citation.cfm?id=1314852 +[FM Index]: http://portal.acm.org/citation.cfm?id=796543 +[Burrows-Wheeler]: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform + +Command Line +------------ + +Usage: + + bowtie-build [options]* + +### Main arguments + +
+ + + + + +A comma-separated list of FASTA files containing the reference +sequences to be aligned to, or, if [`-c`](#bowtie-build-options-c) is specified, the sequences +themselves. E.g., `` might be +`chr1.fa,chr2.fa,chrX.fa,chrY.fa`, or, if [`-c`](#bowtie-build-options-c) is specified, this might +be `GGTCATCCT,ACGGGTCGT,CCGTTCTATGCGGCTTA`. + +
+ + + + + +The basename of the index files to write. By default, `bowtie-build` +writes files named `NAME.1.ebwt`, `NAME.2.ebwt`, `NAME.3.ebwt`, +`NAME.4.ebwt`, `NAME.rev.1.ebwt`, and `NAME.rev.2.ebwt`, where `NAME` +is ``. + +
+ +### Options + +
+ + -f + + + +The reference input files (specified as ``) are FASTA +files (usually having extension `.fa`, `.mfa`, `.fna` or similar). + +
+ + -c + + + +The reference sequences are given on the command line. I.e. +`` is a comma-separated list of sequences rather than a +list of FASTA files. + +
+ + -C/--color + + + +Build a colorspace index, to be queried using `bowtie` [`-C`]. + +
+ +[`-a`/`--noauto`]: #bowtie-build-options-a + + -a/--noauto + + + +Disable the default behavior whereby `bowtie-build` automatically +selects values for the [`--bmax`], [`--dcv`] and [`--packed`] parameters +according to available memory. Instead, user may specify values for +those parameters. If memory is exhausted during indexing, an error +message will be printed; it is up to the user to try new parameters. + +
+ +[`--packed`]: #bowtie-build-options-p +[`-p`/`--packed`]: #bowtie-build-options-p + + -p/--packed + + + +Use a packed (2-bits-per-nucleotide) representation for DNA strings. +This saves memory but makes indexing 2-3 times slower. Default: off. +This is configured automatically by default; use [`-a`/`--noauto`] to +configure manually. + +
+ +[`--bmax`]: #bowtie-build-options-bmax + + --bmax + + + +The maximum number of suffixes allowed in a block. Allowing more +suffixes per block makes indexing faster, but increases peak memory +usage. Setting this option overrides any previous setting for +[`--bmax`], or [`--bmaxdivn`]. Default (in terms of the [`--bmaxdivn`] +parameter) is [`--bmaxdivn`] 4. This is configured automatically by +default; use [`-a`/`--noauto`] to configure manually. + +
+ +[`--bmaxdivn`]: #bowtie-build-options-bmaxdivn + + --bmaxdivn + + + +The maximum number of suffixes allowed in a block, expressed as a +fraction of the length of the reference. Setting this option overrides +any previous setting for [`--bmax`], or [`--bmaxdivn`]. Default: +[`--bmaxdivn`] 4. This is configured automatically by default; use +[`-a`/`--noauto`] to configure manually. + +
+ +[`--dcv`]: #bowtie-build-options-dcv + + --dcv + + + +Use `` as the period for the difference-cover sample. A larger +period yields less memory overhead, but may make suffix sorting slower, +especially if repeats are present. Must be a power of 2 no greater +than 4096. Default: 1024. This is configured automatically by +default; use [`-a`/`--noauto`] to configure manually. + +
+ +[`--nodc`]: #bowtie-build-options-nodc + + --nodc + + + +Disable use of the difference-cover sample. Suffix sorting becomes +quadratic-time in the worst case (where the worst case is an extremely +repetitive reference). Default: off. + +
+ + -r/--noref + + + +Do not build the `NAME.3.ebwt` and `NAME.4.ebwt` portions of the index, +which contain a bitpacked version of the reference sequences and are +used for paired-end alignment. + +
+ + -3/--justref + + + +Build *only* the `NAME.3.ebwt` and `NAME.4.ebwt` portions of the index, +which contain a bitpacked version of the reference sequences and are +used for paired-end alignment. + +
+ + -o/--offrate + + + +To map alignments back to positions on the reference sequences, it's +necessary to annotate ("mark") some or all of the [Burrows-Wheeler] +rows with their corresponding location on the genome. [`-o`/`--offrate`](#bowtie-build-options-o) +governs how many rows get marked: the indexer will mark every 2^`` +rows. Marking more rows makes reference-position lookups faster, but +requires more memory to hold the annotations at runtime. The default +is 5 (every 32nd row is marked; for human genome, annotations occupy +about 340 megabytes). + +
+ + -t/--ftabchars + + + +The ftab is the lookup table used to calculate an initial +[Burrows-Wheeler] range with respect to the first `` characters +of the query. A larger `` yields a larger lookup table but faster +query times. The ftab has size 4^(``+1) bytes. The default +setting is 10 (ftab is 4MB). + +
+ + --ntoa + + + +Convert Ns in the reference sequence to As before building the index. +By default, Ns are simply excluded from the index and `bowtie` will not +report alignments that overlap them. + +
+ + --big --little + + + +Endianness to use when serializing integers to the index file. +Default: little-endian (recommended for Intel- and AMD-based +architectures). + +
+ + --seed + + + +Use `` as the seed for pseudo-random number generator. + +
+ + --cutoff + + + +Index only the first `` bases of the reference sequences +(cumulative across sequences) and ignore the rest. + +
+ + -q/--quiet + + + +`bowtie-build` is verbose by default. With this option `bowtie-build` +will print only error messages. + +
+ + -h/--help + + + +Print usage information and quit. + +
+ + --version + + + +Print version information and quit. + +
+ +The `bowtie-inspect` index inspector +==================================== + +`bowtie-inspect` extracts information from a Bowtie index about what +kind of index it is and what reference sequences were used to build it. +When run without any options, the tool will output a FASTA file +containing the sequences of the original references (with all +non-`A`/`C`/`G`/`T` characters converted to `N`s). It can also be used +to extract just the reference sequence names using the [`-n`/`--names`] +option or a more verbose summary using the [`-s`/`--summary`] option. + +Command Line +------------ + +Usage: + + bowtie-inspect [options]* + +### Main arguments + +
+ + + + + +The basename of the index to be inspected. The basename is name of any +of the index files but with the `.X.ebwt` or `.rev.X.ebwt` suffix +omitted. `bowtie-inspect` first looks in the current directory for the +index files, then looks in the `indexes` subdirectory under the +directory where the currently-running `bowtie` executable is located, +then looks in the directory specified in the `BOWTIE_INDEXES` +environment variable. + +
+ +### Options + +
+ + -a/--across + + + +When printing FASTA output, output a newline character every `` +bases (default: 60). + +
+ +[`-n`/`--names`]: #bowtie-build-options-n + + -n/--names + + + +Print reference sequence names, one per line, and quit. + +
+ +[`-s`/`--summary`]: #bowtie-inspect-options-s + + -s/--summary + + + +Print a summary that includes information about index settings, as well +as the names and lengths of the input sequences. The summary has this +format: + + Colorspace <0 or 1> + SA-Sample 1 in + FTab-Chars + Sequence-1 + Sequence-2 + ... + Sequence-N + +Fields are separated by tabs. + +
+ +[`-e`/`--ebwt-ref`]: #bowtie-inspect-options-e + + -e/--ebwt-ref + + + +By default, when `bowtie-inspect` is run without [`-s`] or [`-n`], it +recreates the reference nucleotide sequences using the bit-encoded +reference nucleotides kept in the `.3.ebwt` and `.4.ebwt` index files. +When `-e/--ebwt-ref` is specified, `bowtie-inspect` recreates the +reference sequences from the Burrows-Wheeler-transformed reference +sequence in the `.1.ebwt` file instead. The reference recreation +process is much slower when `-e/--ebwt-ref` is specified. Also, when +`-e/--ebwt-ref` is specified and the index is in colorspace, the +reference is printed in colors (A=blue, C=green, G=orange, T=red). + +
+ + -v/--verbose + + + +Print verbose output (for debugging). + +
+ + --version + + + +Print version information and quit. + +
+ + -h/--help + + + +Print usage information and quit. + +
+ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b1a2c76 --- /dev/null +++ b/Makefile @@ -0,0 +1,329 @@ +# +# Makefile for bowtie, bowtie-build, bowtie-inspect +# + +SEQAN_DIR = SeqAn-1.1 +SEQAN_INC = -I $(SEQAN_DIR) +INC = $(SEQAN_INC) +GCC_PREFIX = $(shell dirname `which gcc`) +GCC_SUFFIX = +CC = $(GCC_PREFIX)/gcc$(GCC_SUFFIX) +CPP = $(GCC_PREFIX)/g++$(GCC_SUFFIX) +CXX = $(CPP) +HEADERS = $(wildcard *.h) +BOWTIE_PTHREADS = 1 +BOWTIE_MM = 1 +BOWTIE_SHARED_MEM = 1 +EXTRA_FLAGS = +EXTRA_CFLAGS = +EXTRA_CXXFLAGS = +CFLAGS += $(EXTRA_CFLAGS) +CXXFLAGS += $(EXTRA_CXXFLAGS) + +# Detect Cygwin or MinGW +WINDOWS = 0 +ifneq (,$(findstring CYGWIN,$(shell uname))) +WINDOWS = 1 +# POSIX memory-mapped files not currently supported on Windows +BOWTIE_MM = 0 +BOWTIE_SHARED_MEM = 0 +else +ifneq (,$(findstring MINGW,$(shell uname))) +WINDOWS = 1 +# POSIX memory-mapped files not currently supported on Windows +BOWTIE_MM = 0 +BOWTIE_SHARED_MEM = 0 +endif +endif + +MACOS = 0 +ifneq (,$(findstring Darwin,$(shell uname))) +MACOS = 1 +endif + +LINUX = 0 +ifneq (,$(findstring Linux,$(shell uname))) +LINUX = 1 +EXTRA_FLAGS += -Wl,--hash-style=both +endif + +MM_DEF = +ifeq (1,$(BOWTIE_MM)) +MM_DEF = -DBOWTIE_MM +endif +SHMEM_DEF = +ifeq (1,$(BOWTIE_SHARED_MEM)) +SHMEM_DEF = -DBOWTIE_SHARED_MEM +endif +PTHREAD_PKG = +PTHREAD_LIB = +PTHREAD_DEF = +ifeq (1,$(BOWTIE_PTHREADS)) +PTHREAD_DEF = -DBOWTIE_PTHREADS +ifeq (1,$(WINDOWS)) +# pthreads for windows forces us to be specific about the library +PTHREAD_LIB = -L . -lpthreadGC2 +PTHREAD_PKG = pthreadGC2.dll +else +# There's also -pthread, but that only seems to work on Linux +PTHREAD_LIB = -lpthread +endif +endif + +PREFETCH_LOCALITY = 2 +PREF_DEF = -DPREFETCH_LOCALITY=$(PREFETCH_LOCALITY) + +LIBS = +SEARCH_LIBS = $(PTHREAD_LIB) +BUILD_LIBS = + +OTHER_CPPS = ccnt_lut.cpp ref_read.cpp alphabet.c shmem.cpp \ + edit.cpp ebwt.cpp +SEARCH_CPPS = qual.cpp pat.cpp ebwt_search_util.cpp ref_aligner.cpp \ + log.cpp hit_set.cpp refmap.cpp annot.cpp sam.cpp \ + color.cpp color_dec.cpp hit.cpp +SEARCH_CPPS_MAIN = $(SEARCH_CPPS) bowtie_main.cpp + +BUILD_CPPS = +BUILD_CPPS_MAIN = $(BUILD_CPPS) bowtie_build_main.cpp + +SEARCH_FRAGMENTS = $(wildcard search_*_phase*.c) +VERSION = $(shell cat VERSION) + +# Convert BITS=?? to a -m flag +BITS_FLAG = +ifeq (32,$(BITS)) +BITS_FLAG = -m32 +endif +ifeq (64,$(BITS)) +BITS_FLAG = -m64 +endif + +# Convert CHUD=1 to CHUD-related flags +CHUD=0 +CHUD_DEF = +ifeq (1,$(CHUD)) +EXTRA_FLAGS += -g3 +ifeq (1,$(MACOS)) +CHUD_DEF = -F/System/Library/PrivateFrameworks -weak_framework CHUD -DCHUD_PROFILING +endif +endif + +DEBUG_FLAGS = -O0 -g3 $(BITS_FLAG) +RELEASE_FLAGS = -O3 $(BITS_FLAG) +NOASSERT_FLAGS = -DNDEBUG +FILE_FLAGS = -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +BIN_LIST = bowtie-build \ + bowtie \ + bowtie-inspect +BIN_LIST_AUX = bowtie-build-debug \ + bowtie-debug \ + bowtie-inspect-debug + +GENERAL_LIST = $(wildcard scripts/*.sh) \ + $(wildcard scripts/*.pl) \ + $(wildcard indexes/e_coli*) \ + $(wildcard genomes/NC_008253.fna) \ + $(wildcard reads/e_coli_1000.*) \ + $(wildcard reads/e_coli_1000_*) \ + doc/manual.html \ + doc/README \ + doc/style.css \ + reads/e_coli_10000snp.fa \ + reads/e_coli_10000snp.fq \ + $(PTHREAD_PKG) \ + AUTHORS \ + COPYING \ + NEWS \ + MANUAL \ + MANUAL.markdown \ + TUTORIAL \ + VERSION + +# This is helpful on Windows under MinGW/MSYS, where Make might go for +# the Windows FIND tool instead. +FIND=$(shell which find) + +SRC_PKG_LIST = $(wildcard *.h) \ + $(wildcard *.hh) \ + $(wildcard *.c) \ + $(wildcard *.cpp) \ + $(shell $(FIND) SeqAn-1.1 -name "*.h") \ + $(shell $(FIND) SeqAn-1.1 -name "*.txt") \ + doc/strip_markdown.pl \ + Makefile \ + $(GENERAL_LIST) + +BIN_PKG_LIST = $(GENERAL_LIST) + +all: $(BIN_LIST) + +allall: $(BIN_LIST) $(BIN_LIST_AUX) + +DEFS=-fno-strict-aliasing \ + -DBOWTIE_VERSION="\"`cat VERSION`\"" \ + -DBUILD_HOST="\"`hostname`\"" \ + -DBUILD_TIME="\"`date`\"" \ + -DCOMPILER_VERSION="\"`$(CXX) -v 2>&1 | tail -1`\"" \ + $(FILE_FLAGS) \ + $(PTHREAD_DEF) \ + $(PREF_DEF) \ + $(MM_DEF) \ + $(SHMEM_DEF) \ + $(CHUD_DEF) + +define checksum + cat $^ | md5sum | awk '{print $$1}' > .$@.md5 +endef + +ALL_FLAGS=$(EXTRA_FLAGS) $(CFLAGS) $(CXXFLAGS) +DEBUG_DEFS = -DCOMPILER_OPTIONS="\"$(DEBUG_FLAGS) $(ALL_FLAGS)\"" +RELEASE_DEFS = -DCOMPILER_OPTIONS="\"$(RELEASE_FLAGS) $(ALL_FLAGS)\"" + +# +# bowtie-build targets +# + +bowtie-build: ebwt_build.cpp $(OTHER_CPPS) $(HEADERS) + $(checksum) + $(CXX) $(RELEASE_FLAGS) $(RELEASE_DEFS) $(ALL_FLAGS) \ + -DEBWT_BUILD_HASH=`cat .$@.md5` \ + $(DEFS) $(NOASSERT_FLAGS) -Wall \ + $(INC) \ + -o $@ $< \ + $(OTHER_CPPS) $(BUILD_CPPS_MAIN) \ + $(LIBS) $(BUILD_LIBS) + +bowtie-build_prof: ebwt_build.cpp $(OTHER_CPPS) $(HEADERS) + $(checksum) + $(CXX) $(RELEASE_FLAGS) -pg -p -g3 $(RELEASE_DEFS) $(ALL_FLAGS) \ + -DEBWT_BUILD_HASH=`cat .$@.md5` \ + $(DEFS) $(NOASSERT_FLAGS) -Wall \ + $(INC) \ + -o $@ $< \ + $(OTHER_CPPS) $(BUILD_CPPS_MAIN) \ + $(LIBS) $(BUILD_LIBS) + +bowtie-build-debug: ebwt_build.cpp $(OTHER_CPPS) $(HEADERS) + $(checksum) + $(CXX) $(DEBUG_FLAGS) $(DEBUG_DEFS) $(ALL_FLAGS) \ + -DEBWT_BUILD_HASH=`cat .$@.md5` \ + $(DEFS) -Wall \ + $(INC) \ + -o $@ $< \ + $(OTHER_CPPS) $(BUILD_CPPS_MAIN) \ + $(LIBS) $(BUILD_LIBS) + +# +# bowtie targets +# + +bowtie: ebwt_search.cpp $(SEARCH_CPPS) $(OTHER_CPPS) $(HEADERS) $(SEARCH_FRAGMENTS) + $(checksum) + $(CXX) $(RELEASE_FLAGS) $(RELEASE_DEFS) $(ALL_FLAGS) \ + -DEBWT_SEARCH_HASH=`cat .$@.md5` \ + $(DEFS) $(NOASSERT_FLAGS) -Wall \ + $(INC) \ + -o $@ $< \ + $(OTHER_CPPS) $(SEARCH_CPPS_MAIN) \ + $(LIBS) $(SEARCH_LIBS) + +bowtie_prof: ebwt_search.cpp $(SEARCH_CPPS) $(OTHER_CPPS) $(HEADERS) $(SEARCH_FRAGMENTS) + $(checksum) + $(CXX) $(RELEASE_FLAGS) \ + $(RELEASE_DEFS) -pg -p -g3 $(ALL_FLAGS) \ + -DEBWT_SEARCH_HASH=`cat .$@.md5` \ + $(DEFS) $(NOASSERT_FLAGS) -Wall \ + $(INC) \ + -o $@ $< \ + $(OTHER_CPPS) $(SEARCH_CPPS_MAIN) \ + $(LIBS) $(SEARCH_LIBS) + +bowtie-debug: ebwt_search.cpp $(SEARCH_CPPS) $(OTHER_CPPS) $(HEADERS) $(SEARCH_FRAGMENTS) + $(checksum) + $(CXX) $(DEBUG_FLAGS) \ + $(DEBUG_DEFS) $(ALL_FLAGS) \ + -DEBWT_SEARCH_HASH=`cat .$@.md5` \ + $(DEFS) -Wall \ + $(INC) \ + -o $@ $< \ + $(OTHER_CPPS) $(SEARCH_CPPS_MAIN) \ + $(LIBS) $(SEARCH_LIBS) + +# +# bowtie-inspect targets +# + +bowtie-inspect: bowtie_inspect.cpp $(HEADERS) $(OTHER_CPPS) + $(checksum) + $(CXX) $(RELEASE_FLAGS) \ + $(RELEASE_DEFS) $(ALL_FLAGS) \ + -DEBWT_INSPECT_HASH=`cat .$@.md5` \ + $(DEFS) -Wall \ + $(INC) -I . \ + -o $@ $< \ + $(OTHER_CPPS) \ + $(LIBS) + +bowtie-inspect-debug: bowtie_inspect.cpp $(HEADERS) $(OTHER_CPPS) + $(checksum) + $(CXX) $(DEBUG_FLAGS) \ + $(DEBUG_DEFS) $(ALL_FLAGS) \ + -DEBWT_INSPECT_HASH=`cat .$@.md5` \ + $(DEFS) -Wall \ + $(INC) -I . \ + -o $@ $< \ + $(OTHER_CPPS) \ + $(LIBS) + +chaincat: chaincat.cpp hit_set.h filebuf.h hit_set.cpp alphabet.h alphabet.c + $(CXX) $(DEBUG_FLAGS) $(DEBUG_DEFS) $(ALL_FLAGS) -Wall $(INC) -I . -o $@ $< hit_set.cpp alphabet.c + +bowtie-src.zip: $(SRC_PKG_LIST) + chmod a+x scripts/*.sh scripts/*.pl + mkdir .src.tmp + mkdir .src.tmp/bowtie-$(VERSION) + zip tmp.zip $(SRC_PKG_LIST) + mv tmp.zip .src.tmp/bowtie-$(VERSION) + cd .src.tmp/bowtie-$(VERSION) ; unzip tmp.zip ; rm -f tmp.zip + cd .src.tmp ; zip -r $@ bowtie-$(VERSION) + cp .src.tmp/$@ . + rm -rf .src.tmp + +bowtie-bin.zip: $(BIN_PKG_LIST) $(BIN_LIST) $(BIN_LIST_AUX) + chmod a+x scripts/*.sh scripts/*.pl + rm -rf .bin.tmp + mkdir .bin.tmp + mkdir .bin.tmp/bowtie-$(VERSION) + if [ -f bowtie.exe ] ; then \ + zip tmp.zip $(BIN_PKG_LIST) $(addsuffix .exe,$(BIN_LIST) $(BIN_LIST_AUX)) ; \ + else \ + zip tmp.zip $(BIN_PKG_LIST) $(BIN_LIST) $(BIN_LIST_AUX) ; \ + fi + mv tmp.zip .bin.tmp/bowtie-$(VERSION) + cd .bin.tmp/bowtie-$(VERSION) ; unzip tmp.zip ; rm -f tmp.zip + cd .bin.tmp ; zip -r $@ bowtie-$(VERSION) + cp .bin.tmp/$@ . + rm -rf .bin.tmp + +.PHONY: doc +doc: doc/manual.html MANUAL + +doc/manual.html: MANUAL.markdown + echo "

Table of Contents

" > .tmp.head + pandoc -T "Bowtie Manual" -B .tmp.head \ + --css style.css -o $@ \ + --from markdown --to HTML \ + --table-of-contents $^ + +MANUAL: MANUAL.markdown + perl doc/strip_markdown.pl < $^ > $@ + +.PHONY: clean +clean: + rm -f $(BIN_LIST) $(BIN_LIST_AUX) \ + bowtie_prof \ + $(addsuffix .exe,$(BIN_LIST) $(BIN_LIST_AUX) bowtie_prof) \ + bowtie-src.zip bowtie-bin.zip + rm -f core.* diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..f6fec1f --- /dev/null +++ b/NEWS @@ -0,0 +1,562 @@ +Bowtie: an Ultrafast, Lightweight Short Read Aligner + +Bowtie NEWS +=========== + + Bowtie is now available for download. 0.9.0 is the first version to +be released under the OSI Artistic License (see `COPYING') and freely +available to the public for download. The current version is 0.12.7. + +Reporting Issues +================ + +Please report any issues using the Sourceforge bug tracker: + + https://sourceforge.net/tracker/?group_id=236897&atid=1101606 + +Announcements +============= + +To receive announcements (including release announcements) about Bowtie +and related tools (including Crossbow, TopHat, Cufflinks, Myrna) +subscribe to our mailing list: + + https://lists.sourceforge.net/lists/listinfo/bowtie-bio-announce + +Version Release History +======================= + +Version 0.12.7 - September 7, 2010 + * Fixes the all-gap reference sequence issue that was present in + Bowtie 0.12.6. Index files produced by bowtie-build 0.12.5 and + earlier (back to 0.10.*) are compatible with bowtie 0.12.7. Index + files produced by bowtie-build 0.12.7 are backward compatible with + bowtie 0.12.5 and earlier as long as the first reference sequence + is not all-gaps (or, when colorspace indexes, as long as the first + reference sequence has two consecutive ACGT characters in it + somewhere). + * Indexes where the first sequence consists of all gaps or other + non-ACGT characters are not handled properly by Bowtie versions + 0.12.5 and older, but are handled properly by Bowtie 0.12.7. + * REMOVED: bowtie-build's --old-reverse option; the old reverse- + index scheme is again the default. The new scheme is disabled + pending further refinement. + +September 3, 2010 + * The version of bowtie-build distributed in Bowtie 0.12.6 IS + BROKEN. It could not handle stretches of ambiguous reference + characters compatibly with prior versions of Bowtie. Please use + Bowtie 0.12.5's bowtie-build instead. Bowtie 0.12.7, due out + soon, will contain a complete set of working tools. Bowtie 0.12.7 + will revert to old way of building the reverse index. Sorry for + the inconvenience. + +Version 0.12.6 - August 29, 2010 + * Modified bowtie-inspect's default mode to use the bit-encoded + reference portion of the index to reconstruct the reference + sequence, rather than the ebwt portion. This makes bowtie-inspect + much faster and uses less memory, and the output for a colorspace + index will now be in nucleotide space. To get the behavior of the + old default, use the new -e/--ebwt-ref option. + * Fixed bug whereby SOLiD QV strings would fail to parse. + * Moved to a new default way of building the reverse index. Revert + to the old behavior with bowtie-build's new --old-reverse option. + The new reverse index format is forward and backward compatible + with `bowtie`, unless otherwise noted in a future version. + * Fixed issue that would sometimes cause bowtie-build to crash when + building a large index with a low --offrate. + * Fixed build issue that would cause bowtie-build built on one + version of Linux to die with a "floating point error" on other + versions. + * Fixed a bug whereby alignment cost could sometimes be + miscalculated. Stratum was unaffected. + * bowtie now simply skips reads with 0 characters. Previously it + would print an error and exit. + +Version 0.12.5 - April 10, 2010 + * Fixed spurious "Error while writing string output; not all + characters written" errors in -S/--sam mode. + +Version 0.12.4 - April 5, 2010 + * Periods in read sequences are now treated as Ns instead of + ignored. This should help with some problems where Bowtie + erroneously reports "Reads file contained a pattern with more than + 1024 quality values..." for data from recent versions of the + Illumina GA pipeline. + * Fixed a bug whereby some error and warning messages would be + printed on top of each other in -p mode. + * Chunk-exhaustion warnings messages are now suppressed when --quiet + is specified. + * Fixed small issue in quality decoding whereby no-confidence colors + would incorrectly influence decoded quality of adjacent bases. + +Version 0.12.3 - February 17, 2010 + * Fixed a significant bug in -C/--color mode whereby quality values + for SNP nucleotide positions were erroneously penalized. + * Fixed a bug in -S/--sam mode whereby if whitespace occurred in the + original read name, it would be printed in the QNAME field in + violation of the SAM spec. Bowtie now truncates read names at the + first whitespace character before printing. + * When input is FASTQ and -C/--color is enabled, Bowtie is now + tolerant of output from FASTQ converters that include the primer + base and where the quality string is one character shorter than + the sequence string (due to the primer). This fixes issues users + have reported using output from BFAST's solid2fastq. + * Added support for SOLiD-style _QV files, via the -Q/--quals, --Q1 + and --Q2 options. These options are used in combination with + -C/--color and -f to align parallel colorspace read/quality files + without having to convert to FASTQ. + +Version 0.12.2 - February 2, 2010 + * When -C/--color is enabled, the default paired-end orientation is + now --ff, not --fr. The new default fits typical SOLiD output. + * Fixed a bug whereby very large reads could cause bowtie to crash + in --best mode + * After 0.12.1, some issues remained whereby bowtie would fail to + trim the primer in colorspace (e.g. in -c mode). All input modes + should now have fully-functioning + * Fixed a bug whereby decoded colorspace qualities could overflow + and erroneously become low qualities. + * Fixed a bug that could produce incorrect paired-end alignment + results in -n mode when using paired-end orientation modes other + than --fr. Even with the bug, reported results are reasonable; + but the seed edit constraint (-n) may have been applied to the + wrong end of one of the mates. + * Changed --chunkmbs default up to 64 from 32. + * Better error checking and reporting for some bowtie options. + * Some basic testing scripts are now bundled with Bowtie (in + scripts/test), which should make it easier to regression-test. + +Version 0.12.1 - January 8, 2010 + * IMPORTANT: Fixed bug whereby bowtie would fail to remove both the + primer base and the first color when parsing .csfasta files with + primer bases in -C -f mode. A workaround for users of version + 0.12.0 is to use "-5 1" in that situation. + * Fixed bug whereby, when -M limit was exceeded for an unpaired + read, the number printed in the 7th column for the random + alignment was too low by 1. + * Added documentation discussing a pitfall regarding SOLiD paired- + end input, i.e., not all entries necessarily have corresponding + mates in the other file. + +Version 0.12.0 - December 23, 2009 + * Added missing README.markdown file + * Minor documentation additions + +Version 0.12.0-beta1 - December 12, 2009 + * Added SOLiD colorspace support + * Colorspace indexes are distinct from standard letterspace + indexes and must be built with a separate invocation of + bowtie-build (with -C option) + * Running bowtie with -C causes Bowtie to align in colorspace; + both index and reads must be in colorspace + * Colorspace memory requirement is the same as paired-end + alignment in nucleotide-space (normal) mode. Paired-end + alignment does not increase the memory requirement further in + colorspace. + * csfasta, csfastq, and "raw" read formats are all supported with + -C; '0' means "blue" and is intechangeable with 'A', likewise + '1' ('C') means "green", '2' ('G') means "orange" and '3' ('T') + means "red" + * Colorspace versions of pre-built indexes added (see Bowtie web + site) + * New manual section discussing colorspace features + * Fixed a few SAM output issues + * @PG line now properly uses colons instead of equals signs + * Removed /1, /2 suffixes for paired-end reads in SAM mode + * Added --sam-RG option that permits the user to insert set values + for flags that appear on the @RG line + * Fixed lingering pthreads bugs that would cause Bowtie to hang or + crash toward the end of execution with -p > 1. + * Fixed performance-related bug that would cause paired-end + alignment to be artificially slow in many situations. + * Fixed issue with random number generation that would result in + non-random selection of alignments in some situations. + * bowtie -f now supports fasta files with reads split across + multiple lines + * New --suppress option suppresses unwanted columns of output + * The MANUAL file was converted to markdown format, facilitating + conversion to various other formats using tools like pandoc + * DEPRECATED: bowtie: --concise, bowtie-build: --big, --little + * REMOVED: -z/--phased, -b/--binout, bowtie-maptool, + bowtie-maqconvert + +Version 0.11.3 - October 12, 2009 + * Fixed crashing bug in -S/--sam mode when the number of reference + sequences in the index is very large. + * Added --sam-nohead option to suppress output of SAM headers in + -S/--sam mode. + * Added --sam-nosq option to suppress output of @SQ SAM headers in + -S/--sam mode. These can become a nuisance when the reference + index contains a very large number of sequences. + * Fixed a bug in bowtie-build's auto-configure mode that would cause + it to underestimate the amount of memory required by a set of + parameters. This in turn would cause the index to be corrupted. + +Version 0.11.2 - October 7, 2009 + * Fixed issue whereby --max option was disabled. + +Version 0.11.1 - October 5, 2009 + * SAM output: changed XS:i optional field to be named XA:i to avoid + a conflict with TopHat's XS:i field. + +Version 0.11.0 - October 5, 2009 + * Initial SAM output support with -S/--sam option. Bowtie sets all + fields according to the SAM spec (Version 0.1.2-draft, 20090820). + See the new "SAM Output" section of the manual for details. + * Added --shmem option: --shmem is similar to --mm in that it allows + concurrent 'bowtie' processes querying the same index to share a + single memory image of the index. Unlike --mm, shared memory + alocated by --shmem is permanent. + * The alignment summary printed to stderr at the end of an alignment + run is now more friendly and includes data about the number and + proportion of reads that aligned, failed to align, or were + suppressed via the -m option. + * When too-short reads are encountered, Bowtie now always prints + warnings, not errors. --quiet now suppresses those warnings. + * By default, when bowtie prints a reference sequence name it now + stops at the first whitespace. In 0.10.1, the default was to + print the entire name, which could cause confusion when parsing + Bowtie output. To revert to printing the full name, use the new + --fullref option. + * Bowtie now prints the command-line before exiting with an error. + * Fixed mistake in the manual's "Default output" section: the offset + in field 4 is 0-based, not 1-based. To obtain a 1-based offset + instead, use the -B 1 option. + * Various minor bug fixes. + * DEPRECATED: -z/--phased, -b/--binout, bowtie-maptool, + bowtie-maqconvert. These features will be removed in a future + version of Bowtie. Note that -b/--binout, bowtie-maptool, and + bowtie-maqconvert are largely superseded by the SAM output format + (-S/--sam), BAM, and SAMtools (http://samtools.sf.net). Contact + the authors if this is a problem. + * REMOVED: --unfq/--unfa/--maxfq/--maxfa/--alfq/--alfa. Please use + --un/--max/--al instead. Contact the authors if this is a + problem. + +Version 0.10.1 - July 19, 2009 + * Now when -3/-5 are used in combination with -I/-X, the -I/-X + constraints are interpreted as applying to the original insert, + not the trimmed insert. + * Fixed issue whereby -I option was ignored; -I option works now. + * Fixed a bug whereby some large indexes were incorrectly reported + as corrupt by bowtie-build. + * Fixed issue whereby negative quality values were wrongly rejected + when both --integer-quals and --solexa-quals were specified. + * The -l/--seedlen parameter can now be adjusted down to 5 + (previously had to be >= 20). + * Fixed several minor memory leaks and out-of-bounds issues. The + Linux version of the bowtie aligner now receives a clean bill of + health from valgrind's memcheck. + * Other minor bugfixes. + +Version 0.10.0.2 - 6/28/09 + * Second bugfix for Windows version. src and bin-win32 packages + updated. Linux and Mac users are not affected. Thanks for your + bug reports and patience. + +Version 0.10.0.1 - 6/23/09 + * Fix for crashing bug in Windows version. src and bin-win32 + packages updated. Linux and Mac users are not affected. + +Version 0.10.0 - June 12, 2009 + * Major change: All alignment modes are now unstratified by default. + The --nostrata option has been removed, since it is now the + default. A --strata option has been added to override the default + and force stratified reporting. Reporting is stratified if and + only if --strata is specified. --strata now cannot be specified + without also specifying --best. Please note that, because of this + change, specifying the same arguments to this version of Bowtie + may yield different reported results. + * Replaced the --unfa/--unfq options with a single --un option, + which writes unaligned reads to an output file (or pair of output + files) but keeps reads in their original form. This is in + contrast to the old --unfa/--unfq options, which only supported + FASTA or FASTQ formats, and which would print a post-trimming and + post-quality-value translation version of the read. Likewise, the + --alfa/--alfq and --maxfa/--maxfq options have been replaced with + --al and --max options. The old options are still present, but + are deprecated and will be removed in a future version. + * Added --nofw and --norc options, allowing alignment to just one + reference strand or the other. + * Added --mm option that causes bowtie to use memory-mapped files + instead of traditional file I/O to access the reference index. + This allows multiple bowtie processes running on the same computer + to share a single in-memory image of a given index. This is a + useful feature for parallelizing bowtie in situations where memory + is limited and where -p is inappropriate or insufficient. This + feature is not available in the Windows version of Bowtie. + * Added a section to the manual ("Reporting Modes") clarifying and + giving examples of how to use Bowtie's reporting options. + * The --al and -z/--phased options previously interacted in such a + way that the --al file could contain multiple entries for the same + aligned read. --al and -z/--phased are now incompatible. + * The --oldpmap option, deprecated in version 0.9.8, has been + removed. + +Version 0.9.9.3 - May 12, 2009 + * Fixed an issue where bowtie --best would sometimes use excessive + amounts of memory to store path descriptors. There is now a per- + thread 32-MB ceiling (configurable with new option --chunkmbs + ) on the memory taken by path descriptors. If the ceiling is + exceeded Bowtie will skip the offending read, print a warning + message identifying the read, and continue. + * More options are available for defining the quality-value format, + including new --phred64-quals/--solexa1.3-quals options + appropriate for the 64-based-Phred output of Illumina's GA + Pipeline 1.3. Added option --phred33-quals to to handle the more + typical 33-based-Phred scale (the default). The --solexa-quals + option still handles the 64-based-Solexa scale output by GA + Pipeline versions prior to 1.3. + * bowtie-build now checks output files for obvious corruption due, + for example, to disk exhaustion. + * Specifying "-" (meaning stdin) as an input to bowtie is now + supported and documented. + * Fixed a bug whereby bowtie-maqconvert could fail to notice that it + had exhausted memory and output a corrupt Maq map file. + * Fixed a bug whereby bowtie would crash when trying to use an index + built on a machine with different endianness. + * Fixed several issues that prevented Bowtie from compiling on + Solaris. I confirm that Bowtie builds and runs on Solaris. + * Added _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 _GNU_SOURCE to the + default build options in an attempt to resolve some of the large- + file issues users are having. + * Clarified column 7 in the manual. We received many queries from + users curious about this number. + * Moderate speed improvements in --best mode. + +Version 0.9.9.2 - April 6, 2009 + * Paired-end alignment is now available in all alignment modes, + including all -n modes. + * --best now provides better guarantees. Reported alignments are + now guaranteed to be "best" both in terms of stratum (i.e. number + of mismatches, or mismatches in the seed in the case of -n mode), + and in terms of the quality values at the mismatched position(s). + Stratum always trumps quality when determining best alignments. + Also, --best mode resolves the strand bias issue (see manual for a + discussion of the issue). + * Speed improvements for --best mode in most alignment modes. + * Major speed improvement for the -v 3 alignment mode (except when + -z is also used) + * The "Reported X alignments..." message is now printed to stderr + rather than stdout. Only alignments are written to stdout. + * In bowtie-maqconvert, read names longer than Maq's limit (36) are + now truncated to a suffix of the original name, rather than a + prefix. This mimics Maq's behavior and prevents "/1" and "/2" + suffixes for paired-end reads from being destroyed. + * Added --alfq/--alfa options to dump aligned reads to FASTQ and/or + FASTA files. + * Removed many extraneous source files. + +Version 0.9.9.1 - March 10, 2009 + * Added paired-end alignment for -v 2 and -v 3 alignment modes (-n + modes coming soon). + * Minor bug fixes and speed improvements for all paired-end modes. + * Added -s/--skip option to skip over the first reads or + pairs in the input. + * --unfq/--unfa/--maxfq/--maxfa modes no longer create empty output + files. + * All Bowtie tools now compile under GCC 4.3.3. + * Fixed bug whereby bowtie -b would sometimes write garbage into the + reference offset field. + * Paired-end info is now persisted in the -b format, allowing + bowtie-maptool output to add "/1" and "/2" suffixes as + appropriate. + +Version 0.9.9 - February 19, 2009 + * Added some preliminary support for paired-end alignment in -v 0 + and -v 1 modes. -1/-2 options to specify the paired-end files, + -I/-X to specify min and max insert sizes, and --fr/--rf/--ff + specify relative orientation of upstream and downstream mates. + bowtie-build now builds two additional files: NAME.3.ebwt and + NAME.4.ebwt. Together, these files store a bitpacked version of + the reference and they are required for paired-end alignment. If + your index does not include these files and you would like to + perform a paired-end alignment, you will have to rebuild the index + with bowtie-build version 0.9.9 or later. Paired-end alignment is + not compatible with -z mode, and it incurs about a 30% greater + memory overhead than single-end mode. + * Pre-built indexes available from Bowtie website have been updated + to include .3/.4.ebwt index files. These new pre-built indexes + are no longer compatible with bowtie versions prior to 0.9.8. + * New -B/--offbase option allows user to specify how bowtie numbers + reference positions in its output. E.g. -B 1 causes bowtie to + number leftmost char as 1. -B 0 is the default, but -B 1 will + likely become the default in the 1.0 release. + * Fixed a bug that caused trimming options -3 and -5 not to work + properly in -r (raw input) mode. + * bowtie-build now prints a friendly error message and exits if an + input file doesn't exist. + * Fixed a bug that caused the Win32 version of bowtie to hang just + before it would normally have exited. + * Fixed bug that could prevent successful read-in of very large + (>1GB) .2.ebwt index files. + * Removed --maxns option since it's mostly redundant with what -v + and -n already do. + * Removed --ntoa option. + * bowtie usage message is now divided into sections for clarity. + +Version 0.9.8.1 - January 7, 2009 + * Fixed all known problems with the --unfa/--unfq options: + * They now work properly with multiple threads. + * Fixed issue where sequence and quals were sometimes reversed. + * Fixed other issues causing spurious omission of unaligned reads. + * Added --maxfa/--maxfq options so that reads that don't align due + to the -m limit can be dumped separately from reads that don't + align at all. + * Alignment output is now guaranteed to be "deterministic" even when + multiple threads are used. I.e., given the same input reads (in + any order) and the same --seed, bowtie will produce the same + alignments every time it is run, though not necessarily in the + same order. This does not hold across different versions of + Bowtie. + * Multiple other bug fixes. + +Version 0.9.8 - November 25, 2008 + * --unfa/--unfq options cause bowtie to dump unaligned + reads to FASTA and/or FASTQ files. + * bowtie-build now selects its memory-efficiency parameters (--bmax, + --dcv, --packed) automatically by default; this makes it far + easier to build an index under memory constraints by eliminating + tedious trail-and-error. New -a option disables this, yielding + old behavior. + * bowtie-build-packed is no longer a separate binary. Supplying the + new -p/--packed argument to bowtie-build is the new equivalent. + * New tool bowtie-maptool converts between Bowtie's output formats. + * New tool bowtie-inspect recreates reference strings from Bowtie + index. + * Renamed bowtie-convert to bowtie-maqconvert for clarity. + * New universal Mac binary combines i386 & x86_64 binaries. PowerPC + still not supported. + * Added --nomaqround option to bowtie. + * Fixed memory leaks in bowtie. + * Switched to a new scheme for mapping positions in "joined" + reference string to positions in original strings. This changes + the index format. bowtie-build's --oldpmap parameter reverts to + the old format. Versions of bowtie prior to 0.9.8 cannot search + indexes produced by bowtie-build 0.9.8 unless bowtie-build is run + with --oldpmap. bowtie 0.9.8 can search either index format. + Pre-built indexes are still in the old format, but will switch to + new format when Bowtie 1.0 is released. + +Version 0.9.7.1 - November 11, 2008 + * Fixed an issue that caused a spurious loss of sensitivity between + Bowtie versions 0.9.6 and 0.9.7 in certain modes. Many thanks to + Ali Mortazavi for bringing this to our attention. + +Version 0.9.7 - November 8, 2008 + * Added new reporting option -m which suppresses all + alignments for a particular read if more than reportable + alignments exist for it. + * Threads now buffer all alignments for a particular read/phase then + output all alignments in one critical section. This guarantees + that all alignments for a given read/phase appear in one + consecutive block of the output, even when multiple threads are + operating in parallel. + * Separated the quality-conversion and parsing aspects of the old + --solexa-quals argument into separate arguments: --solexa-quals + (quality conversion) and --integer-quals (parsing). + * bowtie-convert now handles the new (post-0.7.0) Maq alignment + format. The new format allows Maq tools to handle reads up to + 127 bases, whereas the old format was limited to 63 bases. Added + a -o option to opt for the old Maq format. + * New --refout argument sends alignments to a set of files named + refXXXXX.map, where XXXXX is the 0-padded index of the reference + sequence aligned to. Useful for dealing with large datasets + aligned to, e.g., the assembled human genome. + * Improved tutorial to use a simple simulated read set (included) + to do SNP calls with Maq. + * Added --nota option to bowtie-build + * Fixed make_h_sapiens_asm.sh script to include mitochondrial DNA. + +Version 0.9.6 - October 10, 2008 + * 'bowtie' now supports a host of options that allow the user to + specify which and how many valid alignments to report per read. + The default is still to report 1 "good" alignment, which is by far + the fastest mode. See -k/-a/--best/--nostrata options described + in the manual for details. + * 'bowtie' now supports reads up to 1024 bases long. Note that for + reads much longer than, say, 35 bases, the user must be careful to + set alignment policy parameters (especially -e) appropriately. + * --fast flag eliminated, double-index mode is now the default. + Added the -z/--phased flag to revert to phased, half-index mode. + * --concise output mode now officially supported. Now outputs one + alignment per line. + * Changed 'bowtie-build' default back to --bmaxdivn 4. + * -h/--help now prints much more verbose help for 'bowtie' and + 'bowtie-build' (verbatim from MANUAL file) + * BWT-searching code streamlined; much old code eliminated + +Version 0.9.5 - September 27, 2008 + * Last column of output now additionally reports the reference and + query bases (in that order) for mismatches. E.g., old: "30,32", + new: "30:C>A,32:C>T". + * Eliminated spurious trailing space in first column of output. + * Minor performance and sensitivity improvements. + * New option '-p' spawns a user-specified number of pthreads for + parallel processing of reads. For example, use '-p 4' to run + 'bowtie' on 4 processor cores simultaneously. + * Due to the new '-p' option, 'bowtie' needs pthreads to compile and + run. To compile 'bowtie' without pthreads support (which disables + the '-p' option), use 'make BOWTIE_PTHREADS=0'. + * Also due to '-p' option, the Windows version of Bowtie now comes + with the pthreadGC2.dll file from the pthreads for Win32 project + (http://sourceware.org/pthreads-win32). This library is released + under the LGPL license. + * New option '--fast' causes Bowtie to load both the "forward" and + "mirror" halves of the index at once, which eliminates the need + for multiple phases and speeds up matching at the cost of using + about twice as much memory. '--fast' also causes 'bowtie' to + scale better when used in combination with '-p'. + * Fixed crashing bug with -o/--offrate in 'bowtie'. + * Improved error reporting. + +Version 0.9.4 - September 16, 2008 + * New method for handling gaps and ambiguity codes in the reference. + New 'bowtie-build' method handles long stretches of gaps + gracefully. New 'bowtie' rejects alignments that overlap a gap or + ambiguous character in the reference. + * Due to above change, index file format has been changed. All + pre-built indexes available on this site have been updated to the + new format. To obtain indexes with the old format, contact us. + * In 'bowtie' unnamed reads are now given ordinal names (rather than + "default") in the alignment output. Works for all input modes. + * New 'bowtie' input mode: Raw, activated with -r. Expects one read + sequence per line; no quality values or names. + * Fixed 'bowtie' bug whereby trimming did not work in -c mode. + * Changed 'bowtie-build' default to not use blockwise mode. + * Changed 'bowtie-build' to avoid certain infinite-loop and very- + long-runtime scenarios. + * Packaging improvements: archives now explode into subdirectories + and scripts are executable. + +Version 0.9.3 - September 6, 2008 + * Major reference-name bug fixes to bowtie-convert + +Version 0.9.2 - September 4, 2008 + * Now allows 3-mismatches: -n and -v options accept 3 + * Output format prints reference name instead of id in third column + * Pre-built indexes updated to encode reference names + * Ns in reads now match nothing (previously, they matched As/Ts) + * Dropped -l/--linerate and -i/--linesperside arguments to bowtie- + build + * Fixed bug in Maq-like mode that allowed some poor alignments + * Minor speed improvements + +Version 0.9.1 - August 25, 2008 + * Integrated relevant SeqAn-1.1 sources into Bowtie source release + * Now builds on Windows under MinGW (needs pthreads and zlib) + * Binary releases for Linux (i386, x86_64), Windows (i386) and MacOS + X (i386) + +Version 0.9.0 - August 18, 2008 + * First stable release of Bowtie. + * Includes the three core Bowtie tools: the indexer 'bowtie-build', + the read aligner 'bowtie' and the converter from Bowtie's to Maq's + mapping output format, 'bowtie-convert'. + * Compatible pre-built indexes for many model organisms are + available from http://bowtie-bio.sf.net. + * FASTA, FASTQ inputs supported; tested with Solexa FASTQ + * Supports Maq alignment policy (-n and -e behave as in Maq) + * Supports X-mismatch policy (-v option behaves as in SOAP) + * -n and -v options accept 0, 1, or 2 diff --git a/SeqAn-1.1/GPL.txt b/SeqAn-1.1/GPL.txt new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/SeqAn-1.1/GPL.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/SeqAn-1.1/LGPL.txt b/SeqAn-1.1/LGPL.txt new file mode 100644 index 0000000..fc8a5de --- /dev/null +++ b/SeqAn-1.1/LGPL.txt @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/SeqAn-1.1/README.txt b/SeqAn-1.1/README.txt new file mode 100644 index 0000000..53f2d08 --- /dev/null +++ b/SeqAn-1.1/README.txt @@ -0,0 +1,29 @@ +This is SeqAn, the C++ template library for sequence analysis + +See http://www.seqan.de for more information + +Read "docs/Page_Installation.html" for detailed installation instructions. + + +Folders: +======== + +"seqan": SeqAn library (add the folder that contains "seqan" to + your include path) +"demos": SeqAn demos, see also "docs/INDEXPAGE_Demo.html" +"apps": SeqAn applications +"docs": HTML-Documentation + + +Files: +====== + +"Makefile": make file for Linux/Darwin/Solaris +"*_7.sln", "*_7.vcproj": Visual Studio .net 2003 solution and project files +"*_8.sln", "*_8.vcproj": Visual Studio .net 2005 solution and project files +"*_9.sln", "*_9.vcproj": Visual Studio .net 2008 solution and project files + + +Have fun! + +Your SeqAn Team diff --git a/SeqAn-1.1/platform_linux_gcc.h b/SeqAn-1.1/platform_linux_gcc.h new file mode 100644 index 0000000..a385cea --- /dev/null +++ b/SeqAn-1.1/platform_linux_gcc.h @@ -0,0 +1,26 @@ +#define PLATFORM "gcc" + +#ifndef PLATFORM_GCC + #define PLATFORM_GCC +#endif + +// should be set before including anything +#ifndef _FILE_OFFSET_BITS + #define _FILE_OFFSET_BITS 64 +#endif + +#ifndef _LARGEFILE_SOURCE + #define _LARGEFILE_SOURCE +#endif + +//#include +#include + +#define finline __inline__ + +// default 64bit type +typedef int64_t __int64; + + +//define SEQAN_SWITCH_USE_FORWARDS to use generated forwards +#define SEQAN_SWITCH_USE_FORWARDS diff --git a/SeqAn-1.1/platform_windows_mingw.h b/SeqAn-1.1/platform_windows_mingw.h new file mode 100644 index 0000000..70bda5b --- /dev/null +++ b/SeqAn-1.1/platform_windows_mingw.h @@ -0,0 +1,10 @@ +#define PLATFORM "windows" + +#ifndef PLATFORM_WINDOWS + #define PLATFORM_WINDOWS +#endif + +#define finline __inline__ + +//define SEQAN_SWITCH_USE_FORWARDS to use generated forwards +//#define SEQAN_SWITCH_USE_FORWARDS diff --git a/SeqAn-1.1/platform_windows_vs.h b/SeqAn-1.1/platform_windows_vs.h new file mode 100644 index 0000000..7f097d1 --- /dev/null +++ b/SeqAn-1.1/platform_windows_vs.h @@ -0,0 +1,13 @@ +#define PLATFORM "windows" + +#ifndef PLATFORM_WINDOWS + #define PLATFORM_WINDOWS +#endif + +#pragma warning( disable : 4675 ) +#pragma warning( disable : 4503 ) + +#define finline __forceinline + +//define SEQAN_SWITCH_USE_FORWARDS to use generated forwards +//#define SEQAN_SWITCH_USE_FORWARDS diff --git a/SeqAn-1.1/seqan/basic.h b/SeqAn-1.1/seqan/basic.h new file mode 100644 index 0000000..27beba1 --- /dev/null +++ b/SeqAn-1.1/seqan/basic.h @@ -0,0 +1,115 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic.h,v 1.2 2009/05/06 20:32:59 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_H +#define SEQAN_HEADER_BASIC_H + +//____________________________________________________________________________ +// prerequisites + +#include + +//#include +#ifdef PLATFORM_WINDOWS +#include // limits include file exists only for g++ >= 3.0 +#endif + +#include // size_t +#include // FILE, basic_debug +#include +#include +#include +#include // memset +#include // basic_profile + +#define SEQAN_NAMESPACE_MAIN seqan + +//____________________________________________________________________________ + +#include +#ifdef SEQAN_SWITCH_USE_FORWARDS +#include +#endif + +#include +#include +#include +#include +#include +#include + +//____________________________________________________________________________ +// allocators + +#include +#include + +#include + +#include +#include +#include +//#include + +//____________________________________________________________________________ + +#include +#include +#include + +#include + +//____________________________________________________________________________ +// iterators + +#include +#include + +#include + +#include +#include +#include +#include +//#include + +#include + +#include + +//____________________________________________________________________________ +// alphabets + +#include +#include + +#include + +#include +#include + +//____________________________________________________________________________ + +//#include +#include + +#include + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_aggregates.h b/SeqAn-1.1/seqan/basic/basic_aggregates.h new file mode 100644 index 0000000..68e4e70 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_aggregates.h @@ -0,0 +1,689 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_aggregates.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_AGGREGATES_H +#define SEQAN_HEADER_BASIC_AGGREGATES_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +//____________________________________________________________________________ + + struct _Compressed; + typedef Tag<_Compressed> Compressed; + + // for Pairs with small i1-values + // store i1 and i2 in one word of type i2 + // use the upper bits for i1 and the lower bits for i2 + template + struct CutCompressed { + enum { bitSizeI1 = Log2::VALUE }; + }; + +/** +.Class.Pair: +..cat:Aggregates +..summary:Stores two arbitrary objects. +..signature:Pair +..param.T1:The type of the first object. +..param.T2:The type of the second object. +..param.Compression:If $Compressed$, the pair is stored in a more space efficient way (useful for external storage). +...note:When compression is enabled, referring to members is not allowed. +...default:$void$, no compression (faster access). +.Memfunc.Pair#Pair: +..class:Class.Pair +..summary:Constructor +..signature:Pair () +..signature:Pair (pair) +..signature:Pair (i1, i2) +..param.pair:Other Pair object. (copy constructor) +..param.i1:T1 object. +..param.i2:T2 object. +.Memvar.Pair#i1: +..class:Class.Pair +..summary:T1 object +.Memvar.Pair#i2: +..class:Class.Pair +..summary:T2 object +*/ + + // standard storage + template + struct Pair { + typedef _T1 T1; + typedef _T2 T2; + _T1 i1; + _T2 i2; + inline Pair() {} + inline Pair(Pair const &_p): i1(_p.i1), i2(_p.i2) {} + inline Pair(_T1 const &_i1, _T2 const &_i2): i1(_i1), i2(_i2) {} + + template + inline Pair(Pair<__T1, __T2, __TCompression> const &_p): + i1(getValueI1(_p)), i2(getValueI2(_p)) {} + }; + + + + // unaligned and unpadded storage (space efficient) +#ifdef PLATFORM_WINDOWS + #pragma pack(push,1) +#endif + template + struct Pair<_T1, _T2, Compressed> { + typedef _T1 T1; + typedef _T2 T2; + _T1 i1; + _T2 i2; + inline Pair() {} + inline Pair(Pair const &_p): i1(_p.i1), i2(_p.i2) {} + inline Pair(_T1 const &_i1, _T2 const &_i2): i1(_i1), i2(_i2) {} + + template + inline Pair(Pair<__T1, __T2, __TCompression> const &_p): + i1(getValueI1(_p)), i2(getValueI2(_p)) {} + } +#ifndef PLATFORM_WINDOWS + __attribute__((packed)) +#endif + ; +#ifdef PLATFORM_WINDOWS + #pragma pack(pop) +#endif + + + +#ifdef PLATFORM_WINDOWS + #pragma pack(push,1) +#endif + template + struct Pair<_T1, _T2, CutCompressed > { + typedef _T1 T1; + typedef _T2 T2; + + typedef _T2 T12; + + T12 i12; + + enum { bitSizeI1 = CutCompressed::bitSizeI1 }; + enum { bitShiftI1 = BitsPerValue::VALUE - bitSizeI1 }; + + inline Pair() {} + inline Pair(Pair const &_p): i12(_p.i12) {} + inline Pair(_T1 const &_i1, _T2 const &_i2): + i12(((T12)_i1 << bitShiftI1) + (T12)_i2) {} + + template + inline Pair(Pair<__T1, __T2, __TCompression> const &_p): + i12(((T12)getValueI1(_p) << bitShiftI1) + (T12)getValueI2(_p)) {} + } +#ifndef PLATFORM_WINDOWS + __attribute__((packed)) +#endif + ; +#ifdef PLATFORM_WINDOWS + #pragma pack(pop) +#endif + + + + template + std::ostream& operator<<(std::ostream &out, Pair<_T1,_T2,TCompression> const &p) { + out << "< " << getValueI1(p) << " , " << getValueI2(p) << " >"; + return out; + } + + template + struct Value< Pair, 1 > { + typedef T1 Type; + }; + + template + struct Value< Pair, 2 > { + typedef T2 Type; + }; + + template + struct Spec< Pair > { + typedef TCompression Type; + }; + + +//____________________________________________________________________________ + + template + struct Key< Pair > + { + typedef TKey Type; + }; + + template + struct Cargo< Pair > + { + typedef TCargo Type; + }; +//____________________________________________________________________________ + +/** +.Class.Triple: +..cat:Aggregates +..summary:Stores three arbitrary objects. +..signature:Triple +..param.T1:The type of the first object. +..param.T2:The type of the second object. +..param.T3:The type of the third object. +..param.Compression:If $Compressed$, the triple is stored in a more space efficient way (useful for external storage). +...note:When compression is enabled, referring to members is not allowed. +...default:$void$, no compression (faster access). +.Memfunc.Triple#Triple: +..class:Class.Triple +..summary:Constructor +..signature:Triple () +..signature:Triple (triple) +..signature:Triple (i1, i2, i3) +..param.triple:Other Triple object. (copy constructor) +..param.i1:T1 object. +..param.i2:T2 object. +..param.i3:T3 object. +.Memvar.Triple#i1: +..class:Class.Triple +..summary:T1 object +.Memvar.Triple#i2: +..class:Class.Triple +..summary:T2 object +.Memvar.Triple#i3: +..class:Class.Triple +..summary:T3 object +*/ + + // standard storage + template + struct Triple { + typedef _T1 T1; + typedef _T2 T2; + typedef _T3 T3; + _T1 i1; + _T2 i2; + _T3 i3; + inline Triple() {} + inline Triple(Triple const &_p): + i1(_p.i1), i2(_p.i2), i3(_p.i3) {} + inline Triple(_T1 const &_i1, _T2 const &_i2, _T3 const &_i3): + i1(_i1), i2(_i2), i3(_i3) {} + + template + inline Triple(Triple<__T1, __T2, __T3, __TCompression> const &_p): + i1(getValueI1(_p)), i2(getValueI2(_p)), i3(getValueI3(_p)) {} + }; + + // unaligned and unpadded storage (space efficient) +#ifdef PLATFORM_WINDOWS + #pragma pack(push,1) +#endif + template + struct Triple<_T1, _T2, _T3, Compressed> { + typedef _T1 T1; + typedef _T2 T2; + typedef _T3 T3; + _T1 i1; + _T2 i2; + _T3 i3; + inline Triple() {} + inline Triple(Triple const &_p): + i1(_p.i1), i2(_p.i2), i3(_p.i3) {} + inline Triple(_T1 const &_i1, _T2 const &_i2, _T3 const &_i3): + i1(_i1), i2(_i2), i3(_i3) {} + + template + inline Triple(Triple<__T1, __T2, __T3, __TCompression> const &_p): + i1(getValueI1(_p)), i2(getValueI2(_p)), i3(getValueI3(_p)) {} + } +#ifndef PLATFORM_WINDOWS + __attribute__((packed)) +#endif + ; +#ifdef PLATFORM_WINDOWS + #pragma pack(pop) +#endif + + template + std::ostream& operator<<(std::ostream &out, Triple<_T1,_T2,_T3,TCompression> const &t) { + out << "< " << getValueI1(t) << " , " << getValueI2(t) << " , " << getValueI3(t) << " >"; + return out; + } + + template + struct Value< Triple, 1 > { + typedef T1 Type; + }; + + template + struct Value< Triple, 2 > { + typedef T2 Type; + }; + + template + struct Value< Triple, 3 > { + typedef T3 Type; + }; + + template + struct Spec< Triple > { + typedef TCompression Type; + }; + + +//____________________________________________________________________________ + +/** +.Class.Tuple: +..cat:Aggregates +..summary:A plain fixed-length string. +..signature:Tuple +..param.T:The value type, that is the type of characters stored in the tuple. +..param.size:The size/length of the tuple. +...remarks:In contrast to @Class.String@ the length of Tuple is fixed. +..param.compress:Enable/Disable compression. +..param.compress:If $void$, no compression is used. +..param.compress:If $Compressed$, the characters are stored as a bit sequence in an ordinal type (char, ..., __int64) +...remarks:Only useful for small alphabets and small tuple sizes (|Sigma|^size <= 2^64) as for DNA or protein m-grams) +...default:void. +..see:Spec.Sampler +*/ + + // standard storage + template + struct Tuple { + typedef _T T; + enum { size = _size }; + _T i[_size]; + + template + inline _T& operator[](TPos k) { + SEQAN_ASSERT(k >= 0 && k < size); + return i[k]; + } + template + inline const _T& operator[](TPos k) const { + SEQAN_ASSERT(k >= 0 && k < size); + return i[k]; + } + inline _T* operator&() { return i; } + inline const _T* operator&() const { return i; } + + // has to be inline because elements (like this tuple) of packed structs can't be arguments + template + inline SSS const assignValueAt(TPos k, SSS const source) { + return i[k] = source; + } + }; + + + template < unsigned char _size > + struct _BitVector { + typedef typename _BitVector<_size + 1>::Type Type; + }; + + template <> struct _BitVector<8> { typedef unsigned char Type; }; + template <> struct _BitVector<16> { typedef unsigned short Type; }; + template <> struct _BitVector<32> { typedef unsigned int Type; }; + template <> struct _BitVector<64> { typedef __int64 Type; }; + template <> struct _BitVector<255> { typedef __int64 Type; }; + + // bit-compressed storage (space efficient) +#ifdef PLATFORM_WINDOWS + #pragma pack(push,1) +#endif + template + struct Tuple<_T, _size, Compressed> { + typedef _T T; + enum { size = _size }; + enum { bitSize = BitsPerValue<_T>::VALUE }; + enum { bitMask = (1 << bitSize) - 1 }; + enum { mask = (1 << (size * bitSize)) - 1 }; + typedef typename _BitVector< bitSize * size >::Type CT; + + CT i; +/* + inline Tuple() { + SEQAN_ASSERT(bitSize * size <= sizeof(CT) * 8); + } +*/ + template + inline const _T operator[](TPos k) const { + SEQAN_ASSERT(k >= 0 && k < size); + return (i >> (size - 1 - k) * bitSize) & bitMask; + } + template + inline Tuple operator=(Tuple<_T, __size, Compressed> const &_right) { + i = _right.i; + return *this; + } + template + inline CT operator<<=(TShiftSize shift) { + return i = (i << (shift * bitSize)) & mask; + } + template + inline CT operator<<(TShiftSize shift) const { + return (i << (shift * bitSize)) & mask; + } + template + inline CT operator>>=(TShiftSize shift) { + return i = (i >> (shift * bitSize)); + } + template + inline CT operator>>(TShiftSize shift) const { + return i >> (shift * bitSize); + } + template + inline void operator|=(T const &t) { + i |= t; + } + template + inline void operator|=(SimpleType const &t) { + i |= t.value; + } + inline CT* operator&() { return &i; } + inline const CT* operator&() const { return &i; } + + // has to be inline because elements (like this tuple) of packed structs can't be arguments + template + inline SSS const assignValueAt(TPos k, SSS const source) { + typedef Tuple<_T, _size, Compressed> Tup; + typename Tup::CT mask = Tup::bitMask << ((_size - 1 - k) * bitSize); + i = (i & ~mask) | ((CT)source << ((_size - 1 - k) * bitSize)); + return source; + } + } +#ifndef PLATFORM_WINDOWS + __attribute__((packed)) +#endif + ; +#ifdef PLATFORM_WINDOWS + #pragma pack(pop) +#endif + + +////////////////////////////////////////////////////////////////////////////// +// length + + template + inline unsigned length(Tuple<_T, _size, TCompression> const &) { return _size; } + + ///.Metafunction.LENGTH.param.T.type:Class.Tuple + template + struct LENGTH< Tuple<_T, _size, TCompression> > + { + enum { VALUE = _size }; + }; + +////////////////////////////////////////////////////////////////////////////// +// assignValueAt + + template + inline TSource & + assignValueAt(TObject &me, TPos k, TSource &source) { + assign(value(me, k), source); + return source; + } + + template + inline TSource const & + assignValueAt(TObject &me, TPos k, TSource const &source) { + assign(value(me, k), source); + return source; + } + + template + inline SSS const assignValueAt(Tuple &me, TPos k, SSS const source) { + return me.i[k] = source; + } + + template + inline SSS const assignValueAt(Tuple &me, TPos k, SSS const source) { + typedef Tuple Tup; + typename Tup::CT mask = Tup::bitMask << ((_size - 1 - k) * me.bitSize); + me.i = (me.i & ~mask) | source << ((_size - 1 - k) * me.bitSize); + return source; + } + + template + inline SimpleType const & assignValueAt(Tuple &me, TPos k, SimpleType const &source) { + typedef Tuple Tup; + typename Tup::CT mask = Tup::bitMask << ((_size - 1 - k) * me.bitSize); + me.i = (me.i & ~mask) | source.value << ((_size - 1 - k) * me.bitSize); + return source; + } + +////////////////////////////////////////////////////////////////////////////// +// clear + + template + inline void clear(Tuple &me) { + memset(&(me.i)); + } + template + inline void clear(Tuple &me) { + me.i = 0; + } + +////////////////////////////////////////////////////////////////////////////// +// optimized compares + + template + inline bool operator<(Tuple const &_left, Tuple const &_right) { + return _left.i < _right.i; + } + template + inline bool operator>(Tuple const &_left, Tuple const &_right) { + return _left.i > _right.i; + } + template + inline bool operator==(Tuple const &_left, Tuple const &_right) { + return _left.i == _right.i; + } + template + inline bool operator!=(Tuple const &_left, Tuple const &_right) { + return _left.i != _right.i; + } + +////////////////////////////////////////////////////////////////////////////// +// optimized shifts + + struct _TupleShiftLeftWorker { + template + static inline void body(Arg &arg, unsigned I) { + arg[I-1] = arg[I]; + } + }; + + struct _TupleShiftRightWorker { + template + static inline void body(Arg &arg, unsigned I) { + arg[I] = arg[I-1]; + } + }; + + template + inline void shiftLeft(Tuple<_T, _size, TCompression> &me) { + LOOP<_TupleShiftLeftWorker, _size - 1>::run(me); + } + + template + inline void shiftRight(Tuple<_T, _size, TCompression> &me) { + LOOP_REVERSE<_TupleShiftRightWorker, _size - 1>::run(me); + } + + template + inline void shiftLeft(Tuple<_T, _size, Compressed> &me) { + me<<=1; + } + + template + inline void shiftRight(Tuple<_T, _size, Compressed> &me) { + me>>=1; + } + +////////////////////////////////////////////////////////////////////////////// +// standard output + + template + std::ostream& operator<<(std::ostream& out, Tuple<_T,_size,TCompression> const &a) { + out << "["; + if (a.size > 0) + out << a[0]; + for(unsigned j = 1; j < a.size; ++j) + out << " " << a[j]; + out << "]"; + return out; + } + + template + struct Value< Tuple<_T, _size, TCompression> > { + typedef _T Type; + }; + + template + struct Spec< Tuple<_T, _size, TCompression> > { + typedef TCompression Type; + }; + +////////////////////////////////////////////////////////////////////////////// +// getValueIx + + template + inline T1 getValueI1(Pair const &pair) { + return pair.i1; + } + + template + inline T2 getValueI2(Pair const &pair) { + return pair.i2; + } + + template + inline T1 getValueI1(Pair > const &pair) { + typedef Pair > TPair; + return pair.i12 >> TPair::bitShiftI1; + } + + template + inline T2 getValueI2(Pair > const &pair) { + typedef Pair > TPair; + return pair.i12 & (((typename TPair::T12)1 << TPair::bitShiftI1) - 1); + } +//____________________________________________________________________________ + + template + inline T1 getValueI1(Triple const &triple) { + return triple.i1; + } + + template + inline T2 getValueI2(Triple const &triple) { + return triple.i2; + } + + template + inline T3 getValueI3(Triple const &triple) { + return triple.i3; + } + +////////////////////////////////////////////////////////////////////////////// +// assignValueIx + + template + inline void assignValueI1(Pair &pair, T const &_i) { + pair.i1 = _i; + } + + template + inline void assignValueI2(Pair &pair, T const &_i) { + pair.i2 = _i; + } + + template + inline void assignValueI1(Pair > &pair, T const &_i) + { + typedef Pair > TPair; + pair.i12 = ((typename TPair::T12)_i << TPair::bitShiftI1) | + (pair.i12 & (((typename TPair::T12)1 << TPair::bitShiftI1) - 1)); + } + + template + inline void assignValueI2(Pair > &pair, T const &_i) { + typedef Pair > TPair; + pair.i12 = (pair.i12 & ~(((typename TPair::T12)1 << TPair::bitShiftI1) - 1)) | _i; + } +//____________________________________________________________________________ + + template + inline T const assignValueI1(Triple &triple, T const &_i) { + return triple.i1 = _i; + } + + template + inline T const assignValueI2(Triple &triple, T const &_i) { + return triple.i2 = _i; + } + + template + inline T const assignValueI3(Triple &triple, T const &_i) { + return triple.i3 = _i; + } + +////////////////////////////////////////////////////////////////////////////// +// operator ==/!= for pairs and triples + + template + inline bool operator==(Pair const &_left, Pair const &_right) { + return _left.i1 == _right.i1 && _left.i2 == _right.i2; + } + template + inline bool operator!=(Pair const &_left, Pair const &_right) { + return _left.i1 != _right.i1 || _left.i2 != _right.i2; + } + + template + inline bool operator==(Pair > const &_left, Pair > const &_right) { + return _left.i12 == _right.i12; + } + template + inline bool operator!=(Pair > const &_left, Pair > const &_right) { + return _left.i12 != _right.i12; + } +//____________________________________________________________________________ + + template < + typename L1, typename L2, typename L3, typename LCompression, + typename R1, typename R2, typename R3, typename RCompression> + inline bool operator==(Triple const &_left, Triple const &_right) { + return _left.i1 == _right.i1 && _left.i2 == _right.i2 && _left.i3 == _right.i3; + } + template < + typename L1, typename L2, typename L3, typename LCompression, + typename R1, typename R2, typename R3, typename RCompression> + inline bool operator!=(Triple const &_left, Triple const &_right) { + return _left.i1 != _right.i1 || _left.i2 != _right.i2 || _left.i3 != _right.i3; + } + +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_allocator_interface.h b/SeqAn-1.1/seqan/basic/basic_allocator_interface.h new file mode 100644 index 0000000..cc48e0d --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_allocator_interface.h @@ -0,0 +1,236 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_allocator_interface.h,v 1.1 2008/08/25 16:20:02 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALLOCATOR_INTERFACE_H +#define SEQAN_HEADER_BASIC_ALLOCATOR_INTERFACE_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +//Allocator +////////////////////////////////////////////////////////////////////////////// + + +/** +.Class.Allocator: +..cat:Basic +..summary:Manager for allocated memory. +..signature:Allocator +..param.TSpec:The specializing type. +...metafunction:Metafunction.Spec +..implements:Concept.Allocator +..include:basic.h +..remarks:There are two reasons for using non-trivial allocators: +...text:1. Allocators support the function @Function.Allocator#clear@ for a fast deallocation of all +allocated memory blocks. +...text:2. Some allocators are faster in allocating an deallocating memory. +Pool allocators like e.g. @Spec.Single Pool Allocator@ or @Spec.Multi Pool Allocator@ +speed up @Function.allocate@, @Function.deallocate@, and @Function.Allocator#clear@ for +pooled memory blocks. +*/ + +template +struct Allocator; + +///.Function.allocate.param.object.type:Class.Allocator +///.Function.deallocate.param.object.type:Class.Allocator + + +////////////////////////////////////////////////////////////////////////////// +// Metafunctions +////////////////////////////////////////////////////////////////////////////// + +//.Metafunction.Spec.param.T.type:Class.Allocator + +template +struct Spec > +{ + typedef TSpec Type; +}; + + +////////////////////////////////////////////////////////////////////////////// +/** +.Tag.Allocator Usage: +..summary:The purpose of an allocated memory block. +..tag.TagAllocateTemp:Temporary memory. +..tag.TagAllocateStorage:Memory for storing container content. +..see:Function.allocate +..see:Function.deallocate +*/ +struct TagAllocateUnspecified_; //< usage not specified +typedef Tag const TagAllocateUnspecified; + +struct TagAllocateTemp_; //< allocate temporary memory +typedef Tag const TagAllocateTemp; + +struct TagAllocateStorage_; //< allocate memory for storing member data +typedef Tag const TagAllocateStorage; + + +////////////////////////////////////////////////////////////////////////////// +//allocates memory on heap. No c'tors are called. +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.allocate: +..cat:Memory +..summary:Allocates memory from heap. +..signature:allocate(object, data, count [, usage_tag]) +..param.object:Allocator object. +...remarks:$object$ is conceptually the "owner" of the allocated memory. + Objects of all types can be used as allocators. If no special behavior is implemented, + default functions allocation/deallocation are applied that uses standard + $new$ and $delete$ operators. +..param.count:Number of items that could be stored in the allocated memory. +...text:The type of the allocated items is given by the type of $data$. +..param.usage_tag:A tag the specifies the purpose for the allocated memory. +...value:@Tag.Allocator Usage@ +..returns.param.data:Pointer to allocated memory. +...remarks:The value of this pointer is overwritten by the function. +..remarks: +...text:The function allocates at least $count*sizeof(data)$ bytes. + The allocated memory is large enough + to hold $count$ objects of type $T$, where $T *$ is type of $data$. +...note:These objects are not constructed by $allocate$. +...text:Use e.g. one of the functions @Function.valueConstruct@, @Function.arrayConstruct@, @Function.arrayConstructCopy@ or @Function.arrayFill@ +to construct the objects. +A $new$ operator which is part of the C++ standard (defined in $$) + can also be used to construct objects at a given memory address. +..note:All allocated memory blocks should be deallocated by the corresponding function @Function.deallocate@. +..see:Function.deallocate +..see:Function.valueConstruct +..see:Function.arrayFill +..see:Function.arrayConstruct +..see:Function.arrayConstructCopy +*/ +template +inline void +allocate(T const & me, + TValue * & data, + TSize count) +{ + allocate(me, data, count, TagAllocateUnspecified()); +} +template +inline void +allocate(T & me, + TValue * & data, + TSize count) +{ + allocate(me, data, count, TagAllocateUnspecified()); +} + +template +inline void +allocate(T const &, + TValue * & data, + TSize count, + Tag const) +{ + data = (TValue *) operator new(count * sizeof(TValue)); + if (data) + SEQAN_PROADD(SEQAN_PROMEMORY, count * sizeof(TValue)); +} +template +inline void +allocate(T &, + TValue * & data, + TSize count, + Tag const) +{ + data = (TValue *) operator new(count * sizeof(TValue)); + if (data) + SEQAN_PROADD(SEQAN_PROMEMORY, count * sizeof(TValue)); +} + + +////////////////////////////////////////////////////////////////////////////// +//deallocates memory that was allocates using allocate(.) + +/** +.Function.deallocate: +..cat:Memory +..summary:Deallocates memory. +..signature:deallocate(object, data, count [, usage_tag]) +..param.object:Allocator object. +...remarks:$object$ is conceptually the "owner" of the allocated memory. + Objects of all types can be used as allocators. If no special behavior is implemented, + default functions allocation/deallocation are applied that uses standard + $new$ and $delete$ operators. +..param.data:Pointer to allocated memory that was allocated by $allocate$. +..param.count:Number of items that could be stored in the allocated memory. +..param.usage_tag:A tag the specifies the purpose for the allocated memory. +...value:@Tag.Allocator Usage@ +..remarks: +...text:The values for $object$, $count$ and $usage_tag$ should be the same that was +used when $allocate$ was called. The value of $data$ should be the same that was +returned by $allocate$. +...note:$deallocate$ does not destruct objects. +...text:Use e.g. one of the functions @Function.valueDestruct@ or @Function.arrayDestruct@ to destruct the objects. +$delete$ and $delete []$ operators which are part of the C++ standard (defined in $$) + can also be used to destruct objects at a given memory address. +..see:Function.valueDestruct +..see:Function.arrayDestruct +*/ +template +inline void +deallocate(T const & me, + TValue * data, + TSize const count) +{ + deallocate(me, data, count, TagAllocateUnspecified()); +} +template +inline void +deallocate(T & me, + TValue * data, + TSize const count) +{ + deallocate(me, data, count, TagAllocateUnspecified()); +} + +template +inline void +deallocate(T const & /*me*/, + TValue * data, + TSize count, + Tag const) +{ + if (data && count) // .. to use count if SEQAN_PROFILE is not defined + SEQAN_PROSUB(SEQAN_PROMEMORY, count * sizeof(TValue)); + operator delete ((void *) data); +} +template +inline void +deallocate(T & /*me*/, + TValue * data, + TSize count, + Tag const) +{ + if (data && count) // .. to use count if SEQAN_PROFILE is not defined + SEQAN_PROSUB(SEQAN_PROMEMORY, count * sizeof(TValue)); + operator delete ((void *) data); +} +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_allocator_multipool.h b/SeqAn-1.1/seqan/basic/basic_allocator_multipool.h new file mode 100644 index 0000000..c637e20 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_allocator_multipool.h @@ -0,0 +1,230 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_allocator_multipool.h,v 1.2 2009/02/19 01:51:23 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALLOCATOR_MULTIPOOL_H +#define SEQAN_HEADER_BASIC_ALLOCATOR_MULTIPOOL_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// MultiPool Allocator +////////////////////////////////////////////////////////////////////////////// + +/** +.Spec.Multi Pool Allocator: +..cat:Allocators +..general:Class.Allocator +..summary:Allocator that pools memory blocks. +..signature:Allocator< MultiPool > +..param.ParentAllocator:An allocator that is by the pool allocator used to allocate memory. +...default:@Spec.Simple Allocator@ +...note:The multi pool allocator only supports @Function.clear@ if this function is also implemented for $ParentAllocator$. +..remarks:A pool allocator allocates several memory blocks at once. +..param.BLOCKING_LIMIT:The maximum size for memory blocks to be pooled. +...default:256 +Freed blocks are not immediately deallocated but recycled in subsequential allocations. +This way, the number of calls to the heap manager is reduced, and that speeds up memory management. +...text:Note that memory blocks larger than $BLOCKING_LIMIT$ are not pooled +but immediately allocated and deallocated using $ParentAllocator$. +*/ + + +template >, unsigned int BLOCKING_LIMIT = 0x100> +struct MultiPool; + +////////////////////////////////////////////////////////////////////////////// + +typedef Allocator >, 0x100> > PoolAllocator; + +template +struct Allocator > +{ + enum + { + BLOCKING_LIMIT = BLOCKING_LIMIT_, + GRANULARITY_BITS = 2, + BLOCKING_COUNT = BLOCKING_LIMIT >> GRANULARITY_BITS, + STORAGE_SIZE = 0xf80 + }; + + char * data_recycled_blocks [BLOCKING_COUNT]; + char * data_current_begin [BLOCKING_COUNT]; + char * data_current_free [BLOCKING_COUNT]; + Holder data_parent_allocator; + + Allocator() + { +SEQAN_CHECKPOINT + memset(data_recycled_blocks, 0, sizeof(data_recycled_blocks)); + memset(data_current_begin, 0, sizeof(data_current_begin)); + memset(data_current_free, 0, sizeof(data_current_free)); + } + + Allocator(TParentAllocator & parent_alloc) + { +SEQAN_CHECKPOINT + memset(data_recycled_blocks, 0, sizeof(data_recycled_blocks)); + memset(data_current_begin, 0, sizeof(data_current_begin)); + memset(data_current_free, 0, sizeof(data_current_free)); + + setValue(data_parent_allocator, parent_alloc); + } + + //Dummy copy + Allocator(Allocator const &) + { + memset(data_recycled_blocks, 0, sizeof(data_recycled_blocks)); + memset(data_current_begin, 0, sizeof(data_current_begin)); + memset(data_current_free, 0, sizeof(data_current_free)); + } + inline Allocator & + operator = (Allocator const &) + { + clear(*this); + return *this; + } + + ~Allocator() + { +SEQAN_CHECKPOINT + clear(*this); + } +}; +////////////////////////////////////////////////////////////////////////////// + +template +inline TParentAllocator & +parentAllocator(Allocator > & me) +{ +SEQAN_CHECKPOINT + return value(me.data_parent_allocator); +} + +////////////////////////////////////////////////////////////////////////////// + +template +void +clear(Allocator > & me) +{ +SEQAN_CHECKPOINT + memset(me.data_recycled_blocks, 0, sizeof(me.data_recycled_blocks)); + memset(me.data_current_begin, 0, sizeof(me.data_current_begin)); + memset(me.data_current_free, 0, sizeof(me.data_current_free)); + + clear(parentAllocator(me)); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline unsigned int +_allocatorBlockNumber(Allocator > &, + size_t size_) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + + SEQAN_ASSERT(size_) + + if (size_ < BLOCKING_LIMIT) + {//blocks + return size_ >> TAllocator::GRANULARITY_BITS; + } + else + {//no blocking + return TAllocator::BLOCKING_COUNT; + } +} + + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +allocate(Allocator > & me, + TValue * & data, + TSize count, + Tag const tag_) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + + size_t bytes_needed = count * sizeof(TValue); + char * ptr; + + unsigned int block_number = _allocatorBlockNumber(me, bytes_needed); + if (block_number == TAllocator::BLOCKING_COUNT) + {//no blocking + return allocate(parentAllocator(me), data, count, tag_); + } + + bytes_needed = (block_number + 1) << TAllocator::GRANULARITY_BITS; + + if (me.data_recycled_blocks[block_number]) + {//use recycled + ptr = me.data_recycled_blocks[block_number]; + me.data_recycled_blocks[block_number] = * reinterpret_cast(ptr); + } + else + {//use new + ptr = me.data_current_free[block_number]; + if (!ptr || (ptr + bytes_needed > me.data_current_begin[block_number] + TAllocator::STORAGE_SIZE)) + {//not enough free space in current storage: allocate new + allocate(parentAllocator(me), ptr, (size_t) TAllocator::STORAGE_SIZE, tag_); + me.data_current_begin[block_number] = ptr; + } + me.data_current_free[block_number] = ptr + bytes_needed; + } + + data = reinterpret_cast(ptr); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +deallocate(Allocator > & me, + TValue * data, + TSize count, + Tag const tag_) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + + size_t bytes_needed = count * sizeof(TValue); + + unsigned int block_number = _allocatorBlockNumber(me, bytes_needed); + if (block_number == TAllocator::BLOCKING_COUNT) + {//no blocking + return deallocate(parentAllocator(me), data, count, tag_); + } + + bytes_needed = (block_number + 1) << TAllocator::GRANULARITY_BITS; + + //link in recycling list + *reinterpret_cast(data) = me.data_recycled_blocks[block_number]; + me.data_recycled_blocks[block_number] = reinterpret_cast(data); +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_allocator_simple.h b/SeqAn-1.1/seqan/basic/basic_allocator_simple.h new file mode 100644 index 0000000..6b570cc --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_allocator_simple.h @@ -0,0 +1,210 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_allocator_simple.h,v 1.1 2008/08/25 16:20:02 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALLOCATOR_SIMPLE_H +#define SEQAN_HEADER_BASIC_ALLOCATOR_SIMPLE_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// SimpleAlloc Allocator +////////////////////////////////////////////////////////////////////////////// + +/** +.Spec.Simple Allocator: +..cat:Allocators +..general:Class.Allocator +..summary:General purpose allocator. +..signature:Allocator< SimpleAlloc > +..param.ParentAllocator:An allocator that is by the simple allocator used to allocate memory. +...default:@Tag.Default@ +...remarks:@Tag.Default@ used as allocator means that the default implementations +of @Function.allocate@ and @Function.deallocate@ are used. +*/ + +template +struct SimpleAlloc; + +////////////////////////////////////////////////////////////////////////////// + + +typedef Allocator > SimpleAllocator; + +template +struct Allocator > +{ + struct Header + { + Header * left; + Header * right; + size_t size; + }; + + Header * data_storages; + Holder data_parent_allocator; + + Allocator(): + data_storages(0) + { +SEQAN_CHECKPOINT + } + + Allocator(TParentAllocator & parent_alloc): + data_storages(0) + { +SEQAN_CHECKPOINT + setValue(data_parent_allocator, parent_alloc); + } + + //Dummy copy + Allocator(Allocator const &): + data_storages(0) + { + } + inline Allocator & + operator = (Allocator const &) + { + clear(*this); + return *this; + } + + ~Allocator() + { +SEQAN_CHECKPOINT + clear(*this); + } +}; + +////////////////////////////////////////////////////////////////////////////// + +template +inline TParentAllocator & +parentAllocator(Allocator > & me) +{ +SEQAN_CHECKPOINT + return value(me.data_parent_allocator); +} + +////////////////////////////////////////////////////////////////////////////// +/** +.Function.Allocator#clear: +..cat:Memory +..summary:Deallocates all memory blocks. +..signature:clear(allocator) +..param.allocator:Allocator object. +...type:Class.Allocator +...concept:Concept.Allocator +..remarks:This function deallocates all memory blocks +that was allocated using @Function.allocate@ for $allocator$. +The memory is not pooled but directly passed back to the heap manager. +..see:Function.allocate +..see:Function.deallocate +*/ +template +void +clear(Allocator > & me) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + + while (me.data_storages) + { + typename TAllocator::Header * next_storage = me.data_storages->right; + deallocate(parentAllocator(me), reinterpret_cast(me.data_storages), me.data_storages->size); + me.data_storages = next_storage; + } +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +allocate(Allocator > & me, + TValue * & data, + TSize count, + Tag const) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + typedef typename TAllocator::Header THeader; + + //compute needed bytes + size_t bytes_needed = count * sizeof(TValue) + sizeof(THeader); + + //allocate storage from parent + char * ptr; + allocate(parentAllocator(me), ptr, bytes_needed, TagAllocateStorage()); + + THeader * new_block = reinterpret_cast(ptr); + new_block->left = 0; + new_block->right = me.data_storages; + new_block->size = bytes_needed; + + if (me.data_storages) + { + me.data_storages->left = new_block; + } + me.data_storages = new_block; + + //return data + data = reinterpret_cast(ptr + sizeof(THeader)); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +deallocate(Allocator > & me, + TValue * data, + TSize, + Tag const) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + typedef typename TAllocator::Header THeader; + + //update links + THeader & header = *(reinterpret_cast(data) - 1); + if (header.left) + { + header.left->right = header.right; + } + else + { + me.data_storages = header.right; + } + if (header.right) + { + header.right->left = header.left; + } + + //deallocate storage using parent + char * ptr = reinterpret_cast(& header); + deallocate(parentAllocator(me), ptr, header.size); +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_allocator_singlepool.h b/SeqAn-1.1/seqan/basic/basic_allocator_singlepool.h new file mode 100644 index 0000000..88fde00 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_allocator_singlepool.h @@ -0,0 +1,299 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_allocator_singlepool.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALLOCATOR_SINGLE_POOL_H +#define SEQAN_HEADER_BASIC_ALLOCATOR_SINGLE_POOL_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// SinglePool Allocator +////////////////////////////////////////////////////////////////////////////// + +/** +.Spec.Single Pool Allocator: +..cat:Allocators +..general:Class.Allocator +..summary:Allocator that pools memory blocks of specific size. +..signature:Allocator< SinglePool > +..param.SIZE:Size of memory blocks that are pooled. +...value:An unsigned integer with $SIZE >= sizeof(void *)$. +..param.ParentAllocator:An allocator that is by the pool allocator used to allocate memory. +...default:@Spec.Simple Allocator@ +...note:The single pool allocator only supports @Function.clear@ if this function is also implemented for $ParentAllocator$. +..remarks:A pool allocator allocates several memory blocks at once. +Freed blocks are not immediately deallocated but recycled in subsequential allocations. +This way, the number of calls to the heap manager is reduced, and that speeds up memory management. +...text:The single pool allocator only pools memory blocks of size $SIZE$. +Blocks of other sizes are allocated and deallocated using an allocator of type $ParentAllocator$. +...text:Using the single pool allocator for blocksizes larger than some KB is not advised. +*/ + +template +struct SinglePool; + +////////////////////////////////////////////////////////////////////////////// + +template +struct Allocator > +{ + enum + { + SIZE_PER_ITEM = SIZE, + ITEMS_PER_BLOCK = (SIZE_PER_ITEM < 0x0100) ? 0x01000 / SIZE_PER_ITEM : 16, + STORAGE_SIZE = SIZE * ITEMS_PER_BLOCK, + + STORAGE_SIZE_MIN = SIZE + }; + + char * data_recycled_blocks; + char * data_current_begin; + char * data_current_end; + char * data_current_free; + Holder data_parent_allocator; + + Allocator() + { +SEQAN_CHECKPOINT + data_recycled_blocks = data_current_end = data_current_free = 0; + //dont need to initialize data_current_begin + } + + Allocator(size_t reserve_item_count) + { +SEQAN_CHECKPOINT + data_recycled_blocks = 0; + + size_t storage_size = (reserve_item_count * SIZE > STORAGE_SIZE_MIN) ? reserve_item_count * SIZE : STORAGE_SIZE_MIN; + allocate( parentAllocator( *this ), data_current_begin, storage_size ); + data_current_end = data_current_begin + storage_size; + data_current_free = data_current_begin; + } + + Allocator(TParentAllocator & parent_alloc) + { +SEQAN_CHECKPOINT + setValue(data_parent_allocator, parent_alloc); + + data_recycled_blocks = data_current_end = data_current_free = 0; + //dont need to initialize data_current_begin + } + + Allocator(size_t reserve_item_count, TParentAllocator & parent_alloc) + { +SEQAN_CHECKPOINT + data_recycled_blocks = 0; + + setValue(data_parent_allocator, parent_alloc); + + size_t storage_size = (reserve_item_count * SIZE > STORAGE_SIZE_MIN) ? reserve_item_count * SIZE : STORAGE_SIZE_MIN; + allocate( parentAllocator( *this ), data_current_begin, storage_size ); + data_current_end = data_current_begin + storage_size; + data_current_free = data_current_begin; + } + + //Dummy copy + Allocator(Allocator const &) + { + data_recycled_blocks = data_current_end = data_current_free = 0; + //dont need to initialize data_current_begin + } + inline Allocator & + operator = (Allocator const &) + { + clear(*this); + return *this; + } + + ~Allocator() + { +SEQAN_CHECKPOINT + clear(*this); + } +}; +////////////////////////////////////////////////////////////////////////////// + +template +inline TParentAllocator & +parentAllocator(Allocator > & me) +{ +SEQAN_CHECKPOINT + return value(me.data_parent_allocator); +} + +////////////////////////////////////////////////////////////////////////////// + +template +void +clear(Allocator > & me) +{ +SEQAN_CHECKPOINT + + me.data_recycled_blocks = me.data_current_end = me.data_current_free = 0; + + clear(parentAllocator(me)); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +allocate(Allocator > & me, + TValue * & data, + TSize count, + Tag const tag_) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + size_t bytes_needed = count * sizeof(TValue); + + if (bytes_needed != TAllocator::SIZE_PER_ITEM) + {//no blocking + allocate(parentAllocator(me), data, count, tag_); + return; + } + + char * ptr; + if (me.data_recycled_blocks) + {//use recycled + ptr = me.data_recycled_blocks; + me.data_recycled_blocks = * reinterpret_cast(ptr); + } + else + {//use new + ptr = me.data_current_free; + if (ptr + bytes_needed > me.data_current_end) + {//not enough free space in current storage: allocate new + allocate(parentAllocator(me), ptr, (size_t) TAllocator::STORAGE_SIZE, tag_); + me.data_current_begin = ptr; + me.data_current_end = ptr + TAllocator::STORAGE_SIZE; + } + me.data_current_free = ptr + bytes_needed; + } + + data = reinterpret_cast(ptr); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +deallocate(Allocator > & me, + TValue * data, + TSize count, + Tag const tag_) +{ +SEQAN_CHECKPOINT + typedef Allocator > TAllocator; + + size_t bytes_needed = count * sizeof(TValue); + + if (bytes_needed != TAllocator::SIZE_PER_ITEM) + {//no blocking + deallocate(parentAllocator(me), data, count, tag_); + return; + } + + //link in recycling list + *reinterpret_cast(data) = me.data_recycled_blocks; + me.data_recycled_blocks = reinterpret_cast(data); +} + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +// alternative Interface that takes a Type instead of a SIZE +////////////////////////////////////////////////////////////////////////////// + + +template +struct SinglePool2; + +template +struct Allocator > +{ + Allocator > data_alloc; + + + Allocator(size_t reserve_item_count) + : data_alloc(reserve_item_count) + { + } + + Allocator(TParentAllocator & parent_alloc) + : data_alloc(parent_alloc) + { + } + + Allocator(size_t reserve_item_count, TParentAllocator & parent_alloc) + : data_alloc(reserve_item_count, parent_alloc) + + { + } +}; + +////////////////////////////////////////////////////////////////////////////// + +template +inline TParentAllocator & +parentAllocator(Allocator > & me) +{ +SEQAN_CHECKPOINT + return parentAllocator(me.data_alloc); +} + +////////////////////////////////////////////////////////////////////////////// + +template +void +clear(Allocator > & me) +{ +SEQAN_CHECKPOINT + clear(me.data_alloc); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +allocate(Allocator > & me, + TValue2 * & data, + TSize count, + Tag const tag_) +{ +SEQAN_CHECKPOINT + allocate(me.data_alloc, data, count, tag_); +} + +template +inline void +deallocate(Allocator > & me, + TValue2 * data, + TSize count, + Tag const tag_) +{ +SEQAN_CHECKPOINT + deallocate(me.data_alloc, data, count, tag_); +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_allocator_to_std.h b/SeqAn-1.1/seqan/basic/basic_allocator_to_std.h new file mode 100644 index 0000000..e54589d --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_allocator_to_std.h @@ -0,0 +1,178 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_allocator_to_std.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALLOCATOR_TO_STD_H +#define SEQAN_HEADER_BASIC_ALLOCATOR_TO_STD_H + + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// +//helper caller for calling functions that have same name as member functions + +template +inline void call_allocate(TMe & me, TValue * & data, TSize const count) +{ + allocate(me, data, count); +} +template +inline void call_deallocate(TMe & me, TValue * data, TSize const count) +{ + deallocate(me, data, count); +} + +////////////////////////////////////////////////////////////////////////////// +//Filter that adapts seqan allocator zu std allocator +/** +.Class.ToStdAllocator: +..summary:Emulates standard conform allocator. +..signature:ToStdAllocator +..param.THost:Type of the host allocator object. +...text:This object is used to call @Function.allocate@ and @Function.deallocate@. +..param.TValue:Type of allocated items. +..remarks:The member functions $allocate$ and $deallocate$ of $ToStdAllocator$ call +the (globale) functions @Function.allocate@ and @Function.deallocate@, respectively. The globale functions +get an allocator object as their first arguments. This allocator object is not the $ToStdAllocator$ object itself, +but the host object that was given to the constructor. +..remarks: +..see:Function.allocate +..see:Function.deallocate +*/ +template +struct ToStdAllocator +{ + typedef TValue value_type; + typedef value_type * pointer; + typedef value_type & reference; + typedef value_type const * const_pointer; + typedef value_type const & const_reference; + +// typedef typename THost::Size size_type; +// typedef typename THost::Difference difference_type; + typedef size_t size_type; + typedef ptrdiff_t difference_type; + +/** +.Memfunc.ToStdAllocator: +..summary:Constructor +..signature:ToStdAllocator(host) +..class:Class.ToStdAllocator +..param.host:The host object that is used as allocator for @Function.allocate@ and @Function.deallocate@. +*/ + ToStdAllocator(THost & host): m_host(& host) + { + } + ToStdAllocator(ToStdAllocator const & alloc): m_host(alloc.m_host) + { + } + ToStdAllocator & operator= (ToStdAllocator const & alloc) + { + m_host = alloc.m_host; + } + ~ToStdAllocator() + { + } + +/** +.Function.host: +..summary:The object a given object depends on. +..cat:Dependent Objects +..signature:host(object) +..param.object:An object. +...type:Class.ToStdAllocator +..returns:The host object. +*/ + friend THost & host(ToStdAllocator & me) + { + return *me.m_host; + } + + pointer allocate(size_type count) + { + value_type * ptr; + call_allocate(*m_host, ptr, count); + return pointer(ptr); + } + pointer allocate(size_type count, const void *) + { + value_type * ptr; + call_allocate(*m_host, ptr, count); + return pointer(ptr); + } + + void deallocate(pointer data, size_type count) + { + call_deallocate(*m_host, data, count); + } + + void construct(pointer ptr, const_reference data) + { + new(ptr) TValue(data); + } + + void destroy(pointer ptr) + { + ptr->~TValue(); + } + + pointer address(reference value) const + { + return (&value); + } + const_pointer address(const_reference value) const + { + return (&value); + } + + size_type max_size() const + { + return ~0UL / sizeof(value_type); + } + + template + struct rebind + { + typedef ToStdAllocator other; + }; + + private: + THost * m_host; +}; +////////////////////////////////////////////////////////////////////////////// + + + +//returns std-allocator type (for allocators) +template +struct StdAllocator +{ + typedef ToStdAllocator Type; +}; + + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + + +////////////////////////////////////////////////////////////////////////////// + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_alphabet_interface.h b/SeqAn-1.1/seqan/basic/basic_alphabet_interface.h new file mode 100644 index 0000000..dd9a92f --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_alphabet_interface.h @@ -0,0 +1,917 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_alphabet_interface.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALPHABET_INTERFACE_H +#define SEQAN_HEADER_BASIC_ALPHABET_INTERFACE_H + +#include + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +//IsSimple +////////////////////////////////////////////////////////////////////////////// + +/** +.Metafunction.IsSimple: +..summary:Tests type to be simple. +..signature:IsSimple::Type +..param.T:Type that is tested. +..returns.param.Type:@Tag.Logical Values.True@, if $T$ is a simple type, @Tag.Logical Values.False@ otherwise. +...default:@Tag.Logical Values.False@ +..remarks:A simple type is a type that does not need constructors to be created, +a destructor to be destroyed, and copy assignment operators or copy constructors +to be copied. All POD ("plain old data") types are simple, but some +non-POD types could be simple too, e.g. some specializations of @Class.SimpleType@. +..see:Class.SimpleType +*/ + +template +struct _IsSimple { + typedef False Type; +}; + +template +struct IsSimple: + public _IsSimple {}; +template +struct IsSimple: + public IsSimple {}; + +////////////////////////////////////////////////////////////////////////////// +//very basic Alphabets + +typedef char Ascii; +typedef unsigned char Byte; +typedef wchar_t Unicode; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.valueConstruct: +..cat:Content Manipulation +..summary:Constructs an object at specified position. +..signature:valueConstruct(iterator [, param [, move_tag] ]) +..param.iterator:Pointer or iterator to position where the object should be constructed. +..param.param:Parameter that is forwarded to constructor. (optional) +..param.move_tag:Instance of the @Tag.Move Switch.move switch tag@. (optional) +...remarks:If the @Tag.Move Switch.move switch tag@ is specified, it is forwarded to the constructor, +so the constructed object must support move construction. +..remarks:The type of the destructed object is the @Metafunction.Value.value type@ of $iterator$. +*/ + +struct _ValueConstructor +{ + template + static inline void + construct(TIterator it) + { + typedef typename Value::Type TValue; + new( & value(it) ) TValue; + } + + template + static inline void + construct(TIterator it, + TParam const & param_) + { + typedef typename Value::Type TValue; + new( & value(it) ) TValue(param_); + } + + template + static inline void + construct(TIterator it, + TParam const & param_, + Move tag) + { + typedef typename Value::Type TValue; + new( & value(it) ) TValue(param_, tag); + } +}; + +struct _ValueConstructorProxy +{ + template + static inline void construct(TIterator) {} + + template + static inline void construct(TIterator, TParam const &) {} + + template + static inline void construct(TIterator, TParam const &, Move) {} +}; + +//____________________________________________________________________________ + +struct _ValueDestructor +{ + template + static inline void + destruct(TIterator it) + { + typedef typename Value::Type TValue; + value(it).~TValue(); + } +}; +struct _ValueDestructorProxy +{ + template + static inline void destruct(TIterator) {} +}; + +//____________________________________________________________________________ + +template +inline void +valueConstruct(TIterator it) +{ +SEQAN_CHECKPOINT + typedef typename IF< + TYPECMP< + typename Value::Type &, + typename Reference::Type + >::VALUE, + // THEN + _ValueConstructor, // true, types are equal + // ELSE + _ValueConstructorProxy // false, types differ -> value() returns a proxy + >::Type TConstructor; + + TConstructor::construct(it); +} + +template +inline void +valueConstruct(TIterator it, + TParam const & param_) +{ +SEQAN_CHECKPOINT + typedef typename IF< + TYPECMP< + typename Value::Type &, + typename Reference::Type + >::VALUE, + // THEN + _ValueConstructor, // true, types are equal + // ELSE + _ValueConstructorProxy // false, types differ -> value() returns a proxy + >::Type TConstructor; + + TConstructor::construct(it, param_); +} + +template +inline void +valueConstruct(TIterator it, + TParam const & param_, + Move tag) +{ +SEQAN_CHECKPOINT + typedef typename IF< + TYPECMP< + typename Value::Type &, + typename Reference::Type + >::VALUE, + // THEN + _ValueConstructor, // true, types are equal + // ELSE + _ValueConstructorProxy // false, types differ -> value() returns a proxy + >::Type TConstructor; + + TConstructor::construct(it, param_, tag); +} + +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.valueDestruct: +..cat:Content Manipulation +..summary:Destoys an object at specified position. +..signature:valueDestruct(iterator) +..param.iterator:Pointer or iterator to position where the object should be constructed. +..remarks:The type of the constructed object is the @Metafunction.Value.value type@ of $iterator$. +..see:Function.valueConstruct +*/ +template +inline void +valueDestruct(TIterator it) +{ +SEQAN_CHECKPOINT + typedef typename IF< + TYPECMP< + typename Value::Type &, + typename Reference::Type + >::VALUE, + // THEN + _ValueDestructor, // true, types are equal + // ELSE + _ValueDestructorProxy // false, types differ -> value() returns a proxy + >::Type TDestructor; + + TDestructor::destruct(it); +} + + +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.valueConstructMove: +..cat:Content Manipulation +..summary:Move constructs an object at specified position. +..signature:valueConstructMove(iterator, param) +..param.iterator:Pointer or iterator to position where the object should be constructed. +..param.param:Parameter that is moved to the new constructed object. +..remarks:The type of the destructed object is the @Metafunction.Value.value type@ of $iterator$. +..remarks:The default implementation just calls @Function.valueConstruct@. +*/ +template +inline void +valueConstructMove(TIterator it, TValue const & value) +{ + valueConstruct(it, value); +} + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +//arrayConstruct +////////////////////////////////////////////////////////////////////////////// +/** +.Function.arrayConstruct: +..cat:Array Handling +..summary:Construct objects in a given memory buffer. +..signature:arrayConstruct(begin, end [, value]) +..param.begin:Iterator to the begin of the range that is to be constructed. +..param.end:Iterator behind the end of the range. +..param.value:Argument that is forwarded to the constructor. (optional) +...text:An appropriate constructor is required. +If $value$ is not specified, the default constructor is used. +..remarks:The type of the constructed Objects is the @Metafunction.Value.value type@ +of $begin$ and $end$. +..see:Function.arrayDestruct +..see:Function.arrayConstructCopy +..see:Function.arrayFill +..see:Class.SimpleType +..see:Function.valueConstruct +*/ +template +inline void +_arrayConstruct_Default(TIterator1 begin_, + TIterator2 end_) +{ +SEQAN_CHECKPOINT + while (begin_ != end_) + { + valueConstruct(begin_); + ++begin_; + } +} +template +inline void +arrayConstruct(TIterator1 begin_, + TIterator2 end_) +{ +SEQAN_CHECKPOINT + _arrayConstruct_Default(begin_, end_); +} + +//____________________________________________________________________________ + +template +inline void +_arrayConstruct_Default(TIterator1 begin_, + TIterator2 end_, + TParam const & param_) +{ +SEQAN_CHECKPOINT + while (begin_ != end_) + { + valueConstruct(begin_, param_); + ++begin_; + } +} +template +inline void +arrayConstruct(TIterator1 begin_, + TIterator2 end_, + TParam const & param_) +{ +SEQAN_CHECKPOINT + _arrayConstruct_Default(begin_, end_, param_); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayConstructCopy +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayConstructCopy: +..cat:Array Handling +..summary:Copy constructs an array of objects into in a given memory buffer. +..signature:arrayConstructCopy(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source range. +..param.source_end:Iterator behind the last element of the source range. +...text:$source_end$ should have the same type as $source_begin$. +..param.target:Pointer to the memory block the new objects will be constructed in. +...text:The type of $target$ specifies the type of the constructed objects: +If $T*$ is the type of $target$, then the function constructs objects of type $T$. +...text:The memory buffer should be large enough to store $source_end$ - $source_begin$ objects. +An appropriate (copy-) constructor that constructs an target objects given a source object is required. +..see:Function.arrayDestruct +..see:Function.arrayCopyForward +..see:Function.arrayCopy +..see:Function.valueConstruct +*/ +template +inline void +_arrayConstructCopy_Default(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + while (source_begin != source_end) + { + valueConstruct(target_begin, *source_begin); + ++source_begin; + ++target_begin; + } +} + +template +inline void +arrayConstructCopy(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + _arrayConstructCopy_Default(source_begin, source_end, target_begin); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayConstructMove +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayConstructMove: +..cat:Array Handling +..summary:Move constructs an array of objects into in a given memory buffer. +..signature:arrayConstructMove(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source range. +..param.source_end:Iterator behind the last element of the source range. +...text:$source_end$ should have the same type as $source_begin$. +..param.target:Pointer to the memory block the new objects will be constructed in. +...text:The type of $target$ specifies the type of the constructed objects: +If $T*$ is the type of $target$, then the function constructs objects of type $T$. +...text:The memory buffer should be large enough to store $source_end$ - $source_begin$ objects. +An appropriate move constructor that constructs an target objects given a source object is required. +..see:Function.arrayDestruct +..see:Function.arrayConstructCopy +..see:Function.arrayMoveForward +..see:Function.arrayMove +..see:Function.valueConstruct +*/ +template +inline void +_arrayConstructMove_Default(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + while (source_begin < source_end) + { + valueConstructMove(target_begin, *source_begin); + ++source_begin; + ++target_begin; + } +} + +template +inline void +arrayConstructMove(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + _arrayMoveConstruct_Default(source_begin, source_end, target_begin); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayDestruct +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayDestruct: +..cat:Array Handling +..summary:Destroys an array of objects. +..signature:arrayDestruct(begin, end) +..param.begin:Iterator to the begin of the range that is to be destructed. +..param.end:Iterator behind the end of the range. +..remarks:This function does not deallocates the memory. +..see:Class.SimpleType +..see:Function.valueDestruct +*/ +template +inline void +_arrayDestruct_Default(TIterator1 begin_, + TIterator2 end_) +{ +SEQAN_CHECKPOINT + while (begin_ != end_) + { + valueDestruct(begin_); + ++begin_; + } +} +template +inline void +arrayDestruct(TIterator1 begin_, + TIterator2 end_) +{ +SEQAN_CHECKPOINT + _arrayDestruct_Default(begin_, end_); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayFill +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayFill: +..cat:Array Handling +..summary:Assigns one object to each element of a range. +..signature:arrayFill(begin, end, value) +..param.begin:Iterator to the begin of the range that is to be filled. +..param.end:Iterator behind the end of the range. +..param.value:Argument that is assigned to all $count$ objects in $array$. +..remarks:All objects $target_begin[0]$ to $target_begin[count-1]$ are set to $value$. +..see:Function.arrayCopy +..see:Function.arrayCopyForward +*/ +template +inline void +arrayFill(TIterator1 begin_, + TIterator2 end_, + TValue const & value) +{ +SEQAN_CHECKPOINT + ::std::fill_n(begin_, end_ - begin_, value); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayCopyForward +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayCopyForward: +..cat:Array Handling +..summary:Copies a range of objects into another range of objects starting from the first element. +..signature:arrayCopyForward(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source array. +..param.source_end:Iterator behind the last element of the source array. +...text:$source_end$ must have the same type as $source_begin$. +..param.target:Iterator to the first element of the target array. +...text:The target capacity should be at least as long as the source range. +..remarks.note:Be careful if source and target range overlap, because in this case + some source elements could be accidently overwritten before they are moved. +..remarks:If there is no need for the source elements to persist, consider to use +@Function.arrayMoveForward@ instead to improve performance. +..see:Class.SimpleType +*/ +template +inline void +_arrayCopyForward_Default(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + ::std::copy(source_begin, source_end, target_begin); +} +template +inline void +arrayCopyForward(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + _arrayCopyForward_Default(source_begin, source_end, target_begin); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayCopyBackward +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayCopyBackward: +..cat:Array Handling +..summary:Copies a range of objects into another range of objects starting from the last element. +..signature:arrayCopyBackward(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source array. +..param.source_end:Iterator behind the last element of the source array. +...text:$source_end$ must have the same type as $source_begin$. +..param.target:Iterator to the first element of the target array. +...text:The target capacity should be at least as long as the source range. +..remarks.note:Be careful if source and target range overlap, because in this case + some source elements could be accidently overwritten before they are moved. +..remarks.text:If source and target do not overlap, consider to use the function +@Function.arrayCopyForward@ instead that is faster in some cases. +..remarks:If there is no need for the source elements to persist, consider to use +@Function.arrayMoveBackward@ instead to improve performance. +..remarks.note:The semantic of this function's argument $target$ differ from the arguments of $::std::copy_backward$. +..see:Function.arrayCopyForward +..see:Class.SimpleType +*/ +template +inline void +_arrayCopyBackward_Default(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + ::std::copy_backward(source_begin, source_end, target_begin + (source_end - source_begin)); +} +template +inline void +arrayCopyBackward(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + _arrayCopyBackward_Default(source_begin, source_end, target_begin); +} + + +////////////////////////////////////////////////////////////////////////////// +//arrayCopy +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayCopy: +..cat:Array Handling +..summary:Copies a range of objects into another range of objects. +..signature:arrayCopy(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source range. +..param.source_end:Iterator behind the last element of the source range. +...text:$source_end$ must have the same type as $source_begin$. +..param.target:Iterator to the first element of the target range. +...text:The target capacity should be at least as long as the source range. +..remarks.text:If source and target range do not overlap, consider to use + @Function.arrayCopyForward@ instead to improve performance. +..remarks:If there is no need for the source elements to persist, consider to use + @Function.arrayMoveForward@ instead to improve performance. +..DISABLED.remarks.note:Be careful if source and target range overlap and the size of the + source elements differ from the size of target elements, because in this case + some source elements could be accidently overwritten before they are moved. +..see:Function.arrayCopyForward +..see:Function.arrayCopyBackward +..see:Class.SimpleType +*/ +template +inline void arrayCopy(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ + if ((void *) source_begin >= (void *) target_begin) + { +SEQAN_CHECKPOINT + arrayCopyForward(source_begin, source_end, target_begin); + } + else + { +SEQAN_CHECKPOINT + arrayCopyBackward(source_begin, source_end, target_begin); + } +} + +////////////////////////////////////////////////////////////////////////////// +//arrayMoveForward +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayMoveForward: +..cat:Array Handling +..summary:Moves a range of objects into another range of objects starting from the first element. +..signature:arrayMoveForward(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source array. +..param.source_end:Iterator behind the last element of the source array. +...text:$source_end$ must have the same type as $source_begin$. +..param.target:Iterator to the first element of the target array. +...text:The target capacity should be at least as long as the source range. +..remarks:The function possibly clears (but does not destroy) the source elements. + If source elements must persist, consider to use @Function.arrayCopyForward@ instead. +..remarks.note:Be careful if source and target range overlap, because in this case + some source elements could be accidently overwritten before they are moved. +..see:Function.arrayCopyForward +..see:Class.SimpleType +*/ +template +inline void +_arrayMoveForward_Default(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + while (source_begin != source_end) + { + move(*target_begin, *source_begin); + ++source_begin; + ++target_begin; + } +} +template +inline void +arrayMoveForward(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + _arrayMoveForward_Default(source_begin, source_end, target_begin); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayMoveBackward +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayMoveBackward: +..cat:Array Handling +..summary:Moves a range of objects into another range of objects starting from the last element. +..signature:arrayMoveBackward(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source array. +..param.source_end:Iterator behind the last element of the source array. +...text:$source_end$ must have the same type as $source_begin$. +..param.target:Iterator to the first element of the target array. +...text:The target capacity should be at least as long as the source range. +..remarks:The function possibly clears (but does not destroy) the source elements. + If source elements must persist, consider to use @Function.arrayCopyBackward@ instead. +..remarks.note:Be careful if source and target range overlap, because in this case + some source elements could be accidently overwritten before they are moved. +..remarks.text:If source and target do not overlap, consider to use the function +@Function.arrayMoveForward@ instead that is faster in some cases. +..remarks.note:The semantic of this function's argument $target$ differ from the arguments of $::std::copy_backward$. +..see:Function.arrayMoveForward +..see:Function.arrayCopyBackward +..see:Class.SimpleType +*/ +template +inline void +_arrayMoveBackward_Default(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + target_begin += (source_end - source_begin); + while (source_end != source_begin) + { + --source_end; + --target_begin; + move(*target_begin, *source_end); + } +} +template +inline void +arrayMoveBackward(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ +SEQAN_CHECKPOINT + _arrayMoveBackward_Default(source_begin, source_end, target_begin); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayMove +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayMove: +..cat:Array Handling +..summary:Moves a range of objects into another range of objects. +..signature:arrayMove(source_begin, source_end, target) +..param.source_begin:Iterator to the first element of the source range. +..param.source_end:Iterator behind the last element of the source range. +...text:$source_end$ must have the same type as $source_begin$. +..param.target:Iterator to the first element of the target range. +...text:The target capacity should be at least as long as the source range. +..remarks:The function possibly clears (but does not destroy) the source elements. + If source elements must persist, consider to use @Function.arrayCopy@ instead. +..remarks.text:If source and target range do not overlap, consider to use + @Function.arrayMoveForward@ instead to improve performance. +..DISABLED.remarks.note:Be careful if source and target range overlap and the size of the + source elements differ from the size of target elements, because in this case + some source elements could be accidently overwritten before they are moved. +..remarks.note:Don't confuse this function with the standard $move$ function that +resembles @Function.arrayCopy@. +..see:Function.arrayMoveForward +..see:Function.arrayMoveBackward +..see:Function.arrayCopy +..see:Class.SimpleType +*/ +template +inline void +arrayMove(TSource1 source_begin, + TSource2 source_end, + TTarget target_begin) +{ + if ((void *) source_begin >= (void *) target_begin) + { +SEQAN_CHECKPOINT + arrayMoveForward(source_begin, source_end, target_begin); + } + else + { +SEQAN_CHECKPOINT + arrayMoveBackward(source_begin, source_end, target_begin); + } +} + +////////////////////////////////////////////////////////////////////////////// +//arrayClearSpace +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.arrayClearSpace: +..cat:Array Handling +..summary:Destroys the begin of an array and keeps the rest. +..signature:arrayClearSpace(arr_begin, arr_length, keep_from, move_to) +..param.arr_begin:Pointer to the first element of the array. +..param.arr_length:Length of the array. +..param.keep_from:Offset of the first object that will be kept. +..param.move_to:Offset the first kept object will get at the end of the function. +..remarks.text:The objects $arr[keep_from]$ to $arr[arr_length-1]$ +are moved to the area beginning at positions $move_to$. +All objects in $arr[0]$ to $arr[keep_from-1]$ are destroyed. +After this function, the first $move_to$ positions of the array +are free and dont contain objects. +..remarks.text:The array must have at least enough space to store $arr_length + move_to - keep_from$ objects. +..see:Function.arrayCopy +..see:Function.arrayDestruct +..see:Function.arrayCopyForward +..see:Class.SimpleType +*/ +template +void _arrayClearSpace_Default(TIterator array_begin, + size_t array_length, + size_t keep_from, + size_t move_to) +{ + if (keep_from == array_length) + { + arrayDestruct(array_begin, array_begin + array_length); + return; + } + + SEQAN_ASSERT(keep_from < array_length) + + if (keep_from == move_to) + { + arrayDestruct(array_begin, array_begin + move_to); + } + else if (keep_from < move_to) + { + if (array_length > move_to) + { +SEQAN_CHECKPOINT + size_t middle = array_length - (move_to - keep_from); + arrayConstructMove(array_begin + middle, array_begin + array_length, array_begin + array_length); + arrayMove(array_begin + keep_from, array_begin + middle, array_begin + move_to); + arrayDestruct(array_begin, array_begin + move_to); + } + else + { +SEQAN_CHECKPOINT + arrayConstructMove(array_begin + keep_from, array_begin + array_length, array_begin + move_to); + arrayDestruct(array_begin, array_begin + array_length); + } + } + else + { +SEQAN_CHECKPOINT + arrayMove(array_begin + keep_from, array_begin + array_length, array_begin + move_to); + arrayDestruct(array_begin, array_begin + move_to); + arrayDestruct(array_begin + array_length - (keep_from - move_to), array_begin + array_length); + } +} + +template +void arrayClearSpace(TIterator array_begin, + size_t array_length, + size_t keep_from, + size_t move_to) +{ + _arrayClearSpace_Default(array_begin, array_length, keep_from, move_to); +} + + +////////////////////////////////////////////////////////////////////////////// +//BitsPerValue +////////////////////////////////////////////////////////////////////////////// +/** +.Metafunction.BitsPerValue: +..summary:Number of bits needed to store a value. +..signature:BitsPerValue::VALUE +..param.T:A class. +..returns.param.VALUE:Number of bits needed to store $T$. +...default:$sizeof * 8$ +..see:Metafunction.ValueSize +*/ +template +struct BitsPerValue +{ + enum { VALUE = sizeof(TValue) * 8 }; +}; +template +struct BitsPerValue: + public BitsPerValue {}; + +////////////////////////////////////////////////////////////////////////////// +//ValueSize +////////////////////////////////////////////////////////////////////////////// +/** +.Metafunction.ValueSize: +..summary:Number of different values a value type object can have. +..signature:ValueSize::VALUE +..param.T:A class. +..returns.param.VALUE:Value size of $T$. +..remarks +...text:This function is only defined for integral types like $unsigned int$, $double$ or @Spec.Dna@. +..see:Metafunction.Value +*/ +template +struct ValueSize +{ + enum { VALUE = 1 << BitsPerValue::VALUE }; +}; +template +struct ValueSize: + public ValueSize {}; + + + +template < typename T > +struct _SupremumValueUnsigned { static const T VALUE; }; +template < typename T > +struct _SupremumValueSigned { static const T VALUE; }; + +template < typename T > +struct _InfimumValueUnsigned { static const T VALUE; }; +template < typename T > +struct _InfimumValueSigned { static const T VALUE; }; + + + +template < typename T > +const T _SupremumValueUnsigned::VALUE = ~(T)0; +template < typename T > +const T _SupremumValueSigned::VALUE = ( (((T)1 << (BitsPerValue::VALUE - 2)) - 1) << 1) + 1; + +template < typename T > +const T _InfimumValueUnsigned::VALUE = 0; +template < typename T > +const T _InfimumValueSigned::VALUE = ~(T)_SupremumValueSigned::VALUE; + + + +template < + typename T, + typename TParent = typename IF< + TYPECMP< typename _MakeSigned::Type, T >::VALUE, + _SupremumValueSigned, + _SupremumValueUnsigned >::Type > +struct SupremumValue: + public TParent +{ +}; + +template < + typename T, + typename TParent = typename IF< + TYPECMP< typename _MakeSigned::Type, T >::VALUE, + _InfimumValueSigned, + _InfimumValueUnsigned >::Type > +struct InfimumValue: + public TParent +{ +}; + +////////////////////////////////////////////////////////////////////////////// +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_alphabet_interface2.h b/SeqAn-1.1/seqan/basic/basic_alphabet_interface2.h new file mode 100644 index 0000000..d523e2b --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_alphabet_interface2.h @@ -0,0 +1,178 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_alphabet_interface2.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALPHABET_INTERFACE2_H +#define SEQAN_HEADER_BASIC_ALPHABET_INTERFACE2_H + +#include + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// +// gapValue, gapValueImpl +////////////////////////////////////////////////////////////////////////////// +/** +.Function.gapValueImpl: +..hidefromindex +..cat:Alphabets +..summary:Implements @Function.gapValue@. +..signature:gapValueImpl(value_pointer_tag) +..param.value_pointer_tag:A pointer that is used as a tag to specify the value type. +...remarks:The pointer needs not to point to a valid object, so it is possible to use a null pointer here. +..returns:A gap character. +..remarks.text:This function implements @Function.getValue@. +It is recommended to use @Function.gapValue@ rather than $gapValueImpl$. +*/ + +template +inline T const & +gapValueImpl(T *) +{ +SEQAN_CHECKPOINT + static T const _gap = T(); + return _gap; +} + + +/** +.Function.gapValue: +..cat:Alphabets +..cat:Alignments +..summary:Returns reference to a value that is used as gap character. +..signature:gapValue() +..param.TValue:Value type. +..returns:A gap character. +..remarks.text:The function is implemented in @Function.gapValueImpl@. +Do not specialize $gapValue$, specialize @Function.gapValueImpl@ instead! +..see:Function.gapValueImpl +*/ + +template +inline T const & +gapValue() +{ +SEQAN_CHECKPOINT + T * _tag = 0; + return gapValueImpl(_tag); +} + + +////////////////////////////////////////////////////////////////////////////// +// supremumValue, supremumValueImpl +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.supremumValueImpl: +..hidefromindex +..cat:Alphabets +..summary:Implements @Function.supremumValue@. +..signature:supremumValueImpl(value_pointer_tag) +..param.value_pointer_tag:A pointer that is used as a tag to specify the value type. +...remarks:The pointer needs not to point to a valid object, so it is possible to use a null pointer here. +..returns:A value $inf$ that holds: $inf >= i$ for all values $i$. +..remarks.text:This function implements @Function.supremumValue@. +It is recommended to use @Function.supremumValue@ rather than $supremumValueImpl$. +*/ + +/* +template +inline T const & +supremumValueImpl(T *) +{ + static T const _value = -1; + return _value; +} +*/ + +/** +.Function.supremumValue: +..cat:Alphabets +..summary:Supremum for a given type. +..signature:supremumValue() +..param.T:An ordered type. +..returns:A value $inf$ that holds: $inf >= i$ for all values $i$ of type $T$. +..remarks.text:The function is implemented in @Function.supremumValueImpl@. +Do not specialize $supremumValue$, specialize @Function.supremumValueImpl@ instead! +..see:Function.supremumValueImpl +*/ + +template +inline T const & +supremumValue() +{ +SEQAN_CHECKPOINT + T * _tag = 0; + return supremumValueImpl(_tag); +} + +////////////////////////////////////////////////////////////////////////////// +// infimumValue, infimumValueImpl +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.infimumValueImpl: +..hidefromindex +..cat:Alphabets +..summary:Implements @Function.infimumValue@. +..signature:infimumValueImpl(value_pointer_tag) +..param.value_pointer_tag:A pointer that is used as a tag to specify the value type. +...remarks:The pointer needs not to point to a valid object, so it is possible to use a null pointer here. +..returns:A value $inf$ that holds: $inf <= i$ for all values $i$. +..remarks.text:This function implements @Function.infimumValue@. +It is recommended to use @Function.infimumValue@ rather than $infimumValueImpl$. +*/ + +/* +template +inline T const & +infimumValueImpl(T *) +{ + static T const _value = -1; + return _value; +} +*/ + +/** +.Function.infimumValue: +..cat:Alphabets +..summary:Infimum for a given type. +..signature:infimumValue() +..param.T:An ordered type. +..returns:A value $inf$ that holds: $inf <= i$ for all values $i$ of type $T$. +..remarks.text:The function is implemented in @Function.infimumValueImpl@. +Do not specialize $infimumValue$, specialize @Function.infimumValueImpl@ instead! +..see:Function.infimumValueImpl +..see:Function.supremumValue +*/ + +template +inline T const & +infimumValue() +{ +SEQAN_CHECKPOINT + T * _tag = 0; + return infimumValueImpl(_tag); +} + +////////////////////////////////////////////////////////////////////////////// +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_alphabet_simple.h b/SeqAn-1.1/seqan/basic/basic_alphabet_simple.h new file mode 100644 index 0000000..9703666 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_alphabet_simple.h @@ -0,0 +1,1296 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_alphabet_simple.h,v 1.1 2008/08/25 16:20:02 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALPHABET_SIMPLE_H +#define SEQAN_HEADER_BASIC_ALPHABET_SIMPLE_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// +//Class that is used for various simple value types +////////////////////////////////////////////////////////////////////////////// + +/** +.Class.SimpleType: +..cat:Basic +..summary:Implementation for "simple" types. +..signature:SimpleType +..param.TValue:Type that stores the values of an instance. +...remarks:TValue must be a simple type. +...metafunction:Metafunction.Value +..param.TSpec:Specialization tag. +...metafunction:Metafunction.Spec +..remarks: +...text:A "simple type" is a C++ type that can be constructed without constructor, +destructed without destructor and copied without copy constructor or assignment operator. +All basic types (like $char$, $int$ or $float$) are simple. Pointers, references and arrays of +simple types are simple. +POD types ("plain old data types"), that are - simplified spoken - C++-types that already existed in C, +are simple too. +...text:Arrays of simple types can be copied very fast by memory manipulation routines, +but the default implementation of functions like @Function.arrayCopyForward@ and @Function.arrayCopy@ +are not optimized for simple types this way. +But for classes derived from $SimpleType$, optimized variants of array manipulation functions are applied. +...text:Note that simple types need not to be derived or specialized from $SimpleType$, but +it could be convenient to do so. +..implements:Concept.Simple Type +*/ +template +struct SimpleType +{ +//____________________________________________________________________________ + + TValue value; + +//____________________________________________________________________________ + + SimpleType() + { +SEQAN_CHECKPOINT + } + +//____________________________________________________________________________ + + SimpleType(SimpleType const & other) + { +SEQAN_CHECKPOINT + assign(*this, other); + } + + template + SimpleType(T const & other) + { +SEQAN_CHECKPOINT + assign(*this, other); + } + + +//____________________________________________________________________________ + + SimpleType & operator=(SimpleType const & other) + { +SEQAN_CHECKPOINT + assign(*this, other); + return *this; + } + template + SimpleType & operator=(T const & other) + { +SEQAN_CHECKPOINT + assign(*this, other); + return *this; + } +//____________________________________________________________________________ + + ~SimpleType() + { +SEQAN_CHECKPOINT + } +//____________________________________________________________________________ + + //this cannot be a template since a template would be in conflict to + //the template c'tor + + + operator long() const + { +SEQAN_CHECKPOINT + long c; + assign(c, *this); + return c; + } + operator unsigned long() const + { +SEQAN_CHECKPOINT + unsigned long c; + assign(c, *this); + return c; + } + operator int() const + { +SEQAN_CHECKPOINT + int c; + assign(c, *this); + return c; + } + operator unsigned int() const + { +SEQAN_CHECKPOINT + unsigned int c; + assign(c, *this); + return c; + } + operator short() const + { +SEQAN_CHECKPOINT + short c; + assign(c, *this); + return c; + } + operator unsigned short() const + { +SEQAN_CHECKPOINT + unsigned short c; + assign(c, *this); + return c; + } + operator char() const + { +SEQAN_CHECKPOINT + char c; + assign(c, *this); + return c; + } + operator signed char() const + { +SEQAN_CHECKPOINT + signed char c; + assign(c, *this); + return c; + } + operator unsigned char() const + { +SEQAN_CHECKPOINT + unsigned char c; + assign(c, *this); + return c; + } + +//____________________________________________________________________________ +}; + +////////////////////////////////////////////////////////////////////////////// +// METAFUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.IsSimple.param.T.type:Class.SimpleType + +template +struct IsSimple > +{ + typedef True Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Value.param.T.type:Class.SimpleType +template +struct Value > +{ + typedef TValue Type; +}; + +template +struct Value const > +{ + typedef TValue const Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Spec.param.T.type:Class.SimpleType +template +struct Spec > +{ + typedef TSpec Type; +}; + +template +struct Spec const > +{ + typedef TSpec Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +template +struct Iterator, Standard> +{ + typedef SimpleType * Type; +// typedef Iter, SimpleIterator> * Type; +}; + +template +struct Iterator const, Standard> +{ + typedef SimpleType const * Type; +// typedef Iter const, SimpleIterator> * Type; +}; + + +////////////////////////////////////////////////////////////////////////////// +// FUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +template +inline typename _RemoveConst::Type +convertImpl(Convert const, + SimpleType const & source_) +{ +SEQAN_CHECKPOINT + typename _RemoveConst::Type target_; + assign(target_, source_); + return target_; +} + + + +////////////////////////////////////////////////////////////////////////////// + +template +inline TStream & +operator << (TStream & stream, + SimpleType const & data) +{ +SEQAN_CHECKPOINT + stream << convert(data); + return stream; +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline TStream & +operator >> (TStream & stream, + SimpleType & data) +{ +SEQAN_CHECKPOINT + char c; + stream >> c; + assign(data, c); + return stream; +} + +////////////////////////////////////////////////////////////////////////////// +// assign +////////////////////////////////////////////////////////////////////////////// + +///.Function.assign.param.target.type:Class.SimpleType +///.Function.assign.param.source.type:Class.SimpleType + + +template +inline void +assign(SimpleType & target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + target.value = source.value; +} +template +inline void +assign(SimpleType & target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + target.value = source.value; +} + +//____________________________________________________________________________ + +template +inline void +assign(SimpleType & target, + TSource & source) +{ +SEQAN_CHECKPOINT + target.value = source; +} +template +inline void +assign(SimpleType & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + target.value = source; +} + +//____________________________________________________________________________ +// Assign Proxy to SimpleType +//??? Diese Funktionen wurden noetig wegen eines seltsamen VC++-Verhaltens + +template +inline void +assign(SimpleType & target, + Proxy & source) +{ +SEQAN_CHECKPOINT + target.value = getValue(source); +} + +template +inline void +assign(SimpleType & target, + Proxy const & source) +{ +SEQAN_CHECKPOINT + target.value = getValue(source); +} + +//____________________________________________________________________________ +//INTEGRAL TYPES +//note: it is not possible to write a single function here since "assign" +//must be specialized for the first argument at the first place + +//int +template +inline void +assign(int & c_target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} +template +inline void +assign(int & c_target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} + +//unsigned int +template +inline void +assign(unsigned int & c_target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} +template +inline void +assign(unsigned int & c_target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} + +//short +template +inline void +assign(short & c_target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} +template +inline void +assign(short & c_target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} + +//unsigned short +template +inline void +assign(unsigned short & c_target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} +template +inline void +assign(unsigned short & c_target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} + +//char +template +inline void +assign(char & c_target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} +template +inline void +assign(char & c_target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} + +//signed char +template +inline void +assign(signed char & c_target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} +template +inline void +assign(signed char & c_target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} + +//unsigned char +template +inline void +assign(unsigned char & c_target, + SimpleType & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} +template +inline void +assign(unsigned char & c_target, + SimpleType const & source) +{ +SEQAN_CHECKPOINT + c_target = source.value; +} + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +// CompareType +////////////////////////////////////////////////////////////////////////////// + +/**.Metafunction.CompareType: +..summary:Type to convert other types for comparisons. +..signature:CompareType::Type +..param.TLeft:Type of the left operand of a comparison. +..param.TRight:Type of the right operand of a comparison. +..return.Type:The Type in which the arguments are converted in order to compare them. +..remarks:Comparisons are for example operators like $==$ or $<$. +..remarks.text:Note that there is no rule that guarantees that $CompareType::Type$ +is the same as $CompareType::Type$. It is also possible, that only one of these +two types is defined. +..remarks.text:This metafunction is used for the implementation of +comparisons that involve @Class.SimpleType@. +*/ +//???TODO: muss geprueft werden, ob diese Metafunktion noch ausgeweitet oder aber versteckt wird. + +template +struct CompareType; + +template +struct CompareType +{ + typedef T Type; +}; + +//____________________________________________________________________________ + +template +struct CompareType, TRight> +{ + typedef TRight Type; +}; + +////////////////////////////////////////////////////////////////////////////// +// operator == + +template +inline bool +operator == (SimpleType const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} + +template +inline bool +operator == (TLeft const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} + +template +inline bool +operator == (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} + +template +inline bool +operator == (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + return convert(left_) == convert(right_); +} + + +template +inline bool +operator == (Proxy const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} +template +inline bool +operator == (SimpleType const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} + + +//____________________________________________________________________________ +// operator != + +template +inline bool +operator != (SimpleType const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} + +template +inline bool +operator != (TLeft const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} + +template +inline bool +operator != (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} + +template +inline bool +operator != (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + return convert(left_) != convert(right_); +} + + +template +inline bool +operator != (Proxy const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} +template +inline bool +operator != (SimpleType const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} + + +//____________________________________________________________________________ +// operator < + +template +inline bool +operator < (SimpleType const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} + +template +inline bool +operator < (TLeft const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} + +template +inline bool +operator < (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} + +template +inline bool +operator < (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + return convert(left_) < convert(right_); +} + + +template +inline bool +operator < (Proxy const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} +template +inline bool +operator < (SimpleType const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} + + +//____________________________________________________________________________ +// operator <= + +template +inline bool +operator <= (SimpleType const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} + +template +inline bool +operator <= (TLeft const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} + +template +inline bool +operator <= (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} + +template +inline bool +operator <= (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + return convert(left_) <= convert(right_); +} + + +template +inline bool +operator <= (Proxy const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} +template +inline bool +operator <= (SimpleType const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} + + + +//____________________________________________________________________________ +// operator > + +template +inline bool +operator > (SimpleType const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} + +template +inline bool +operator > (TLeft const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} + +template +inline bool +operator > (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} + +template +inline bool +operator > (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + return convert(left_) > convert(right_); +} + + +template +inline bool +operator > (Proxy const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} +template +inline bool +operator > (SimpleType const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} + + +//____________________________________________________________________________ +// operator >= + +template +inline bool +operator >= (SimpleType const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} + +template +inline bool +operator >= (TLeft const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} + +template +inline bool +operator >= (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} + +template +inline bool +operator >= (SimpleType const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + return convert(left_) >= convert(right_); +} + + +template +inline bool +operator >= (Proxy const & left_, + SimpleType const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef SimpleType TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} +template +inline bool +operator >= (SimpleType const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef SimpleType TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} + + +////////////////////////////////////////////////////////////////////////////// + +template +inline +bool lexLess(SimpleType<_T, TSpec> const &_Left, SimpleType<_T, TSpec> const &_Right) +{ // return lexicographical _Left < _Right + typedef typename _MakeUnsigned<_T>::Type TUnsigned; + return (TUnsigned)(_Left.value) < (TUnsigned)(_Right.value); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline SimpleType & +operator ++ (SimpleType & me) +{ + ++me.value; + return me; +} +template +inline SimpleType +operator ++ (SimpleType & me, + int) +{ + SimpleType dummy = me; + ++me.value; + return dummy; +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline SimpleType & +operator -- (SimpleType & me) +{ + --me.value; + return me; +} +template +inline SimpleType +operator -- (SimpleType & me, + int) +{ + SimpleType dummy = me; + --me.value; + return dummy; +} + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +/** +.Spec.Dna: +..cat:Alphabets +..summary:Alphabet for DNA. +..general:Class.SimpleType +..signature:Dna +..remarks: +...text:The @Metafunction.ValueSize@ of $Dna$ is 4. +The nucleotides are enumerated this way: $'A' = 0, 'C' = 1, 'G' = 2, 'T' = 3$. +...text:Objects of type $Dna$ can be converted to various other types and vice versa. +An object that has a value not in ${'A', 'C', 'G', 'T'}$ is converted to $'A'$. +...text:$Dna$ is typedef for $SimpleType$, while $_Dna$ is a helper +specialization tag class. +..see:Metafunction.ValueSize +..see:Spec.Dna5 +*/ +struct _Dna {}; +typedef SimpleType Dna; + +template <> struct ValueSize< Dna > { enum { VALUE = 4 }; }; +template <> struct BitsPerValue< Dna > { enum { VALUE = 2 }; }; + +//____________________________________________________________________________ + +/** +.Spec.Dna5: +..cat:Alphabets +..summary:Alphabet for DNA including 'N' character. +..general:Class.SimpleType +..signature:Dna5 +..remarks: +...text:The @Metafunction.ValueSize@ of $Dna5$ is 5. +The nucleotides are enumerated this way: $'A' = 0, 'C' = 1, 'G' = 2, 'T' = 3$. +The 'N' character ("unkown nucleotide") is encoded by 4. +...text:Objects of type $Dna5$ can be converted to various other types and vice versa. +An object that has a value not in ${'A', 'C', 'G', 'T'}$ is converted to $'N'$. +...text:$Dna5$ is typedef for $SimpleType$, while $_Dna5$ is a helper +specialization tag class. +..see:Metafunction.ValueSize +*/ +struct _Dna5 {}; +typedef SimpleType Dna5; + +template <> struct ValueSize< Dna5 > { enum { VALUE = 5 }; }; +template <> struct BitsPerValue< Dna5 > { enum { VALUE = 3 }; }; + +//____________________________________________________________________________ + +/** +.Spec.Iupac: +..cat:Alphabets +..summary:Iupac code for DNA. +..general:Class.SimpleType +..signature:Iupac +..remarks: +...text:The @Metafunction.ValueSize@ of $Iupac$ is 16. +The nucleotides are enumerated from 0 to 15 in this order: +'U'=0, 'T', 'A', 'W', 'C', 'Y', 'M', 'H', 'G', 'K', 'R', 'D', 'S', 'B', 'V', 'N'=15. +...text:Objects of type $Iupac$ can be converted to various other types and vice versa. +Unkown values are converted to $'N'$. +...text:$Iupac$ is typedef for $SimpleType$, while $_Iupac$ is a helper +specialization tag class. +..see:Metafunction.ValueSize +*/ +struct _Iupac {}; +typedef SimpleType Iupac; + +template <> struct ValueSize< Iupac > { enum { VALUE = 16 }; }; +template <> struct BitsPerValue< Iupac > { enum { VALUE = 4 }; }; + + +//____________________________________________________________________________ + +/** +.Spec.AminoAcid: +..cat:Alphabets +..summary:Iupac code for amino acids. +..general:Class.SimpleType +..signature:AminoAcid +..remarks: +...text:The @Metafunction.ValueSize@ of $AminoAcid$ is 24. +...text:The amino acids are enumerated from 0 to 15 in this order: +...text:'A'=0, 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V'=19. +...text:The remaining 4 symbols are: +...text: 'B'=20 (Aspartic Acid, Asparagine), 'Z'=21 (Glutamic Acid, Glutamine), 'X'=22 (unknown), '*'=23 (terminator) +...text:Objects of type $AminoAcid$ can be converted to $char$ and vice versa. +Unkown values are converted to $'X'$. +...text:$AminoAcid$ is typedef for $SimpleType$, while $_AminoAcid$ is a helper +specialization tag class. +..see:Metafunction.ValueSize +*/ +struct _AminoAcid {}; +typedef SimpleType AminoAcid; + +template <> struct ValueSize< AminoAcid > { enum { VALUE = 24 }; }; +template <> struct BitsPerValue< AminoAcid > { enum { VALUE = 5 }; }; + +////////////////////////////////////////////////////////////////////////////// +//ASCII + +inline void assign(Ascii & c_target, + Dna const & source) +{ +SEQAN_CHECKPOINT + c_target = _Translate_Table_Dna5_2_Ascii<>::VALUE[source.value]; +} +//____________________________________________________________________________ + +inline void assign(Ascii & c_target, + Dna5 const & source) +{ +SEQAN_CHECKPOINT + c_target = _Translate_Table_Dna5_2_Ascii<>::VALUE[source.value]; +} +//____________________________________________________________________________ + +inline void assign(Ascii & c_target, Iupac const & source) +{ +SEQAN_CHECKPOINT + c_target = _Translate_Table_Iupac_2_Ascii<>::VALUE[source.value]; +} +//____________________________________________________________________________ + +inline void assign(Ascii & c_target, AminoAcid const & source) +{ +SEQAN_CHECKPOINT + c_target = _Translate_Table_AA_2_Ascii<>::VALUE[source.value]; +} + +////////////////////////////////////////////////////////////////////////////// +//DNA (4 letters) + +template <> +struct CompareType { typedef Dna Type; }; +inline void assign(Dna & target, Byte c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Byte_2_Dna<>::VALUE[c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna Type; }; +inline void assign(Dna & target, Ascii c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_Dna<>::VALUE[(unsigned char)c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna Type; }; +inline void assign(Dna & target, Unicode c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_Dna<>::VALUE[(unsigned char) c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna Type; }; +inline void assign(Dna & target, Dna5 const & c_source) +{ +SEQAN_CHECKPOINT + target.value = c_source.value & 0x03; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna Type; }; +inline void assign(Dna & target, Iupac const & source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Iupac_2_Dna<>::VALUE[source.value]; +} + +////////////////////////////////////////////////////////////////////////////// +//DNA (5 letters) + +template <> +struct CompareType { typedef Dna5 Type; }; +inline void assign(Dna5 & target, Byte c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Byte_2_Dna5<>::VALUE[c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna5 Type; }; +inline void assign(Dna5 & target, Ascii c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_Dna5<>::VALUE[(unsigned char) c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna5 Type; }; +inline void assign(Dna5 & target, Unicode c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_Dna5<>::VALUE[(unsigned char) c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna5 Type; }; +inline void assign(Dna5 & target, Iupac const & source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Iupac_2_Dna5<>::VALUE[source.value]; +} + +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Dna Type; }; +inline void assign(Dna5 & target, Dna const & c_source) +{ +SEQAN_CHECKPOINT + target.value = c_source.value; +} + +////////////////////////////////////////////////////////////////////////////// +//IUPAC (4 bits) + +template <> +struct CompareType { typedef Iupac Type; }; +inline void assign(Iupac & target, Byte c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Byte_2_Iupac<>::VALUE[c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Iupac Type; }; +inline void assign(Iupac & target, Ascii c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_Iupac<>::VALUE[(unsigned char) c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef Iupac Type; }; +inline void assign(Iupac & target, Unicode c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_Iupac<>::VALUE[(unsigned char) c_source]; +} +//____________________________________________________________________________ + +inline void assign(Iupac & target, Dna const & source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Dna5_2_Iupac<>::VALUE[source.value]; +} +//____________________________________________________________________________ + +inline void assign(Iupac & target, Dna5 const & source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Dna5_2_Iupac<>::VALUE[source.value]; +} + +////////////////////////////////////////////////////////////////////////////// +//Amino Acid (5 bits) + +template <> +struct CompareType { typedef AminoAcid Type; }; +inline void assign(AminoAcid & target, Byte c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Byte_2_AA<>::VALUE[c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef AminoAcid Type; }; +inline void assign(AminoAcid & target, Ascii c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_AA<>::VALUE[(unsigned char) c_source]; +} +//____________________________________________________________________________ + +template <> +struct CompareType { typedef AminoAcid Type; }; +inline void assign(AminoAcid & target, Unicode c_source) +{ +SEQAN_CHECKPOINT + target.value = _Translate_Table_Ascii_2_AA<>::VALUE[(unsigned char) c_source]; +} + +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_alphabet_simple_tabs.h b/SeqAn-1.1/seqan/basic/basic_alphabet_simple_tabs.h new file mode 100644 index 0000000..6a82ad9 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_alphabet_simple_tabs.h @@ -0,0 +1,439 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_alphabet_simple_tabs.h,v 1.1 2008/08/25 16:20:02 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALPHABET_SIMPLE_TABS_H +#define SEQAN_HEADER_BASIC_ALPHABET_SIMPLE_TABS_H + + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// + +//use same tables for Dna + +template +struct _Translate_Table_Dna5_2_Ascii +{ + static char const VALUE[5]; +}; +template +char const _Translate_Table_Dna5_2_Ascii::VALUE[5] = {'A', 'C', 'G', 'T', 'N'}; + +//____________________________________________________________________________ + +template +struct _Translate_Table_Dna5_2_Iupac +{ + static char const VALUE[5]; +}; +template +char const _Translate_Table_Dna5_2_Iupac::VALUE[5] = {0x02, 0x04, 0x08, 0x01, 0x0f}; + +//____________________________________________________________________________ + +template +struct _Translate_Table_Iupac_2_Ascii +{ + static char const VALUE[16]; +}; +template +char const _Translate_Table_Iupac_2_Ascii::VALUE[16] = +{ + 'U', //0000=0 + 'T', //0001=1 //T=1: change between U and T is just inc/dec + 'A', //0010=2 + 'W', //0011=3 TA + 'C', //0100=4 + 'Y', //0101=5 TC (pyrimidine) + 'M', //0110=6 AC + 'H', //0111=7 not-G + 'G', //1000=8 + 'K', //1001=9 TG + 'R', //1010=A AG (purine) + 'D', //1011=B not-C + 'S', //1100=C CG + 'B', //1101=D non-A + 'V', //1110=E non-T + 'N' //1111=F any +}; + +//____________________________________________________________________________ + +template +struct _Translate_Table_Iupac_2_Dna +{ + static char const VALUE[16]; +}; +template +char const _Translate_Table_Iupac_2_Dna::VALUE[16] = +{ + 3, //'U' + 3, //'T' + 0, //'A' + 0, //'W' = TA + 1, //'C' + 1, //'Y' = TC + 0, //'M' = AC + 0, //'H' = not-G + 2, //'G' + 2, //'K' = TG + 0, //'R' = AG + 0, //'D' = not-C + 1, //'S' = CG + 1, //'B' = non-A + 0, //'V' = non-T + 0 //'N' = any +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_Iupac_2_Dna5 +{ + static char const VALUE[16]; +}; +template +char const _Translate_Table_Iupac_2_Dna5::VALUE[16] = +{ + 3, //'U' + 3, //'T' + 0, //'A' + 4, //'W' = TA + 1, //'C' + 4, //'Y' = TC + 4, //'M' = AC + 4, //'H' = not-G + 2, //'G' + 4, //'K' = TG + 4, //'R' = AG + 4, //'D' = not-C + 4, //'S' = CG + 4, //'B' = non-A + 4, //'V' = non-T + 4 //'N' = any +}; + +//____________________________________________________________________________ + +template +struct _Translate_Table_Ascii_2_Dna +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Ascii_2_Dna::VALUE[256] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //1 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //2 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //3 + + 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, //4 +// , A, B, C, D, E, D, G, H, I, J, K, L, M, N, O, + + 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //5 +// P, Q, R, S, T, U, V, W, X, Y, Z, , , , , + + 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, //6 +// , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, + + 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //7 +// p, q, r, s, t, u, v, w, x, y, z, , , , , + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //8 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //9 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //10 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //11 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //12 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //13 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //14 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 //15 +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_Ascii_2_Dna5 +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Ascii_2_Dna5::VALUE[256] = +{ + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //0 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //1 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //2 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //3 + + 4, 0, 4, 1, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, //4 +// , A, B, C, D, E, D, G, H, I, J, K, L, M, N, O, + + 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //5 +// P, Q, R, S, T, U, V, W, X, Y, Z, , , , , + + 4, 0, 4, 1, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, //6 +// , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, + + 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //7 +// p, q, r, s, t, u, v, w, x, y, z, , , , , + + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //8 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //9 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //10 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //11 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //12 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //13 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 //15 +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_Ascii_2_Iupac +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Ascii_2_Iupac::VALUE[256] = +{ + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //0 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //1 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //2 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //3 + + 15, 2, 13, 4, 11, 15, 15, 8, 7, 15, 15, 9, 15, 6, 15, 15, //4 + // , A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, + + 15, 15, 10, 12, 1, 0, 14, 3, 15, 5, 15, 15, 15, 15, 15, 15, //5 + // P, Q, R, S, T, U, V, W, X, Y, Z, , , , , + + 15, 2, 13, 4, 11, 15, 15, 8, 7, 15, 15, 9, 15, 6, 15, 15, //6 + // , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, + + 15, 15, 10, 12, 1, 0, 14, 3, 15, 5, 15, 15, 15, 15, 15, 15, //7 + // p, q, r, s, t, u, v, w, x, y, z, , , , , + + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //8 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //9 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //10 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //11 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //12 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //13 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //14 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 //15 +}; + +//____________________________________________________________________________ + +template +struct _Translate_Table_Byte_2_Dna +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Byte_2_Dna::VALUE[256] = +{ + 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //1 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //2 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //3 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //4 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //5 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //6 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //7 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //8 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //9 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //10 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //11 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //12 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //13 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //14 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 //15 +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_Byte_2_Dna5 +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Byte_2_Dna5::VALUE[256] = { + 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //0 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //1 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //2 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //3 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //4 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //5 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //6 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //7 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //8 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //9 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //10 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //11 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //12 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //13 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //14 + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 //15 +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_Byte_2_Iupac +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Byte_2_Iupac::VALUE[256] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, //0 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //1 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //2 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //3 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //4 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //5 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //6 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //7 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //8 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //9 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //10 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //11 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //12 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //13 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //14 + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 //15 +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_AA_2_Ascii +{ + static char const VALUE[24]; +}; +template +char const _Translate_Table_AA_2_Ascii::VALUE[24] = +{ + 'A', // 0 Ala Alanine + 'R', // 1 Arg Arginine + 'N', // 2 Asn Asparagine + 'D', // 3 Asp Aspartic Acid + 'C', // 4 Cys Cystine + 'Q', // 5 Gln Glutamine + 'E', // 6 Glu Glutamic Acid + 'G', // 7 Gly Glycine + 'H', // 8 His Histidine + 'I', // 9 Ile Isoleucine + 'L', //10 Leu Leucine + 'K', //11 Lys Lysine + 'M', //12 Met Methionine + 'F', //13 Phe Phenylalanine + 'P', //14 Pro Proline + 'S', //15 Ser Serine + 'T', //16 Thr Threonine + 'W', //17 Trp Tryptophan + 'Y', //18 Tyr Tyrosine + 'V', //19 Val Valine + 'B', //20 Aspartic Acid, Asparagine + 'Z', //21 Glutamic Acid, Glutamine + 'X', //22 Unknown + '*' //23 Terminator +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_Ascii_2_AA +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Ascii_2_AA::VALUE[256] = +{ + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //0 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //1 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, 22, //2 +// * + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //3 + 22, 0, 20, 4, 3, 6, 13, 7, 8, 9, 22, 11, 10, 12, 2, 22, //4 +// , A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, + + 14, 5, 1, 15, 16, 22, 19, 17, 22, 18, 21, 22, 22, 22, 22, 22, //5 +// P, Q, R, S, T, U, V, W, X, Y, Z, , , , , , + + 22, 0, 20, 4, 3, 6, 13, 7, 8, 9, 22, 11, 10, 12, 2, 22, //6 +// , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, + + 14, 5, 1, 15, 16, 22, 19, 17, 22, 18, 21, 22, 22, 22, 22, 22, //7 +// p, q, r, s, t, u, v, w, x, y, z, , , , , , + + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //8 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //9 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //10 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //11 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //12 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //13 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //14 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 //15 +}; + +//____________________________________________________________________________ + + +template +struct _Translate_Table_Byte_2_AA +{ + static char const VALUE[256]; +}; +template +char const _Translate_Table_Byte_2_AA::VALUE[256] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, //0 + 16, 17, 18, 19, 20, 21, 22, 23, 22, 22, 22, 22, 22, 22, 22, 22, //1 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //2 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //3 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //4 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //5 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //6 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //7 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //8 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //9 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //10 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //11 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //12 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //13 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //14 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 //15 +}; + +////////////////////////////////////////////////////////////////////////////// + +}//namespace SEQAN_NAMESPACE_MAIN +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_alphabet_trait_basic.h b/SeqAn-1.1/seqan/basic/basic_alphabet_trait_basic.h new file mode 100644 index 0000000..024bf55 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_alphabet_trait_basic.h @@ -0,0 +1,733 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_alphabet_trait_basic.h,v 1.2 2009/02/19 01:51:23 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ALPHABET_TRAIT_BASIC_H +#define SEQAN_HEADER_BASIC_ALPHABET_TRAIT_BASIC_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// +//arrayConstruct +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayConstruct_Pointer(TIterator, + TIterator, + True) +{ +SEQAN_CHECKPOINT + //nothing to do +} +template +inline void +_arrayConstruct_Pointer(TIterator begin_, + TIterator end_, + False) +{ +SEQAN_CHECKPOINT + _arrayConstruct_Default(begin_, end_); +} +template +inline void +arrayConstruct(TValue * begin_, + TValue * end_) +{ +SEQAN_CHECKPOINT + _arrayConstruct_Pointer(begin_, end_, typename IsSimple::Type() ); +} + +//____________________________________________________________________________ + +template +inline void +_arrayConstruct_Pointer(TIterator begin_, + TIterator end_, + TParam const & param_, + True) +{ +SEQAN_CHECKPOINT + arrayFill(begin_, end_, param_); +} +template +inline void +_arrayConstruct_Pointer(TIterator begin_, + TIterator end_, + TParam const & param_, + False) +{ +SEQAN_CHECKPOINT + _arrayConstruct_Default(begin_, end_, param_); +} +template +inline void +arrayConstruct(TValue * begin_, + TValue * end_, + TParam const & param_) +{ +SEQAN_CHECKPOINT + _arrayConstruct_Pointer(begin_, end_, param_, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayConstructCopy +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayConstructCopy_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + True) +{ +SEQAN_CHECKPOINT + arrayCopyForward(source_begin, source_end, target_begin); +} +template +inline void +_arrayConstructCopy_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + False) +{ +SEQAN_CHECKPOINT + _arrayConstructCopy_Default(source_begin, source_end, target_begin); +} +template +inline void +arrayConstructCopy(TValue * source_begin, + TValue * source_end, + TValue * target_begin) +{ +SEQAN_CHECKPOINT + _arrayConstructCopy_Pointer(source_begin, source_end, target_begin, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayConstructMove +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayConstructMove_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + True) +{ +SEQAN_CHECKPOINT + arrayMoveForward(source_begin, source_end, target_begin); +} +template +inline void +_arrayConstructMove_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + False) +{ +SEQAN_CHECKPOINT + _arrayConstructMove_Default(source_begin, source_end, target_begin); +} +template +inline void +arrayConstructMove(TValue * source_begin, + TValue * source_end, + TValue * target_begin) +{ +SEQAN_CHECKPOINT + _arrayConstructMove_Pointer(source_begin, source_end, target_begin, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayDestruct +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayDestruct_Pointer(TValue * /*begin_*/, + TValue * /*end_*/, + True) +{ +SEQAN_CHECKPOINT + //do nothing +} +template +inline void +_arrayDestruct_Pointer(TValue * begin_, + TValue * end_, + False) +{ +SEQAN_CHECKPOINT + _arrayDestruct_Default(begin_, end_); +} +template +inline void +arrayDestruct(TValue * begin_, + TValue * end_) +{ +SEQAN_CHECKPOINT + _arrayDestruct_Pointer(begin_, end_, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayFill +////////////////////////////////////////////////////////////////////////////// + +//no specializiation for pointer to simple + +////////////////////////////////////////////////////////////////////////////// +//arrayCopyForward +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayCopyForward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + True) +{ +SEQAN_CHECKPOINT + memmove(target_begin, source_begin, (source_end - source_begin) * sizeof(TValue)); +} +template +inline void +_arrayCopyForward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + False) +{ +SEQAN_CHECKPOINT + _arrayCopyForward_Default(source_begin, source_end, target_begin); +} +template +inline void +arrayCopyForward(TValue * source_begin, + TValue * source_end, + TValue * target_begin) +{ +SEQAN_CHECKPOINT + _arrayCopyForward_Pointer(source_begin, source_end, target_begin, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayCopyBackward +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayCopyBackward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + True) +{ +SEQAN_CHECKPOINT + memmove(target_begin, source_begin, (source_end - source_begin) * sizeof(TValue)); +} +template +inline void +_arrayCopyBackward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + False) +{ +SEQAN_CHECKPOINT + _arrayCopyBackward_Default(source_begin, source_end, target_begin); +} +template +inline void +arrayCopyBackward(TValue * source_begin, + TValue * source_end, + TValue * target_begin) +{ +SEQAN_CHECKPOINT + _arrayCopyBackward_Pointer(source_begin, source_end, target_begin, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayMoveForward +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayMoveForward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + True) +{ +SEQAN_CHECKPOINT + memmove(target_begin, source_begin, (source_end - source_begin) * sizeof(TValue)); +} +template +inline void +_arrayMoveForward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + False) +{ +SEQAN_CHECKPOINT + _arrayMoveForward_Default(source_begin, source_end, target_begin); +} +template +inline void +arrayMoveForward(TValue * source_begin, + TValue * source_end, + TValue * target_begin) +{ +SEQAN_CHECKPOINT + _arrayMoveForward_Pointer(source_begin, source_end, target_begin, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayMoveBackward +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayMoveBackward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + True) +{ +SEQAN_CHECKPOINT + memmove(target_begin, source_begin, (source_end - source_begin) * sizeof(TValue)); +} +template +inline void +_arrayMoveBackward_Pointer(TValue * source_begin, + TValue * source_end, + TValue * target_begin, + False) +{ +SEQAN_CHECKPOINT + _arrayMoveBackward_Default(source_begin, source_end, target_begin); +} +template +inline void +arrayMoveBackward(TValue * source_begin, + TValue * source_end, + TValue * target_begin) +{ +SEQAN_CHECKPOINT + _arrayMoveBackward_Pointer(source_begin, source_end, target_begin, typename IsSimple::Type() ); +} + +////////////////////////////////////////////////////////////////////////////// +//arrayClearSpace +////////////////////////////////////////////////////////////////////////////// + +template +inline void +_arrayClearSpace_Pointer(TValue * array_begin, + size_t array_length, + size_t keep_from, + size_t move_to, + True) +{ + if (keep_from == move_to) return; +SEQAN_CHECKPOINT + arrayMove(array_begin + keep_from, array_begin + array_length, array_begin + move_to); +} +template +inline void +_arrayClearSpace_Pointer(TValue * array_begin, + size_t array_length, + size_t keep_from, + size_t move_to, + False) +{ + _arrayClearSpace_Default(array_begin, array_length, keep_from, move_to); +} +template +void arrayClearSpace(TValue * array_begin, + size_t array_length, + size_t keep_from, + size_t move_to) +{ + _arrayClearSpace_Pointer(array_begin, array_length, keep_from, move_to, typename IsSimple::Type() ); +} + + + +////////////////////////////////////////////////////////////////////////////// +// IsSimple specializations +////////////////////////////////////////////////////////////////////////////// + +// standard types +template <> struct _IsSimple< bool > { typedef True Type; }; +template <> struct _IsSimple< char > { typedef True Type; }; + +template <> struct _IsSimple< unsigned char > { typedef True Type; }; +template <> struct _IsSimple< unsigned short > { typedef True Type; }; +template <> struct _IsSimple< unsigned int > { typedef True Type; }; +template <> struct _IsSimple< unsigned long > { typedef True Type; }; + +template <> struct _IsSimple< signed char > { typedef True Type; }; +template <> struct _IsSimple< signed short > { typedef True Type; }; +template <> struct _IsSimple< signed int > { typedef True Type; }; +template <> struct _IsSimple< signed long > { typedef True Type; }; + +template <> struct _IsSimple< float > { typedef True Type; }; +template <> struct _IsSimple< double > { typedef True Type; }; +template <> struct _IsSimple< long double > { typedef True Type; }; + +// user defined types (re-specializations are allowed here) +template <> struct IsSimple< wchar_t > { typedef True Type; }; +template <> struct IsSimple< __int64 > { typedef True Type; }; + +////////////////////////////////////////////////////////////////////////////// +// gapValue +////////////////////////////////////////////////////////////////////////////// + +inline char const & +gapValueImpl(char *) +{ +SEQAN_CHECKPOINT + static char const _gap = '-'; + return _gap; +} +inline char const & +gapValueImpl(char const *) +{ +SEQAN_CHECKPOINT + static char const _gap = '-'; + return _gap; +} + +////////////////////////////////////////////////////////////////////////////// +// generic extreme values +////////////////////////////////////////////////////////////////////////////// + +template +inline T const & +supremumValueImpl(T *) +{ +SEQAN_CHECKPOINT + return SupremumValue::VALUE; +} +template +inline T const & +infimumValueImpl(T *) +{ +SEQAN_CHECKPOINT + return InfimumValue::VALUE; +} + +////////////////////////////////////////////////////////////////////////////// +// bool +////////////////////////////////////////////////////////////////////////////// + +template <> struct BitsPerValue< bool > { enum { VALUE = 1 }; }; + +/* +////////////////////////////////////////////////////////////////////////////// +// char +////////////////////////////////////////////////////////////////////////////// + +inline char const & +supremumValueImpl(char *) +{ +SEQAN_CHECKPOINT + static char const _value = (char) 127; + return _value; +} +inline char const & +infimumValueImpl(char *) +{ +SEQAN_CHECKPOINT + static char const _value = (char) -128; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// signed char +////////////////////////////////////////////////////////////////////////////// + +inline signed char const & +supremumValueImpl(signed char *) +{ +SEQAN_CHECKPOINT + static signed char const _value = 127; + return _value; +} +inline signed char const & +infimumValueImpl(signed char *) +{ +SEQAN_CHECKPOINT + static signed char const _value = -128; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// unsigned char +////////////////////////////////////////////////////////////////////////////// + +inline unsigned char const & +supremumValueImpl(unsigned char *) +{ +SEQAN_CHECKPOINT + static unsigned char const _value = 255; + return _value; +} +inline unsigned char const & +infimumValueImpl(unsigned char *) +{ +SEQAN_CHECKPOINT + static unsigned char const _value = 0; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// wchar_t +////////////////////////////////////////////////////////////////////////////// + +inline wchar_t const & +supremumValueImpl(wchar_t *) +{ +SEQAN_CHECKPOINT + static wchar_t const _value = 1UL << (BitsPerValue::VALUE) - 1; + return _value; +} +inline wchar_t const & +infimumValueImpl(wchar_t *) +{ +SEQAN_CHECKPOINT + static wchar_t const _value = 0; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// signed short +////////////////////////////////////////////////////////////////////////////// + +inline signed short const & +supremumValueImpl(signed short *) +{ +SEQAN_CHECKPOINT + static signed short const _value = (((1 << (BitsPerValue::VALUE - 2)) - 1) << 1) + 1; + return _value; +} +inline signed short const & +infimumValueImpl(signed short *dummy) +{ +SEQAN_CHECKPOINT + static signed short const _value = -supremumValueImpl(dummy) - 1; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// unsigned short +////////////////////////////////////////////////////////////////////////////// + +inline unsigned short const & +supremumValueImpl(unsigned short *) +{ +SEQAN_CHECKPOINT + static unsigned short const _value = (((1 << (BitsPerValue::VALUE - 1)) - 1) << 1) + 1; + return _value; +} +inline unsigned short const & +infimumValueImpl(unsigned short *) +{ +SEQAN_CHECKPOINT + static unsigned short const _value = 0; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// signed int +////////////////////////////////////////////////////////////////////////////// + +inline signed int const & +supremumValueImpl(signed int *) +{ +SEQAN_CHECKPOINT + static signed int const _value = (((1 << (BitsPerValue::VALUE - 2)) - 1) << 1) + 1; + return _value; +} +inline signed int const & +infimumValueImpl(signed int *dummy) +{ +SEQAN_CHECKPOINT + static signed int const _value = -supremumValueImpl(dummy) - 1; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// unsigned int +////////////////////////////////////////////////////////////////////////////// + +inline unsigned int const & +supremumValueImpl(unsigned int *) +{ +SEQAN_CHECKPOINT + static unsigned int const _value = ~0ul; + return _value; +} +inline unsigned int const & +infimumValueImpl(unsigned int *) +{ +SEQAN_CHECKPOINT + static unsigned int const _value = 0; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// signed long +////////////////////////////////////////////////////////////////////////////// + +inline signed long const & +supremumValueImpl(signed long *) +{ +SEQAN_CHECKPOINT + static signed long const _value = (((1 << (BitsPerValue::VALUE - 2)) - 1) << 1) + 1; + return _value; +} +inline signed long const & +infimumValueImpl(signed long *dummy) +{ +SEQAN_CHECKPOINT + static signed long const _value = -supremumValueImpl(dummy) - 1; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// unsigned long +////////////////////////////////////////////////////////////////////////////// + +inline unsigned long const & +supremumValueImpl(unsigned long *) +{ +SEQAN_CHECKPOINT + static unsigned long const _value = ~0ul; + return _value; +} +inline unsigned long const & +infimumValueImpl(unsigned long *) +{ +SEQAN_CHECKPOINT + static unsigned long const _value = 0; + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// signed 64bit int (cannot use long long <- no ISO C++) +////////////////////////////////////////////////////////////////////////////// + +inline __int64 const & +supremumValueImpl(__int64 *) +{ +SEQAN_CHECKPOINT + static __int64 const _value = ((((__int64)1 << (BitsPerValue<__int64>::VALUE - 2)) - 1) << 1) + 1; + return _value; +} +inline __int64 const & +infimumValueImpl(__int64 *dummy) +{ +SEQAN_CHECKPOINT + static __int64 const _value = -supremumValueImpl(dummy) - 1; + return _value; +} +*/ + +////////////////////////////////////////////////////////////////////////////// +// float +////////////////////////////////////////////////////////////////////////////// + +inline float const & +supremumValueImpl(float *) +{ +SEQAN_CHECKPOINT +#ifdef PLATFORM_WINDOWS + static float const _value = ::std::numeric_limits::infinity( ); +#else + static float const _value = 3.40282347e+38F; +#endif + return _value; +} +inline float const & +infimumValueImpl(float *) +{ +SEQAN_CHECKPOINT +#ifdef PLATFORM_WINDOWS + static float const _value = -::std::numeric_limits::infinity( ); +#else + static float const _value = -3.40282347e+38F; +#endif + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// double +////////////////////////////////////////////////////////////////////////////// + +inline double const & +supremumValueImpl(double *) +{ +SEQAN_CHECKPOINT +#ifdef PLATFORM_WINDOWS + static double const _value = ::std::numeric_limits::infinity( ); +#else + static double const _value = 1.7976931348623157e+308; +#endif + return _value; +} +inline double const & +infimumValueImpl(double *) +{ +SEQAN_CHECKPOINT +#ifdef PLATFORM_WINDOWS + static double const _value = -::std::numeric_limits::infinity( ); +#else + static double const _value = -1.7976931348623157e+308; +#endif + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +// long double +////////////////////////////////////////////////////////////////////////////// + +inline long double const & +supremumValueImpl(long double *) +{ +SEQAN_CHECKPOINT +#ifdef PLATFORM_WINDOWS + static long double const _value = ::std::numeric_limits::infinity( ); +#else + static long double const _value = 1.7976931348623157e+308; +#endif + return _value; +} +inline long double const & +infimumValueImpl(long double *) +{ +SEQAN_CHECKPOINT +#ifdef PLATFORM_WINDOWS + static long double const _value = -::std::numeric_limits::infinity( ); +#else + static long double const _value = -1.7976931348623157e+308; +#endif + return _value; +} + +////////////////////////////////////////////////////////////////////////////// +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_compare.h b/SeqAn-1.1/seqan/basic/basic_compare.h new file mode 100644 index 0000000..6499da9 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_compare.h @@ -0,0 +1,60 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_compare.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_COMPARE_H +#define SEQAN_HEADER_BASIC_COMPARE_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// + +template +struct CompareType; + +template +struct CompareType +{ + typedef typename CompareType::Type const Type; +}; +template +struct CompareType +{ + typedef typename CompareType::Type const Type; +}; +template +struct CompareType +{ + typedef typename CompareType::Type const Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +template inline +bool lexLess(const _T& _Left, const _T& _Right) +{ // return lexicographical _Left < _Right + typedef typename _MakeUnsigned<_T>::Type TUnsigned; + return (TUnsigned)_Left < (TUnsigned)_Right; +} + +////////////////////////////////////////////////////////////////////////////// +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_converter.h b/SeqAn-1.1/seqan/basic/basic_converter.h new file mode 100644 index 0000000..966f467 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_converter.h @@ -0,0 +1,117 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_converter.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_CONVERTER_H +#define SEQAN_HEADER_BASIC_CONVERTER_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// +//Convert +////////////////////////////////////////////////////////////////////////////// + +//gibt den Typ an, in den TSource konvertiert werden kann (TTarget oder TTarget &) + +/** +.Metafunction.Convert: +..summary:Return type of a conversion. +..signature:Convert::Type +..param.Target:Type the object should be converted to. +..param.Source:Type of the object that should be converted to $Target$. +..returns.param.Type:Type that is returned by @Function.convert@. +...remarks:This is either $Target$ or $Target &$: +If instances of $Source: /fs/szdevel/src/cvsroot/bowtie/SeqAn-1.1/seqan/basic/basic_converter.h,v $ can be re-interpreted as instances of $Target$, +than this metafunction returns a reference, otherwise it returns $Target$, +that is @Function.convert@ returns a temporary. +..remarks:A constant instance of $Convert$ is (ab)used as tag argument of @Function.convertImpl@. +*/ +template +struct Convert +{ + typedef TTarget Type; + +}; + +////////////////////////////////////////////////////////////////////////////// +//convertImpl +////////////////////////////////////////////////////////////////////////////// +/** +.Function.convertImpl: +..hidefromindex +..cat:Alphabets +..summary:Implements @Function.convert@. +..signature:Convert convertImpl(convert, source) +..param.convert:Object that specifies the conversion. +...type:Metafunction.Convert +...remarks:A constant instance of @Metafunction.Convert@ is used to specify the conversion target. +..param.source:An object that should be converted. +..returns:$source$ converted to the type specified by convert. +...metafunction:Metafunction.Convert +..remarks:This function implements @Function.convert@. +It is recommended to use @Function.convert@ rather than $convertImpl$. +*/ +//??? Spezialisiere convertImpl, verwende convert +//??? Konversion eines einzelnen Zeichens in ein einzelnes Zeichen. Konversion von Sequenzen in Sequenzen finden wo anders statt. +//??? Kann entweder kopieren oder re-interpretieren, je nach Convert::Type +template +inline typename Convert::Type +convertImpl(Convert const, + TSource & source) +{ + return source; +} +template +inline typename Convert::Type +convertImpl(Convert const, + TSource const & source) +{ + return source; +} + +////////////////////////////////////////////////////////////////////////////// +//convert +////////////////////////////////////////////////////////////////////////////// +/** +.Function.convert: +..cat:Alphabets +..summary:Converts a value into another value. +..signature:Convert convert(source) +..param.Target:The type $source$ is converted to. +..param.source:An object that is converted to $Target$. +..returns:$source$ converted to $Target$. +...remarks:If $source$ can be re-interpreted as instance of $Target$, then a reference is returned. +Otherwise the function returns a temporary object. +...metafunction:Metafunction.Convert +..remarks:This function is implemented in @Function.convertImpl@. +Do not specialize $convert$, specialize @Function.convertImpl@ instead. +..see:Function.convertImpl +*/ +template +inline typename Convert::Type +convert(TSource const & source) +{ + return convertImpl(Convert(), source); +} + +////////////////////////////////////////////////////////////////////////////// +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_counted_ptr.h b/SeqAn-1.1/seqan/basic/basic_counted_ptr.h new file mode 100644 index 0000000..4973a9f --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_counted_ptr.h @@ -0,0 +1,116 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_counted_ptr.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +// THIS FILE IS CURRENTLY NOT USED IN SEQAN + +#ifndef SEQAN_HEADER_BASIC_COUNTED_PTR_H +#define SEQAN_HEADER_BASIC_COUNTED_PTR_H + +namespace SEQAN_NAMESPACE_MAIN +{ + + ////////////////////////////////////////////////////////////////////////////// + // counted pointer + + template < typename Type > + struct CountedPtr + { + typedef CountedPtr _Self; + typedef CountedPtr* _SelfPtr; + typedef CountedPtr& _SelfRef; + + typedef Type& reference; + typedef const Type& const_reference; + typedef Type* pointer; + + explicit CountedPtr(pointer p = 0): // allocate a new counter + itsCounter(0) + { + if (p) itsCounter = new counter(p); + } + + CountedPtr(const _Self& r) throw() { + acquire(r.itsCounter); + } + + ~CountedPtr() { + release(); + } + + CountedPtr& operator=(const _Self& r) + { + if (this != &r) { + release(); + acquire(r.itsCounter); + } + return *this; + } + + reference operator*() const throw() { + return *itsCounter->ptr; + } + + pointer operator->() const throw() { + return itsCounter->ptr; + } + + pointer get() const throw() { + return itsCounter ? itsCounter->ptr : 0; + } + + bool unique() const throw() { + return (itsCounter ? itsCounter->count == 1 : true); + } + + inline operator pointer () const { + return get(); + } + + private: + + struct counter { + pointer ptr; + unsigned count; + counter(pointer p = 0, unsigned c = 1): + ptr(p), + count(c) { } + }* itsCounter; + + void acquire(counter* c) throw() + { // increment the count + itsCounter = c; + if (c) ++c->count; + } + + void release() + { // decrement the count, delete if it is 0 + if (itsCounter) { + if (--itsCounter->count == 0) { + delete itsCounter->ptr; + delete itsCounter; + } + itsCounter = 0; + } + } + }; + +} + +#endif diff --git a/SeqAn-1.1/seqan/basic/basic_debug.h b/SeqAn-1.1/seqan/basic/basic_debug.h new file mode 100644 index 0000000..424b011 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_debug.h @@ -0,0 +1,385 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_debug.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_DEBUG_H +#define SEQAN_HEADER_BASIC_DEBUG_H + +#ifndef SEQAN_DEBUG_OR_TEST_ +#ifdef SEQAN_DEBUG +#define SEQAN_DEBUG_OR_TEST_ +#else //#ifdef SEQAN_DEBUG +#ifdef SEQAN_TEST +#define SEQAN_DEBUG_OR_TEST_ +#endif //#ifdef SEQAN_TEST +#endif //#ifdef SEQAN_DEBUG +#endif //#ifndef SEQAN_DEBUG_OR_TEST_ + + +#ifdef SEQAN_DEBUG_OR_TEST_ +#include +#endif //#ifdef SEQAN_DEBUG_OR_TEST_ + +#ifdef SEQAN_DEBUG + +//throw a fatal debug report if _cond is false +#define SEQAN_ASSERT(_cond) { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Error< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, #_cond " is FALSE"); } +#define SEQAN_ASSERT1(_cond) SEQAN_ASSERT(_cond) +#define SEQAN_ASSERT2(_cond, _comment) { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Error< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, _comment); } + +//throw a debug report if _cond is false +#define SEQAN_CHECK(_cond) { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Message< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, #_cond " is FALSE"); } +#define SEQAN_CHECK1(_cond) SEQAN_CHECK(_cond) +#define SEQAN_CHECK2(_cond, _comment) { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Message< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, _comment); } + +#define SEQAN_DO(_cond) { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Message< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, #_cond " is FALSE"); } +#define SEQAN_DO1(_cond) SEQAN_DO(_cond) +#define SEQAN_DO2(_cond, _comment) { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Error< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, _comment); } + +//report a message +#define SEQAN_ABORT(_comment) { ::SEQAN_NAMESPACE_MAIN::debug::Error< ::SEQAN_NAMESPACE_MAIN::debug::Report >(__FILE__, __LINE__, _comment); } +#define SEQAN_REPORT(_comment) { ::SEQAN_NAMESPACE_MAIN::debug::Message< ::SEQAN_NAMESPACE_MAIN::debug::Report >(__FILE__, __LINE__, _comment); } + +#else //#ifdef SEQAN_DEBUG + +//disable debug reports in release built +#define SEQAN_ASSERT(_cond) {} +#define SEQAN_ASSERT1(_cond) {} +#define SEQAN_ASSERT2(_cond, _comment) {} + +#define SEQAN_CHECK(_cond) {} +#define SEQAN_CHECK1(_cond) {} +#define SEQAN_CHECK2(_cond, _comment) {} + +#define SEQAN_DO(_cond) { _cond; } +#define SEQAN_DO1(_cond) SEQAN_DO(_cond) +#define SEQAN_DO2(_cond, _comment) { _cond; } + +#define SEQAN_ABORT(_comment) {} +#define SEQAN_REPORT(_comment) {} + +#endif //#ifdef SEQAN_DEBUG + +#ifdef SEQAN_TEST + +//test a condition and report test result +#define SEQAN_TASSERT(_cond) \ + { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Error< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, "(" #_cond ") is FALSE"); } +#define SEQAN_TASSERT1(_cond) SEQAN_TASSERT(_cond) +#define SEQAN_TASSERT2(_cond, _comment) \ + { if (!(_cond)) ::SEQAN_NAMESPACE_MAIN::debug::Error< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, _comment); } + +#define SEQAN_TCHECK(_cond) \ + { if (_cond) ::SEQAN_NAMESPACE_MAIN::debug::Result< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, "(" #_cond ") is TRUE"); \ + else ::SEQAN_NAMESPACE_MAIN::debug::Result< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, "(" #_cond ") is FALSE"); } +#define SEQAN_TCHECK1(_cond) SEQAN_TCHECK(_cond) +#define SEQAN_TCHECK2(_cond, _comment) \ + { if (_cond) ::SEQAN_NAMESPACE_MAIN::debug::Result< ::SEQAN_NAMESPACE_MAIN::debug::Check >(__FILE__, __LINE__, _comment); } + +//report a test result +#define SEQAN_TABORT(_comment) { ::SEQAN_NAMESPACE_MAIN::debug::Error< ::SEQAN_NAMESPACE_MAIN::debug::Report >(__FILE__, __LINE__, _comment); } +#define SEQAN_TREPORT(_comment) { ::SEQAN_NAMESPACE_MAIN::debug::Result< ::SEQAN_NAMESPACE_MAIN::debug::Report >(__FILE__, __LINE__, _comment); } + +#else //#ifdef SEQAN_TEST + +#define SEQAN_TASSERT(_cond) {} +#define SEQAN_TASSERT1(_cond) {} +#define SEQAN_TASSERT2(_cond, _comment) {} + +#define SEQAN_TCHECK(_cond) {} +#define SEQAN_TABORT(_comment) {} +#define SEQAN_TREPORT(_comment) {} + +#endif //#ifdef SEQAN_TEST +//____________________________________________________________________________ + +#ifdef SEQAN_DEBUG_OR_TEST_ + +//Test Helper Functions + +// compare two files, do not translate linebreaks +inline bool +_compareBinaryFiles(char * file1, char * file2) +{ + bool ret = false; + + FILE * fl1 = fopen(file1, "rb"); + if (!fl1) return ret; + + FILE * fl2 = fopen(file2, "rb"); + if (!fl2) + { + fclose(fl1); + return ret; + } + + while (!feof(fl1) && !feof(fl2)) + { + if (fgetc(fl1) != fgetc(fl2)) goto End; + } + + ret = feof(fl1) && feof(fl2); + +End: + fclose(fl2); + fclose(fl1); + + return ret; + +} +//____________________________________________________________________________ + +//one line break is either \r, \n, or \r\n. +inline void +_compareTextFiles_readChar(FILE * fl, char & c, bool & is_lb, bool & is_eof) +{ + is_lb = false; + is_eof = false; + + c = fgetc(fl); + if (c == '\r') + { + is_lb = true; + char c_help = fgetc(fl); + if (feof(fl)) is_eof = true; + else + { + if (c_help == '\n') + { + c = fgetc(fl); + if (feof(fl)) is_eof = true; + } + else c = c_help; + } + } + if (c == '\n') + { + is_lb = true; + c = fgetc(fl); + if (feof(fl)) is_eof = true; + } +} + +// compare two files, translate linebreaks +inline bool +_compareTextFiles(char * file1, char * file2) +{ + FILE * fl1 = fopen(file1, "rb"); + if (!fl1) return false; + + FILE * fl2 = fopen(file2, "rb"); + if (!fl2) + { + fclose(fl1); + return false; + } + + bool ret = false; + + bool is_lb1, is_lb2, is_eof1, is_eof2; + char c1, c2; + + while (!feof(fl1) && !feof(fl2)) + { + _compareTextFiles_readChar(fl1, c1, is_lb1, is_eof1); + _compareTextFiles_readChar(fl2, c2, is_lb2, is_eof2); + + if (is_lb1 ^ is_lb2) + { + goto End; + } + if (is_eof1 ^ is_eof2) + { + goto End; + } + if (c1 != c2) + { + goto End; + } + } + + ret = feof(fl1) && feof(fl2); + +End: + fclose(fl2); + fclose(fl1); + + return ret; + +} + + +//____________________________________________________________________________ + +namespace SEQAN_NAMESPACE_MAIN +{ + +namespace debug +{ + +//action of SEQAN_ASSERT, SEQAN_TCHECK and SEQAN_CHECK +//use as template argument for Error<> and Message<> and Result<> +class Check {}; + +//action of SEQAN_ABORT, SEQAN_TREPORT and SEQAN_REPORT +//use as template argument for Error<> and Message<> and Result<> +class Report {}; + + +//report fatal error +//template argument TAction is the action (Check or Report) +//use explicit instatiation for overwriting the default behavior +template +void Error(const char * file, int line, const char * comment="-") +{ + std::fprintf(stderr, "%s(%i) : SEQAN: %s\nSEQAN: execution aborted\n", file, line, comment); + exit(1); +} + +//report debug message +//template argument TAction is the action (Check or Report) +//use explicit instatiation for overwriting the default behavior +template +void Message(const char * file, int line, const char * comment="-") +{ + std::fprintf(stderr, "%s(%i) : SEQAN: %s\n", file, line, comment); +} + +//report test result +//template argument TAction is the action (Check or Report) +//use explicit instatiation for overwriting the default behavior +template +void Result(const char * file, int line, const char * comment="-") +{ + std::fprintf(stdout, "%s(%i) : %s\n", file, line, comment); +} + +} //namespace debug + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifdef SEQAN_DEBUG_OR_TEST_ + + +//____________________________________________________________________________ +//Checkpoint Testing + +//note: this framework relies on the filenames in the project to be unique + +#ifdef SEQAN_TEST + +#include +#include +#include + +namespace SEQAN_NAMESPACE_MAIN +{ +namespace debug +{ +struct Checkpoint +{ + char const* file; + unsigned int line; +}; + +struct CheckpointLess : public ::std::binary_function +{ + inline bool operator() (Checkpoint const &a, Checkpoint const &b) const + { + int c = strcmp(a.file, b.file); + return c < 0 || (c == 0 && a.line < b.line); + } +}; + +template +struct CheckpointStore +{ + static ::std::set data; +}; +template +::std::set CheckpointStore::data; + + +inline bool +checkpoint(unsigned int line, char const* file) +{ + char const* file_name = strrchr(file, '/'); + char const* file_name_2 = strrchr(file, '\\'); + if (file_name_2 > file_name) file_name = file_name_2; + if (!file_name) file_name = file; + else ++file_name; + + Checkpoint cp = {file_name, line}; + CheckpointStore<>::data.insert(cp); + return true; +} +#define SEQAN_CHECKPOINT \ + ::SEQAN_NAMESPACE_MAIN::debug::checkpoint(__LINE__, __FILE__); + + +inline void +testCheckpoint(char const* file, unsigned int line) +{ + Checkpoint cp = {file, line}; + if (CheckpointStore<>::data.find(cp) == CheckpointStore<>::data.end()) + Message< Report >(file, line, "Checkpoint lost"); +} + +inline void +verifyCheckpoints(char const* file) +{ + char const* file_name = strrchr(file, '/'); + char const* file_name_2 = strrchr(file, '\\'); + if (file_name_2 > file_name) file_name = file_name_2; + if (!file_name) file_name = file; + else ++file_name; + + FILE * fl = ::std::fopen(file, "r"); + if (!fl) + { + Error< Report >(file, 0, "verifyCheckpoints could not find this file."); + } + unsigned int line_number = 1; + char buf[1<<16]; + + while (::std::fgets(buf, sizeof(buf), fl)) + { + if (::std::strstr(buf, "SEQAN_CHECKPOINT")) + { + testCheckpoint(file_name, line_number); + } + ++line_number; + } + + ::std::fclose(fl); +} + +} //namespace debug + +} //namespace SEQAN_NAMESPACE_MAIN + +#else //#ifdef SEQAN_TEST + +#define SEQAN_CHECKPOINT + +#endif //#ifdef SEQAN_TEST + +//____________________________________________________________________________ + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_definition.h b/SeqAn-1.1/seqan/basic/basic_definition.h new file mode 100644 index 0000000..b12fd4c --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_definition.h @@ -0,0 +1,405 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_definition.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_DEFINITION_H +#define SEQAN_HEADER_BASIC_DEFINITION_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// + +template +struct Tag +{ +}; + +////////////////////////////////////////////////////////////////////////////// +/** +.Tag.Default: +..summary:Tag that specifies default behavior. +..tag.Default:Use default behavior. +*/ +struct Default_; +typedef Tag const Default; + +////////////////////////////////////////////////////////////////////////////// +/** +.Tag.Move Switch: +..summary:Switch to force move. +..tag.Move:Move instead of assign. +..remarks.text:The difference between move constructor and copy constructor +is that the source object is not copied but moved into the target object. +The source object can lose its content and will be empty after +this operation in this case. +A move constructor can sigificantly faster than a copy constructor. +..example.code:String source("hello"); +String target(source, Move()); // source is moved to target +std::cout << source; //nothing printed since source lost content +std::cout << target; //"hello" +..see:Function.move +*/ + +struct Move_; +typedef Tag const Move; + +////////////////////////////////////////////////////////////////////////////// + +//Pass to c'tor of iterator to move it to the end +struct GoEnd_; +typedef Tag const GoEnd; + + +////////////////////////////////////////////////////////////////////////////// + +//construct without initializing +struct MinimalCtor_; +typedef Tag const MinimalCtor; + +//construct with initializing +struct NonMinimalCtor_; +typedef Tag const NonMinimalCtor; + +////////////////////////////////////////////////////////////////////////////// +/** +.Tag.Logical Values: +..summary:Tag that represents true and false. +..tag.True:The logical value "true". +..tag.False:The logical value "false". +*/ +struct True { enum { VALUE = true }; }; +struct False { enum { VALUE = false }; }; + + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Nothing: +..summary:Tag that represents an absent parameter or an absent type. +..tag.Nothing:Omit parameter. +*/ +///Empty Data Class. +struct Nothing {}; + + + +////////////////////////////////////////////////////////////////////////////// +// returns TTo const, if TFrom is const, TTo otherwise + +template +struct _CopyConst +{ + typedef TTo Type; +}; +template +struct _CopyConst +{ + typedef TTo const Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Internal._RemoveConst: +..signature:_RemoveConst +..returns:$t$ if $T$ is $t const$, otherwise $T$. +*/ +template +struct _RemoveConst +{ + typedef T Type; +}; +template +struct _RemoveConst: + public _RemoveConst {}; + +template +struct _RemoveConst +{ + typedef typename _RemoveConst::Type & Type; +}; +template +struct _RemoveConst +{ + typedef typename _RemoveConst::Type * Type; +}; +template +struct _RemoveConst +{ + typedef T * Type; +}; + +////////////////////////////////////////////////////////////////////////////// +/** +.Internal._MakeUnsigned: +..signature:_MakeUnsigned +..returns:$unsigned t$ if $T$ is not $unsigned t$, otherwise $T$. +*/ +template +struct _MakeUnsigned +{ + typedef T Type; +}; + +template +struct _MakeUnsigned { + typedef typename _MakeUnsigned::Type const Type; +}; + +template <> +struct _MakeUnsigned +{ + typedef unsigned char Type; +}; + +template <> +struct _MakeUnsigned +{ + typedef unsigned char Type; +}; + +template <> +struct _MakeUnsigned +{ + typedef unsigned int Type; +}; + +template <> +struct _MakeUnsigned +{ + typedef unsigned short Type; +}; + +template <> +struct _MakeUnsigned +{ + typedef unsigned long Type; +}; + +/* +template <> +struct _MakeUnsigned +{ + typedef unsigned long long Type; +}; +*/ + +////////////////////////////////////////////////////////////////////////////// +/** +.Internal._MakeSigned: +..signature:_MakeSigned +..returns:$signed t$ if $T$ is not $signed t$, otherwise $T$. +*/ +template +struct _MakeSigned +{ + typedef T Type; +}; + +template +struct _MakeSigned { + typedef typename _MakeSigned::Type const Type; +}; + +template <> +struct _MakeSigned +{ + typedef signed char Type; +}; + +template <> +struct _MakeSigned +{ + typedef signed char Type; +}; + +template <> +struct _MakeSigned +{ + typedef signed int Type; +}; + +template <> +struct _MakeSigned +{ + typedef signed short Type; +}; + +template <> +struct _MakeSigned +{ + typedef signed long Type; +}; + +/* +template <> +struct _MakeSigned +{ + typedef signed long long Type; +}; +*/ + +////////////////////////////////////////////////////////////////////////////// +/** +.Internal._ClassIdentifier: +..signature:void * _ClassIdentifier::getID() +..returns:A void * that identifies $T$. +...text:The returned values of two calls of $getID$ are equal if and only if +the used type $T$ was the same. +*/ +template +struct _ClassIdentifier +{ + static inline void * + getID() + { +SEQAN_CHECKPOINT + static bool _id_dummy; + return &_id_dummy; + } +}; + +////////////////////////////////////////////////////////////////////////////// +/** +.Function.log2: +..cat:Miscellaneous +..summary:Computes logarithm of base 2 for integer types +..signature:unsigned int log2(i) +..param.i:An integer type. +..returns:The largest integer smaller or equal than +the logarithm of $i$. +*/ + +#if 0 +template +struct _Log2_Impl +{ + template + static inline unsigned int + log2(T val, unsigned int offset) + { + unsigned int val2 = val >> (BITS_MAX / 2); + if (val2) + { + val = val2; + offset += BITS_MAX / 2; + } + return _Log2_Impl::log2(val, offset); + } +}; + +template <> +struct _Log2_Impl<1> +{ + template + static inline unsigned int + log2(T /*val*/, unsigned int offset) + { + return offset; + } +}; + + +template +inline unsigned int +log2(T val) +{ + enum + { +// BITS_PER_VALUE = BitsPerValue::VALUE //TODO??? + BITS_PER_VALUE = sizeof(T) * 8 + }; + + return _Log2_Impl::log2(val, 0); +} +#endif + +template +inline TValue _intPow(TValue a, TExponent b) +{ +SEQAN_CHECKPOINT + TValue ret = 1; + while (b != 0) + { + if (b & 1) ret *= a; + a *= a; + b >>= 1; + } + return ret; +} + +////////////////////////////////////////////////////////////////////////////// +// to avoid conflicts with non-standard macros and namespaces +// we define our own Min/Max functions + +template inline +const _Tx& _min(const _Tx& _Left, const _Tx& _Right) +{ // return smaller of _Left and _Right + if (_Left < _Right) + return _Left; + else + return _Right; +} + +template inline +_Tx _min(const _Tx& _Left, const _Ty& _Right) +{ // return smaller of _Left and _Right + return (_Right < _Left ? _Right : _Left); +} + +template inline +const _Ty& _max(const _Ty& _Left, const _Ty& _Right) +{ // return larger of _Left and _Right + if (_Left < _Right) + return _Right; + else + return _Left; +} + +////////////////////////////////////////////////////////////////////////////// + +template +struct _IsSameType +{ + enum {VALUE = false}; + typedef False Type; +}; + +template +struct _IsSameType +{ + enum {VALUE = true}; + typedef True Type; +}; + +template +inline bool +_isSameType() +{ + return _IsSameType::VALUE; +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... + + diff --git a/SeqAn-1.1/seqan/basic/basic_forwards.h b/SeqAn-1.1/seqan/basic/basic_forwards.h new file mode 100644 index 0000000..13e70fb --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_forwards.h @@ -0,0 +1,71 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_forwards.h,v 1.1 2008/08/25 16:20:02 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_FORWARD2_H +#define SEQAN_HEADER_BASIC_FORWARD2_H + +//forward declarations (make GCC 4.x happy) + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// basic_transport.h::assign + +template +inline void +assign(TTarget & target, + TSource & source); + +template +inline void +assign(TTarget & target, + TSource const & source); + +////////////////////////////////////////////////////////////////////////////// +// string_pointer.h::assignValue + +template +inline void +assignValue(TValue * me, + TPos pos, + TValue const & _value); + +////////////////////////////////////////////////////////////////////////////// +// string_pointer.h::moveValue + +template +inline void +moveValue(TValue * me, + TPos pos, + TValue const & _value); + +////////////////////////////////////////////////////////////////////////////// +// string_pointer.h::value + +template +inline TValue & +value(TValue * me, + TPos pos); + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_generated_forwards.h b/SeqAn-1.1/seqan/basic/basic_generated_forwards.h new file mode 100644 index 0000000..55f8ded --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_generated_forwards.h @@ -0,0 +1,1941 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_GENERATED_FORWARDS_H +#define SEQAN_HEADER_BASIC_GENERATED_FORWARDS_H + +////////////////////////////////////////////////////////////////////////////// +// NOTE: This file is automatically generated by build_forwards.py +// Do not edit this file manually! +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// CLASSES +////////////////////////////////////////////////////////////////////////////// + +namespace SEQAN_NAMESPACE_MAIN { +namespace debug { + +//____________________________________________________________________________ +// Check + +class Check; // "projects/library/seqan/basic/basic_debug.h"(238) + +//____________________________________________________________________________ +// Checkpoint + +struct Checkpoint; // "projects/library/seqan/basic/basic_debug.h"(296) + +//____________________________________________________________________________ +// CheckpointLess + +struct CheckpointLess; // "projects/library/seqan/basic/basic_debug.h"(302) + +//____________________________________________________________________________ +// CheckpointStore + +template struct CheckpointStore; // "projects/library/seqan/basic/basic_debug.h"(312) + +//____________________________________________________________________________ +// Report + +class Report; // "projects/library/seqan/basic/basic_debug.h"(242) + +} //namespace debug +} //namespace SEQAN_NAMESPACE_MAIN +////////////////////////////////////////////////////////////////////////////// + +namespace SEQAN_NAMESPACE_MAIN { + +//____________________________________________________________________________ +// AdaptorIterator + +template struct AdaptorIterator; // "projects/library/seqan/basic/basic_iterator_adaptor.h"(31) + +//____________________________________________________________________________ +// Allocator + +template struct Allocator; // "projects/library/seqan/basic/basic_allocator_interface.h"(50) + +//____________________________________________________________________________ +// BitsPerValue + +template struct BitsPerValue; // "projects/library/seqan/basic/basic_alphabet_interface.h"(837) + +//____________________________________________________________________________ +// CASE + +template struct CASE; // "projects/library/seqan/basic/basic_metaprogramming.h"(76) + +//____________________________________________________________________________ +// Cargo + +template struct Cargo; // "projects/library/seqan/basic/basic_type.h"(290) + +//____________________________________________________________________________ +// ChunkPool + +#if 0 +template struct ChunkPool; // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(56) +#endif + +//____________________________________________________________________________ +// ChunkPool2 + +template struct ChunkPool2; // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(248) + +//____________________________________________________________________________ +// CompareType + +template struct CompareType; // "projects/library/seqan/basic/basic_alphabet_simple.h"(500) +template struct CompareType; // "projects/library/seqan/basic/basic_compare.h"(30) + +//____________________________________________________________________________ +// Container + +template struct Container; // "projects/library/seqan/basic/basic_iterator_base.h"(106) +template struct Container; // "projects/library/seqan/basic/basic_iterator.h"(147) + +//____________________________________________________________________________ +// Convert + +template struct Convert; // "projects/library/seqan/basic/basic_converter.h"(48) + +//____________________________________________________________________________ +// CountedPtr + +template struct CountedPtr; // "projects/library/seqan/basic/basic_counted_ptr.h"(34) + +//____________________________________________________________________________ +// CutCompressed + +template struct CutCompressed; // "projects/library/seqan/basic/basic_aggregates.h"(36) + +//____________________________________________________________________________ +// DeepestSpec + +template struct DeepestSpec; // "projects/library/seqan/basic/basic_type.h"(229) + +//____________________________________________________________________________ +// DefaultGetIteratorSpec + +template struct DefaultGetIteratorSpec; // "projects/library/seqan/basic/basic_iterator.h"(94) + +//____________________________________________________________________________ +// DefaultIteratorSpec + +template struct DefaultIteratorSpec; // "projects/library/seqan/basic/basic_iterator.h"(72) + +//____________________________________________________________________________ +// Default_ + +struct Default_; // "projects/library/seqan/basic/basic_definition.h"(40) + +//____________________________________________________________________________ +// Difference + +template struct Difference; // "projects/library/seqan/basic/basic_type.h"(137) + +//____________________________________________________________________________ +// DotDrawing_ + +struct DotDrawing_; // "projects/library/seqan/basic/basic_tag.h"(36) + +//____________________________________________________________________________ +// False + +struct False; // "projects/library/seqan/basic/basic_definition.h"(88) + +//____________________________________________________________________________ +// GetValue + +template struct GetValue; // "projects/library/seqan/basic/basic_type.h"(69) + +//____________________________________________________________________________ +// GoEnd_ + +struct GoEnd_; // "projects/library/seqan/basic/basic_definition.h"(66) + +//____________________________________________________________________________ +// Gotoh_ + +struct Gotoh_; // "projects/library/seqan/basic/basic_tag.h"(90) + +//____________________________________________________________________________ +// Hirschberg_ + +struct Hirschberg_; // "projects/library/seqan/basic/basic_tag.h"(118) + +//____________________________________________________________________________ +// Holder + +template struct Holder; // "projects/library/seqan/basic/basic_holder.h"(112) + +//____________________________________________________________________________ +// Host + +template struct Host; // "projects/library/seqan/basic/basic_type.h"(181) + +//____________________________________________________________________________ +// IF + +template struct IF; // "projects/library/seqan/basic/basic_metaprogramming.h"(35) + +//____________________________________________________________________________ +// Id + +template struct Id; // "projects/library/seqan/basic/basic_type.h"(335) + +//____________________________________________________________________________ +// InfimumValue + +template struct InfimumValue; // "projects/library/seqan/basic/basic_alphabet_interface.h"(911) + +//____________________________________________________________________________ +// IsSimple + +template struct IsSimple; // "projects/library/seqan/basic/basic_alphabet_interface.h"(53) + +//____________________________________________________________________________ +// Iter + +template class Iter; // "projects/library/seqan/basic/basic_iterator_base.h"(41) + +//____________________________________________________________________________ +// Iterator + +template struct Iterator; // "projects/library/seqan/basic/basic_iterator.h"(129) + +//____________________________________________________________________________ +// IteratorProxy + +template struct IteratorProxy; // "projects/library/seqan/basic/basic_proxy.h"(80) + +//____________________________________________________________________________ +// Iterator_Default_Imp + +template struct Iterator_Default_Imp; // "projects/library/seqan/basic/basic_iterator.h"(119) + +//____________________________________________________________________________ +// Key + +template struct Key; // "projects/library/seqan/basic/basic_type.h"(358) + +//____________________________________________________________________________ +// LENGTH + +template struct LENGTH; // "projects/library/seqan/basic/basic_type.h"(586) + +//____________________________________________________________________________ +// LOOP + +template class LOOP; // "projects/library/seqan/basic/basic_metaprogramming.h"(121) + +//____________________________________________________________________________ +// LOOP_REVERSE + +template class LOOP_REVERSE; // "projects/library/seqan/basic/basic_metaprogramming.h"(144) + +//____________________________________________________________________________ +// Log2 + +template <__int64 numerus > struct Log2; // "projects/library/seqan/basic/basic_metaprogramming.h"(166) + +//____________________________________________________________________________ +// Log2Floor + +template <__int64 numerus > struct Log2Floor; // "projects/library/seqan/basic/basic_metaprogramming.h"(171) + +//____________________________________________________________________________ +// MemsetConstValueWorker + +template struct MemsetConstValueWorker; // "projects/library/seqan/basic/basic_metaprogramming.h"(251) + +//____________________________________________________________________________ +// MemsetWorker + +template struct MemsetWorker; // "projects/library/seqan/basic/basic_metaprogramming.h"(205) + +//____________________________________________________________________________ +// MinimalCtor_ + +struct MinimalCtor_; // "projects/library/seqan/basic/basic_definition.h"(73) + +//____________________________________________________________________________ +// Move_ + +struct Move_; // "projects/library/seqan/basic/basic_definition.h"(60) + +//____________________________________________________________________________ +// MultiPool + +template struct MultiPool; // "projects/library/seqan/basic/basic_allocator_multipool.h"(50) + +//____________________________________________________________________________ +// MyersBitVector_ + +struct MyersBitVector_; // "projects/library/seqan/basic/basic_tag.h"(100) + +//____________________________________________________________________________ +// MyersHirschberg_ + +struct MyersHirschberg_; // "projects/library/seqan/basic/basic_tag.h"(109) + +//____________________________________________________________________________ +// NeedlemanWunsch_ + +struct NeedlemanWunsch_; // "projects/library/seqan/basic/basic_tag.h"(81) + +//____________________________________________________________________________ +// NilCase + +struct NilCase; // "projects/library/seqan/basic/basic_metaprogramming.h"(72) + +//____________________________________________________________________________ +// NonMinimalCtor_ + +struct NonMinimalCtor_; // "projects/library/seqan/basic/basic_definition.h"(77) + +//____________________________________________________________________________ +// Nothing + +struct Nothing; // "projects/library/seqan/basic/basic_definition.h"(99) + +//____________________________________________________________________________ +// Nussinov_ + +struct Nussinov_; // "projects/library/seqan/basic/basic_tag.h"(163) + +//____________________________________________________________________________ +// Object + +template struct Object; // "projects/library/seqan/basic/basic_type.h"(377) + +//____________________________________________________________________________ +// Pair + +template struct Pair; // "projects/library/seqan/basic/basic_aggregates.h"(69) + +//____________________________________________________________________________ +// Position + +template struct Position; // "projects/library/seqan/basic/basic_type.h"(161) + +//____________________________________________________________________________ +// PositionIterator + +struct PositionIterator; // "projects/library/seqan/basic/basic_iterator_position.h"(29) + +//____________________________________________________________________________ +// Power + +template <__int64 base, __int64 exponent > struct Power; // "projects/library/seqan/basic/basic_metaprogramming.h"(186) + +//____________________________________________________________________________ +// Proxy + +template struct Proxy; // "projects/library/seqan/basic/basic_transport.h"(67) +template struct Proxy; // "projects/library/seqan/basic/basic_proxy.h"(48) + +//____________________________________________________________________________ +// Reference + +template struct Reference; // "projects/library/seqan/basic/basic_type.h"(91) + +//____________________________________________________________________________ +// SWITCH + +template class SWITCH; // "projects/library/seqan/basic/basic_metaprogramming.h"(84) + +//____________________________________________________________________________ +// Simple + +struct Simple; // "projects/library/seqan/basic/basic_holder.h"(86) + +//____________________________________________________________________________ +// SimpleAlloc + +template struct SimpleAlloc; // "projects/library/seqan/basic/basic_allocator_simple.h"(46) + +//____________________________________________________________________________ +// SimpleIterator + +struct SimpleIterator; // "projects/library/seqan/basic/basic_iterator_simple.h"(30) + +//____________________________________________________________________________ +// SimpleType + +template struct SimpleType; // "projects/library/seqan/basic/basic_alphabet_simple.h"(58) + +//____________________________________________________________________________ +// SinglePool + +template struct SinglePool; // "projects/library/seqan/basic/basic_allocator_singlepool.h"(50) + +//____________________________________________________________________________ +// SinglePool2 + +template struct SinglePool2; // "projects/library/seqan/basic/basic_allocator_singlepool.h"(226) + +//____________________________________________________________________________ +// Size + +template struct Size; // "projects/library/seqan/basic/basic_type.h"(113) + +//____________________________________________________________________________ +// SmithWatermanClump_ + +struct SmithWatermanClump_; // "projects/library/seqan/basic/basic_tag.h"(145) + +//____________________________________________________________________________ +// SmithWatermanIsland_ + +struct SmithWatermanIsland_; // "projects/library/seqan/basic/basic_tag.h"(154) + +//____________________________________________________________________________ +// SmithWaterman_ + +struct SmithWaterman_; // "projects/library/seqan/basic/basic_tag.h"(136) + +//____________________________________________________________________________ +// Source + +template struct Source; // "projects/library/seqan/basic/basic_type.h"(392) + +//____________________________________________________________________________ +// Spec + +template struct Spec; // "projects/library/seqan/basic/basic_type.h"(200) + +//____________________________________________________________________________ +// StdAllocator + +template struct StdAllocator; // "projects/library/seqan/basic/basic_allocator_to_std.h"(166) + +//____________________________________________________________________________ +// StdContainerIterator + +template struct StdContainerIterator; // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(68) + +//____________________________________________________________________________ +// StdIteratorAdaptor + +struct StdIteratorAdaptor; // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(89) + +//____________________________________________________________________________ +// SupremumValue + +template struct SupremumValue; // "projects/library/seqan/basic/basic_alphabet_interface.h"(900) + +//____________________________________________________________________________ +// TYPECMP + +template struct TYPECMP; // "projects/library/seqan/basic/basic_metaprogramming.h"(54) + +//____________________________________________________________________________ +// Tag + +template struct Tag; // "projects/library/seqan/basic/basic_definition.h"(31) + +//____________________________________________________________________________ +// TagAllocateStorage_ + +struct TagAllocateStorage_; // "projects/library/seqan/basic/basic_allocator_interface.h"(84) + +//____________________________________________________________________________ +// TagAllocateTemp_ + +struct TagAllocateTemp_; // "projects/library/seqan/basic/basic_allocator_interface.h"(81) + +//____________________________________________________________________________ +// TagAllocateUnspecified_ + +struct TagAllocateUnspecified_; // "projects/library/seqan/basic/basic_allocator_interface.h"(78) + +//____________________________________________________________________________ +// TagRooted_ + +struct TagRooted_; // "projects/library/seqan/basic/basic_iterator.h"(48) + +//____________________________________________________________________________ +// TagStandard_ + +struct TagStandard_; // "projects/library/seqan/basic/basic_iterator.h"(51) + +//____________________________________________________________________________ +// ToStdAllocator + +template struct ToStdAllocator; // "projects/library/seqan/basic/basic_allocator_to_std.h"(61) + +//____________________________________________________________________________ +// Triple + +template struct Triple; // "projects/library/seqan/basic/basic_aggregates.h"(218) + +//____________________________________________________________________________ +// Tristate + +struct Tristate; // "projects/library/seqan/basic/basic_holder.h"(87) + +//____________________________________________________________________________ +// Tristate2 + +struct Tristate2; // "projects/library/seqan/basic/basic_holder.h"(790) + +//____________________________________________________________________________ +// True + +struct True; // "projects/library/seqan/basic/basic_definition.h"(87) + +//____________________________________________________________________________ +// Tuple + +template struct Tuple; // "projects/library/seqan/basic/basic_aggregates.h"(313) + +//____________________________________________________________________________ +// Value + +template struct Value; // "projects/library/seqan/basic/basic_type.h"(43) + +//____________________________________________________________________________ +// ValueSize + +template struct ValueSize; // "projects/library/seqan/basic/basic_alphabet_interface.h"(859) + +//____________________________________________________________________________ +// VertexDescriptor + +template struct VertexDescriptor; // "projects/library/seqan/basic/basic_type.h"(313) + +//____________________________________________________________________________ +// VolatilePtr + +template struct VolatilePtr; // "projects/library/seqan/basic/basic_volatile_ptr.h"(40) + +//____________________________________________________________________________ +// WEIGHT + +template struct WEIGHT; // "projects/library/seqan/basic/basic_type.h"(608) + +//____________________________________________________________________________ +// WorkerNothing + +struct WorkerNothing; // "projects/library/seqan/basic/basic_metaprogramming.h"(115) + +//____________________________________________________________________________ +// _AminoAcid + +struct _AminoAcid; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1085) + +//____________________________________________________________________________ +// _BitVector + +template struct _BitVector; // "projects/library/seqan/basic/basic_aggregates.h"(340) + +//____________________________________________________________________________ +// _ClassIdentifier + +template struct _ClassIdentifier; // "projects/library/seqan/basic/basic_definition.h"(269) + +//____________________________________________________________________________ +// _Compressed + +struct _Compressed; // "projects/library/seqan/basic/basic_aggregates.h"(29) + +//____________________________________________________________________________ +// _ConstParameter + +template struct _ConstParameter; // "projects/library/seqan/basic/basic_type.h"(474) + +//____________________________________________________________________________ +// _CopyConst + +template struct _CopyConst; // "projects/library/seqan/basic/basic_definition.h"(108) + +//____________________________________________________________________________ +// _Dna + +struct _Dna; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1010) + +//____________________________________________________________________________ +// _Dna5 + +struct _Dna5; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1034) + +//____________________________________________________________________________ +// _HammingDistance + +struct _HammingDistance; // "projects/library/seqan/basic/basic_tag.h"(50) + +//____________________________________________________________________________ +// _InfimumValueSigned + +template struct _InfimumValueSigned; // "projects/library/seqan/basic/basic_alphabet_interface.h"(876) + +//____________________________________________________________________________ +// _InfimumValueUnsigned + +template struct _InfimumValueUnsigned; // "projects/library/seqan/basic/basic_alphabet_interface.h"(874) + +//____________________________________________________________________________ +// _IsSameType + +template struct _IsSameType; // "projects/library/seqan/basic/basic_definition.h"(378) + +//____________________________________________________________________________ +// _IsSimple + +template struct _IsSimple; // "projects/library/seqan/basic/basic_alphabet_interface.h"(47) + +//____________________________________________________________________________ +// _Iupac + +struct _Iupac; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1058) + +//____________________________________________________________________________ +// _LevenshteinDistance + +struct _LevenshteinDistance; // "projects/library/seqan/basic/basic_tag.h"(51) + +//____________________________________________________________________________ +// _Log2_Impl + +template struct _Log2_Impl; // "projects/library/seqan/basic/basic_definition.h"(292) + +//____________________________________________________________________________ +// _MakeSigned + +template struct _MakeSigned; // "projects/library/seqan/basic/basic_definition.h"(212) + +//____________________________________________________________________________ +// _MakeUnsigned + +template struct _MakeUnsigned; // "projects/library/seqan/basic/basic_definition.h"(157) + +//____________________________________________________________________________ +// _Parameter + +template struct _Parameter; // "projects/library/seqan/basic/basic_type.h"(416) + +//____________________________________________________________________________ +// _Pointer + +template struct _Pointer; // "projects/library/seqan/basic/basic_type.h"(519) + +//____________________________________________________________________________ +// _RemoveConst + +template struct _RemoveConst; // "projects/library/seqan/basic/basic_definition.h"(126) + +//____________________________________________________________________________ +// _SupremumValueSigned + +template struct _SupremumValueSigned; // "projects/library/seqan/basic/basic_alphabet_interface.h"(871) + +//____________________________________________________________________________ +// _SupremumValueUnsigned + +template struct _SupremumValueUnsigned; // "projects/library/seqan/basic/basic_alphabet_interface.h"(869) + +//____________________________________________________________________________ +// _Translate_Table_AA_2_Ascii + +template struct _Translate_Table_AA_2_Ascii; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(337) + +//____________________________________________________________________________ +// _Translate_Table_Ascii_2_AA + +template struct _Translate_Table_Ascii_2_AA; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(374) + +//____________________________________________________________________________ +// _Translate_Table_Ascii_2_Dna + +template struct _Translate_Table_Ascii_2_Dna; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(138) + +//____________________________________________________________________________ +// _Translate_Table_Ascii_2_Dna5 + +template struct _Translate_Table_Ascii_2_Dna5; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(176) + +//____________________________________________________________________________ +// _Translate_Table_Ascii_2_Iupac + +template struct _Translate_Table_Ascii_2_Iupac; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(214) + +//____________________________________________________________________________ +// _Translate_Table_Byte_2_AA + +template struct _Translate_Table_Byte_2_AA; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(412) + +//____________________________________________________________________________ +// _Translate_Table_Byte_2_Dna + +template struct _Translate_Table_Byte_2_Dna; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(251) + +//____________________________________________________________________________ +// _Translate_Table_Byte_2_Dna5 + +template struct _Translate_Table_Byte_2_Dna5; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(280) + +//____________________________________________________________________________ +// _Translate_Table_Byte_2_Iupac + +template struct _Translate_Table_Byte_2_Iupac; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(308) + +//____________________________________________________________________________ +// _Translate_Table_Dna5_2_Ascii + +template struct _Translate_Table_Dna5_2_Ascii; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(33) + +//____________________________________________________________________________ +// _Translate_Table_Dna5_2_Iupac + +template struct _Translate_Table_Dna5_2_Iupac; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(43) + +//____________________________________________________________________________ +// _Translate_Table_Iupac_2_Ascii + +template struct _Translate_Table_Iupac_2_Ascii; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(53) + +//____________________________________________________________________________ +// _Translate_Table_Iupac_2_Dna + +template struct _Translate_Table_Iupac_2_Dna; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(81) + +//____________________________________________________________________________ +// _Translate_Table_Iupac_2_Dna5 + +template struct _Translate_Table_Iupac_2_Dna5; // "projects/library/seqan/basic/basic_alphabet_simple_tabs.h"(110) + +//____________________________________________________________________________ +// _TupleShiftLeftWorker + +struct _TupleShiftLeftWorker; // "projects/library/seqan/basic/basic_aggregates.h"(510) + +//____________________________________________________________________________ +// _TupleShiftRightWorker + +struct _TupleShiftRightWorker; // "projects/library/seqan/basic/basic_aggregates.h"(517) + +//____________________________________________________________________________ +// _ValueConstructor + +struct _ValueConstructor; // "projects/library/seqan/basic/basic_alphabet_interface.h"(81) + +//____________________________________________________________________________ +// _ValueConstructorProxy + +struct _ValueConstructorProxy; // "projects/library/seqan/basic/basic_alphabet_interface.h"(111) + +//____________________________________________________________________________ +// _ValueDestructor + +struct _ValueDestructor; // "projects/library/seqan/basic/basic_alphabet_interface.h"(125) + +//____________________________________________________________________________ +// _ValueDestructorProxy + +struct _ValueDestructorProxy; // "projects/library/seqan/basic/basic_alphabet_interface.h"(135) + +} //namespace SEQAN_NAMESPACE_MAIN + + +////////////////////////////////////////////////////////////////////////////// +// TYPEDEFS +////////////////////////////////////////////////////////////////////////////// + +namespace SEQAN_NAMESPACE_MAIN { + +//____________________________________________________________________________ +// AminoAcid + +typedef SimpleType AminoAcid; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1086) + +//____________________________________________________________________________ +// Ascii + +typedef char Ascii; // "projects/library/seqan/basic/basic_alphabet_interface.h"(61) + +//____________________________________________________________________________ +// Byte + +typedef unsigned char Byte; // "projects/library/seqan/basic/basic_alphabet_interface.h"(62) + +//____________________________________________________________________________ +// Compressed + +typedef Tag<_Compressed> Compressed; // "projects/library/seqan/basic/basic_aggregates.h"(30) + +//____________________________________________________________________________ +// Default + +typedef Tag const Default; // "projects/library/seqan/basic/basic_definition.h"(41) + +//____________________________________________________________________________ +// Dna + +typedef SimpleType Dna; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1011) + +//____________________________________________________________________________ +// Dna5 + +typedef SimpleType Dna5; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1035) + +//____________________________________________________________________________ +// DotDrawing + +typedef Tag const DotDrawing; // "projects/library/seqan/basic/basic_tag.h"(37) + +//____________________________________________________________________________ +// EditDistance + +typedef Tag<_LevenshteinDistance> EditDistance; // "projects/library/seqan/basic/basic_tag.h"(55) + +//____________________________________________________________________________ +// GoEnd + +typedef Tag const GoEnd; // "projects/library/seqan/basic/basic_definition.h"(67) + +//____________________________________________________________________________ +// Gotoh + +typedef Tag const Gotoh; // "projects/library/seqan/basic/basic_tag.h"(91) + +//____________________________________________________________________________ +// HammingDistance + +typedef Tag<_HammingDistance> HammingDistance; // "projects/library/seqan/basic/basic_tag.h"(53) + +//____________________________________________________________________________ +// Hirschberg + +typedef Tag const Hirschberg; // "projects/library/seqan/basic/basic_tag.h"(119) + +//____________________________________________________________________________ +// Iupac + +typedef SimpleType Iupac; // "projects/library/seqan/basic/basic_alphabet_simple.h"(1059) + +//____________________________________________________________________________ +// LevenshteinDistance + +typedef Tag<_LevenshteinDistance> LevenshteinDistance; // "projects/library/seqan/basic/basic_tag.h"(54) + +//____________________________________________________________________________ +// MinimalCtor + +typedef Tag const MinimalCtor; // "projects/library/seqan/basic/basic_definition.h"(74) + +//____________________________________________________________________________ +// Move + +typedef Tag const Move; // "projects/library/seqan/basic/basic_definition.h"(61) + +//____________________________________________________________________________ +// MyersBitVector + +typedef Tag const MyersBitVector; // "projects/library/seqan/basic/basic_tag.h"(101) + +//____________________________________________________________________________ +// MyersHirschberg + +typedef Tag const MyersHirschberg; // "projects/library/seqan/basic/basic_tag.h"(110) + +//____________________________________________________________________________ +// NeedlemanWunsch + +typedef Tag const NeedlemanWunsch; // "projects/library/seqan/basic/basic_tag.h"(82) + +//____________________________________________________________________________ +// NonMinimalCtor + +typedef Tag const NonMinimalCtor; // "projects/library/seqan/basic/basic_definition.h"(78) + +//____________________________________________________________________________ +// Nussinov + +typedef Tag const Nussinov; // "projects/library/seqan/basic/basic_tag.h"(164) + +//____________________________________________________________________________ +// PoolAllocator + +typedef Allocator >, 0x100> > PoolAllocator; // "projects/library/seqan/basic/basic_allocator_multipool.h"(54) + +//____________________________________________________________________________ +// Rooted + +typedef Tag const Rooted; // "projects/library/seqan/basic/basic_iterator.h"(49) + +//____________________________________________________________________________ +// SimpleAllocator + +typedef Allocator > SimpleAllocator; // "projects/library/seqan/basic/basic_allocator_simple.h"(51) + +//____________________________________________________________________________ +// SmithWaterman + +typedef Tag const SmithWaterman; // "projects/library/seqan/basic/basic_tag.h"(137) + +//____________________________________________________________________________ +// SmithWatermanClump + +typedef Tag const SmithWatermanClump; // "projects/library/seqan/basic/basic_tag.h"(146) + +//____________________________________________________________________________ +// SmithWatermanIsland + +typedef Tag const SmithWatermanIsland; // "projects/library/seqan/basic/basic_tag.h"(155) + +//____________________________________________________________________________ +// Standard + +typedef Tag const Standard; // "projects/library/seqan/basic/basic_iterator.h"(52) + +//____________________________________________________________________________ +// TagAllocateStorage + +typedef Tag const TagAllocateStorage; // "projects/library/seqan/basic/basic_allocator_interface.h"(85) + +//____________________________________________________________________________ +// TagAllocateTemp + +typedef Tag const TagAllocateTemp; // "projects/library/seqan/basic/basic_allocator_interface.h"(82) + +//____________________________________________________________________________ +// TagAllocateUnspecified + +typedef Tag const TagAllocateUnspecified; // "projects/library/seqan/basic/basic_allocator_interface.h"(79) + +//____________________________________________________________________________ +// Unicode + +typedef wchar_t Unicode; // "projects/library/seqan/basic/basic_alphabet_interface.h"(63) + +} //namespace SEQAN_NAMESPACE_MAIN + + +////////////////////////////////////////////////////////////////////////////// +// FUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +namespace SEQAN_NAMESPACE_MAIN { +namespace debug { + +//____________________________________________________________________________ +// Error + +template void Error(const char * file, int line, const char * comment); // "projects/library/seqan/basic/basic_debug.h"(250) + +//____________________________________________________________________________ +// Message + +template void Message(const char * file, int line, const char * comment); // "projects/library/seqan/basic/basic_debug.h"(260) + +//____________________________________________________________________________ +// Result + +template void Result(const char * file, int line, const char * comment); // "projects/library/seqan/basic/basic_debug.h"(269) + +//____________________________________________________________________________ +// checkpoint + +inline bool checkpoint(unsigned int line, char const* file); // "projects/library/seqan/basic/basic_debug.h"(321) + +//____________________________________________________________________________ +// testCheckpoint + +inline void testCheckpoint(char const* file, unsigned int line); // "projects/library/seqan/basic/basic_debug.h"(338) + +//____________________________________________________________________________ +// verifyCheckpoints + +inline void verifyCheckpoints(char const* file); // "projects/library/seqan/basic/basic_debug.h"(346) + +} //namespace debug +} //namespace SEQAN_NAMESPACE_MAIN +////////////////////////////////////////////////////////////////////////////// + +namespace SEQAN_NAMESPACE_MAIN { + +//____________________________________________________________________________ +// _allocatorBlockNumber + +template inline unsigned int _allocatorBlockNumber(Allocator > &, size_t size_); // "projects/library/seqan/basic/basic_allocator_multipool.h"(140) + +//____________________________________________________________________________ +// _arrayClearSpace_Default + +template void _arrayClearSpace_Default(TIterator array_begin, size_t array_length, size_t keep_from, size_t move_to); // "projects/library/seqan/basic/basic_alphabet_interface.h"(774) + +//____________________________________________________________________________ +// _arrayClearSpace_Pointer + +template inline void _arrayClearSpace_Pointer(TValue * array_begin, size_t array_length, size_t keep_from, size_t move_to, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(342) +template inline void _arrayClearSpace_Pointer(TValue * array_begin, size_t array_length, size_t keep_from, size_t move_to, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(354) + +//____________________________________________________________________________ +// _arrayConstructCopy_Default + +template inline void _arrayConstructCopy_Default(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(349) + +//____________________________________________________________________________ +// _arrayConstructCopy_Pointer + +template inline void _arrayConstructCopy_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(100) +template inline void _arrayConstructCopy_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(110) + +//____________________________________________________________________________ +// _arrayConstructMove_Default + +template inline void _arrayConstructMove_Default(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(397) + +//____________________________________________________________________________ +// _arrayConstructMove_Pointer + +template inline void _arrayConstructMove_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(134) +template inline void _arrayConstructMove_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(144) + +//____________________________________________________________________________ +// _arrayConstruct_Default + +template inline void _arrayConstruct_Default(TIterator1 begin_, TIterator2 end_); // "projects/library/seqan/basic/basic_alphabet_interface.h"(280) +template inline void _arrayConstruct_Default(TIterator1 begin_, TIterator2 end_, TParam const & param_); // "projects/library/seqan/basic/basic_alphabet_interface.h"(304) + +//____________________________________________________________________________ +// _arrayConstruct_Pointer + +template inline void _arrayConstruct_Pointer(TIterator, TIterator, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(36) +template inline void _arrayConstruct_Pointer(TIterator begin_, TIterator end_, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(45) +template inline void _arrayConstruct_Pointer(TIterator begin_, TIterator end_, TParam const & param_, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(66) +template inline void _arrayConstruct_Pointer(TIterator begin_, TIterator end_, TParam const & param_, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(76) + +//____________________________________________________________________________ +// _arrayCopyBackward_Default + +template inline void _arrayCopyBackward_Default(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(547) + +//____________________________________________________________________________ +// _arrayCopyBackward_Pointer + +template inline void _arrayCopyBackward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(239) +template inline void _arrayCopyBackward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(249) + +//____________________________________________________________________________ +// _arrayCopyForward_Default + +template inline void _arrayCopyForward_Default(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(504) + +//____________________________________________________________________________ +// _arrayCopyForward_Pointer + +template inline void _arrayCopyForward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(205) +template inline void _arrayCopyForward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(215) + +//____________________________________________________________________________ +// _arrayDestruct_Default + +template inline void _arrayDestruct_Default(TIterator1 begin_, TIterator2 end_); // "projects/library/seqan/basic/basic_alphabet_interface.h"(436) + +//____________________________________________________________________________ +// _arrayDestruct_Pointer + +template inline void _arrayDestruct_Pointer(TValue * , TValue * , True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(167) +template inline void _arrayDestruct_Pointer(TValue * begin_, TValue * end_, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(176) + +//____________________________________________________________________________ +// _arrayMoveBackward_Default + +template inline void _arrayMoveBackward_Default(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(679) + +//____________________________________________________________________________ +// _arrayMoveBackward_Pointer + +template inline void _arrayMoveBackward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(307) +template inline void _arrayMoveBackward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(317) + +//____________________________________________________________________________ +// _arrayMoveForward_Default + +template inline void _arrayMoveForward_Default(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(630) + +//____________________________________________________________________________ +// _arrayMoveForward_Pointer + +template inline void _arrayMoveForward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, True); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(273) +template inline void _arrayMoveForward_Pointer(TValue * source_begin, TValue * source_end, TValue * target_begin, False); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(283) + +//____________________________________________________________________________ +// _intPow + +template inline TValue _intPow(TValue a, TExponent b); // "projects/library/seqan/basic/basic_definition.h"(334) + +//____________________________________________________________________________ +// _isSameType + +template inline bool _isSameType(); // "projects/library/seqan/basic/basic_definition.h"(393) + +//____________________________________________________________________________ +// _max + +template inline const _Ty& _max(const _Ty& _Left, const _Ty& _Right); // "projects/library/seqan/basic/basic_definition.h"(367) + +//____________________________________________________________________________ +// _min + +template inline const _Tx& _min(const _Tx& _Left, const _Tx& _Right); // "projects/library/seqan/basic/basic_definition.h"(352) +template inline _Tx _min(const _Tx& _Left, const _Ty& _Right); // "projects/library/seqan/basic/basic_definition.h"(361) + +//____________________________________________________________________________ +// _toParameter + +template typename _Parameter::Type _toParameter(T * _object); // "projects/library/seqan/basic/basic_type.h"(447) +template typename _Parameter::Type _toParameter(T _object); // "projects/library/seqan/basic/basic_type.h"(454) + +//____________________________________________________________________________ +// _toPointer + +template typename _Pointer::Type _toPointer(T & _object); // "projects/library/seqan/basic/basic_type.h"(553) +template typename _Pointer::Type _toPointer(T const & _object); // "projects/library/seqan/basic/basic_type.h"(560) +template typename _Pointer::Type _toPointer(T * _object); // "projects/library/seqan/basic/basic_type.h"(568) + +//____________________________________________________________________________ +// addRef + +template inline void addRef(T & ); // "projects/library/seqan/basic/basic_holder.h"(45) +template inline void addRef(T const & ); // "projects/library/seqan/basic/basic_holder.h"(51) + +//____________________________________________________________________________ +// allocate + +template inline void allocate(Allocator > & me, TValue * & data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(162) +template inline void allocate(Allocator > & me, TValue2 * & data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(279) +template inline void allocate(Allocator > & me, TValue * & data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_multipool.h"(165) +template inline void allocate(Allocator > & me, TValue * & data, TSize count, Tag const); // "projects/library/seqan/basic/basic_allocator_simple.h"(146) +template inline void allocate(T const & me, TValue * & data, TSize count); // "projects/library/seqan/basic/basic_allocator_interface.h"(129) +template inline void allocate(T & me, TValue * & data, TSize count); // "projects/library/seqan/basic/basic_allocator_interface.h"(137) +template inline void allocate(T const &, TValue * & data, TSize count, Tag const); // "projects/library/seqan/basic/basic_allocator_interface.h"(147) +template inline void allocate(T &, TValue * & data, TSize count, Tag const); // "projects/library/seqan/basic/basic_allocator_interface.h"(158) +//template inline void allocate(Allocator > & me, TValue * & data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(173) +template inline void allocate(Allocator > & me, TValue2 * & data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(302) + +//____________________________________________________________________________ +// arrayClearSpace + +template void arrayClearSpace(TIterator array_begin, size_t array_length, size_t keep_from, size_t move_to); // "projects/library/seqan/basic/basic_alphabet_interface.h"(818) +template void arrayClearSpace(TValue * array_begin, size_t array_length, size_t keep_from, size_t move_to); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(362) + +//____________________________________________________________________________ +// arrayConstruct + +template inline void arrayConstruct(TIterator1 begin_, TIterator2 end_); // "projects/library/seqan/basic/basic_alphabet_interface.h"(292) +template inline void arrayConstruct(TIterator1 begin_, TIterator2 end_, TParam const & param_); // "projects/library/seqan/basic/basic_alphabet_interface.h"(317) +template inline void arrayConstruct(TValue * begin_, TValue * end_); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(53) +template inline void arrayConstruct(TValue * begin_, TValue * end_, TParam const & param_); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(85) + +//____________________________________________________________________________ +// arrayConstructCopy + +template inline void arrayConstructCopy(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(364) +template inline void arrayConstructCopy(TValue * source_begin, TValue * source_end, TValue * target_begin); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(119) + +//____________________________________________________________________________ +// arrayConstructMove + +template inline void arrayConstructMove(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(412) +template inline void arrayConstructMove(TValue * source_begin, TValue * source_end, TValue * target_begin); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(153) + +//____________________________________________________________________________ +// arrayCopy + +template inline void arrayCopy(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(591) + +//____________________________________________________________________________ +// arrayCopyBackward + +template inline void arrayCopyBackward(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(556) +template inline void arrayCopyBackward(TValue * source_begin, TValue * source_end, TValue * target_begin); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(258) + +//____________________________________________________________________________ +// arrayCopyForward + +template inline void arrayCopyForward(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(513) +template inline void arrayCopyForward(TValue * source_begin, TValue * source_end, TValue * target_begin); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(224) + +//____________________________________________________________________________ +// arrayDestruct + +template inline void arrayDestruct(TIterator1 begin_, TIterator2 end_); // "projects/library/seqan/basic/basic_alphabet_interface.h"(448) +template inline void arrayDestruct(TValue * begin_, TValue * end_); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(184) + +//____________________________________________________________________________ +// arrayFill + +template inline void arrayFill(TIterator1 begin_, TIterator2 end_, TValue const & value); // "projects/library/seqan/basic/basic_alphabet_interface.h"(474) + +//____________________________________________________________________________ +// arrayMove + +template inline void arrayMove(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(732) + +//____________________________________________________________________________ +// arrayMoveBackward + +template inline void arrayMoveBackward(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(694) +template inline void arrayMoveBackward(TValue * source_begin, TValue * source_end, TValue * target_begin); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(326) + +//____________________________________________________________________________ +// arrayMoveForward + +template inline void arrayMoveForward(TSource1 source_begin, TSource2 source_end, TTarget target_begin); // "projects/library/seqan/basic/basic_alphabet_interface.h"(644) +template inline void arrayMoveForward(TValue * source_begin, TValue * source_end, TValue * target_begin); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(292) + +//____________________________________________________________________________ +// assign + +template inline void assign(SimpleType & target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(294) +template inline void assign(SimpleType & target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(302) +template inline void assign(SimpleType & target, TSource & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(313) +template inline void assign(SimpleType & target, TSource const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(321) +template inline void assign(SimpleType & target, Proxy & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(334) +template inline void assign(SimpleType & target, Proxy const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(343) +template inline void assign(int & c_target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(358) +template inline void assign(int & c_target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(366) +template inline void assign(unsigned int & c_target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(376) +template inline void assign(unsigned int & c_target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(384) +template inline void assign(short & c_target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(394) +template inline void assign(short & c_target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(402) +template inline void assign(unsigned short & c_target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(412) +template inline void assign(unsigned short & c_target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(420) +template inline void assign(char & c_target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(430) +template inline void assign(char & c_target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(438) +template inline void assign(signed char & c_target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(448) +template inline void assign(signed char & c_target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(456) +template inline void assign(unsigned char & c_target, SimpleType & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(466) +template inline void assign(unsigned char & c_target, SimpleType const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(474) +inline void assign(Ascii & c_target, Dna const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1096) +inline void assign(Ascii & c_target, Dna5 const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1104) +inline void assign(Ascii & c_target, Iupac const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1111) +inline void assign(Ascii & c_target, AminoAcid const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1118) +inline void assign(Dna & target, Byte c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1129) +inline void assign(Dna & target, Ascii c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1138) +inline void assign(Dna & target, Unicode c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1147) +inline void assign(Dna & target, Dna5 const & c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1156) +inline void assign(Dna & target, Iupac const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1165) +inline void assign(Dna5 & target, Byte c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1176) +inline void assign(Dna5 & target, Ascii c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1185) +inline void assign(Dna5 & target, Unicode c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1194) +inline void assign(Dna5 & target, Iupac const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1203) +inline void assign(Dna5 & target, Dna const & c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1213) +inline void assign(Iupac & target, Byte c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1224) +inline void assign(Iupac & target, Ascii c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1233) +inline void assign(Iupac & target, Unicode c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1242) +inline void assign(Iupac & target, Dna const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1249) +inline void assign(Iupac & target, Dna5 const & source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1256) +inline void assign(AminoAcid & target, Byte c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1267) +inline void assign(AminoAcid & target, Ascii c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1276) +inline void assign(AminoAcid & target, Unicode c_source); // "projects/library/seqan/basic/basic_alphabet_simple.h"(1285) +template inline void assign(TTarget & target, TSource & source); // "projects/library/seqan/basic/basic_transport.h"(52) +template inline void assign(TTarget & target, TSource const & source); // "projects/library/seqan/basic/basic_transport.h"(60) +template inline void assign(Proxy & target, TSource & source); // "projects/library/seqan/basic/basic_transport.h"(73) +template inline void assign(Proxy & target, TSource const & source); // "projects/library/seqan/basic/basic_transport.h"(82) +template inline void assign(Iter & target, TSource const & source); // "projects/library/seqan/basic/basic_iterator_position.h"(440) +template inline void assign(Holder & target_, Holder const & source_); // "projects/library/seqan/basic/basic_holder.h"(554) +template inline void assign(Holder & target_, Holder const & source_); // "projects/library/seqan/basic/basic_holder.h"(774) +template inline void assign(Holder & target_, Holder const & source_); // "projects/library/seqan/basic/basic_holder.h"(1091) +template inline void assign(Iter > & target, TSource const & source); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(514) +template inline void assign(Iter & target, TSource const & source); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(427) + +//____________________________________________________________________________ +// assignHost + +template inline void assignHost(T & me, THost & host_); // "projects/library/seqan/basic/basic_host.h"(135) +template inline void assignHost(T & me, THost const & host_); // "projects/library/seqan/basic/basic_host.h"(143) + +//____________________________________________________________________________ +// assignValue + +template inline void assignValue(Iter & me, TValue _value); // "projects/library/seqan/basic/basic_iterator_position.h"(184) +template inline void assignValue(Iter const & me, TValue _value); // "projects/library/seqan/basic/basic_iterator_position.h"(192) +template inline void assignValue(Holder & me, TSource const & value_); // "projects/library/seqan/basic/basic_holder.h"(512) +template inline void assignValue(Holder & me, TSource const & value_); // "projects/library/seqan/basic/basic_holder.h"(752) +template inline void assignValue(Holder & me, TSource const & value_); // "projects/library/seqan/basic/basic_holder.h"(1049) +template inline void assignValue(T & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator.h"(258) +template inline void assignValue(T const & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator.h"(268) +template inline void assignValue(Iter > & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(288) +template inline void assignValue(Iter > const & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(296) +template inline void assignValue(Iter & me, TValue & val); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(165) +template inline void assignValue(Iter & me, TValue const & val); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(172) + +//____________________________________________________________________________ +// assignValueAt + +template inline TSource & assignValueAt(TObject &me, TPos k, TSource &source); // "projects/library/seqan/basic/basic_aggregates.h"(442) +template inline TSource const & assignValueAt(TObject &me, TPos k, TSource const &source); // "projects/library/seqan/basic/basic_aggregates.h"(449) +template inline SSS const assignValueAt(Tuple &me, TPos k, SSS const source); // "projects/library/seqan/basic/basic_aggregates.h"(455) +template inline SSS const assignValueAt(Tuple &me, TPos k, SSS const source); // "projects/library/seqan/basic/basic_aggregates.h"(460) +template inline SimpleType const & assignValueAt(Tuple &me, TPos k, SimpleType const &source); // "projects/library/seqan/basic/basic_aggregates.h"(468) + +//____________________________________________________________________________ +// assignValueI1 + +template inline void assignValueI1(Pair &pair, T const &_i); // "projects/library/seqan/basic/basic_aggregates.h"(613) +template inline void assignValueI1(Pair > &pair, T const &_i); // "projects/library/seqan/basic/basic_aggregates.h"(624) +template inline T const assignValueI1(Triple &triple, T const &_i); // "projects/library/seqan/basic/basic_aggregates.h"(638) + +//____________________________________________________________________________ +// assignValueI2 + +template inline void assignValueI2(Pair &pair, T const &_i); // "projects/library/seqan/basic/basic_aggregates.h"(618) +template inline void assignValueI2(Pair > &pair, T const &_i); // "projects/library/seqan/basic/basic_aggregates.h"(631) +template inline T const assignValueI2(Triple &triple, T const &_i); // "projects/library/seqan/basic/basic_aggregates.h"(643) + +//____________________________________________________________________________ +// assignValueI3 + +template inline T const assignValueI3(Triple &triple, T const &_i); // "projects/library/seqan/basic/basic_aggregates.h"(648) + +//____________________________________________________________________________ +// atBegin + +template inline bool atBegin(T const & it, TContainer const & cont); // "projects/library/seqan/basic/basic_iterator.h"(394) +template inline bool atBegin(T const & it); // "projects/library/seqan/basic/basic_iterator.h"(404) + +//____________________________________________________________________________ +// atEnd + +template inline bool atEnd(T & it, TContainer const & cont); // "projects/library/seqan/basic/basic_iterator.h"(435) +template inline bool atEnd(T const & it, TContainer const & cont); // "projects/library/seqan/basic/basic_iterator.h"(443) +template inline bool atEnd(T & it); // "projects/library/seqan/basic/basic_iterator.h"(452) +template inline bool atEnd(T const & it); // "projects/library/seqan/basic/basic_iterator.h"(459) +template inline bool atEnd(Iter > & me); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(501) + +//____________________________________________________________________________ +// atNil + +template inline bool atNil(TIterator & me); // "projects/library/seqan/basic/basic_iterator.h"(714) +template inline bool atNil(TIterator * me); // "projects/library/seqan/basic/basic_iterator.h"(723) + +//____________________________________________________________________________ +// call_allocate + +template inline void call_allocate(TMe & me, TValue * & data, TSize const count); // "projects/library/seqan/basic/basic_allocator_to_std.h"(33) + +//____________________________________________________________________________ +// call_deallocate + +template inline void call_deallocate(TMe & me, TValue * data, TSize const count); // "projects/library/seqan/basic/basic_allocator_to_std.h"(38) + +//____________________________________________________________________________ +// clear + +template void clear(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(146) +template void clear(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(266) +template inline void clear(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(314) +template inline void clear(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(685) +template inline void clear(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(901) +template void clear(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_multipool.h"(125) +template void clear(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_simple.h"(126) +//template void clear(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(157) +template void clear(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(289) +template inline void clear(Tuple &me); // "projects/library/seqan/basic/basic_aggregates.h"(479) +template inline void clear(Tuple &me); // "projects/library/seqan/basic/basic_aggregates.h"(483) + +//____________________________________________________________________________ +// clearHost + +template inline void clearHost(T & me); // "projects/library/seqan/basic/basic_host.h"(59) + +//____________________________________________________________________________ +// container + +template inline typename Container::Type container(T me); // "projects/library/seqan/basic/basic_iterator.h"(328) + +//____________________________________________________________________________ +// convert + +template inline typename Convert::Type convert(TSource const & source); // "projects/library/seqan/basic/basic_converter.h"(110) + +//____________________________________________________________________________ +// convertImpl + +template inline typename _RemoveConst::Type convertImpl(Convert const, SimpleType const & source_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(247) +template inline typename Convert >::Type convertImpl(Convert const, Proxy & source); // "projects/library/seqan/basic/basic_proxy.h"(264) +template inline typename Convert const>::Type convertImpl(Convert const, Proxy const & source); // "projects/library/seqan/basic/basic_proxy.h"(271) +template inline typename Convert::Type convertImpl(Convert const, TSource & source); // "projects/library/seqan/basic/basic_converter.h"(78) +template inline typename Convert::Type convertImpl(Convert const, TSource const & source); // "projects/library/seqan/basic/basic_converter.h"(85) + +//____________________________________________________________________________ +// create + +template inline void create(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(361) +template inline void create(Holder & me, typename _Parameter::Type value_); // "projects/library/seqan/basic/basic_holder.h"(395) +template inline void create(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(694) +template inline void create(Holder & me, TValue const & value_); // "projects/library/seqan/basic/basic_holder.h"(704) +template inline void create(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(932) +template inline void create(Holder & me, TValue const & value_); // "projects/library/seqan/basic/basic_holder.h"(966) + +//____________________________________________________________________________ +// createHost + +template inline void createHost(T & me); // "projects/library/seqan/basic/basic_host.h"(69) +template inline void createHost(T & me, THost & host_); // "projects/library/seqan/basic/basic_host.h"(80) +template inline void createHost(T & me, THost const & host_); // "projects/library/seqan/basic/basic_host.h"(88) + +//____________________________________________________________________________ +// deallocate + +template inline void deallocate(Allocator > & me, TValue * data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(202) +template inline void deallocate(Allocator > & me, TValue2 * data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(290) +template inline void deallocate(Allocator > & me, TValue * data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_multipool.h"(207) +template inline void deallocate(Allocator > & me, TValue * data, TSize, Tag const); // "projects/library/seqan/basic/basic_allocator_simple.h"(181) +template inline void deallocate(T const & me, TValue * data, TSize const count); // "projects/library/seqan/basic/basic_allocator_interface.h"(198) +template inline void deallocate(T & me, TValue * data, TSize const count); // "projects/library/seqan/basic/basic_allocator_interface.h"(206) +template inline void deallocate(T const & , TValue * data, TSize count, Tag const); // "projects/library/seqan/basic/basic_allocator_interface.h"(216) +template inline void deallocate(T & , TValue * data, TSize count, Tag const); // "projects/library/seqan/basic/basic_allocator_interface.h"(227) +//template inline void deallocate(Allocator > & me, TValue * data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(222) +template inline void deallocate(Allocator > & me, TValue2 * data, TSize count, Tag const tag_); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(313) + +//____________________________________________________________________________ +// dependent + +template inline bool dependent(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(300) +template inline bool dependent(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(675) +template inline bool dependent(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(887) + +//____________________________________________________________________________ +// dependentHost + +template inline bool dependentHost(T const & me); // "projects/library/seqan/basic/basic_host.h"(49) + +//____________________________________________________________________________ +// detach + +template inline void detach(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(430) +template inline void detach(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(714) +template inline void detach(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(987) + +//____________________________________________________________________________ +// difference + +template inline typename Difference::Type difference( TIterator const & begin, TIterator const & end); // "projects/library/seqan/basic/basic_iterator.h"(657) + +//____________________________________________________________________________ +// empty + +template inline bool empty(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(288) +template inline bool empty(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(665) +template inline bool empty(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(875) + +//____________________________________________________________________________ +// emptyHost + +template inline bool emptyHost(T const & me); // "projects/library/seqan/basic/basic_host.h"(39) + +//____________________________________________________________________________ +// gapValue + +template inline T const & gapValue(); // "projects/library/seqan/basic/basic_alphabet_interface2.h"(71) + +//____________________________________________________________________________ +// gapValueImpl + +inline char const & gapValueImpl(char *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(400) +inline char const & gapValueImpl(char const *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(407) +template inline T const & gapValueImpl(T *); // "projects/library/seqan/basic/basic_alphabet_interface2.h"(48) + +//____________________________________________________________________________ +// getValue + +template typename GetValue >::Type getValue(Proxy & me); // "projects/library/seqan/basic/basic_proxy.h"(235) +template typename GetValue const>::Type getValue(Proxy const & me); // "projects/library/seqan/basic/basic_proxy.h"(241) +template inline typename GetValue::Type getValue(T & me); // "projects/library/seqan/basic/basic_iterator.h"(210) +template inline typename GetValue::Type getValue(T const & me); // "projects/library/seqan/basic/basic_iterator.h"(217) +template inline T & getValue(T * me); // "projects/library/seqan/basic/basic_iterator.h"(225) + +//____________________________________________________________________________ +// getValueI1 + +template inline T1 getValueI1(Pair const &pair); // "projects/library/seqan/basic/basic_aggregates.h"(572) +template inline T1 getValueI1(Pair > const &pair); // "projects/library/seqan/basic/basic_aggregates.h"(582) +template inline T1 getValueI1(Triple const &triple); // "projects/library/seqan/basic/basic_aggregates.h"(595) + +//____________________________________________________________________________ +// getValueI2 + +template inline T2 getValueI2(Pair const &pair); // "projects/library/seqan/basic/basic_aggregates.h"(577) +template inline T2 getValueI2(Pair > const &pair); // "projects/library/seqan/basic/basic_aggregates.h"(588) +template inline T2 getValueI2(Triple const &triple); // "projects/library/seqan/basic/basic_aggregates.h"(600) + +//____________________________________________________________________________ +// getValueI3 + +template inline T3 getValueI3(Triple const &triple); // "projects/library/seqan/basic/basic_aggregates.h"(605) + +//____________________________________________________________________________ +// goBegin + +template inline void goBegin(TIterator & it, TContainer & container); // "projects/library/seqan/basic/basic_iterator.h"(488) +template inline void goBegin(TIterator & it); // "projects/library/seqan/basic/basic_iterator.h"(506) + +//____________________________________________________________________________ +// goEnd + +template inline void goEnd(TIterator & it, TContainer & container); // "projects/library/seqan/basic/basic_iterator.h"(536) +template inline void goEnd(TIterator & it, TContainer const & container); // "projects/library/seqan/basic/basic_iterator.h"(544) +template inline void goEnd(TIterator & it); // "projects/library/seqan/basic/basic_iterator.h"(552) + +//____________________________________________________________________________ +// goFurther + +template inline void goFurther(TIterator & it, TDiff steps); // "projects/library/seqan/basic/basic_iterator.h"(602) + +//____________________________________________________________________________ +// goNext + +template inline void goNext(Iter & me); // "projects/library/seqan/basic/basic_iterator_position.h"(295) +template inline void goNext(TIterator & it); // "projects/library/seqan/basic/basic_iterator.h"(576) +template inline void goNext(Iter > & me); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(355) +template inline void goNext(Iter & me); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(280) + +//____________________________________________________________________________ +// goNil + +template inline void goNil(TIterator & me); // "projects/library/seqan/basic/basic_iterator.h"(681) +template inline void goNil(TIterator * & me); // "projects/library/seqan/basic/basic_iterator.h"(689) + +//____________________________________________________________________________ +// goPrevious + +template inline void goPrevious(Iter & me); // "projects/library/seqan/basic/basic_iterator_position.h"(307) +template inline void goPrevious(TIterator & it); // "projects/library/seqan/basic/basic_iterator.h"(626) +template inline void goPrevious(Iter > & me); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(367) +template inline void goPrevious(Iter & me); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(292) + +//____________________________________________________________________________ +// host + +template inline typename Host::Type & host(T & me); // "projects/library/seqan/basic/basic_host.h"(117) +template inline typename Host::Type & host(T const & me); // "projects/library/seqan/basic/basic_host.h"(124) + +//____________________________________________________________________________ +// hostIterator + +template inline typename StdContainerIterator::Type & hostIterator(Iter & me); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(129) +template inline typename StdContainerIterator::Type const & hostIterator(Iter const & me); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(135) + +//____________________________________________________________________________ +// infimumValue + +template inline T const & infimumValue(); // "projects/library/seqan/basic/basic_alphabet_interface2.h"(169) + +//____________________________________________________________________________ +// infimumValueImpl + +template inline T const & infimumValueImpl(T *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(427) +inline float const & infimumValueImpl(float *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(666) +inline double const & infimumValueImpl(double *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(693) +inline long double const & infimumValueImpl(long double *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(720) + +//____________________________________________________________________________ +// length + +template inline unsigned length(Tuple const &); // "projects/library/seqan/basic/basic_aggregates.h"(428) + +//____________________________________________________________________________ +// lexLess + +template inline bool lexLess(SimpleType const &Left, SimpleType const &Right); // "projects/library/seqan/basic/basic_alphabet_simple.h"(948) +template inline bool lexLess(const TTT& Left, const TTT& Right); // "projects/library/seqan/basic/basic_compare.h"(52) + +//____________________________________________________________________________ +// log2 + +// projects/library/seqan/basic/basic_definition.h(322) +//template inline unsigned int log2(TTT v); + +//____________________________________________________________________________ +// memset + +template finline void memset(void* ptr, unsigned char c); // "projects/library/seqan/basic/basic_metaprogramming.h"(241) +template finline void memset(void* ptr); // "projects/library/seqan/basic/basic_metaprogramming.h"(287) + +//____________________________________________________________________________ +// move + +template inline void move(TTarget & target, TSource & source); // "projects/library/seqan/basic/basic_transport.h"(108) +template inline void move(TTarget const & target, TSource & source); // "projects/library/seqan/basic/basic_transport.h"(116) +template inline void move(TTarget & target, TSource const & source); // "projects/library/seqan/basic/basic_transport.h"(124) +template inline void move(TTarget const & target, TSource const & source); // "projects/library/seqan/basic/basic_transport.h"(132) + +//____________________________________________________________________________ +// moveHost + +template inline void moveHost(T & me, THost & host_); // "projects/library/seqan/basic/basic_host.h"(153) +template inline void moveHost(T & me, THost const & host_); // "projects/library/seqan/basic/basic_host.h"(161) + +//____________________________________________________________________________ +// moveValue + +template inline void moveValue(Iter & me, TValue _value); // "projects/library/seqan/basic/basic_iterator_position.h"(205) +template inline void moveValue(Iter const & me, TValue _value); // "projects/library/seqan/basic/basic_iterator_position.h"(213) +template inline void moveValue(Holder & me, TSource const & value_); // "projects/library/seqan/basic/basic_holder.h"(533) +template inline void moveValue(Holder & me, TSource const & value_); // "projects/library/seqan/basic/basic_holder.h"(763) +template inline void moveValue(Holder & me, TSource const & value_); // "projects/library/seqan/basic/basic_holder.h"(1070) +template inline void moveValue(T & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator.h"(297) +template inline void moveValue(T const & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator.h"(306) +template inline void moveValue(Iter > & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(309) +template inline void moveValue(Iter > const & me, TValue const & _value); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(317) +template inline void moveValue(Iter & me, TValue & val); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(184) +template inline void moveValue(Iter & me, TValue const & val); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(191) + +//____________________________________________________________________________ +// nukeCopies + +template inline void nukeCopies(TValue* &); // "projects/library/seqan/basic/basic_volatile_ptr.h"(152) +template inline void nukeCopies(VolatilePtr &ptr); // "projects/library/seqan/basic/basic_volatile_ptr.h"(155) + +//____________________________________________________________________________ +// operator!= + +template inline bool operator!= (SimpleType const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(594) +template inline bool operator!= (TLeft const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(605) +template inline bool operator!= (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(616) +template inline bool operator!= (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(628) +template inline bool operator!= (Proxy const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(638) +template inline bool operator!= (SimpleType const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(649) +template inline bool operator!= (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(239) +template inline bool operator!= (Proxy const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_proxy.h"(328) +template inline bool operator!= (TLeft const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(339) +template inline bool operator!= (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(350) +template inline bool operator!= (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(362) +template inline bool operator!= (Iter > const & left, Iter > const & right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(343) +template inline bool operator!=(Tuple const &_left, Tuple const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(503) +template inline bool operator!=(Pair const &_left, Pair const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(660) +template inline bool operator!=(Pair > const &_left, Pair > const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(669) +template inline bool operator!=(Triple const &_left, Triple const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(683) +template inline bool operator!= (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(216) + +//____________________________________________________________________________ +// operator* + +template inline typename Reference >::Type operator* (Iter & me); // "projects/library/seqan/basic/basic_iterator_base.h"(143) +template inline typename Reference const>::Type operator* (Iter const & me); // "projects/library/seqan/basic/basic_iterator_base.h"(150) + +//____________________________________________________________________________ +// operator+ + +template inline Iter operator+ (Iter const & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_position.h"(319) +template inline Iter operator+ (Iter const & left, int right); // "projects/library/seqan/basic/basic_iterator_position.h"(328) +template inline Iter operator+ (TIntegral left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(337) +template inline Iter operator+ (int left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(346) +template inline Iter > operator+ (Iter > const & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(380) +template inline Iter > operator+ (Iter > const & left, int right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(389) +template inline Iter > operator+ (TIntegral left, Iter > const & right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(398) +template inline Iter > operator+ (int left, Iter > const & right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(407) +template inline Iter operator+ (Iter const & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(305) +template inline Iter operator+ (Iter const & left, int right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(314) +template inline Iter operator+ (TIntegral left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(323) +template inline Iter operator+ (int left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(332) + +//____________________________________________________________________________ +// operator++ + +template inline SimpleType & operator++ (SimpleType & me); // "projects/library/seqan/basic/basic_alphabet_simple.h"(958) +template inline SimpleType operator++ (SimpleType & me, int); // "projects/library/seqan/basic/basic_alphabet_simple.h"(966) +template inline Iter const & operator++ (Iter & me); // "projects/library/seqan/basic/basic_iterator_base.h"(162) +template inline Iter const operator++ (Iter & me, int); // "projects/library/seqan/basic/basic_iterator_base.h"(171) + +//____________________________________________________________________________ +// operator+= + +template inline Iter & operator+= (Iter & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_position.h"(359) +template inline Iter & operator+= (Iter & left, int right); // "projects/library/seqan/basic/basic_iterator_position.h"(369) +template inline Iter > & operator+= (Iter > & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(420) +template inline Iter > & operator+= (Iter > & left, int right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(430) +template inline Iter & operator+= (Iter & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(345) +template inline Iter & operator+= (Iter & left, int right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(355) + +//____________________________________________________________________________ +// operator- + +template inline Iter operator- (Iter const & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_position.h"(383) +template inline Iter operator- (Iter const & left, int right); // "projects/library/seqan/basic/basic_iterator_position.h"(392) +template inline typename Difference::Type operator- (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(403) +template inline Iter > operator- (Iter > const & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(444) +template inline Iter > operator- (Iter > const & left, int right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(453) +template inline typename Difference > >::Type operator- (Iter > const & left, Iter > const & right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(464) +template inline Iter operator- (Iter const & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(369) +template inline Iter operator- (Iter const & left, int right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(378) +template inline typename Difference >::Type operator- (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(389) + +//____________________________________________________________________________ +// operator-- + +template inline SimpleType & operator-- (SimpleType & me); // "projects/library/seqan/basic/basic_alphabet_simple.h"(977) +template inline SimpleType operator-- (SimpleType & me, int); // "projects/library/seqan/basic/basic_alphabet_simple.h"(985) +template inline Iter const & operator-- (Iter & me); // "projects/library/seqan/basic/basic_iterator_base.h"(185) +template inline Iter const operator-- (Iter & me, int); // "projects/library/seqan/basic/basic_iterator_base.h"(194) + +//____________________________________________________________________________ +// operator-= + +template inline Iter & operator-= (Iter & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_position.h"(416) +template inline Iter & operator-= (Iter & left, int right); // "projects/library/seqan/basic/basic_iterator_position.h"(426) +template inline Iter > & operator-= (Iter > & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(477) +template inline Iter > & operator-= (Iter > & left, int right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(487) +template inline Iter & operator-= (Iter & left, TIntegral right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(402) +template inline Iter & operator-= (Iter & left, int right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(412) + +//____________________________________________________________________________ +// operator< + +template inline bool operator< (SimpleType const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(665) +template inline bool operator< (TLeft const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(676) +template inline bool operator< (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(687) +template inline bool operator< (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(699) +template inline bool operator< (Proxy const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(709) +template inline bool operator< (SimpleType const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(720) +template inline bool operator< (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(252) +template inline bool operator< (Proxy const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_proxy.h"(376) +template inline bool operator< (TLeft const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(387) +template inline bool operator< (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(398) +template inline bool operator< (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(410) +template inline bool operator<(Tuple const &_left, Tuple const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(491) +template inline bool operator< (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(229) + +//____________________________________________________________________________ +// operator<< + +template inline TStream & operator<< (TStream & stream, SimpleType const & data); // "projects/library/seqan/basic/basic_alphabet_simple.h"(262) +template inline TStream & operator<< (TStream & strm, Proxy & proxy); // "projects/library/seqan/basic/basic_proxy.h"(591) +template inline TStream & operator<< (TStream & strm, Proxy const & proxy); // "projects/library/seqan/basic/basic_proxy.h"(598) +template std::ostream& operator<<(std::ostream &out, Pair const &p); // "projects/library/seqan/basic/basic_aggregates.h"(148) +template std::ostream& operator<<(std::ostream &out, Triple const &t); // "projects/library/seqan/basic/basic_aggregates.h"(267) +template std::ostream& operator<<(std::ostream& out, Tuple const &a); // "projects/library/seqan/basic/basic_aggregates.h"(548) + +//____________________________________________________________________________ +// operator<= + +template inline bool operator<= (SimpleType const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(736) +template inline bool operator<= (TLeft const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(747) +template inline bool operator<= (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(758) +template inline bool operator<= (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(770) +template inline bool operator<= (Proxy const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(780) +template inline bool operator<= (SimpleType const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(791) +template inline bool operator<= (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(274) +template inline bool operator<= (Proxy const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_proxy.h"(423) +template inline bool operator<= (TLeft const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(434) +template inline bool operator<= (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(445) +template inline bool operator<= (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(457) +template inline bool operator<= (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(255) + +//____________________________________________________________________________ +// operator== + +template inline bool operator== (SimpleType const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(523) +template inline bool operator== (TLeft const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(534) +template inline bool operator== (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(545) +template inline bool operator== (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(557) +template inline bool operator== (Proxy const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(567) +template inline bool operator== (SimpleType const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(578) +template inline bool operator== (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(226) +template inline bool operator== (Proxy const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_proxy.h"(281) +template inline bool operator== (TLeft const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(292) +template inline bool operator== (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(303) +template inline bool operator== (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(315) +template inline bool operator== (Iter > const & left, Iter > const & right); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(330) +template inline bool operator==(Tuple const &_left, Tuple const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(499) +template inline bool operator==(Pair const &_left, Pair const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(656) +template inline bool operator==(Pair > const &_left, Pair > const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(665) +template inline bool operator==(Triple const &_left, Triple const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(677) +template inline bool operator== (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(203) + +//____________________________________________________________________________ +// operator> + +template inline bool operator> (SimpleType const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(808) +template inline bool operator> (TLeft const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(819) +template inline bool operator> (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(830) +template inline bool operator> (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(842) +template inline bool operator> (Proxy const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(852) +template inline bool operator> (SimpleType const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(863) +template inline bool operator> (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(261) +template inline bool operator> (Proxy const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_proxy.h"(471) +template inline bool operator> (TLeft const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(482) +template inline bool operator> (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(493) +template inline bool operator> (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(505) +template inline bool operator>(Tuple const &_left, Tuple const &_right); // "projects/library/seqan/basic/basic_aggregates.h"(495) +template inline bool operator> (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(242) + +//____________________________________________________________________________ +// operator>= + +template inline bool operator>= (SimpleType const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(879) +template inline bool operator>= (TLeft const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(890) +template inline bool operator>= (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(901) +template inline bool operator>= (SimpleType const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(913) +template inline bool operator>= (Proxy const & left_, SimpleType const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(923) +template inline bool operator>= (SimpleType const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_alphabet_simple.h"(934) +template inline bool operator>= (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_position.h"(283) +template inline bool operator>= (Proxy const & left_, TRight const & right_); // "projects/library/seqan/basic/basic_proxy.h"(519) +template inline bool operator>= (TLeft const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(530) +template inline bool operator>= (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(541) +template inline bool operator>= (Proxy const & left_, Proxy const & right_); // "projects/library/seqan/basic/basic_proxy.h"(553) +template inline bool operator>= (Iter const & left, Iter const & right); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(268) + +//____________________________________________________________________________ +// operator>> + +template inline TStream & operator>> (TStream & stream, SimpleType & data); // "projects/library/seqan/basic/basic_alphabet_simple.h"(274) +template inline TStream & operator>> (TStream & strm, Proxy & proxy); // "projects/library/seqan/basic/basic_proxy.h"(565) +template inline TStream & operator>> (TStream & strm, Proxy const& proxy); // "projects/library/seqan/basic/basic_proxy.h"(577) + +//____________________________________________________________________________ +// parentAllocator + +template inline TParentAllocator & parentAllocator(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(136) +template inline TParentAllocator & parentAllocator(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_singlepool.h"(256) +template inline TParentAllocator & parentAllocator(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_multipool.h"(115) +template inline TParentAllocator & parentAllocator(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_simple.h"(103) +//template inline TParentAllocator & parentAllocator(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(147) +template inline TParentAllocator & parentAllocator(Allocator > & me); // "projects/library/seqan/basic/basic_allocator_chunkpool.h"(279) + +//____________________________________________________________________________ +// position + +template inline typename Position const>::Type position(Iter const & me, TContainer2 const &); // "projects/library/seqan/basic/basic_iterator_base.h"(211) +template inline typename Position::Type position(T * me); // "projects/library/seqan/basic/basic_iterator.h"(354) +template inline typename Position::Type position(TIterator const & it, TContainer const & me); // "projects/library/seqan/basic/basic_iterator.h"(363) +template inline typename Position const>::Type position(Iter const & me, TContainer2 const & cont); // "projects/library/seqan/basic/basic_iterator_simple.h"(108) +template inline typename Position > const>::Type position(Iter > const & me); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(232) +template inline typename Position > const>::Type position(Iter > const & me, TContainer2 const &); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(243) + +//____________________________________________________________________________ +// releaseRef + +template inline void releaseRef(T & ); // "projects/library/seqan/basic/basic_holder.h"(73) +template inline void releaseRef(T const & ); // "projects/library/seqan/basic/basic_holder.h"(79) + +//____________________________________________________________________________ +// set + +template inline void set(TTarget & target, TSource & source); // "projects/library/seqan/basic/basic_transport.h"(160) +template inline void set(TTarget const & target, TSource & source); // "projects/library/seqan/basic/basic_transport.h"(168) +template inline void set(TTarget & target, TSource const & source); // "projects/library/seqan/basic/basic_transport.h"(176) +template inline void set(TTarget const & target, TSource const & source); // "projects/library/seqan/basic/basic_transport.h"(184) + +//____________________________________________________________________________ +// setHost + +template inline void setHost(T & me, THost & host_); // "projects/library/seqan/basic/basic_host.h"(99) +template inline void setHost(T & me, THost const & host_); // "projects/library/seqan/basic/basic_host.h"(107) + +//____________________________________________________________________________ +// setPosition + +template inline void setPosition(Iter > & me, TPosition pos_); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(256) + +//____________________________________________________________________________ +// setValue + +template inline void setValue(Holder & me, typename _Parameter::Type value_); // "projects/library/seqan/basic/basic_holder.h"(453) +template inline void setValue(Holder & me, TValue2 const & value_); // "projects/library/seqan/basic/basic_holder.h"(467) +template inline void setValue(Holder & me, TValue const & value_); // "projects/library/seqan/basic/basic_holder.h"(724) +template inline void setValue(Holder & me, TValue & value_); // "projects/library/seqan/basic/basic_holder.h"(999) + +//____________________________________________________________________________ +// shiftLeft + +template inline void shiftLeft(Tuple &me); // "projects/library/seqan/basic/basic_aggregates.h"(525) +template inline void shiftLeft(Tuple &me); // "projects/library/seqan/basic/basic_aggregates.h"(535) + +//____________________________________________________________________________ +// shiftRight + +template inline void shiftRight(Tuple &me); // "projects/library/seqan/basic/basic_aggregates.h"(530) +template inline void shiftRight(Tuple &me); // "projects/library/seqan/basic/basic_aggregates.h"(540) + +//____________________________________________________________________________ +// supremumValue + +template inline T const & supremumValue(); // "projects/library/seqan/basic/basic_alphabet_interface2.h"(120) + +//____________________________________________________________________________ +// supremumValueImpl + +template inline T const & supremumValueImpl(T *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(420) +inline float const & supremumValueImpl(float *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(655) +inline double const & supremumValueImpl(double *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(682) +inline long double const & supremumValueImpl(long double *); // "projects/library/seqan/basic/basic_alphabet_trait_basic.h"(709) + +//____________________________________________________________________________ +// value + +template inline typename Reference >::Type value(Iter & me); // "projects/library/seqan/basic/basic_iterator_position.h"(164) +template inline typename Reference >::Type value(Iter const & me); // "projects/library/seqan/basic/basic_iterator_position.h"(171) +template inline typename Reference >::Type value(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(479) +template inline typename Reference const>::Type value(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(496) +template inline typename Reference >::Type value(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(734) +template inline typename Reference const>::Type value(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(741) +template inline typename Reference >::Type value(Holder & me); // "projects/library/seqan/basic/basic_holder.h"(1016) +template inline typename Reference const>::Type value(Holder const & me); // "projects/library/seqan/basic/basic_holder.h"(1033) +template inline typename Reference::Type value(T & me); // "projects/library/seqan/basic/basic_iterator.h"(171) +template inline typename Reference::Type value(T const & me); // "projects/library/seqan/basic/basic_iterator.h"(178) +template inline T & value(T * me); // "projects/library/seqan/basic/basic_iterator.h"(187) +template inline typename Reference > >::Type value(Iter > & me); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(268) +template inline typename Reference > const>::Type value(Iter > const & me); // "projects/library/seqan/basic/basic_iterator_adaptor.h"(275) +template inline typename Reference >::Type value(Iter & me); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(146) +template inline typename Reference const>::Type value(Iter const & me); // "projects/library/seqan/basic/basic_iterator_adapt_std.h"(152) + +//____________________________________________________________________________ +// valueConstruct + +template inline void valueConstruct(TIterator it); // "projects/library/seqan/basic/basic_alphabet_interface.h"(145) +template inline void valueConstruct(TIterator it, TParam const & param_); // "projects/library/seqan/basic/basic_alphabet_interface.h"(165) +template inline void valueConstruct(TIterator it, TParam const & param_, Move tag); // "projects/library/seqan/basic/basic_alphabet_interface.h"(186) + +//____________________________________________________________________________ +// valueConstructMove + +template inline void valueConstructMove(TIterator it, TValue const & value); // "projects/library/seqan/basic/basic_alphabet_interface.h"(248) + +//____________________________________________________________________________ +// valueDestruct + +template inline void valueDestruct(TIterator it); // "projects/library/seqan/basic/basic_alphabet_interface.h"(216) + +} //namespace SEQAN_NAMESPACE_MAIN + +//____________________________________________________________________________ +// _compareBinaryFiles + +inline bool _compareBinaryFiles(char * file1, char * file2); // "projects/library/seqan/basic/basic_debug.h"(119) + +//____________________________________________________________________________ +// _compareTextFiles + +inline bool _compareTextFiles(char * file1, char * file2); // "projects/library/seqan/basic/basic_debug.h"(182) + +//____________________________________________________________________________ +// _compareTextFiles_readChar + +inline void _compareTextFiles_readChar(FILE * fl, char & c, bool & is_lb, bool & is_eof); // "projects/library/seqan/basic/basic_debug.h"(151) + +#endif + diff --git a/SeqAn-1.1/seqan/basic/basic_holder.h b/SeqAn-1.1/seqan/basic/basic_holder.h new file mode 100644 index 0000000..df5a791 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_holder.h @@ -0,0 +1,1120 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_holder.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_HOLDER_H +#define SEQAN_HEADER_BASIC_HOLDER_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// +// addRef +////////////////////////////////////////////////////////////////////////////// +/** +.Function.addRef: +..summary:Called when dependency is added. +..cat:Dependent Objects +..signature:addRef(host) +..param.host:The host object. +..remarks.text:A call of this function denotes that a client object is about to become +dependent on $host$. +..remarks.text:The default behavior is: Do nothing. +..see:Class.Holder +*/ + +template +inline void +addRef(T & /*me*/) +{// general: do nothing +SEQAN_CHECKPOINT +} +template +inline void +addRef(T const & /*me*/) +{// general: do nothing +SEQAN_CHECKPOINT +} + +////////////////////////////////////////////////////////////////////////////// +// releaseRef +////////////////////////////////////////////////////////////////////////////// +/** +.Function.releaseRef: +..summary:Called when dependency is released. +..cat:Dependent Objects +..signature:releaseRef(host) +..param.host:The host object. +..remarks.text:A call of this function denotes that a former dependent client object +ceases to be dependent on $host$. +..remarks.text:The default behavior is: Do nothing. +..see:Class.Holder +..see:Function.addRef +*/ +template +inline void +releaseRef(T & /*me*/) +{// general: do nothing +SEQAN_CHECKPOINT +} +template +inline void +releaseRef(T const & /*me*/) +{// general: do nothing +SEQAN_CHECKPOINT +} + +////////////////////////////////////////////////////////////////////////////// +// Tags + +struct Simple; +struct Tristate; + + +////////////////////////////////////////////////////////////////////////////// +// Holder +////////////////////////////////////////////////////////////////////////////// + +/** +.Class.Holder: +..cat:Basic +..summary:Manages relationship to another object. +..signature:Holder +..param.TValue:Type of the managed object. +...metafunction:Metafunction.Value +..param.TSpec:The specializing type. +...metafunction:Metafunction.Spec +...default:$Tristate$ +..remarks.text:The main purpose of this class is to facilitate the handling of +member objects. If we want class $A$ to be dependent on or the owner of another object of class $B$, +then we add a data member of type $Holder$ to $A$. +$Holder$ offers some useful access functions, stores the kind of relationship between $A$ and $B$, +and executes all needed @Function.addRef@ and @Function.releaseRef@ calls. +*/ + +template +struct Holder; + + +////////////////////////////////////////////////////////////////////////////// +// METAFUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Value.param.T.type:Class.Holder + +template +struct Value< Holder > +{ + typedef typename _RemoveConst::Type Type; +}; +template +struct Value< Holder const> +{ + typedef typename _RemoveConst::Type Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Spec.param.T.type:Class.Holder + +template +struct Spec< Holder > +{ + typedef TSpec Type; +}; +template +struct Spec< Holder const> +{ + typedef TSpec Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Reference.param.T.type:Class.Holder + +template +struct Reference< Holder > +{ + typedef typename Value< Holder >::Type & Type; +}; +template +struct Reference< Holder const> +{ + typedef typename Value< Holder const>::Type & Type; +}; + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +// Tristate Holder +////////////////////////////////////////////////////////////////////////////// +/** +.Spec.Tristate Holder +..cat:Holders +..summary:Holder that can be empty, dependent, or owner. +..signature:Holder +..param.TValue:Type of the managed object. +..general:Class.Holder +..remarks.text:A tristate holder $A$ that holds an object $B$ has one of the following states: +..remarks.text:- owner: $A$ is the owner of $B$. If $A$ is destroyed, $B$ will be destroyed automatically. +..remarks.text:- dependent: $A$ depends on $B$. $B$ should not be destroyed as long as $A$ is used. +..remarks.text:- empty: there is currently no object reference stored in the holder $A$. +..remarks.text:The state of the holder can be determined by @Function.empty@ and @Function.dependent@. +*/ + +template +struct Holder +{ +public: + enum EHolderState + { + EMPTY = 0, + OWNER = 1, + DEPENDENT = ~0 + }; + +// typedef typename _RemoveConst::Type TValue_NotConst; + typedef typename Value::Type THostValue; + + typename _Pointer::Type data_value; + EHolderState data_state; + +//____________________________________________________________________________ + +/** +.Memfunc.Holder: +..class:Class.Holder +..summary:Constructor +..signature:Holder () +..signature:Holder (holder) +..signature:Holder (value) +..param.holder:Another holder object. +..param.value:An object of type $TValue$. +..remarks.text: +The default constructor creates a holder that is in state 'empty'. +If a $value$ is passed to the constructor, the holder will be in state 'dependent'. +*/ + + Holder(): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + } + Holder(Holder const & source_): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + assign(*this, source_); + } + Holder(typename _Parameter::Type value_): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + setValue(*this, value_); + } + Holder(typename _ConstParameter::Type value_): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + assignValue(*this, value_); + } + +/** +.Memfunc.~Holder: +..class:Class.Holder +..summary:Destructor +..signature:~Holder() +..remarks.text: +If the holder is in state 'owner', the holded object will be destoyed too. +*/ + ~Holder() + { +SEQAN_CHECKPOINT + clear(*this); + } + +//____________________________________________________________________________ + + Holder const & + operator = (Holder const & source_) + { +SEQAN_CHECKPOINT + assign(*this, source_); + return *this; + } + + Holder const & + operator = (typename _ConstParameter::Type value_) + { +SEQAN_CHECKPOINT + assignValue(*this, value_); + return *this; + } + + operator typename _Parameter::Type() + { +SEQAN_CHECKPOINT + return *data_value; + } +//____________________________________________________________________________ + +}; + +////////////////////////////////////////////////////////////////////////////// +// FUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +///.Function.empty.param.object.type:Class.Holder + +template +inline bool +empty(Holder const & me) +{ +SEQAN_CHECKPOINT + return (me.data_state == Holder::EMPTY); +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.dependent.param.object.type:Class.Holder + +template +inline bool +dependent(Holder const & me) +{ +SEQAN_CHECKPOINT + return (me.data_state == Holder::DEPENDENT); +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.clear.param.object.type:Class.Holder +///.Function.clear.remarks.text:If $clear$ is applied on a @Class.Holder@ object, +///the state of this object is set to 'empty'. + +template +inline void +clear(Holder & me) +{ + switch (me.data_state) + { + case Holder::EMPTY: + break; + + case Holder::DEPENDENT: + { +SEQAN_CHECKPOINT + releaseRef(_toParameter(me.data_value)); + me.data_state = Holder::EMPTY; + } + break; + + default: /*Holder::OWNER*/ + { +SEQAN_CHECKPOINT + valueDestruct(me.data_value); + deallocate(me, me.data_value, 1); + me.data_state = Holder::EMPTY; + } + break; + } +} + +////////////////////////////////////////////////////////////////////////////// +/** +.Function.create: +..summary:Makes an object to owner of its content. +..cat:Dependent Objects +..signature:create(holder [, object]) +..param.holder:A holder object. +...type:Class.Holder +..param.object:Object from which a copy is made and stored in $holder$. (optional) +...type:Metafunction.Value.Value::Type +..remarks.text:After this operation, $holder$ will be in state 'owner'. +If $object$ is specified, $holder$ will hold a copy of $object$ at the end of this function. +If $object$ is not specified, the action depends on the former state of $holder$: +..remarks.text:- If the state of $holder$ was 'empty', a new object is default constructed and stored into $holder$. +..remarks.text:- If the state of $holder$ was 'dependent', a copy of the former object is made and stored into $holder$. +..remarks.text:- If the state of $holder$ was already 'owner', nothing happens. +..see:Class.Holder +*/ + +template +inline void +create(Holder & me) +{ + typedef Holder THolder; + + switch (me.data_state) + { + case Holder::EMPTY: + { +SEQAN_CHECKPOINT + allocate(me, me.data_value, 1); + valueConstruct(me.data_value); + me.data_state = THolder::OWNER; + } + break; + + case THolder::DEPENDENT: + { +SEQAN_CHECKPOINT + typename _Parameter::Type old_value = value(me); + allocate(me, me.data_value, 1); + valueConstruct(me.data_value, old_value); + me.data_state = THolder::OWNER; + releaseRef(old_value); + } + break; + default:; + } +} + +//____________________________________________________________________________ + +template +inline void +create(Holder & me, + typename _Parameter::Type value_) +{ +SEQAN_CHECKPOINT + + if (me.data_state == Holder::OWNER) + { + assign(_toParameter(me.data_value), value_); + return; + } + + clear(me); + allocate(me, me.data_value, 1); + valueConstruct(me.data_value, value_); + me.data_state = Holder::OWNER; +} + +////////////////////////////////////////////////////////////////////////////// +/** +.Function.detach: +..summary:Makes an object independent from other objects. +..cat:Dependent Objects +..signature:detach(object) +..param.object:An object. +...type:Class.Holder +..remarks: +After this function, $object$ does not depends from any other entity outside of $object$, +like a @Function.source@ or a @Function.host@, and @Function.dependent.dependent(object)@ returns $false$ +..see:Function.source +..see:Function.host +..see:Function.createSource +..see:Function.create +*/ + +template +inline void +detach(Holder & me) +{ +SEQAN_CHECKPOINT + create(me); +} + +////////////////////////////////////////////////////////////////////////////// +/** +.Function.setValue: +..cat:Content Manipulation +..summary:Makes holder dependent. +..signature:setValue(holder, object) +..param.holder:A holder object. +...type:Class.Holder +..param.object:Object from which $holder$ will be dependent. +...type:Metafunction.Value.Value::Type +..remarks.text:After this operation, $holder$ will be dependent in state 'dependent'. +..see:Class.Holder +*/ + +template +inline void +setValue(Holder & me, + typename _Parameter::Type value_) +{ +SEQAN_CHECKPOINT + typedef typename Value >::Type THolderType; + + clear(me); + me.data_value = _toPointer(value_); + me.data_state = Holder::DEPENDENT; + addRef(_toParameter(me.data_value)); +} + +template +inline void +setValue(Holder & me, + TValue2 const & value_) +{ +SEQAN_CHECKPOINT + set(value(me), value_); +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.value.param.object.type:Class.Holder + +template +inline typename Reference >::Type +value(Holder & me) +{ +SEQAN_CHECKPOINT + typedef Holder THolder; + + if (empty(me)) + { + allocate(me, me.data_value, 1); + valueConstruct(me.data_value); + me.data_state = THolder::OWNER; + } + + typedef typename Value >::Type THolderType; + return _toParameter(me.data_value); +} +template +inline typename Reference const>::Type +value(Holder const & me) +{ +SEQAN_CHECKPOINT + SEQAN_ASSERT(!empty(me)); + + typedef typename Value >::Type THolderType; + return _toParameter(me.data_value); +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.assignValue.param.object.type:Class.Holder + +template +inline void +assignValue(Holder & me, + TSource const & value_) +{ +SEQAN_CHECKPOINT + typedef typename Value >::Type THostValue; + if (empty(me)) + { + create(me, value_); + } + else + { + assign(_toParameter(me.data_value), value_); + } +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.moveValue.param.object.type:Class.Holder + +template +inline void +moveValue(Holder & me, + TSource const & value_) +{ +SEQAN_CHECKPOINT + if (empty(me)) + { + create(me, value_); + } + else + { + move(value(me), value_); + } +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.assign.param.target.type:Class.Holder +///.Function.assign.param.source.type:Class.Holder + +template +inline void +assign(Holder & target_, + Holder const & source_) +{ +SEQAN_CHECKPOINT + switch(source_.data_state) + { + case Holder::EMPTY: + { + clear(target_); + } + break; + + case Holder::OWNER: + { + assignValue(target_, value(source_)); + } + break; + + default: /*case Holder::DEPENDENT*/ + { + setValue(target_, value(source_)); + } + break; + } +} + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +// Simple Holder +////////////////////////////////////////////////////////////////////////////// +//??? TODO: Documentation of Simple Holder + +template +struct Holder +{ + typedef typename Value::Type THolderValue; + typedef typename _Parameter::Type THolderParameter; + + mutable THolderValue data_value; +//____________________________________________________________________________ + + Holder() + { +SEQAN_CHECKPOINT + } + Holder(Holder & source_): + data_value(source_.data_value) + { +SEQAN_CHECKPOINT + } + Holder(Holder const & source_): + data_value(source_.data_value) + { +SEQAN_CHECKPOINT + } + template + Holder(TSource & value_): + data_value(value_) + { +SEQAN_CHECKPOINT + } + template + Holder(TSource const & value_): + data_value(value_) + { +SEQAN_CHECKPOINT + } +/* + Holder(TValue const & value_): + data_value(value_) + { +SEQAN_CHECKPOINT + } +*/ + ~Holder() + { +SEQAN_CHECKPOINT + } + +//____________________________________________________________________________ + + Holder const & + operator = (Holder const & source_) + { +SEQAN_CHECKPOINT + data_value = source_.data_value; + return *this; + } + + Holder const & + operator = (THolderValue const & value_) + { +SEQAN_CHECKPOINT + data_value = value_; + return *this; + } + + operator THolderParameter() + { +SEQAN_CHECKPOINT + return *data_value; + } +//____________________________________________________________________________ +}; + + +////////////////////////////////////////////////////////////////////////////// +// FUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +empty(Holder const & me) +{ +SEQAN_CHECKPOINT + return false; +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +dependent(Holder const & me) +{ +SEQAN_CHECKPOINT + return false; +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +clear(Holder & me) +{ +SEQAN_CHECKPOINT +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +create(Holder & me) +{ +SEQAN_CHECKPOINT +} + +//____________________________________________________________________________ + +template +inline void +create(Holder & me, + TValue const & value_) +{ +SEQAN_CHECKPOINT + me.data_value = value_; +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +detach(Holder & me) +{ +SEQAN_CHECKPOINT +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +setValue(Holder & me, + TValue const & value_) +{ +SEQAN_CHECKPOINT + me.data_value = value_; +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Reference >::Type +value(Holder & me) +{ +SEQAN_CHECKPOINT + return me.data_value; +} +template +inline typename Reference const>::Type +value(Holder const & me) +{ +SEQAN_CHECKPOINT + return me.data_value; +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assignValue(Holder & me, + TSource const & value_) +{ +SEQAN_CHECKPOINT + assignValue(me.data_value, value_); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +moveValue(Holder & me, + TSource const & value_) +{ +SEQAN_CHECKPOINT + move(me.data_value, value_); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assign(Holder & target_, + Holder const & source_) +{ +SEQAN_CHECKPOINT + assignValue(target_, source_); +} + + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + + + + +////////////////////////////////////////////////////////////////////////////// +// New Tristate Holder that works also on pointers +////////////////////////////////////////////////////////////////////////////// + +struct Tristate2; + +template +struct Holder +{ +public: + enum EHolderState + { + EMPTY = 0, + OWNER = 1, + DEPENDENT = ~0 + }; + + typedef typename Value::Type THostValue; + + TValue * data_value; + EHolderState data_state; + +//____________________________________________________________________________ + + Holder(): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + } + Holder(Holder const & source_): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + assign(*this, source_); + } + Holder(typename _Parameter::Type value_): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + setValue(*this, value_); + } + Holder(typename _ConstParameter::Type value_): + data_state(EMPTY) + { +SEQAN_CHECKPOINT + assignValue(*this, value_); + } + ~Holder() + { +SEQAN_CHECKPOINT + clear(*this); + } + +//____________________________________________________________________________ + + Holder const & + operator = (Holder const & source_) + { +SEQAN_CHECKPOINT + assign(*this, source_); + return *this; + } + + Holder const & + operator = (TValue const & value_) + { +SEQAN_CHECKPOINT + assignValue(*this, value_); + return *this; + } + + operator TValue &() + { +SEQAN_CHECKPOINT + return *data_value; + } +//____________________________________________________________________________ + +}; + +////////////////////////////////////////////////////////////////////////////// +// FUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +///.Function.empty.param.object.type:Class.Holder + +template +inline bool +empty(Holder const & me) +{ +SEQAN_CHECKPOINT + return (me.data_state == Holder::EMPTY); +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.dependent.param.object.type:Class.Holder + +template +inline bool +dependent(Holder const & me) +{ +SEQAN_CHECKPOINT + return (me.data_state == Holder::DEPENDENT); +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.clear.param.object.type:Class.Holder +///.Function.clear.remarks.text:If $clear$ is applied on a @Class.Holder@ object, +///the state of this object is set to 'empty'. + +template +inline void +clear(Holder & me) +{ + switch (me.data_state) + { + case Holder::EMPTY: + break; + + case Holder::DEPENDENT: + { +SEQAN_CHECKPOINT + releaseRef(*(me.data_value)); + me.data_state = Holder::EMPTY; + } + break; + + default: /*Holder::OWNER*/ + { +SEQAN_CHECKPOINT + valueDestruct(me.data_value); + deallocate(me, me.data_value, 1); + me.data_state = Holder::EMPTY; + } + break; + } +} + +////////////////////////////////////////////////////////////////////////////// + + +template +inline void +create(Holder & me) +{ + typedef Holder THolder; + + switch (me.data_state) + { + case Holder::EMPTY: + { +SEQAN_CHECKPOINT + allocate(me, me.data_value, 1); + valueConstruct(me.data_value); + me.data_state = THolder::OWNER; + } + break; + + case THolder::DEPENDENT: + { +SEQAN_CHECKPOINT + TValue & old_value = value(me); + allocate(me, me.data_value, 1); + valueConstruct(me.data_value, old_value); + me.data_state = THolder::OWNER; + releaseRef(old_value); + } + break; + default:; + } +} + +//____________________________________________________________________________ + +template +inline void +create(Holder & me, + TValue const & value_) +{ +SEQAN_CHECKPOINT + + if (me.data_state == Holder::OWNER) + { + assign(*(me.data_value), value_); + return; + } + + clear(me); + allocate(me, me.data_value, 1); + valueConstruct(me.data_value, value_); + me.data_state = Holder::OWNER; +} + +////////////////////////////////////////////////////////////////////////////// + + +template +inline void +detach(Holder & me) +{ +SEQAN_CHECKPOINT + create(me); +} + +////////////////////////////////////////////////////////////////////////////// + + +template +inline void +setValue(Holder & me, + TValue & value_) +{ +SEQAN_CHECKPOINT + typedef typename Value >::Type THolderType; + + clear(me); + me.data_value = & value_; + me.data_state = Holder::DEPENDENT; + addRef(value_); +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.value.param.object.type:Class.Holder + +template +inline typename Reference >::Type +value(Holder & me) +{ +SEQAN_CHECKPOINT + typedef Holder THolder; + + if (empty(me)) + { + allocate(me, me.data_value, 1); + valueConstruct(me.data_value); + me.data_state = THolder::OWNER; + } + + typedef typename Value >::Type THolderType; + return *(me.data_value); +} +template +inline typename Reference const>::Type +value(Holder const & me) +{ +SEQAN_CHECKPOINT + SEQAN_ASSERT(!empty(me)); + + return *(me.data_value); +} + + +////////////////////////////////////////////////////////////////////////////// + +///.Function.assignValue.param.object.type:Class.Holder + +template +inline void +assignValue(Holder & me, + TSource const & value_) +{ +SEQAN_CHECKPOINT + typedef typename Value >::Type THostValue; + if (empty(me)) + { + create(me, value_); + } + else + { + assign(*(me.data_value), value_); + } +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.moveValue.param.object.type:Class.Holder + +template +inline void +moveValue(Holder & me, + TSource const & value_) +{ +SEQAN_CHECKPOINT + if (empty(me)) + { + create(me, value_); + } + else + { + move(value(me), value_); + } +} + +////////////////////////////////////////////////////////////////////////////// + +///.Function.assign.param.target.type:Class.Holder +///.Function.assign.param.source.type:Class.Holder + +template +inline void +assign(Holder & target_, + Holder const & source_) +{ +SEQAN_CHECKPOINT + switch(source_.data_state) + { + case Holder::EMPTY: + { + clear(target_); + } + break; + + case Holder::OWNER: + { + assignValue(target_, value(source_)); + } + break; + + default: /*case Holder::DEPENDENT*/ + { + setValue(target_, value(source_)); + } + break; + } +} +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... + + diff --git a/SeqAn-1.1/seqan/basic/basic_host.h b/SeqAn-1.1/seqan/basic/basic_host.h new file mode 100644 index 0000000..a1a7231 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_host.h @@ -0,0 +1,171 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_host.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_HOST_H +#define SEQAN_HEADER_BASIC_HOST_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// Host Functions +////////////////////////////////////////////////////////////////////////////// +//these functions assume that the hosted object exports a function "_dataHost" +//that returns a reference to a holder type of Host::Type & + +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +emptyHost(T const & me) +{ +SEQAN_CHECKPOINT + return empty(_dataHost(me)); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +dependentHost(T const & me) +{ +SEQAN_CHECKPOINT + return dependent(_dataHost(me)); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +clearHost(T & me) +{ +SEQAN_CHECKPOINT + clear(_dataHost(me)); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +createHost(T & me) +{ +SEQAN_CHECKPOINT + create(_dataHost(me)); +} + +//____________________________________________________________________________ + +template +inline void +createHost(T & me, + THost & host_) +{ +SEQAN_CHECKPOINT + create(_dataHost(me), host_); +} +template +inline void +createHost(T & me, + THost const & host_) +{ +SEQAN_CHECKPOINT + create(_dataHost(me), host_); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +setHost(T & me, + THost & host_) +{ +SEQAN_CHECKPOINT + setValue(_dataHost(me), host_); +} +template +inline void +setHost(T & me, + THost const & host_) +{ +SEQAN_CHECKPOINT + setValue(_dataHost(me), host_); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Host::Type & +host(T & me) +{ +SEQAN_CHECKPOINT + return value(_dataHost(me)); +} +template +inline typename Host::Type & +host(T const & me) +{ +SEQAN_CHECKPOINT + return value(_dataHost(me)); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assignHost(T & me, + THost & host_) +{ +SEQAN_CHECKPOINT + assignValue(_dataHost(me), host_); +} +template +inline void +assignHost(T & me, + THost const & host_) +{ +SEQAN_CHECKPOINT + assignValue(_dataHost(me), host_); +} +////////////////////////////////////////////////////////////////////////////// + +template +inline void +moveHost(T & me, + THost & host_) +{ +SEQAN_CHECKPOINT + moveValue(_dataHost(me), host_); +} +template +inline void +moveHost(T & me, + THost const & host_) +{ +SEQAN_CHECKPOINT + moveValue(_dataHost(me), host_); +} + +////////////////////////////////////////////////////////////////////////////// +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... + + diff --git a/SeqAn-1.1/seqan/basic/basic_iterator.h b/SeqAn-1.1/seqan/basic/basic_iterator.h new file mode 100644 index 0000000..9ccc0dd --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_iterator.h @@ -0,0 +1,732 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_iterator.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ITERATOR_H +#define SEQAN_HEADER_BASIC_ITERATOR_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// TAGS +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Iterator Spec: +..summary:Specifies the kind of an iterator. +..tag.Rooted:Rooted iterator. +...remarks +....text:This iterator implements some more advanced functions like +@Function.container@ and @Function.position@. +....concept:Concept.Rooted Iterator +..tag.Standard:Standard conform iterator. +...remarks +....text:Note that standard iterators need not to implement all functions +that are available for rooted iterators. +....concept:Concept.Iterator +..remarks.text:The default iterator spec is given by @Metafunction.DefaultIteratorSpec@. +..see:Metafunction.DefaultIteratorSpec +..see:Concept.Iterator +*/ + +struct TagRooted_; +typedef Tag const Rooted; + +struct TagStandard_; +typedef Tag const Standard; + + +////////////////////////////////////////////////////////////////////////////// +// METAFUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +/** +.Metafunction.DefaultIteratorSpec: +..hidefromindex +..summary:Specifies default kind of iterator. +..signature:DefaultIteratorSpec::Type +..param.T:Container type for which the default iterator spec is determined. +...concept:Concept.Container +..returns.param.Type:Iterator spec of $T$. +..see:Metafunction.Iterator +*/ + +template +struct DefaultIteratorSpec +{ + typedef Standard Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Metafunction.DefaultGetIteratorSpec: +..hidefromindex +..summary:Specifies default kind of iterator returned by functions. +..signature:DefaultGetIteratorSpec::Type +..param.T:Container type for which the spec is determined. +...concept:Concept.Container +..returns.param.Type:Iterator spec of $T$. +..remarks:This metafunction returns the iterator spec of iterators that are returned by functions like +@Function.begin@, @Function.end@, or @Function.iter@. +..see:Metafunction.Iterator +..see:Metafunction.DefaultIteratorSpec +*/ + +template +struct DefaultGetIteratorSpec +{ + typedef Rooted Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Metafunction.Iterator: +..summary:Type of iterator objects that are used to traverse the container. +..signature:Iterator::Type +..param.T:Type for which the iterator type is determined. +...concept:Concept.Container +...type:Class.Iter +..param.TSpec:Specifies an @Tag.Iterator Spec.iterator spec@. +...default:The default iterator spec is given by @Metafunction.DefaultIteratorSpec@. +..returns.param.Type:Iterator type of $T$. +..remarks.text:Iterators behave like pointers in some respects. + For example, you can use $*it$ to access the value object the iterator $it$ points to. + But note that $Iterator::Type$ can differ from $T *$, depending on $T$. +..see:Metafunction.Position +*/ + +//____________________________________________________________________________ + +template +struct Iterator_Default_Imp; + +//Iterator_Default_Imp is implemented in basic_iterator_simple.h +//Iterator_Default_Imp is implemented in basic_iterator_adaptor.h + +//____________________________________________________________________________ + +template ::Type> +struct Iterator: + Iterator_Default_Imp +{ +}; + + +////////////////////////////////////////////////////////////////////////////// + +/** +.Metafunction.Container: +..summary:Type of the container given an iterator. +..signature:Container::Type +..param.T:Iterator type. +...type:Class.Iter +...concept:Concept.Iterator +..returns.param.Type:The container type to $T$. +*/ + +template +struct Container +{ + typedef T Type; +}; + + +////////////////////////////////////////////////////////////////////////////// +// GENERAL FUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// value +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.value: +..signature:Reference value(object) +..param.object:An object that holds a value or an iterator that points to a value. +...type:Class.Iter +...concept:Concept.Iterator +*/ + +template +inline typename Reference::Type +value(T & me) +{ +SEQAN_CHECKPOINT + return *me; +} +template +inline typename Reference::Type +value(T const & me) +{ +SEQAN_CHECKPOINT + return *me; +} + + +template +inline T & +value(T * me) +{ +SEQAN_CHECKPOINT + return *me; +} + +////////////////////////////////////////////////////////////////////////////// +// getValue +////////////////////////////////////////////////////////////////////////////// + +//unary getValue +/** +.Function.getValue: +..cat:Iteration +..signature:GetValue getValue(object) +..param.object:An object that holds a value or points to a value. +...type:Class.Iter +...concept:Concept.Iterator +..see:Metafunction.GetValue +*/ + +template +inline typename GetValue::Type +getValue(T & me) +{ +SEQAN_CHECKPOINT + return value(me); +} +template +inline typename GetValue::Type +getValue(T const & me) +{ +SEQAN_CHECKPOINT + return value(me); +} + +template +inline T & +getValue(T * me) +{ +SEQAN_CHECKPOINT + return value(me); +} + +////////////////////////////////////////////////////////////////////////////// +//toGetValue +////////////////////////////////////////////////////////////////////////////// +//Nimmt eine Reference und macht daraus einen GetValue +//???TODO toGetValue() + +////////////////////////////////////////////////////////////////////////////// +// assignValue +////////////////////////////////////////////////////////////////////////////// +/** +.Function.assignValue: +..cat:Iteration +..summary:Assigns value to item. +..signature:assignValue(object, value) +..param.object:An object that holds a value or points to a value. +...type:Class.Iter +...concept:Concept.Iterator +..param.value:A value that is assigned to the item $object$ holds or points to. +..remarks.text:This function is similar to @Function.assign@. +The difference is, that $assignValue$ just changes a value stored in $object$ or the value $object$ points to, +while @Function.assign@ changes the whole object. +..see:Function.assign +*/ + +template +inline void +assignValue(T & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + assign(value(me), _value); +} + +//const version for iterators as targets +template +inline void +assignValue(T const & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + assign(value(me), _value); +} + +////////////////////////////////////////////////////////////////////////////// +// moveValue +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.moveValue: +..cat:Iteration +..summary:Assigns value to item. +..signature:moveValue(object, value) +..param.object:An object that holds a value or points to a value. +...type:Class.Iter +...concept:Concept.Iterator +..param.value:A value that is handed over to the item $object$ holds or points to. +..remarks.text:This function is similar to @Function.move@. +The difference is, that $moveValue$ just changes a value stored in $object$ or the value $object$ points to, +while @Function.move@ changes the whole object. +..see:Function.move +..see:Function.assignValue +*/ + +template +inline void +moveValue(T & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + move(value(me), _value); +} +//const version for iterators as targets +template +inline void +moveValue(T const & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + move(value(me), _value); +} + +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.container: +..cat:Iteration +..summary:Container of an iterator. +..signature:Container container(iterator) +..param.iterator:An iterator. +...type:Class.Iter +...concept:Concept.Rooted Iterator +..returns:The container that $iterator$ traverses. +...metafunction:Metafunction.Container +*/ + +template +inline typename Container::Type +container(T me) +{ +SEQAN_CHECKPOINT + return me; +} + +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.position: +..summary:Position of an iterator. +..cat:Iteration +..signature:Position position(iterator [, container]) +..param.iterator:An iterator. +...type:Class.Iter +...concept:Concept.Iterator +..param.container:A container. +...concept:Concept.Container +...remarks:If $iterator$ implements @Concept.Rooted Iterator@, then $container$ is optional. +...remarks:If $container$ is specified, $iterator$ must be a container of $container$. +..returns:The position of the value in the container $iterator$ points to. +...metafunction:Metafunction.Position +*/ + +template +inline typename Position::Type +position(T * me) +{ +SEQAN_CHECKPOINT + return 0; +} + +template +inline typename Position::Type +position(TIterator const & it, + TContainer const & me) +{ +SEQAN_CHECKPOINT + return it - begin(me, Standard()); +} + +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// atBegin +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.atBegin: +..cat:Iteration +..summary:Determines whether an iterator is at the beginning position. +..signature:bool atBegin(iterator [, container]) +..param.iterator:An iterator. +...type:Class.Iter +...concept:Concept.Iterator +..param.container:Container of $iterator$. (optional) +...remarks.text:If $iterator$ implements @Concept.Rooted Iterator@ then $container$ is optional otherwise $container$ is required. +..returns:$true$ if $iterator$ points to the fist item of the container, otherwise $false$. +..see:Function.begin +*/ + +//TODO???: Was, wenn der Container leer ist? + +template +inline bool +atBegin(T const & it, TContainer const & cont) +{ +SEQAN_CHECKPOINT + return it == begin(cont, Standard()); +} + +//____________________________________________________________________________ + +template +inline bool +atBegin(T const & it) +{ +SEQAN_CHECKPOINT + return atBegin(it, container(it)); +} + + + +////////////////////////////////////////////////////////////////////////////// +// atEnd +////////////////////////////////////////////////////////////////////////////// +/** +.Function.atEnd: +..cat:Iteration +..summary:Determines whether an iterator is at the end position. +..signature:bool atEnd(iterator [, container]) +..param.iterator:An iterator. +...type:Class.Iter +...concept:Concept.Iterator +..param.container:Container of $iterator$. +...remarks.text:If $iterator$ implements @Concept.Rooted Iterator@ then $container$ is optional. +....text:$container$ is also optional for iterators to @Adaption.char array.char arrays@. +....text:Otherwise, $container$ is required. +..returns:$true$ if $iterator$ points behind the last item of the container, otherwise $false$. +..see:Function.atBegin +..see:Function.end +*/ + +template +inline bool +atEnd(T & it, + TContainer const & cont) +{ +SEQAN_CHECKPOINT + return it == end(cont, Standard()); +} +template +inline bool +atEnd(T const & it, + TContainer const & cont) +{ +SEQAN_CHECKPOINT + return it == end(cont, Standard()); +} +//____________________________________________________________________________ + +template +inline bool +atEnd(T & it) +{ +SEQAN_CHECKPOINT + return atEnd(it, container(it)); +} +template +inline bool +atEnd(T const & it) +{ +SEQAN_CHECKPOINT + return atEnd(it, container(it)); +} + +////////////////////////////////////////////////////////////////////////////// +// goBegin +////////////////////////////////////////////////////////////////////////////// +/** +.Function.goBegin: +..cat:Iteration +..summary:Iterates to the first position of a container. +..signature:goBegin(iterator [, container]) +..param.iterator:Object that iterates through $container$. +...type:Class.Iter +...concept:Concept.Iterator +...text:$iterator$ is set to the position of the first item in $container$. +..param.container:Container of $iterator$. +...remarks.text:If $iterator$ implements @Concept.Rooted Iterator@ then $container$ is optional, +otherwise $container$ is required. +..remarks:This function is equivalent to $iterator = begin(container)$. +..see:Function.begin +..see:Function.atBegin +..see:Function.goEnd +*/ +template +inline void +goBegin(TIterator & it, + TContainer & container) +{ +SEQAN_CHECKPOINT + it = begin(container); +} +/* +template +inline void +goBegin(TIterator & it, + TContainer const & container) +{ +SEQAN_CHECKPOINT + it = begin(container); +} +*/ + +template +inline void +goBegin(TIterator & it) +{ +SEQAN_CHECKPOINT + goBegin(it, container(it)); +} + +////////////////////////////////////////////////////////////////////////////// +// goEnd +////////////////////////////////////////////////////////////////////////////// +/** +.Function.goEnd: +..cat:Iteration +..summary:Iterates to the last position of a container. +..signature:goEnd(iterator [, container]) +..param.iterator:Object that iterates through $container$. +...type:Class.Iter +...concept:Concept.Iterator +...text:$iterator$ is set to the position behin the last item in $container$. +..param.container:Container of $iterator$. +...remarks.text:If $iterator$ implements @Concept.Rooted Iterator@ then $container$ is optional, +otherwise $container$ is required. +..remarks:This function is equivalent to $iterator = end(container)$. +..see:Function.end +..see:Function.atEnd +..see:Function.goBegin +..see:Function.goEnd +*/ +template +inline void +goEnd(TIterator & it, + TContainer & container) +{ +SEQAN_CHECKPOINT + it = end(container); +} +template +inline void +goEnd(TIterator & it, + TContainer const & container) +{ +SEQAN_CHECKPOINT + it = end(container); +} + +template +inline void +goEnd(TIterator & it) +{ +SEQAN_CHECKPOINT + goEnd(it, container(it)); +} + +////////////////////////////////////////////////////////////////////////////// +// goNext +////////////////////////////////////////////////////////////////////////////// +/** +.Function.goNext: +..cat:Iteration +..summary:Iterates to next position. +..signature:goNext(iterator) +..param.iterator:An iterator. +...type:Class.Iter +...concept:Concept.Iterator +...text:$iterator$ is set to the next position of an iteration through its container. +..remarks:This function is equivalent to $++iterator$. +..see:Function.goBegin +..see:Function.goEnd +*/ +template +inline void +goNext(TIterator & it) +{ +SEQAN_CHECKPOINT + ++it; +} + +////////////////////////////////////////////////////////////////////////////// +// goFurther +////////////////////////////////////////////////////////////////////////////// +/** +.Function.goFurther: +..cat:Iteration +..summary:Iterates some steps further. +..signature:goFurther(iterator, steps) +..param.iterator:An iterator. +...type:Class.Iter +...concept:Concept.Iterator +...text:$iterator$ is set $steps$ positions further in the iteration through the container. +..param.steps:Number of steps $iterator$ should be moved further. +...remarks:If $iterator$ supports bidirectional iteration, $steps$ could also be negativ. +..remarks:This function is equivalent to $iterator += steps$ for random access iterators. +..see:Function.goNext +..see:Function.goPrevious +*/ + +template inline +void goFurther(TIterator & it, TDiff steps) +{ // return distance type from arbitrary argument + it += steps; +} + +////////////////////////////////////////////////////////////////////////////// +// goPrevious +////////////////////////////////////////////////////////////////////////////// +/** +.Function.goPrevious: +..cat:Iteration +..summary:Iterates to pevious position. +..signature:goPrevious(iterator) +..param.iterator:An iterator. +...type:Class.Iter +...concept:Concept.Iterator +...text:$iterator$ is set to the pevious position of an iteration through its container. +..remarks:This function is equivalent to $--iterator$. +..see:Function.goBegin +..see:Function.goEnd +..see:Function.goNext +*/ +template +inline void +goPrevious(TIterator & it) +{ +SEQAN_CHECKPOINT + --it; +} + +////////////////////////////////////////////////////////////////////////////// +// difference +////////////////////////////////////////////////////////////////////////////// +/** +.Function.difference: +..cat:Iteration +..summary:The difference between two iterators. +..signature:difference(begin, end) +..param.begin:Iterator to the first position of a range. +...type:Class.Iter +...Concept.Iterator +..param.end:Iterator behind the last position of a range. +...type:Class.Iter +...Concept.Iterator +..returns:Length of the range between $begin$ and $end$. +..remarks:This function is equivalent to $begin - end$. +...text:Usually, $begin$ and $end$ have the same type. +..see:Function.begin +..see:Function.end +..see:Function.length +*/ + +template inline +typename Difference::Type difference( + TIterator const & begin, + TIterator const & end) +{ // return distance type from arbitrary argument +SEQAN_CHECKPOINT + return end - begin; +} + +////////////////////////////////////////////////////////////////////////////// +// goNil +////////////////////////////////////////////////////////////////////////////// + + +/** +.Function.goNil: +..cat:Iteration +..summary:Moves iterator to nil position. +..signature:goNil(iterator) +..param.iterator:The iterator that will be moved. +...type:Class.String +..remarks:$iterator$ is set to an invalid position, e.g. $NULL$ for pointer types. +..see:Function.clear +*/ + +template +inline void +goNil(TIterator & me) +{ +SEQAN_CHECKPOINT + me = TIterator(); +} + +template +inline void +goNil(TIterator * & me) +{ +SEQAN_CHECKPOINT + me = 0; +} + +////////////////////////////////////////////////////////////////////////////// +// atNil +////////////////////////////////////////////////////////////////////////////// + + +/** +.Function.atNil: +..cat:Iteration +..summary:Tests whether iterator is at nil position. +..signature:bool atNil(iterator) +..param.iterator:An iterator. +...type:Class.String +..returns:$true$ if $iterator$ points to an ivalid position, e.g. $iterator$ is a $NULL$ pointer. +$false$ otherwise. +..see:Function.goNil +*/ + +template +inline bool +atNil(TIterator & me) +{ +SEQAN_CHECKPOINT + return me == TIterator(); +} + + +template +inline bool +atNil(TIterator * me) +{ +SEQAN_CHECKPOINT + return me == 0; +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_iterator_adapt_std.h b/SeqAn-1.1/seqan/basic/basic_iterator_adapt_std.h new file mode 100644 index 0000000..a39f23b --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_iterator_adapt_std.h @@ -0,0 +1,436 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_iterator_adapt_std.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ITERATOR_ADAPT_STD_H +#define SEQAN_HEADER_BASIC_ITERATOR_ADAPT_STD_H + +////////////////////////////////////////////////////////////////////////////// + +//adapt SeqAn iterator to std +namespace std +{ + template + struct iterator_traits > + { + typedef ::seqan::Iter TIter; + + typedef random_access_iterator_tag iterator_category; + typedef typename ::seqan::Value::Type value_type; + typedef typename ::seqan::Difference::Type difference_type; + typedef typename ::seqan::Value::Type * pointer; + typedef typename ::seqan::Reference::Type reference; + }; +} + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +namespace SEQAN_NAMESPACE_MAIN +{ + +//helper Metafunction + +/* This simple, general implementation cannot be used due to strange VC++ 2003 behavior + +template +struct StdContainerIterator +{ + typedef typename TStdContainer::iterator Type; +}; + +template +struct StdContainerIterator +{ + typedef typename TStdContainer::const_iterator Type; +}; +*/ + +//we use this instead: specialize StdContainerIterator for each std-container +template +struct StdContainerIterator +{ + typedef void * Type; //dummy, just to make VC++ 2003 happy +}; + +template +struct StdContainerIterator< ::std::basic_string > +{ + typedef ::std::basic_string TContainer; + typedef typename TContainer::iterator Type; +}; +template +struct StdContainerIterator< ::std::basic_string const> +{ + typedef ::std::basic_string TContainer; + typedef typename TContainer::const_iterator Type; +}; + +////////////////////////////////////////////////////////////////////////////// +//adapt std iterator to SeqAn + + +struct StdIteratorAdaptor; + +template +class Iter +{ +public: + typedef typename StdContainerIterator::Type TIterator; + TIterator data_iterator; + + Iter() {} + Iter(Iter const & other_): data_iterator(other_.data_iterator) {} + Iter(TIterator const & iter_): data_iterator(iter_) {} + Iter(TContainer const & cont_): data_iterator(begin(cont_)) {} + + Iter const & operator = (Iter const & other_) + { + data_iterator = other_.data_iterator; + return *this; + } + Iter const & operator = (TIterator const & iter_) + { + data_iterator = iter_; + return *this; + } + + operator TIterator &() + { + return data_iterator; + } + + ~Iter() {} +}; + +////////////////////////////////////////////////////////////////////////////// +// hostIterator +////////////////////////////////////////////////////////////////////////////// + +template +inline typename StdContainerIterator::Type & +hostIterator(Iter & me) +{ + return me.data_iterator; +} +template +inline typename StdContainerIterator::Type const & +hostIterator(Iter const & me) +{ + return me.data_iterator; +} + +////////////////////////////////////////////////////////////////////////////// +// value +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Reference >::Type +value(Iter & me) +{ + return *(me.data_iterator); +} +template +inline typename Reference const>::Type +value(Iter const & me) +{ + return *(me.data_iterator); +} + + +///////////////////////////////////////////////////////////////////////////// +// assignValue +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assignValue(Iter & me, + TValue & val) +{ + *(me.data_iterator) = val; +} +template +inline void +assignValue(Iter & me, + TValue const & val) +{ + *(me.data_iterator) = val; +} + +///////////////////////////////////////////////////////////////////////////// +// moveValue +////////////////////////////////////////////////////////////////////////////// + +template +inline void +moveValue(Iter & me, + TValue & val) +{ + move(*(me.data_iterator), val); +} +template +inline void +moveValue(Iter & me, + TValue const & val) +{ + move(*(me.data_iterator), val); +} + +////////////////////////////////////////////////////////////////////////////// +// operator == +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator == (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) == hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator != +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator != (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) != hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator < +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator < (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) < hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator > +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator > (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) > hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator <= +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator <= (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) <= hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator >= +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator >= (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) >= hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// goNext +////////////////////////////////////////////////////////////////////////////// + +template +inline void +goNext(Iter & me) +{ +SEQAN_CHECKPOINT + goNext(hostIterator(me)); +} + +////////////////////////////////////////////////////////////////////////////// +// goPrevious +////////////////////////////////////////////////////////////////////////////// + +template +inline void +goPrevious(Iter & me) +{ +SEQAN_CHECKPOINT + goPrevious(hostIterator(me)); +} + +////////////////////////////////////////////////////////////////////////////// +// operator + +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter +operator + (Iter const & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + return Iter(hostIterator(left) + right); +} +// for types +template +inline Iter +operator + (Iter const & left, + int right) +{ +SEQAN_CHECKPOINT + return Iter(hostIterator(left) + right); +} + +template +inline Iter +operator + (TIntegral left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return Iter(hostIterator(right) + left); +} +// for types +template +inline Iter +operator + (int left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return Iter(hostIterator(right) + left); +} + +////////////////////////////////////////////////////////////////////////////// +// operator += +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter & +operator += (Iter & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + hostIterator(left) += right; + return left; +} +// for types +template +inline Iter & +operator += (Iter & left, + int right) +{ +SEQAN_CHECKPOINT + hostIterator(left) += right; + return left; +} + +////////////////////////////////////////////////////////////////////////////// +// operator - +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter +operator - (Iter const & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + return Iter(hostIterator(left) - right); +} +// for types +template +inline Iter +operator - (Iter const & left, + int right) +{ +SEQAN_CHECKPOINT + return Iter(hostIterator(left) - right); +} + +//____________________________________________________________________________ + +template +inline typename Difference >::Type +operator - (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) - hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator -= +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter & +operator -= (Iter & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + hostIterator(left) -= right; + return left; +} +// for types +template +inline Iter & +operator -= (Iter & left, + int right) +{ +SEQAN_CHECKPOINT + hostIterator(left) -= right; + return left; +} + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +// assign (Conversion) +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assign(Iter & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + target.data_iterator = begin(container(source)) + position(source); +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_iterator_adaptor.h b/SeqAn-1.1/seqan/basic/basic_iterator_adaptor.h new file mode 100644 index 0000000..9a68a98 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_iterator_adaptor.h @@ -0,0 +1,524 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_iterator_adaptor.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ITERATOR_ADAPTOR_H +#define SEQAN_HEADER_BASIC_ITERATOR_ADAPTOR_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// Tag + +//An iterator that adapts a std iterator to a default seqan iterator +template +struct AdaptorIterator; + +////////////////////////////////////////////////////////////////////////////// + +template +struct Iterator_Default_Imp +{ + typedef typename Iterator::Type TStandardIterator; + typedef Iter > Type; +}; + +////////////////////////////////////////////////////////////////////////////// +// Adaptor Iterator +////////////////////////////////////////////////////////////////////////////// + +/** +.Spec.Adaptor Iterator: +..cat:Iterators +..general:Class.Iter +..summary:Adapts iterators to @Concept.Rooted Iterator@. +..signature:Iter > +..param.TContainer:Type of the container that can be iterated by $TIterator$. +...remarks:Use @Metafunction.Container@ to get the container type for a given iterator. +..param.TIterator:Type of the iterator that is adapted to @Concept.Rooted Iterator@. +..remarks.text:Adaptor iterators can implicitly converted to $TIterator$. +*/ + +template +class Iter > +{ +private: + typename _Pointer::Type data_container; + TIterator data_iterator; +//____________________________________________________________________________ + +/** +.Memfunc.AdaptorIterator#Iter: +..class:Spec.Adaptor Iterator +..summary:Constructor +..signature:Iter() +..signature:Iter(iter) +..signature:Iter(container [, iterator]) +..param.iter:Another adaptor iterator object. +..param.container:The corresponding container object. +..param.iterator:A iterator of $container$. (optional) +...remarks.text:If this argument is omitted, the adaptor iterator is initialized to the @Function.begin.begin iterator@ of $container$. +*/ + +public: + Iter(): + data_container(0) + { +SEQAN_CHECKPOINT + data_iterator = TIterator(); + } +/*//TODO: welches "begin" zur initialisierung von "data_iterator" aufrufen? + Iter(typename _Parameter::Type container_): + data_container(_toPointer(container_)), + data_iterator(begin(container_)) + { +SEQAN_CHECKPOINT + } +*/ + Iter(typename _Parameter::Type container_, TIterator it_): + data_container(_toPointer(container_)), + data_iterator(it_) + { +SEQAN_CHECKPOINT + } + Iter(Iter const & other_): + data_container(other_.data_container), + data_iterator(other_.data_iterator) + { +SEQAN_CHECKPOINT + } +/* + template + Iter(TSource & source) + { +SEQAN_CHECKPOINT + assign(*this, source); + } + template + Iter(TSource const & source) + { +SEQAN_CHECKPOINT + assign(*this, source); + } +*/ + + ~Iter() + { +SEQAN_CHECKPOINT + } + + Iter const & + operator = (Iter const & other_) + { +SEQAN_CHECKPOINT + data_container = other_.data_container; + data_iterator = other_.data_iterator; + return *this; + } +/* + template + Iter const & + operator = (TSource & source) + { +SEQAN_CHECKPOINT + assign(*this, source); + return *this; + } + template + Iter const & + operator = (TSource const & source) + { +SEQAN_CHECKPOINT + assign(*this, source); + return *this; + } +*/ +//____________________________________________________________________________ + + friend inline typename _Parameter::Type + container(Iter & me) + { +SEQAN_CHECKPOINT + return _toParameter(me.data_container); + } + friend inline typename _Parameter::Type + container(Iter const & me) + { +SEQAN_CHECKPOINT + return _toParameter(me.data_container); + } +//____________________________________________________________________________ + + friend inline void + setContainer(Iter & me, typename _Parameter::Type container_) + { +SEQAN_CHECKPOINT + if (me.data_container && me.data_iterator != TIterator()) + { + typename Position::Type pos = position(me); + me.data_container = _toPointer(container_); + setPosition(me, pos); + } + else + { + me.data_container = _toPointer(container_); + } + } + +//____________________________________________________________________________ + + friend inline TIterator & + hostIterator(Iter & me) + { +SEQAN_CHECKPOINT + return me.data_iterator; + } + friend inline TIterator const & + hostIterator(Iter const & me) + { +SEQAN_CHECKPOINT + return me.data_iterator; + } + +//____________________________________________________________________________ + + operator TIterator () const + { +SEQAN_CHECKPOINT + return data_iterator; + } + +//____________________________________________________________________________ +}; + +////////////////////////////////////////////////////////////////////////////// +// METAFUNCTIONS +////////////////////////////////////////////////////////////////////////////// +/* +template +struct Reference > const>: + Reference +{ +}; +*/ + +////////////////////////////////////////////////////////////////////////////// +// FUNCTIONS +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// +// position +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Position > const>::Type +position(Iter > const & me) +{ +SEQAN_CHECKPOINT + return hostIterator(me) - begin(container(me), Standard()); +} + +//____________________________________________________________________________ + +template +inline typename Position > const>::Type +position(Iter > const & me, + TContainer2 const &) +{ +SEQAN_CHECKPOINT + return hostIterator(me) - begin(container(me), Standard()); +} + +////////////////////////////////////////////////////////////////////////////// +// setPosition +////////////////////////////////////////////////////////////////////////////// + +template +inline void +setPosition(Iter > & me, + TPosition pos_) +{ +SEQAN_CHECKPOINT + hostIterator(me) = begin(container(me), Standard()) + pos_; +} + +////////////////////////////////////////////////////////////////////////////// +// value +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Reference > >::Type +value(Iter > & me) +{ +SEQAN_CHECKPOINT + return value(hostIterator(me)); +} +template +inline typename Reference > const>::Type +value(Iter > const & me) +{ +SEQAN_CHECKPOINT + return value(hostIterator(me)); +} + +///////////////////////////////////////////////////////////////////////////// +// assignValue +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assignValue(Iter > & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + assignValue(hostIterator(me), _value); +} +template +inline void +assignValue(Iter > const & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + assignValue(hostIterator(me), _value); +} + +///////////////////////////////////////////////////////////////////////////// +// moveValue +////////////////////////////////////////////////////////////////////////////// + +template +inline void +moveValue(Iter > & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + moveValue(hostIterator(me), _value); +} +template +inline void +moveValue(Iter > const & me, + TValue const & _value) +{ +SEQAN_CHECKPOINT + moveValue(hostIterator(me), _value); +} + +////////////////////////////////////////////////////////////////////////////// +// operator == +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator == (Iter > const & left, + Iter > const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) == hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator != +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator != (Iter > const & left, + Iter > const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) != hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// goNext +////////////////////////////////////////////////////////////////////////////// + +template +inline void +goNext(Iter > & me) +{ +SEQAN_CHECKPOINT + goNext(hostIterator(me)); +} + +////////////////////////////////////////////////////////////////////////////// +// goPrevious +////////////////////////////////////////////////////////////////////////////// + +template +inline void +goPrevious(Iter > & me) +{ +SEQAN_CHECKPOINT + goPrevious(hostIterator(me)); +} + +////////////////////////////////////////////////////////////////////////////// +// operator + +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter > +operator + (Iter > const & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + return Iter >(container(left), hostIterator(left) + right); +} +// for types +template +inline Iter > +operator + (Iter > const & left, + int right) +{ +SEQAN_CHECKPOINT + return Iter >(container(left), hostIterator(left) + right); +} + +template +inline Iter > +operator + (TIntegral left, + Iter > const & right) +{ +SEQAN_CHECKPOINT + return Iter >(container(right), hostIterator(right) + left); +} +// for types +template +inline Iter > +operator + (int left, + Iter > const & right) +{ +SEQAN_CHECKPOINT + return Iter >(container(right), hostIterator(right) + left); +} + +////////////////////////////////////////////////////////////////////////////// +// operator += +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter > & +operator += (Iter > & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + hostIterator(left) += right; + return left; +} +// for types +template +inline Iter > & +operator += (Iter > & left, + int right) +{ +SEQAN_CHECKPOINT + hostIterator(left) += right; + return left; +} + +////////////////////////////////////////////////////////////////////////////// +// operator - +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter > +operator - (Iter > const & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + return Iter >(container(left), hostIterator(left) - right); +} +// for types +template +inline Iter > +operator - (Iter > const & left, + int right) +{ +SEQAN_CHECKPOINT + return Iter >(container(left), hostIterator(left) - right); +} + +//____________________________________________________________________________ + +template +inline typename Difference > >::Type +operator - (Iter > const & left, + Iter > const & right) +{ +SEQAN_CHECKPOINT + return hostIterator(left) - hostIterator(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator -= +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter > & +operator -= (Iter > & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + hostIterator(left) -= right; + return left; +} +// for types +template +inline Iter > & +operator -= (Iter > & left, + int right) +{ +SEQAN_CHECKPOINT + hostIterator(left) -= right; + return left; +} + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// +// atEnd +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +atEnd(Iter > & me) +{ +SEQAN_CHECKPOINT + return atEnd(me, container(me)); +} + +////////////////////////////////////////////////////////////////////////////// +// assign (Conversion) +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assign(Iter > & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + target.data_container = container(source); + target.data_iterator = begin(container(source)) + position(source); +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_iterator_base.h b/SeqAn-1.1/seqan/basic/basic_iterator_base.h new file mode 100644 index 0000000..4c3049a --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_iterator_base.h @@ -0,0 +1,221 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_iterator_base.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ITERATOR_BASE_H +#define SEQAN_HEADER_BASIC_ITERATOR_BASE_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// Iter +////////////////////////////////////////////////////////////////////////////// +/** +.Class.Iter: +..cat:Basic +..summary:Iterator that is used to traverse containers. +..signature:Iter +..param.TContainer:Type of the container that can be iterated by $Iter$. +...metafunction:Metafunction.Container +..param.TSpec:The specializing type. +...metafunction:Metafunction.Spec +..implements:Concept.Iterator +*/ +template +class Iter; + +////////////////////////////////////////////////////////////////////////////// +///.Metafunction.Spec.param.T.type:Class.Iter + +template +struct Spec > +{ + typedef TSpec Type; +}; +template +struct Spec const> +{ + typedef TSpec Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Value.param.T.type:Class.Iter + +template +struct Value >: + Value +{ +}; +template +struct Value const>: + Value +{ +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.GetValue.param.T.type:Class.Iter + +template +struct GetValue >: + GetValue +{ +}; +template +struct GetValue const>: + GetValue +{ +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Reference.param.T.type:Class.Iter + +template +struct Reference >: + Reference +{ +}; +template +struct Reference const>: + Reference +{ +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Container.param.T.type:Class.Iter + +template struct Container; + +template +struct Container > +{ + typedef TContainer Type; +}; +template +struct Container const> +{ + typedef TContainer Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +/* +///.Metafunction.Host.param.T.type:Class.Iter + +template +struct Host >: + Container > +{ +}; +template +struct Host const>: + Container const> +{ +}; +*/ + +////////////////////////////////////////////////////////////////////////////// +// operator * +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Reference >::Type +operator * (Iter & me) +{ +SEQAN_CHECKPOINT + return value(me); +} +template +inline typename Reference const>::Type +operator * (Iter const & me) +{ +SEQAN_CHECKPOINT + return value(me); +} + +////////////////////////////////////////////////////////////////////////////// +// operator ++ +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter const & +operator ++ (Iter & me) +{ +SEQAN_CHECKPOINT + goNext(me); + return me; +} + +template +inline Iter const +operator ++ (Iter & me, int) +{ +SEQAN_CHECKPOINT + Iter temp_(me); + goNext(me); + return temp_; +} + +////////////////////////////////////////////////////////////////////////////// +// operator -- +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter const & +operator -- (Iter & me) +{ +SEQAN_CHECKPOINT + goPrevious(me); + return me; +} + +template +inline Iter const +operator -- (Iter & me, int) +{ +SEQAN_CHECKPOINT + Iter temp_(me); + goPrevious(me); + return temp_; +} + +////////////////////////////////////////////////////////////////////////////// +// position +////////////////////////////////////////////////////////////////////////////// + +//most Iter classes are rooted strings + +template +inline typename Position const>::Type +position(Iter const & me, + TContainer2 const &) +{ +SEQAN_CHECKPOINT + return position(me); +} + + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_iterator_position.h b/SeqAn-1.1/seqan/basic/basic_iterator_position.h new file mode 100644 index 0000000..adc4222 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_iterator_position.h @@ -0,0 +1,450 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_iterator_position.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ITERATOR_POSITION_H +#define SEQAN_HEADER_BASIC_ITERATOR_POSITION_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// Tag + +struct PositionIterator; + +////////////////////////////////////////////////////////////////////////////// +// Position Iterator +////////////////////////////////////////////////////////////////////////////// + +/** +.Spec.Position Iterator: +..cat:Iterators +..general:Class.Iter +..summary:Adapts @Metafunction.Position.position@ to @Concept.Rooted Iterator.iterator@. +..signature:Iter +..param.TContainer:Type of the container. +...metafunction:Metafunction.Container +..remarks +...text:Position Iterators provide the concept @Concept.Rooted Iterator@. +..see:Metafunction.Position +*/ + +template +class Iter +{ +public: + typedef typename Position::Type TPosition; + + typename _Pointer::Type data_container; + TPosition data_position; +//____________________________________________________________________________ + +public: +/** +.Memfunc.PositionIterator#Iter: +..class:Spec.Position Iterator +..summary:Constructor +..signature:Iter() +..signature:Iter(iter) +..signature:Iter(container [, position]) +..param.iter:Another position iterator object. +..param.container:The corresponding container object. +...metafunction:Metafunction.Container +..param.position:A position in $container$. (optional) +...metafunction:Metafunction.Position +...remarks.text:If this argument is omitted, the adaptor iterator is initialized to the @Function.beginPosition.begin position@ of $container$. +*/ + Iter() + { +SEQAN_CHECKPOINT + } + Iter(typename _Parameter::Type container_, TPosition position_ = 0): + data_container(_toPointer(container_)), + data_position(position_) + { +SEQAN_CHECKPOINT + } + Iter(Iter const & other_): + data_container(other_.data_container), + data_position(other_.data_position) + { +SEQAN_CHECKPOINT + } + template + Iter(Iter const & other_) + { +SEQAN_CHECKPOINT + assign(*this, other_); + } + ~Iter() + { +SEQAN_CHECKPOINT + } + Iter const & + operator = (Iter const & other_) + { +SEQAN_CHECKPOINT + data_container = other_.data_container; + data_position = other_.data_position; + return *this; + } +//____________________________________________________________________________ + + friend inline typename _Parameter::Type + container(Iter & me) + { +SEQAN_CHECKPOINT + return _toParameter(me.data_container); + } + friend inline typename _Parameter::Type + container(Iter const & me) + { +SEQAN_CHECKPOINT + return _toParameter(me.data_container); + } +//____________________________________________________________________________ + + friend inline void + setContainer(Iter & me, typename _Parameter::Type container_) + { +SEQAN_CHECKPOINT + typename Position::Type pos = position(me); + me.data_container = _toPointer(container_); + setPosition(me, pos); + } + +//____________________________________________________________________________ + + friend inline TPosition & + position(Iter & me) + { +SEQAN_CHECKPOINT + return me.data_position; + } + friend inline TPosition const & + position(Iter const & me) + { +SEQAN_CHECKPOINT + return me.data_position; + } +//____________________________________________________________________________ + + friend inline void + setPosition(Iter & me, TPosition position_) + { +SEQAN_CHECKPOINT + me.data_position = position_; + } +//____________________________________________________________________________ +}; + +////////////////////////////////////////////////////////////////////////////// +// value +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Reference >::Type +value(Iter & me) +{ +SEQAN_CHECKPOINT + return value(container(me), position(me)); +} +template +inline typename Reference >::Type +value(Iter const & me) +{ +SEQAN_CHECKPOINT + return value(container(me), position(me)); +} + +///////////////////////////////////////////////////////////////////////////// +// assignValue +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assignValue(Iter & me, + TValue _value) +{ +SEQAN_CHECKPOINT + assignValue(container(me), position(me), _value); +} +template +inline void +assignValue(Iter const & me, + TValue _value) +{ +SEQAN_CHECKPOINT + assignValue(container(me), position(me), _value); +} + +///////////////////////////////////////////////////////////////////////////// +// moveValue +////////////////////////////////////////////////////////////////////////////// + +template +inline void +moveValue(Iter & me, + TValue _value) +{ +SEQAN_CHECKPOINT + moveValue(container(me), position(me), _value); +} +template +inline void +moveValue(Iter const & me, + TValue _value) +{ +SEQAN_CHECKPOINT + moveValue(container(me), position(me), _value); +} + +////////////////////////////////////////////////////////////////////////////// +// operator == +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator == (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return position(left) == position(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator != +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator != (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return position(left) != position(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator < / > +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator < (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return position(left) < position(right); +} + +template +inline bool +operator > (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return position(left) > position(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator <= / >= +////////////////////////////////////////////////////////////////////////////// + +template +inline bool +operator <= (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return position(left) <= position(right); +} + +template +inline bool +operator >= (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return position(left) >= position(right); +} + +////////////////////////////////////////////////////////////////////////////// +// goNext +////////////////////////////////////////////////////////////////////////////// + +template +inline void +goNext(Iter & me) +{ +SEQAN_CHECKPOINT + setPosition(me, position(me) + 1); +} + +////////////////////////////////////////////////////////////////////////////// +// goPrevious +////////////////////////////////////////////////////////////////////////////// + +template +inline void +goPrevious(Iter & me) +{ +SEQAN_CHECKPOINT + setPosition(me, position(me) - 1); +} + +////////////////////////////////////////////////////////////////////////////// +// operator + +////////////////////////////////////////////////////////////////////////////// +template +inline Iter +operator + (Iter const & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + return Iter(container(left), position(left) + right); +} +// for types +template +inline Iter +operator + (Iter const & left, + int right) +{ +SEQAN_CHECKPOINT + return Iter(container(left), position(left) + right); +} + +template +inline Iter +operator + (TIntegral left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return Iter(container(right), position(right) + left); +} +// for types +template +inline Iter +operator + (int left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return Iter(container(right), position(right) + left); +} + +////////////////////////////////////////////////////////////////////////////// +// operator += +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter & +operator += (Iter & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + setPosition(left, position(left) + right); + return left; +} +// for types +template +inline Iter & +operator += (Iter & left, + int right) +{ +SEQAN_CHECKPOINT + setPosition(left, position(left) + right); + return left; +} + +////////////////////////////////////////////////////////////////////////////// +// operator - +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter +operator - (Iter const & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + return Iter(container(left), position(left) - right); +} +// for types +template +inline Iter +operator - (Iter const & left, + int right) +{ +SEQAN_CHECKPOINT + return Iter(container(left), position(left) - right); +} + +//____________________________________________________________________________ + +template +inline typename Difference::Type +operator - (Iter const & left, + Iter const & right) +{ +SEQAN_CHECKPOINT + return position(left) - position(right); +} + +////////////////////////////////////////////////////////////////////////////// +// operator -= +////////////////////////////////////////////////////////////////////////////// + +template +inline Iter & +operator -= (Iter & left, + TIntegral right) +{ +SEQAN_CHECKPOINT + setPosition(left, position(left) - right); + return left; +} +// for types +template +inline Iter & +operator -= (Iter & left, + int right) +{ +SEQAN_CHECKPOINT + setPosition(left, position(left) - right); + return left; +} + +////////////////////////////////////////////////////////////////////////////// +// assign (Conversion) +////////////////////////////////////////////////////////////////////////////// + +template +inline void +assign(Iter & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + target.data_container = container(source); + target.data_position = position(source); +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_iterator_simple.h b/SeqAn-1.1/seqan/basic/basic_iterator_simple.h new file mode 100644 index 0000000..8bfe78f --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_iterator_simple.h @@ -0,0 +1,117 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_iterator_simple.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_ITERATOR_SIMPLE_H +#define SEQAN_HEADER_BASIC_ITERATOR_SIMPLE_H + +namespace SEQAN_NAMESPACE_MAIN +{ +////////////////////////////////////////////////////////////////////////////// +// Iter +////////////////////////////////////////////////////////////////////////////// + +struct SimpleIterator; + +/** +.Spec.SimpleIterator: +..cat:Iterators +..summary:A simple iterator. +..signature:Iter +..param.TContainer:Type of the container that can be iterated. +...metafunction:Metafunction.Container +..general:Class.Iter +*/ +template +class Iter +{ +public: + typedef typename Value::Type TValue; + TValue * data_ptr; + + Iter() + { + } + Iter(Iter const & other_): + data_ptr(other_.data_ptr) + { + } + Iter(TValue * other_data_ptr): + data_ptr(other_data_ptr) + { + } + template + Iter(Iter const & other_): + data_ptr(other_.data_ptr) + { + } + ~Iter() + { + } + Iter const & + operator = (Iter const & other_) + { + this->data_ptr = other_.data_ptr; + return *this; + } + Iter const & + operator = (TValue * other_data_ptr) + { + data_ptr = other_data_ptr; + return *this; + } + template + Iter const & + operator = (Iter const & other_) + { + this->data_ptr = other_.data_ptr; + return *this; + } + + operator TValue * () + { + return data_ptr; + } +}; + +////////////////////////////////////////////////////////////////////////////// + +template +struct Iterator_Default_Imp +{ + typedef typename Value::Type * Type; +// typedef Iter Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +template +inline typename Position const>::Type +position(Iter const & me, + TContainer2 const & cont) +{ +SEQAN_CHECKPOINT + return me.data_ptr - begin(cont); +} + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_metaprogramming.h b/SeqAn-1.1/seqan/basic/basic_metaprogramming.h new file mode 100644 index 0000000..fffe660 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_metaprogramming.h @@ -0,0 +1,293 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_metaprogramming.h,v 1.2 2009/02/19 01:51:23 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_BASIC_METAPROGRAMMING_H +#define SEQAN_BASIC_METAPROGRAMMING_H + +namespace SEQAN_NAMESPACE_MAIN +{ + + ////////////////////////////////////////////////////////////////////////////// + // generic "if" (using meta-programming) + // if Flag is true, the resulting type is Type1 + // if Flag is false, the resulting type is Type2 + ////////////////////////////////////////////////////////////////////////////// + + template + struct IF + { + typedef Type1 Type; + }; + + template + struct IF + { + typedef Type2 Type; + }; + + + ////////////////////////////////////////////////////////////////////////////// + // generic type comparison (using meta-programming) + // if Type1 equals Type2, VALUE is true + // if Type1 differs from Type2, VALUE is false + ////////////////////////////////////////////////////////////////////////////// + + template + struct TYPECMP + { + typedef False Type; + enum { VALUE = false }; + }; + + template + struct TYPECMP + { + typedef True Type; + enum { VALUE = true }; + }; + + ////////////////////////////////////////////////////////////////////////////// + // generic "switch" (using meta-programming) + ////////////////////////////////////////////////////////////////////////////// + + const int DEFAULT = ~(~0u >> 1); // initialize with the smallest int + + struct NilCase {}; + + template + struct CASE + { + enum { tag = tag_ }; + typedef Type_ Type; + typedef Next_ Next; + }; + + template + class SWITCH + { + typedef typename Case::Next NextCase; + enum + { + caseTag = Case::tag, + found = (caseTag == tag || caseTag == DEFAULT) + }; + public: + typedef typename + IF< + found, + typename Case::Type, + typename SWITCH::Type + >::Type Type; + }; + + template + class SWITCH + { + public: + typedef NilCase Type; + }; + + + ////////////////////////////////////////////////////////////////////////////// + // generic loops (using meta-programming) + // corresponds to for(i=1; i<=I; ++i) ... + ////////////////////////////////////////////////////////////////////////////// + + // example of a loop Worker class + struct WorkerNothing + { + template + static inline void body(Arg &arg, int I) {} + }; + + template + class LOOP { + public: + template + static inline void run(Arg &arg) { + LOOP::run(arg); + Worker::body(arg, I); + } + }; + + template + class LOOP { + public: + // end of loop + template + static inline void run(Arg &) {} + }; + + ////////////////////////////////////////////////////////////////////////////// + // generic reverse loops (using meta-programming) + // corresponds to for(i=I; i>0; --i) ... + ////////////////////////////////////////////////////////////////////////////// + + template + class LOOP_REVERSE { + public: + template + static inline void run(Arg &arg) { + Worker::body(arg, I); + LOOP_REVERSE::run(arg); + } + }; + + template + class LOOP_REVERSE { + public: + // end of loop + template + static inline void run(Arg &) {} + }; + + ////////////////////////////////////////////////////////////////////////////// + // logarithmus dualis (using meta-programming) + ////////////////////////////////////////////////////////////////////////////// + + template < __int64 numerus > + struct Log2 { + enum { VALUE = Log2<(numerus + 1) / 2>::VALUE + 1 }; // ceil(log_2(n)) + }; + + template < __int64 numerus > + struct Log2Floor { + enum { VALUE = Log2Floor::VALUE + 1 }; // floor(log_2(n)) + }; + + template <> struct Log2<1> { enum { VALUE = 0 }; }; + template <> struct Log2<0> { enum { VALUE = 0 }; }; + template <> struct Log2Floor<1> { enum { VALUE = 0 }; }; + template <> struct Log2Floor<0> { enum { VALUE = 0 }; }; + + + ////////////////////////////////////////////////////////////////////////////// + // exponentiation (using meta-programming) + ////////////////////////////////////////////////////////////////////////////// + + template < __int64 base, __int64 exponent > + struct Power { + enum { + VALUE = + Power::VALUE * + Power::VALUE + }; + }; + + template < __int64 base > struct Power { enum { VALUE = base }; }; + template < __int64 base > struct Power { enum { VALUE = 1 }; }; + + + ////////////////////////////////////////////////////////////////////////////// + // memset with fill size (using meta-programming) + ////////////////////////////////////////////////////////////////////////////// + + using ::memset; + + template + struct MemsetWorker { + finline static void run(unsigned char* ptr, unsigned char c) { memset(ptr, c, SIZE); } + }; + + template + struct MemsetWorker { + finline static void run(unsigned char* ptr, unsigned char c) { + *((unsigned*)ptr) = ((unsigned)c << 24) + ((unsigned)c << 16) + ((unsigned)c << 8) + (unsigned)c; + MemsetWorker::run(ptr + 4, c); + } + }; + + template <> + struct MemsetWorker<0, true> { + finline static void run(unsigned char*, unsigned char) {} + }; + + template <> + struct MemsetWorker<1, true> { + finline static void run(unsigned char* ptr, unsigned char c) { *ptr = c; } + }; + + template <> + struct MemsetWorker<2, true> { + finline static void run(unsigned char* ptr, unsigned char c) { *(unsigned short *)ptr = ((unsigned short)c << 8) + (unsigned short)c; } + }; + + template <> + struct MemsetWorker<3, true> { + finline static void run(unsigned char* ptr, unsigned char c) { + MemsetWorker<2, true>::run(ptr, c); + MemsetWorker<1, true>::run(ptr + 2, c); + } + }; + + template + finline void memset(void* ptr, unsigned char c) { + MemsetWorker::run((unsigned char*)ptr, c); + } + + + ////////////////////////////////////////////////////////////////////////////// + // memset with fill value (using meta-programming) + ////////////////////////////////////////////////////////////////////////////// + + template + struct MemsetConstValueWorker { + finline static void run(unsigned char* ptr) { memset(ptr, c, SIZE); } + }; + + template + struct MemsetConstValueWorker { + finline static void run(unsigned char* ptr) { + *((unsigned*)ptr) = ((unsigned)c << 24) + ((unsigned)c << 16) + ((unsigned)c << 8) + (unsigned)c; + MemsetConstValueWorker::run(ptr + 4); + } + }; + + template + struct MemsetConstValueWorker<0, true, c> { + finline static void run(unsigned char* ptr) {} + }; + + template + struct MemsetConstValueWorker<1, true, c> { + finline static void run(unsigned char* ptr) { *ptr = c; } + }; + + template + struct MemsetConstValueWorker<2, true, c> { + finline static void run(unsigned char* ptr) { *(unsigned short *)ptr = ((unsigned short)c << 8) + (unsigned short)c; } + }; + + template + struct MemsetConstValueWorker<3, true, c> { + finline static void run(unsigned char* ptr) { + MemsetConstValueWorker<2, true, c>::run(ptr); + MemsetConstValueWorker<1, true, c>::run(ptr + 2); + } + }; + + template + finline void memset(void* ptr) { + MemsetConstValueWorker::run((unsigned char*)ptr); + } + +} + +#endif diff --git a/SeqAn-1.1/seqan/basic/basic_operator.h b/SeqAn-1.1/seqan/basic/basic_operator.h new file mode 100644 index 0000000..2bd48d9 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_operator.h @@ -0,0 +1,32 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_operator.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_OPERATOR_H +#define SEQAN_HEADER_BASIC_OPERATOR_H + +namespace SEQAN_NAMESPACE_MAIN +{ + + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... + + diff --git a/SeqAn-1.1/seqan/basic/basic_pointer.h b/SeqAn-1.1/seqan/basic/basic_pointer.h new file mode 100644 index 0000000..83825c0 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_pointer.h @@ -0,0 +1,103 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_pointer.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_POINTER_H +#define SEQAN_HEADER_BASIC_POINTER_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Value.param.T.type:Adaption.char array + +template +struct Value< TValue * > +{ + typedef TValue Type; +}; +template +struct Value< TValue * const> +{ + typedef TValue Type; +}; + +//The next two metafunctions dont work in VC++ due to a compiler bug. +//(the default implementation in common_type.h is called instead) +//work-around: convert arrays to pointers. +template +struct Value< TValue [SIZE] > +{ + typedef TValue Type; +}; +template +struct Value< TValue const [SIZE] > +{ + typedef TValue const Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Iterator.param.T.type:Adaption.char array + +template +struct Iterator< TValue *, Standard> +{ + typedef TValue * Type; +}; +template +struct Iterator< TValue * const, Standard> +{ + typedef TValue * Type; +}; + +//____________________________________________________________________________ + +template +struct Iterator< TValue [SIZE], Standard>: + Iterator +{ +}; +template +struct Iterator< TValue const [SIZE], Standard>: + Iterator +{ +}; + +template +struct Iterator< TValue [SIZE], Rooted>: + Iterator +{ +}; +template +struct Iterator< TValue const [SIZE], Rooted>: + Iterator +{ +}; + + + + +////////////////////////////////////////////////////////////////////////////// +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_profile.h b/SeqAn-1.1/seqan/basic/basic_profile.h new file mode 100644 index 0000000..edcf42b --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_profile.h @@ -0,0 +1,503 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_profile.h,v 1.1 2008/08/25 16:20:02 langmead Exp $ + ==========================================================================*/ + +//SEQAN_NO_GENERATED_FORWARDS: no forwards are generated for this file + +#ifndef SEQAN_HEADER_BASIC_PROFILE_H +#define SEQAN_HEADER_BASIC_PROFILE_H + +// todo: substitute defines with inlines +#ifndef SEQAN_PROFILE + + #define SEQAN_PROSET(i,v) + #define SEQAN_PROADD(i,v) + #define SEQAN_PROSUB(i,v) + #define SEQAN_PROVAL(i) 0 + #define SEQAN_PROEXTRAS(i) + #define SEQAN_PROMARK(m) + #define SEQAN_PROENDMARK(m) + #define SEQAN_PRORESET + #define SEQAN_PROGETTIME 0 + #define SEQAN_PROTIMESTART(a) + #define SEQAN_PROTIMEDIFF(a) 0 + // replace malloc and free in external tools + // with SEQAN_PROMALLOC and SEQAN_PROFREE to profile + // their memory usage + #define SEQAN_PROMALLOC(s) malloc(s) + #define SEQAN_PROFREE(p) free(p) + +#else + + #define SEQAN_PROSET(i,v) _proSet(i,v) + #define SEQAN_PROADD(i,v) _proAdd(i,v) + #define SEQAN_PROSUB(i,v) _proSub(i,v) + #define SEQAN_PROVAL(i) (_proData<>::_proValue[i]) + #define SEQAN_PROEXTRAS(i) {_proData<>::_proExtraCount = i;} + #define SEQAN_PROMARK(m) _proMark(m) + #define SEQAN_PROENDMARK(m) _proEndMark(m) + #define SEQAN_PRORESET _proReset() + #define SEQAN_PROGETTIME sysTime() + #define SEQAN_PROTIMESTART(a) _proFloat a = sysTime() + #define SEQAN_PROTIMEDIFF(a) (sysTime() - a) + #define SEQAN_PROMALLOC(s) _proMalloc(s) + #define SEQAN_PROFREE(p) _proFree(p) + +#endif + +#ifdef PLATFORM_WINDOWS + typedef __int64 _proInt; +#else + typedef int64_t _proInt; +#endif + + typedef double _proFloat; + + + typedef _proFloat _proTValue; + + enum _proConsts { + SEQAN_PROPAGESIZE = 4096, // B in byte + SEQAN_PROFLOAT = 0, + SEQAN_PROINT = 1, + SEQAN_PROTIME = 2, + SEQAN_PROTYPEMASK = 3, + SEQAN_PROSTATE = 4 + }; + + enum _proValueIndex { + SEQAN_PROSYSTIME = 0, + SEQAN_PROCPUTIME = 1, + SEQAN_PROMEMORY = 2, // current memory usage (state value) + SEQAN_PROIO = 3, // IOs done (measured in Blocks of size B) + SEQAN_PROIORANDOM = 4, // IOs calls done (read/write calls done) + SEQAN_PROIOVOLUME = 5, // current disk usage (state value) + SEQAN_PRODEPTH = 6, // algorithmic rec. depth or loop count + SEQAN_PROOPENFILES = 7, // currently opened files + SEQAN_PROIWAIT = 8, // waiting time (initiating) + SEQAN_PROCWAIT = 9, // waiting time (completing) + SEQAN_PROEXTRA1 = 10, + SEQAN_PROEXTRA2 = 11, + SEQAN_PROEXTRA3 = 12, + SEQAN_PROINDEXCOUNT = 13, + SEQAN_PROEXTRACOUNT = 3 + }; + + const char _proValueType[] = { + SEQAN_PROTIME, + SEQAN_PROTIME, + SEQAN_PROINT + SEQAN_PROSTATE, + SEQAN_PROINT, + SEQAN_PROINT, + SEQAN_PROINT + SEQAN_PROSTATE, + SEQAN_PROINT + SEQAN_PROSTATE, + SEQAN_PROINT + SEQAN_PROSTATE, + SEQAN_PROFLOAT, + SEQAN_PROFLOAT, + SEQAN_PROFLOAT + SEQAN_PROSTATE, + SEQAN_PROFLOAT + SEQAN_PROSTATE, + SEQAN_PROFLOAT + SEQAN_PROSTATE + }; + + typedef _proTValue _proTStates[SEQAN_PROINDEXCOUNT]; + typedef _proFloat _proTTimes[SEQAN_PROINDEXCOUNT]; + + + + struct _proFile; + + template + struct _proData + { + static _proTStates _proValue; + static _proTTimes _proLastUpdate; + static int _proExtraCount; + + static clock_t _proCpuTimeLast; // clock_t wraps around every 72mins + static _proInt _proCpuTimeOffset; // we have to work around this + + static _proFile* _proPFile; + static _proFile* _proPFileStream; + }; + + template _proTStates _proData::_proValue = {}; + template _proTStates _proData::_proLastUpdate = {}; + template int _proData::_proExtraCount = 0; + template clock_t _proData::_proCpuTimeLast = 0; + template _proInt _proData::_proCpuTimeOffset = 0; + template _proFile* _proData::_proPFile = NULL; + template _proFile* _proData::_proPFileStream = NULL; + + + inline _proFile* & _proPFile() { return _proData<>::_proPFile; } + inline _proFile* & _proPFileStream() { return _proData<>::_proPFileStream; } + + +// HINT: The unit of all time functions is second. + inline _proFloat cpuTime() { + clock_t now = clock(); + if (_proData<>::_proCpuTimeLast > now) { // test for time wrap + _proData<>::_proCpuTimeOffset += (~0u); // got one + _proData<>::_proCpuTimeOffset ++; +// printf("\n!!WRAP!! old:%d, now:%d ofs:%d\n",_proData<>::_proCpuTimeLast,now,_proData<>::_proCpuTimeOffset); + } + _proData<>::_proCpuTimeLast = now; + return (_proData<>::_proCpuTimeOffset + now) / (_proFloat)CLOCKS_PER_SEC; + } + + #ifdef PLATFORM_WINDOWS +// inline _proFloat sysTime() { return GetTickCount() * 1e-3; } + inline _proFloat sysTime() { return ( (_proFloat) clock() ) / CLOCKS_PER_SEC; } + #else + + #include + #if _POSIX_TIMERS > 0 + #ifndef SEQAN_USE_CLOCKGETTIME + #define SEQAN_USE_CLOCKGETTIME + #endif + #endif + + #ifndef SEQAN_USE_CLOCKGETTIME + /* some systems e.g. darwin have no clock_gettime */ + + #include + + inline _proFloat sysTime() { + struct timeval tp; + gettimeofday(&tp, NULL); + return tp.tv_sec + tp.tv_usec * 1e-6; + } + + #else + + inline _proFloat sysTime() { + /*struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + return tp.tv_sec + tp.tv_nsec * 1e-9;*/ + return 0; // BTL: to compile under cygwin + } + + #endif + + #endif + + + struct _proFile { + + FILE *out; + bool running; + + _proFloat dumpStep; // 0 .. manual dump mode, >0 .. live stream + _proFloat dumpNext; + + _proTStates all, last; + ::std::string mark; + unsigned lines; + + _proFile() { + running = false; + } + + _proFile(char const *fname, _proFloat _dumpStep = 300.0) { // five minutes default dump interval + running = false; + start(fname, _dumpStep); + } + + ~_proFile() { + if (running) stop(); + } + + inline void start(char const *fname, _proFloat _dumpStep = 300.0, bool append = false) { + if (append) + out = fopen(fname, "a"); + else { + out = fopen(fname, "w"); + dumpHeader(); + } + + if (!out) printf("WARNING: proFile could not be opened.\n"); + + setTime(_proData<>::_proValue); + syncAll(all); + syncAll(last); + running = true; + lines = 0; + dumpStep = _dumpStep; + dumpNext = sysTime(); + dump(last); + } + + inline void stop() { + dump(last); + maximize(all, last); + if (dumpStep == 0) { + mark = "Zusammenfassung"; + dump(all); + } + fclose(out); + running = false; + } + + inline void syncTime(_proTStates &dst) { + memcpy(dst, _proData<>::_proValue, 2 * sizeof(_proTValue)); + } + + inline void sync(_proTStates &dst) { + memcpy(&(dst[2]), &(_proData<>::_proValue[2]), sizeof(_proTStates) - 2 * sizeof(_proTValue)); + } + + inline void syncAll(_proTStates &dst) { + memcpy(dst, _proData<>::_proValue, sizeof(_proTStates)); + } + + inline static void setTime(_proTStates &dst) { + dst[0] = sysTime(); + dst[1] = cpuTime(); + } + + inline void maximize(_proTStates &dst, _proTStates const &src) { + for(int i = 0; i < SEQAN_PROINDEXCOUNT; ++i) + if (((_proValueType[i] & SEQAN_PROSTATE) != 0)) + if (dst[i] < src[i]) + dst[i] = src[i]; + } + + inline void dumpTab() { + if (!bol) + fprintf(out, " \t"); + bol = false; + } + + inline void dumpEndl() { fprintf(out, "\n"); } + + inline void dumpHeader() { + fprintf(out, "\"Echtzeit\"\t\"CPU-Zeit\"\t\"Speicher\"\t\"I/O-Zugriffe\"\t\"wahlfreie I/Os\"\t\"I/O-Volumen\"\t\"Rekursionstiefe\"\t\"Offene Dateien\"\t\"Idle-Zeit vor I/O\"\t\"Idle-Zeit nach I/O\"\n"); + } + + inline void dumpTime(_proFloat seconds) { + if (seconds < 0) { + fputc('-', out); + seconds = -seconds; + } + int secs = (int)seconds; + int mins = secs/60; secs -= 60*mins; + int hours = mins/60; mins -= 60*hours; + fprintf(out, "%d:%02d:%02d", hours, mins, secs); + } + + inline void dumpTimeEx(_proFloat seconds) { + int milli = (int)(seconds * 1000.0); + int secs = (int)seconds; + int mins = secs/60; secs -= 60*mins; + int hours = mins/60; mins -= 60*hours; + fprintf(out, "%d:%02d:%02d.%03d", hours, mins, secs, milli); + } + + inline void dumpValue(_proTStates &stat, int valNum) { + _proFloat f = stat[valNum]; + if ((_proValueType[valNum] & SEQAN_PROSTATE) == 0) + f = _proData<>::_proValue[valNum] - f; + + switch (_proValueType[valNum] & SEQAN_PROTYPEMASK) { + case SEQAN_PROINT: // state value -> print last seen maximum + fprintf(out, "%.0f", f); + break; + + case SEQAN_PROFLOAT: + fprintf(out, "%f", f); + break; + + case SEQAN_PROTIME: + dumpTimeEx(f); + } + } + + inline void dumpSysValues(_proTStates &stat) { + for(int i = 0; i < SEQAN_PROINDEXCOUNT - SEQAN_PROEXTRACOUNT; ++i) { + dumpTab(); + dumpValue(stat, i); + } + } + + inline void dumpExtraValues(_proTStates &stat) { + for(int i = 0; i < _proData<>::_proExtraCount; ++i) { + dumpTab(); + dumpValue(stat, SEQAN_PROINDEXCOUNT - SEQAN_PROEXTRACOUNT + i); + } + } + + inline void dumpMark() { + if (!mark.empty()) { + dumpTab(); + fprintf(out, "\"%s\"", mark.c_str()); + mark.erase(); + } + } + + inline void dump(_proTStates &stat) { + setTime(_proData<>::_proValue); + dumpNext += dumpStep; + bol = true; + bool _flush = ((dumpStep == 0.0)) || ((lines & 16) == 0); + + dumpSysValues(stat); + dumpExtraValues(stat); + dumpMark(); + dumpEndl(); + if (_flush) fflush(out); + ++lines; + } + + inline void signalDumpTest(_proFloat now) { + if (dumpStep > 0 && now > dumpNext && running) { + dump(last); + maximize(all, last); + sync(last); + } + } + + inline void signalNewMax(int valNum) { + if (running) + if (last[valNum] < _proData<>::_proValue[valNum]) + last[valNum] = _proData<>::_proValue[valNum]; + } + + inline void setMark(const char *text) { + if (running) { + mark = text; + if (dumpStep == 0.0) { + dump(last); // manual dump; + maximize(all, last); + sync(last); + } + } + } + + inline void reset() { + syncTime(last); + } + + inline void setEndMark(const char *text) { + if (running) { + setMark(text); + reset(); + } + } + + private: + + bool bol; // begin of line + }; + + + +/* + inline void _proSignalDumpTest(_proFloat now); + inline void _proSignalNewMax(int valNum); + inline void _proMark(const char *text); + inline void _proEndMark(const char *text); + inline void _proReset(); + + inline void _proSet(int valNum, _proFloat value); + inline void _proAdd(int valNum, _proFloat value); + inline void _proSub(int valNum, _proFloat value); + + // simple interface for external programs + inline void *_proMalloc(size_t size); + inline void _proFree(void *_ptr); +*/ + + inline void _proSignalDumpTest(_proFloat now) { + if (_proData<>::_proPFileStream) _proData<>::_proPFileStream->signalDumpTest(now); + } + + inline void _proSignalNewMax(int valNum) { + if (((_proValueType[valNum] & SEQAN_PROSTATE) != 0)) { + if (_proData<>::_proPFileStream) _proData<>::_proPFileStream->signalNewMax(valNum); + if (_proData<>::_proPFile) _proData<>::_proPFile->signalNewMax(valNum); + } + } + + inline void _proMark(const char *text) { + if (_proData<>::_proPFileStream) _proData<>::_proPFileStream->setMark(text); + if (_proData<>::_proPFile) _proData<>::_proPFile->setMark(text); + } + + inline void _proEndMark(const char *text) { + if (_proData<>::_proPFileStream) { _proData<>::_proPFileStream->setEndMark(text); } + if (_proData<>::_proPFile) { _proData<>::_proPFile->setEndMark(text); } + } + + inline void _proReset() { + if (_proData<>::_proPFileStream) { _proData<>::_proPFileStream->reset(); } + if (_proData<>::_proPFile) { _proData<>::_proPFile->reset(); } + } + + + + + inline void _proSet(_proValueIndex valNum, _proFloat value) { + _proFloat now = sysTime(); + _proData<>::_proLastUpdate[valNum] = now; + if (_proData<>::_proValue[valNum] < value) { + _proData<>::_proValue[valNum] = value; + _proSignalNewMax(valNum); + } else + _proData<>::_proValue[valNum] = value; + _proSignalDumpTest(now); + } + + inline void _proAdd(_proValueIndex valNum, _proFloat value) { + _proFloat now = sysTime(); + _proData<>::_proValue[valNum] += value; + _proData<>::_proLastUpdate[valNum] = now; + if (valNum == SEQAN_PROIO) _proAdd(SEQAN_PROIORANDOM, 1); + _proSignalNewMax(valNum); + _proSignalDumpTest(now); + } + + inline void _proSub(_proValueIndex valNum, _proFloat value) { + _proFloat now = sysTime(); + _proData<>::_proValue[valNum] -= value; + _proData<>::_proLastUpdate[valNum] = now; + _proSignalDumpTest(now); + } + + // simple interface for external programs + inline void *_proMalloc(size_t size) { + size_t *ptr = reinterpret_cast(malloc(size + sizeof(size_t))); + if (ptr) { + _proAdd(SEQAN_PROMEMORY, *ptr = size); +// printf("_proMalloc %x size %d\n", ptr, size); + ++ptr; + } + return ptr; + } + + inline void _proFree(void *_ptr) { + size_t *ptr = reinterpret_cast(_ptr); + if (ptr) { + --ptr; +// printf("_proFree %x size %d\n", _ptr, *ptr); + _proSub(SEQAN_PROMEMORY, *ptr); + } + free(ptr); + } + +#endif diff --git a/SeqAn-1.1/seqan/basic/basic_proxy.h b/SeqAn-1.1/seqan/basic/basic_proxy.h new file mode 100644 index 0000000..c384e05 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_proxy.h @@ -0,0 +1,606 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_proxy.h,v 1.1 2008/08/25 16:20:02 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_PROXY_H +#define SEQAN_HEADER_BASIC_PROXY_H + + +namespace SEQAN_NAMESPACE_MAIN +{ + + +////////////////////////////////////////////////////////////////////////////// +// Proxy +////////////////////////////////////////////////////////////////////////////// +/** +.Class.Proxy: +..cat:Basic +..summary:Emulates object of another class. +..signature:Proxy +..param.TSpec:The specializing type. +...metafunction:Metafunction.Spec +..remarks.text:Use @Metafunction.Value@ to get the emulated type. +An instance of $Proxy$ behaves like an object of its value type. +$Proxy$ can be used as reference type (see @Metafunction.Reference@). +..remarks.text:Note that functions that are both general and specialized for +the value type should be specialized for $Proxy$ too, +since otherwise the general version will be called. +*/ + +template +struct Proxy; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Spec.param.T.type:Class.Proxy + +template +struct Spec< Proxy > +{ + typedef TSpec Type; +}; +template +struct Spec< Proxy const> +{ + typedef TSpec Type; +}; + +////////////////////////////////////////////////////////////////////////////// +// Iterator Proxy +////////////////////////////////////////////////////////////////////////////// +/** +.Spec.Iterator Proxy: +..cat:Proxies +..general:Class.Proxy +..summary:Proxy that is implemented by an iterator. +..signature:Proxy > +..param.TIterator:Iterator type. +..remarks.text:The value type of an iterator proxy is the value type of the +iterator $TIterator$. +*/ + +template +struct IteratorProxy; + +//____________________________________________________________________________ + +template +struct Proxy > +{ +public: + typedef typename Value::Type TValue; + typedef typename GetValue::Type TAccessor; + + typedef typename _RemoveConst::Type TAccessor_NotConst; + +private: + TIterator data_iterator; + +public: + Proxy(TIterator const _it): + data_iterator(_it) + { +SEQAN_CHECKPOINT + } + Proxy(Proxy const & _other): + data_iterator(_other.data_iterator) + { +SEQAN_CHECKPOINT + } + + ~Proxy() + { +SEQAN_CHECKPOINT + } + + Proxy const & + operator = (Proxy const & _other) + { +SEQAN_CHECKPOINT + assignValue(data_iterator, getValue(_other.data_iterator)); + return *this; + } + + Proxy const & + operator = (TValue const & _value) + { +SEQAN_CHECKPOINT + assignValue(data_iterator, _value); + return *this; + } + + operator TAccessor_NotConst() + { +SEQAN_CHECKPOINT + return getValue(data_iterator); + } + +//____________________________________________________________________________ + + //not documented + friend inline TIterator & + iter(Proxy & me) + { + return me.data_iterator; + } + friend inline TIterator const & + iter(Proxy const & me) + { + return me.data_iterator; + } + +//____________________________________________________________________________ +}; + +////////////////////////////////////////////////////////////////////////////// +// Metafunctions +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Value.param.T.type:Class.Proxy + +template +struct Value< Proxy > >: + Value +{ +}; +template +struct Value< Proxy > const> +{ + typedef typename Value::Type const Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.GetValue.param.T.type:Class.Proxy + +template +struct GetValue< Proxy > >: + GetValue +{ +}; +template +struct GetValue< Proxy > const> +{ + typedef typename GetValue::Type Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Reference.param.T.type:Class.Proxy + +template +struct Reference< Proxy > > +{ + typedef Proxy > Type; +}; +template +struct Reference< Proxy > const > +{ + typedef Proxy > const Type; +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Size.param.T.type:Class.Proxy + +template +struct Size< Proxy > >: + Size +{ +}; +template +struct Size< Proxy > const>: + Size +{ +}; + +////////////////////////////////////////////////////////////////////////////// + +///.Metafunction.Difference.param.T.type:Class.Proxy + +template +struct Difference< Proxy > >: + Difference +{ +}; +template +struct Difference< Proxy > const>: + Difference +{ +}; + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +template +typename GetValue >::Type +getValue(Proxy & me) +{ + return getValue(iter(me)); +} +template +typename GetValue const>::Type +getValue(Proxy const & me) +{ + return getValue(iter(me)); +} + +////////////////////////////////////////////////////////////////////////////// +// Comparison +////////////////////////////////////////////////////////////////////////////// + +template +struct CompareType , T> +{ + typedef typename Value >::Type TValue; + typedef typename _RemoveConst::Type TValue_NoConst; + typedef typename CompareType::Type Type; +}; + +//???TODO: Symmetrie von CompareType herstellen +//____________________________________________________________________________ + +template +inline typename Convert >::Type +convertImpl(Convert const, + Proxy & source) +{ + return convert(getValue(source)); +} +template +inline typename Convert const>::Type +convertImpl(Convert const, + Proxy const & source) +{ + return convert(getValue(source)); +} +////////////////////////////////////////////////////////////////////////////// +// operator == + +template +inline bool +operator == (Proxy const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} + +template +inline bool +operator == (TLeft const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} + +template +inline bool +operator == (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) == convert(right_); +} + +template +inline bool +operator == (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef typename GetValue >::Type TAccessor; + return convert(left_) == convert(right_); +} + +//____________________________________________________________________________ +// operator != + +template +inline bool +operator != (Proxy const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} + +template +inline bool +operator != (TLeft const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} + +template +inline bool +operator != (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) != convert(right_); +} + +template +inline bool +operator != (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef typename GetValue >::Type TAccessor; + return convert(left_) != convert(right_); +} + + +//____________________________________________________________________________ +// operator < + +template +inline bool +operator < (Proxy const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} + +template +inline bool +operator < (TLeft const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} + +template +inline bool +operator < (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) < convert(right_); +} + +template +inline bool +operator < (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef typename GetValue >::Type TAccessor; + return convert(left_) < convert(right_); +} + +//____________________________________________________________________________ +// operator <= + +template +inline bool +operator <= (Proxy const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} + +template +inline bool +operator <= (TLeft const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} + +template +inline bool +operator <= (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) <= convert(right_); +} + +template +inline bool +operator <= (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef typename GetValue >::Type TAccessor; + return convert(left_) <= convert(right_); +} + + +//____________________________________________________________________________ +// operator > + +template +inline bool +operator > (Proxy const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} + +template +inline bool +operator > (TLeft const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} + +template +inline bool +operator > (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) > convert(right_); +} + +template +inline bool +operator > (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef typename GetValue >::Type TAccessor; + return convert(left_) > convert(right_); +} + + +//____________________________________________________________________________ +// operator >= + +template +inline bool +operator >= (Proxy const & left_, + TRight const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} + +template +inline bool +operator >= (TLeft const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} + +template +inline bool +operator >= (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef Proxy TLeft; + typedef Proxy TRight; + typedef typename CompareType::Type TCompareType; + return convert(left_) >= convert(right_); +} + +template +inline bool +operator >= (Proxy const & left_, + Proxy const & right_) +{ +SEQAN_CHECKPOINT + typedef typename GetValue >::Type TAccessor; + return convert(left_) >= convert(right_); +} + +////////////////////////////////////////////////////////////////////////////// + +template +inline TStream & +operator >> (TStream & strm, + Proxy & proxy) +{ + typedef Proxy TProxy; + typedef typename Value::Type TValue; + TValue temp; + strm >> temp; + assignValue(iter(proxy), temp); + return strm; +} +template +inline TStream & +operator >> (TStream & strm, + Proxy const& proxy) +{ + typedef Proxy TProxy; + typedef typename Value::Type TValue; + TValue temp; + strm >> temp; + assignValue(iter(proxy), temp); + return strm; +} + + +template +inline TStream & +operator << (TStream & strm, + Proxy & proxy) +{ + return strm << getValue(proxy); +} +template +inline TStream & +operator << (TStream & strm, + Proxy const & proxy) +{ + return strm << getValue(proxy); +} + + +////////////////////////////////////////////////////////////////////////////// +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_tag.h b/SeqAn-1.1/seqan/basic/basic_tag.h new file mode 100644 index 0000000..3035cba --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_tag.h @@ -0,0 +1,173 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_tag.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_TAG_H +#define SEQAN_HEADER_BASIC_TAG_H + +namespace SEQAN_NAMESPACE_MAIN +{ + + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.DotDrawing +..summary:Switch to trigger drawing in dot format. +..value.DotDrawing:Graphs in dot format. +*/ + +struct DotDrawing_; +typedef Tag const DotDrawing; + + +/** +.Tag.HammingDistance +..summary:Switch to trigger Hamming distance, which is a measure of character substitutions. +*/ + +/** +.Tag.LevenshteinDistance +..summary:Switch to trigger Levenshtein distance, which is a measure of edit operations (character substitutions, deletions or insertions). +*/ + +struct _HammingDistance; +struct _LevenshteinDistance; + +typedef Tag<_HammingDistance> HammingDistance; +typedef Tag<_LevenshteinDistance> LevenshteinDistance; +typedef Tag<_LevenshteinDistance> EditDistance; + + +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// +// Alignment: Tags +////////////////////////////////////////////////////////////////////////////// +//Sollte eigentlich nach align/, aber da jetzt ja so viele +//alignment algorithmen in graph/ gelandet sind... + +/** +.Tag.Global Alignment Algorithms: +..summary:Global alignment algorithm used by globalAlignment. +..see:Function.globalAlignment +..see:Tag.Local Alignment Algorithms +*/ + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Global Alignment Algorithms.value.NeedlemanWunsch: + Dynamic programming algorithm for alignments by Needleman and Wunsch. +*/ + +struct NeedlemanWunsch_; +typedef Tag const NeedlemanWunsch; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Global Alignment Algorithms.value.Gotoh: + Gotoh's affine gap cost alignment algorithm. +*/ +struct Gotoh_; +typedef Tag const Gotoh; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Global Alignment Algorithms.value.MyersBitVector: + Myers' bit vector alignment algorithm for edit distance. + Note that this algorithm does not returns the alignment itself, but only computes the score. +*/ +struct MyersBitVector_; +typedef Tag const MyersBitVector; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Global Alignment Algorithms.value.MyersHirschberg: + Myers' bit vector algorithm for edit distance combined with Hirschberg's linear space alignment algorithm. +*/ +struct MyersHirschberg_; +typedef Tag const MyersHirschberg; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Global Alignment Algorithms.value.Hirschberg: + Hirschberg's linear space global alignment algorithm. +*/ +struct Hirschberg_; +typedef Tag const Hirschberg; + +////////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Local Alignment Algorithms: +..summary:Local alignment algorithm used by localAlignment. +..see:Function.localAlignment +*/ + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Local Alignment Algorithms.value.SmithWaterman: + Triggers a Smith Waterman local alignment algorithm. +*/ +struct SmithWaterman_; +typedef Tag const SmithWaterman; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Local Alignment Algorithms.value.SmithWatermanClump: + Local alignment algorithm with "declumping" by Waterman and Eggert. +*/ +struct SmithWatermanClump_; +typedef Tag const SmithWatermanClump; + +////////////////////////////////////////////////////////////////////////////// + +/** +.Tag.Local Alignment Algorithms.value.SmithWatermanIsland: + Local alignment algorithm finding all "islands". +*/ +struct SmithWatermanIsland_; +typedef Tag const SmithWatermanIsland; + +////////////////////////////////////////////////////////////////////////////// + +/*DISABLED +.Tag.RNA Folding Algorithms.value.Nussinov: + Nussinov style RNA folding algorithm +*/ +struct Nussinov_; +typedef Tag const Nussinov; + +////////////////////////////////////////////////////////////////////////////// + + +////////////////////////////////////////////////////////////////////////////// + +}// namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... diff --git a/SeqAn-1.1/seqan/basic/basic_transport.h b/SeqAn-1.1/seqan/basic/basic_transport.h new file mode 100644 index 0000000..4757d87 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_transport.h @@ -0,0 +1,196 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_transport.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_TRANSPORT_H +#define SEQAN_HEADER_BASIC_TRANSPORT_H + +namespace SEQAN_NAMESPACE_MAIN +{ + +////////////////////////////////////////////////////////////////////////////// +//assign +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.assign: +..summary:Assigns one object to another object. +..cat:Content Manipulation +..signature:assign(target, source) +..signature:assign(target, source [, limit] [,resize_tag]) +..param.target: Gets the content of $source$. +..param.source: Is copied to $target$. +..param.limit: The maximal length of $target$ after the operation. (optional) +...remarks:This arguments can be applied if $target$ is a container. +..param.resize_tag: Specifies the strategy that is applied if $target$ has not enough capacity to store the complete content. (optional) +...type:Tag.Overflow Strategy +...default:Specified by @Metafunction.DefaultOverflowImplicit@ of the $target$ type. +...remarks:This arguments can be applied if $target$ is a container. +..remarks:$assign(target, source)$ is semantically equivalent to $target = source$. +*/ + +template +inline void +assign(TTarget & target, + TSource & source) +{ +SEQAN_CHECKPOINT + target = source; +} +template +inline void +assign(TTarget & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + target = source; +} + +////////////////////////////////////////////////////////////////////////////// + +template struct Proxy; + +template +inline void +assign(Proxy & target, + TSource & source) +{ +SEQAN_CHECKPOINT + assignValue(iter(target), source); +} + +template +inline void +assign(Proxy & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + assignValue(iter(target), source); +} + +////////////////////////////////////////////////////////////////////////////// +// move +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.move: +..summary:Hands over content from one container to another container. +..cat:Content Manipulation +..signature:move(target, source) +..param.target:A container $source$ is moved to. +..param.source:A container that is moved to $target$. +..remarks:The function tries to hand over the contents of $source$ to $target$. +If this is possible, $source$ losts its content and will therefore be empty after this operation. +Otherwise, the function behaves like @Function.assign@ and $source$ is copied to $target$. +..see:Function.assign +*/ + +template +inline void +move(TTarget & target, + TSource & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} +template +inline void +move(TTarget const & target, + TSource & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} +template +inline void +move(TTarget & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} +template +inline void +move(TTarget const & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} + + +////////////////////////////////////////////////////////////////////////////// +// set +////////////////////////////////////////////////////////////////////////////// + +/** +.Function.set: +..summary:Assigns one object to another object avoiding to copy contents. +..cat:Content Manipulation +..signature:assign(target, source) +..signature:assign(target, source) +..param.target: Gets the content of $source$. +..param.source: Content source. +..remarks:$set(target, source)$ is semantically equivalent to $target = source$. +If possible, $set$ copies content references instead of the content itself. +*/ + +//TODO: rename set to ... + +template +inline void +set(TTarget & target, + TSource & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} +template +inline void +set(TTarget const & target, + TSource & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} +template +inline void +set(TTarget & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} +template +inline void +set(TTarget const & target, + TSource const & source) +{ +SEQAN_CHECKPOINT + assign(target, source); +} + + +////////////////////////////////////////////////////////////////////////////// + +} //namespace SEQAN_NAMESPACE_MAIN + +#endif //#ifndef SEQAN_HEADER_... + + diff --git a/SeqAn-1.1/seqan/basic/basic_type.h b/SeqAn-1.1/seqan/basic/basic_type.h new file mode 100644 index 0000000..320fa99 --- /dev/null +++ b/SeqAn-1.1/seqan/basic/basic_type.h @@ -0,0 +1,624 @@ + /*========================================================================== + SeqAn - The Library for Sequence Analysis + http://www.seqan.de + ============================================================================ + Copyright (C) 2007 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + ============================================================================ + $Id: basic_type.h,v 1.1 2008/08/25 16:20:01 langmead Exp $ + ==========================================================================*/ + +#ifndef SEQAN_HEADER_BASIC_TYPE_H +#define SEQAN_HEADER_BASIC_TYPE_H + +namespace SEQAN_NAMESPACE_MAIN +{ + + +////////////////////////////////////////////////////////////////////////////// + +/** +.Metafunction.Value: +..summary:Type of the items in the container. +..signature:Value::Type +..param.T:Type for which the value type is determined. +..returns.param.Type:Value type of $T$. +..remarks.text:The value type of a container $T$ is the type of the elements in $T$. + For example, the value type of a sequence of $int$ is $int$. +..example.code:Value >::Type c; //c has type char +*/ + +template +struct Value +{ + typedef T Type; +}; +/* +template +struct Value +{ + typedef T Type; +}; +*/ +//____________________________________________________________________________ + +/** +.Metafunction.GetValue: +..summary:Type for reading values. +..signature:GetValue::Type +..param.T:Type of container that holds a value. +..returns.param.Type:GetValue type of $T$. +..remarks.text:Depending on $T$, the $GetValue$-type can either be $Value::Type &$ or $Value::Type$. +..text:$GetValue$ is the return type of @Function.getValue@ that allows a (read-only) access to objects. +Do not confuse it with @Function.value@ that returns a @Metafunction.Reference.reference@ to the value. +..see:Metafunction.Value +..see:Function.getValue +*/ +template +struct GetValue +{ + typedef typename Value::Type const & Type; +}; +template +struct GetValue: + public GetValue +{ +}; + +//____________________________________________________________________________ + +/** +.Metafunction.Reference: +..summary:Reference type. +..signature:Reference::Type +..param.T:A Type. +..returns.param.Type:Either $T &$ or a proxy object @Class.Proxy@ for $T$. +..see:Metafunction.Value +..see:Metafunction.GetValue +*/ +template +struct Reference +{ + typedef typename Value::Type & Type; +}; +template +struct Reference +{ + typedef typename Value::Type const & Type; +}; + +//____________________________________________________________________________ + + +/** +.Metafunction.Size: +..summary:Type of an object that is suitable to hold size information. +..signature:Size::Type +..param.T:Type for which the size type is determined. +..returns.param.Type:Size type of $T$. +..remarks.text:In most cases this type is $size_t$. +*/ +template +struct Size +{ + typedef size_t Type; +}; +template +struct Size: + Size +{ +}; + +//____________________________________________________________________________ + + +/** +.Metafunction.Difference: +..summary:Type of an object that stores the difference between two iterators. +..signature:Difference::Type +..param.T:Type for which the difference type is determined. +...type:Class.Iter +..returns.param.Type:Difference type of $T$. +..remarks.text:In most cases this type is $ptrdiff_t$. +..see:Metafunction.Size +*/ +template +struct Difference +{ + typedef ptrdiff_t Type; +}; +template +struct Difference: + Difference +{ +}; + +//____________________________________________________________________________ + + +/** +.Metafunction.Position: +..summary:Type of an object that represents a position in a container. +..signature:Position::Type +..param.T:Type for which the position type is determined. +...type:Class.Iter +...type:Class.String +..returns.param.Type:Position type of $T$. +..see:Metafunction.Iterator +*/ +template +struct Position +{ + typedef typename Size::Type Type; +}; +template +struct Position: + Position +{ +}; + +//____________________________________________________________________________ + +/** +.Metafunction.Host: +..summary:Type of the object a given object depends on. +..signature:Host::Type +..param.T:Type for which the host type is determined. +..returns.param.Type:Host type of $T$. +*/ +template +struct Host +{ + typedef T Type; +}; + +//____________________________________________________________________________ + +/** +.Metafunction.Spec: +..summary:The spec of a class. +..signature:Spec::Type +..param.T:Type for which the spec is determined. +..returns.param.Type:Spec of $T$. +..remarks:The spec of a SeqAn type is the class that is used in template subclassing + to specify the specialization. + For example, the spec of $String >$ is $Alloc<>$. +*/ + +// default case +template +struct Spec { + typedef void Type; +}; + + +// one argument case +template