├── .gitignore ├── License.txt ├── README.md ├── benchmark ├── IntervalTree.h ├── Makefile ├── def.h ├── evaluation.cpp ├── evaluation.h ├── lostintranslation.cpp └── lostintranslation.h ├── dataset ├── ecsample-truth.txt └── selfSampleData │ ├── README │ ├── pacbio.spec │ └── reference.fasta ├── include ├── align.hpp ├── bloomfilter.hpp ├── chain.hpp ├── common │ ├── AMGGraph.h │ ├── BitMap.h │ ├── CSC.h │ ├── CSR.h │ ├── Deleter.h │ ├── GTgraph │ │ ├── Makefile │ │ ├── Makefile.var │ │ ├── R-MAT │ │ │ ├── COPYRIGHT │ │ │ ├── Makefile │ │ │ ├── config │ │ │ ├── defs.h │ │ │ ├── drive.c │ │ │ ├── globals.c │ │ │ ├── globals.h │ │ │ ├── graph.c │ │ │ ├── graph.h │ │ │ ├── init.c │ │ │ ├── init.h │ │ │ ├── utils.c │ │ │ └── utils.h │ │ ├── README │ │ ├── SSCA2 │ │ │ ├── COPYRIGHT │ │ │ ├── Makefile │ │ │ ├── config │ │ │ ├── defs.h │ │ │ ├── drive.c │ │ │ ├── globals.c │ │ │ ├── globals.h │ │ │ ├── graph.c │ │ │ ├── graph.h │ │ │ ├── init.c │ │ │ ├── init.h │ │ │ ├── utils.c │ │ │ └── utils.h │ │ ├── gen.pdf │ │ ├── random │ │ │ ├── COPYRIGHT │ │ │ ├── Makefile │ │ │ ├── config │ │ │ ├── defs.h │ │ │ ├── drive.c │ │ │ ├── globals.c │ │ │ ├── globals.h │ │ │ ├── graph.c │ │ │ ├── graph.h │ │ │ ├── init.c │ │ │ ├── init.h │ │ │ ├── utils.c │ │ │ └── utils.h │ │ └── sprng2.0-lite │ │ │ ├── Makefile │ │ │ ├── include │ │ │ ├── interface.h │ │ │ ├── sprng.h │ │ │ └── sprng_f.h │ │ │ ├── lib │ │ │ └── Makefile │ │ │ └── src │ │ │ ├── .insertlib │ │ │ ├── .template.c │ │ │ ├── Makefile │ │ │ ├── checkid.c │ │ │ ├── cmrg │ │ │ ├── Makefile │ │ │ ├── cmrg.c │ │ │ ├── cmrg.data │ │ │ └── cmrg.h │ │ │ ├── communicate.c │ │ │ ├── cputime.c │ │ │ ├── cputime.h │ │ │ ├── drand.c │ │ │ ├── fwrap.h │ │ │ ├── fwrap_.h │ │ │ ├── fwrap_mpi.c │ │ │ ├── interface.h │ │ │ ├── lcg │ │ │ ├── Makefile │ │ │ ├── READMEver2.CHANGES │ │ │ ├── lcg.c │ │ │ ├── lcg.data │ │ │ └── lcg.h │ │ │ ├── lcg64 │ │ │ ├── Makefile │ │ │ ├── lcg64.c │ │ │ ├── lcg64.data │ │ │ └── lcg64.h │ │ │ ├── lfg │ │ │ ├── Makefile │ │ │ ├── lfg.c │ │ │ ├── lfg.data │ │ │ └── lfg.h │ │ │ ├── makeseed.c │ │ │ ├── memory.c │ │ │ ├── memory.h │ │ │ ├── mlfg │ │ │ ├── Makefile │ │ │ ├── int64.h │ │ │ ├── mlfg.c │ │ │ ├── mlfg.data │ │ │ └── mlfg.h │ │ │ ├── multiply.h │ │ │ ├── primelist_32.h │ │ │ ├── primelist_64.h │ │ │ ├── primes_32.c │ │ │ ├── primes_32.h │ │ │ ├── primes_64.c │ │ │ ├── primes_64.h │ │ │ ├── simple.c │ │ │ ├── simple_.h │ │ │ ├── simple_mpi.c │ │ │ ├── sprng.h │ │ │ ├── sprng │ │ │ ├── Makefile │ │ │ ├── READMEver2.CHANGES │ │ │ └── sprng.c │ │ │ ├── sprng_f.h │ │ │ ├── store.c │ │ │ ├── store.h │ │ │ ├── timing.c │ │ │ └── timingf.f │ ├── HeapEntry.h │ ├── IO.h │ ├── MPIType.h │ ├── Triple.h │ ├── bellaio.h │ ├── common.h │ ├── makefile │ ├── overridenew.h │ ├── transpose.h │ └── utility.h ├── cxxopts.hpp ├── kmercount.hpp ├── markov.hpp ├── minimizer.hpp ├── overlap.hpp └── syncmer.hpp ├── kmercode ├── Buffer.c ├── Buffer.h ├── Kmer.cpp ├── Kmer.hpp ├── ParallelFASTQ.h ├── bound.cpp ├── bound.hpp ├── common.h ├── fq_reader.c ├── fq_reader.h ├── hash_funcs.c ├── hash_funcs.h ├── hyperloglog.hpp ├── main.cpp ├── makefile └── usage ├── libbloom ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── README ├── bloom.cpp ├── bloom.h ├── bloom64.cpp ├── bloom64.h ├── murmur2 │ ├── CMakeLists.txt │ ├── MurmurHash2.c │ ├── README │ └── murmurhash2.h └── test.cpp ├── libcuckoo ├── cuckoohash_config.hh ├── cuckoohash_map.hh ├── cuckoohash_util.hh └── libcuckoo_bucket_container.hh ├── loganGPU ├── functions.cuh ├── logan.cuh ├── score.cuh └── seed.cuh ├── makefile-mac ├── makefile-nersc ├── optlist ├── optlist.c └── optlist.h ├── sanitytests ├── reversecomptest.fastq └── reversecomptest.txt ├── script ├── README.md ├── SAMparser.py ├── mafconvert.py ├── morescript │ ├── IntervalTree.h │ ├── README.md │ ├── chainedMarkov.py │ ├── checkOutput.cpp │ ├── checkOutput.py │ ├── daligner_scripts │ │ ├── example-translation-environment.sh │ │ ├── parserLAdump.py │ │ ├── run_daligner.slurm │ │ ├── run_daligner_celegans.slurm │ │ ├── tinytest.dump │ │ ├── translateDalignerOut.sh │ │ ├── valgrind_daligner.slurm │ │ └── zip_tag.py │ ├── evaluation.cpp │ ├── evaluation.h │ ├── exactMarkov.py │ ├── filterby_overlap_length.py │ ├── mafconvert.py │ └── makefile └── run-bella-pipeline.sh ├── seqan └── seqan │ ├── align.h │ ├── align │ ├── align_base.h │ ├── align_cols.h │ ├── align_config.h │ ├── align_interface_wrapper.h │ ├── align_iterator_base.h │ ├── align_metafunctions.h │ ├── align_traceback.h │ ├── alignment_algorithm_tags.h │ ├── alignment_operations.h │ ├── dp_algorithm_impl.h │ ├── dp_align_simd_helper.h │ ├── dp_band.h │ ├── dp_cell.h │ ├── dp_cell_affine.h │ ├── dp_cell_dynamic.h │ ├── dp_cell_linear.h │ ├── dp_context.h │ ├── dp_formula.h │ ├── dp_formula_affine.h │ ├── dp_formula_dynamic.h │ ├── dp_formula_linear.h │ ├── dp_matrix.h │ ├── dp_matrix_navigator.h │ ├── dp_matrix_navigator_score_matrix.h │ ├── dp_matrix_navigator_score_matrix_sparse.h │ ├── dp_matrix_navigator_trace_matrix.h │ ├── dp_matrix_sparse.h │ ├── dp_meta_info.h │ ├── dp_profile.h │ ├── dp_scout.h │ ├── dp_scout_simd.h │ ├── dp_setup.h │ ├── dp_trace_segment.h │ ├── dp_traceback_adaptor.h │ ├── dp_traceback_impl.h │ ├── evaluate_alignment.h │ ├── fragment.h │ ├── gap_anchor.h │ ├── gapped_value_type.h │ ├── gaps_anchor.h │ ├── gaps_array.h │ ├── gaps_base.h │ ├── gaps_iterator_anchor.h │ ├── gaps_iterator_array.h │ ├── gaps_iterator_base.h │ ├── global_alignment_banded.h │ ├── global_alignment_hirschberg_impl.h │ ├── global_alignment_myers_hirschberg_impl.h │ ├── global_alignment_myers_impl.h │ ├── global_alignment_specialized.h │ ├── global_alignment_unbanded.h │ ├── local_alignment_banded.h │ ├── local_alignment_banded_waterman_eggert_impl.h │ ├── local_alignment_enumeration.h │ ├── local_alignment_enumeration_banded.h │ ├── local_alignment_enumeration_unbanded.h │ ├── local_alignment_unbanded.h │ ├── local_alignment_waterman_eggert_impl.h │ └── matrix_base.h │ ├── align_extend.h │ ├── align_extend │ ├── align_extend.h │ ├── align_extend_base.h │ └── dp_scout_xdrop.h │ ├── align_profile.h │ ├── align_profile │ ├── add_to_profile.h │ └── score_profile_seq.h │ ├── align_split.h │ ├── align_split │ ├── align_split_interface.h │ └── dp_scout_split.h │ ├── alignment_free.h │ ├── alignment_free │ ├── af_d2.h │ ├── af_d2star.h │ ├── af_d2z.h │ ├── af_n2.h │ ├── alignment_free_base.h │ ├── alignment_free_comparison.h │ └── kmer_functions.h │ ├── arg_parse.h │ ├── arg_parse │ ├── arg_parse_argument.h │ ├── arg_parse_ctd_support.h │ ├── arg_parse_doc.h │ ├── arg_parse_exceptions.h │ ├── arg_parse_option.h │ ├── arg_parse_parse.h │ ├── arg_parse_type_support.h │ ├── arg_parse_version_check.h │ ├── argument_parser.h │ ├── tool_doc.h │ └── xml_support.h │ ├── bam_io.h │ ├── bam_io │ ├── bam_alignment_record.h │ ├── bam_alignment_record_util.h │ ├── bam_file.h │ ├── bam_header_record.h │ ├── bam_index_bai.h │ ├── bam_io_context.h │ ├── bam_sam_conversion.h │ ├── bam_scanner_cache.h │ ├── bam_tags_dict.h │ ├── cigar.h │ ├── read_bam.h │ ├── read_sam.h │ ├── write_bam.h │ └── write_sam.h │ ├── basic.h │ ├── basic │ ├── aggregate_concept.h │ ├── allocator_chunkpool.h │ ├── allocator_interface.h │ ├── allocator_multipool.h │ ├── allocator_simple.h │ ├── allocator_singlepool.h │ ├── allocator_to_std.h │ ├── alphabet_adapt_builtins.h │ ├── alphabet_bio.h │ ├── alphabet_concept.h │ ├── alphabet_math.h │ ├── alphabet_profile.h │ ├── alphabet_qualities.h │ ├── alphabet_residue.h │ ├── alphabet_residue_funcs.h │ ├── alphabet_residue_tabs.h │ ├── alphabet_simple_type.h │ ├── alphabet_storage.h │ ├── array_construct_destruct.h │ ├── basic_aggregate.h │ ├── basic_allocator.h │ ├── basic_alphabet.h │ ├── basic_concept.h │ ├── basic_container.h │ ├── basic_debug.h │ ├── basic_device.h │ ├── basic_exception.h │ ├── basic_functors.h │ ├── basic_fundamental.h │ ├── basic_iterator.h │ ├── basic_math.h │ ├── basic_metaprogramming.h │ ├── basic_parallelism.h │ ├── basic_proxy.h │ ├── basic_simd_vector.h │ ├── basic_smart_pointer.h │ ├── basic_stream.h │ ├── basic_tangle.h │ ├── basic_type.h │ ├── basic_view.h │ ├── boost_preprocessor_subset.h │ ├── builtin_functions.h │ ├── concept_checking.h │ ├── container_concept.h │ ├── debug_helper.h │ ├── debug_test_system.h │ ├── fundamental_chunking.h │ ├── fundamental_comparison.h │ ├── fundamental_concepts.h │ ├── fundamental_conversion.h │ ├── fundamental_metafunctions.h │ ├── fundamental_tags.h │ ├── fundamental_transport.h │ ├── holder_base.h │ ├── holder_simple.h │ ├── holder_tristate.h │ ├── hosted_type_interface.h │ ├── iterator_adapt_pointer.h │ ├── iterator_adapt_std.h │ ├── iterator_adaptor.h │ ├── iterator_base.h │ ├── iterator_concept.h │ ├── iterator_counting.h │ ├── iterator_interface.h │ ├── iterator_position.h │ ├── iterator_range.h │ ├── iterator_zip.h │ ├── macro_deprecated.h │ ├── math_functions.h │ ├── math_log_space_value.h │ ├── metaprogramming_control.h │ ├── metaprogramming_enable_if.h │ ├── metaprogramming_logic.h │ ├── metaprogramming_math.h │ ├── metaprogramming_type.h │ ├── metaprogramming_type_algebra.h │ ├── pair_base.h │ ├── pair_bit_compressed.h │ ├── pair_packed.h │ ├── profiling.h │ ├── property_map_concept.h │ ├── proxy_base.h │ ├── proxy_iterator.h │ ├── test_system.h │ ├── triple_base.h │ ├── triple_packed.h │ ├── tuple_base.h │ ├── tuple_bit_compressed.h │ └── volatile_ptr.h │ ├── bed_io.h │ ├── bed_io │ ├── bed_file.h │ ├── bed_record.h │ ├── read_bed.h │ └── write_bed.h │ ├── blast.h │ ├── blast │ ├── blast_base.h │ ├── blast_io_context.h │ ├── blast_record.h │ ├── blast_report_out.h │ ├── blast_statistics.h │ ├── blast_tabular.h │ ├── blast_tabular_in.h │ ├── blast_tabular_lowlevel.h │ └── blast_tabular_out.h │ ├── consensus.h │ ├── consensus │ ├── consensus_aligner.h │ ├── consensus_aligner_interface.h │ ├── consensus_alignment_options.h │ ├── consensus_base.h │ ├── consensus_builder.h │ ├── consensus_library.h │ ├── consensus_realign.h │ ├── consensus_score.h │ ├── overlap_info_computation.h │ └── overlapper.h │ ├── file.h │ ├── file │ ├── file_base.h │ ├── file_cstyle.h │ ├── file_forwards.h │ ├── file_interface.h │ ├── file_mapping.h │ ├── file_page.h │ ├── string_external.h │ └── string_mmap.h │ ├── find.h │ ├── find │ ├── find_abndm.h │ ├── find_ahocorasick.h │ ├── find_base.h │ ├── find_begin.h │ ├── find_bndm.h │ ├── find_bom.h │ ├── find_hamming_simple.h │ ├── find_horspool.h │ ├── find_lambda.h │ ├── find_multi.h │ ├── find_multiple_bfam.h │ ├── find_multiple_shiftand.h │ ├── find_myers_ukkonen.h │ ├── find_pattern_base.h │ ├── find_pex.h │ ├── find_score.h │ ├── find_set_horspool.h │ ├── find_shiftand.h │ ├── find_shiftor.h │ ├── find_simple.h │ ├── find_wild_shiftand.h │ └── find_wumanber.h │ ├── gff_io.h │ ├── gff_io │ ├── gff_file.h │ └── gff_io_base.h │ ├── graph_algorithms.h │ ├── graph_algorithms │ ├── all_pairs_shortest_path.h │ ├── bellman_ford.h │ ├── bipartite_matching.h │ ├── breadth_first_search.h │ ├── connected_components.h │ ├── depth_first_search.h │ ├── dijkstra.h │ ├── floyd_warshall.h │ ├── ford_fulkerson.h │ ├── graph_algorithm_heap_tree.h │ ├── graph_algorithm_hmm.h │ ├── graph_algorithm_lis_his.h │ ├── kruskal.h │ ├── path_growing.h │ ├── prim.h │ ├── single_source_shortest_path.h │ ├── strongly_connected_compnents.h │ ├── topological_sort.h │ ├── transitive_closure.h │ ├── weakly_connected_components.h │ └── weighted_bipartite_matching.h │ ├── graph_align.h │ ├── graph_align │ ├── graph_algorithm_refine_align.h │ ├── graph_algorithm_refine_aligngraph.h │ ├── graph_algorithm_refine_annotation.h │ ├── graph_algorithm_refine_exact.h │ ├── graph_algorithm_refine_exact_iterative.h │ ├── graph_algorithm_refine_fragment.h │ ├── graph_algorithm_refine_inexact.h │ ├── graph_algorithm_refine_scoring.h │ ├── graph_impl_align.h │ └── graph_impl_align_adapt.h │ ├── graph_msa.h │ ├── graph_msa │ ├── graph_align_tcoffee_base.h │ ├── graph_align_tcoffee_distance.h │ ├── graph_align_tcoffee_guidetree.h │ ├── graph_align_tcoffee_io.h │ ├── graph_align_tcoffee_kmer.h │ ├── graph_align_tcoffee_library.h │ ├── graph_align_tcoffee_msa.h │ ├── graph_align_tcoffee_progressive.h │ └── graph_align_tcoffee_refinement.h │ ├── graph_types.h │ ├── graph_types │ ├── graph_base.h │ ├── graph_drawing.h │ ├── graph_edgestump.h │ ├── graph_idmanager.h │ ├── graph_impl_automaton.h │ ├── graph_impl_directed.h │ ├── graph_impl_hmm.h │ ├── graph_impl_oracle.h │ ├── graph_impl_tree.h │ ├── graph_impl_trie.h │ ├── graph_impl_undirected.h │ ├── graph_impl_wordgraph.h │ ├── graph_interface.h │ ├── graph_iterator.h │ ├── graph_iterator_adjacency.h │ ├── graph_iterator_bfs.h │ ├── graph_iterator_dfs.h │ ├── graph_iterator_edge.h │ ├── graph_iterator_outedge.h │ ├── graph_iterator_vertex.h │ ├── graph_utility_parsing.h │ ├── property_map_generic.h │ ├── property_map_internal.h │ └── property_map_internal_pointer.h │ ├── index.h │ ├── index │ ├── find2_backtracking.h │ ├── find2_base.h │ ├── find2_functors.h │ ├── find2_index.h │ ├── find2_index_multi.h │ ├── find2_vstree_factory.h │ ├── find_backtracking.h │ ├── find_index.h │ ├── find_index_approx.h │ ├── find_index_binary.h │ ├── find_index_esa.h │ ├── find_index_lambda.h │ ├── find_index_qgram.h │ ├── find_pigeonhole.h │ ├── find_quasar.h │ ├── find_swift.h │ ├── index_base.h │ ├── index_bidirectional.h │ ├── index_bidirectional_stree.h │ ├── index_bifm.h │ ├── index_bifm_stree.h │ ├── index_bwt.h │ ├── index_childtab.h │ ├── index_device.h │ ├── index_dfi.h │ ├── index_esa_algs.h │ ├── index_esa_algs_multi.h │ ├── index_esa_base.h │ ├── index_esa_drawing.h │ ├── index_esa_stree.h │ ├── index_fm.h │ ├── index_fm_compressed_sa.h │ ├── index_fm_compressed_sa_iterator.h │ ├── index_fm_dox.h │ ├── index_fm_lf_table.h │ ├── index_fm_rank_dictionary_base.h │ ├── index_fm_rank_dictionary_levels.h │ ├── index_fm_rank_dictionary_naive.h │ ├── index_fm_rank_dictionary_wt.h │ ├── index_fm_right_array_binary_tree.h │ ├── index_fm_right_array_binary_tree_iterator.h │ ├── index_fm_sparse_string.h │ ├── index_fm_stree.h │ ├── index_forwards.h │ ├── index_lcp.h │ ├── index_lcp_tree.h │ ├── index_pizzachili.h │ ├── index_pizzachili_find.h │ ├── index_pizzachili_string.h │ ├── index_qgram.h │ ├── index_qgram_bucketrefinement.h │ ├── index_qgram_openaddressing.h │ ├── index_qgram_stree.h │ ├── index_sa_btree.h │ ├── index_sa_bwtwalk.h │ ├── index_sa_lss.h │ ├── index_sa_mm.h │ ├── index_sa_qsort.h │ ├── index_sa_stree.h │ ├── index_sa_truncated.h │ ├── index_shawarma.h │ ├── index_shims.h │ ├── index_skew3.h │ ├── index_skew7.h │ ├── index_skew7_multi.h │ ├── index_view.h │ ├── index_wotd.h │ ├── pipe_merger3.h │ ├── pipe_merger7.h │ ├── pizzachili_api.h │ ├── pump_extender3.h │ ├── pump_extender7.h │ ├── pump_lcp_core.h │ ├── pump_separator7.h │ ├── radix.h │ ├── repeat_base.h │ ├── shape_base.h │ ├── shape_gapped.h │ ├── shape_minimizer.h │ ├── shape_onegapped.h │ ├── shape_predefined.h │ └── shape_threshold.h │ ├── journaled_set.h │ ├── journaled_set │ ├── journal_alignment_interface.h │ ├── journal_alignment_traceback_adaptor.h │ ├── journaled_set_base.h │ ├── journaled_set_impl.h │ ├── journaled_set_join.h │ ├── journaled_set_join_config.h │ ├── journaled_set_join_global_align_compact.h │ ├── journaled_set_join_global_align_manhatten.h │ ├── journaled_set_journal_trace_descriptor.h │ └── score_biaffine.h │ ├── journaled_string_tree.h │ ├── journaled_string_tree │ ├── delta_map.h │ ├── delta_map_entry.h │ ├── delta_map_iterator.h │ ├── delta_store.h │ ├── journaled_string_tree_base.h │ ├── journaled_string_tree_impl.h │ ├── journaled_string_tree_sequence_buffer.h │ ├── journaled_string_tree_traverser.h │ ├── journaled_string_tree_traverser_node.h │ ├── journaled_string_tree_traverser_util.h │ ├── jst_extension_base.h │ ├── jst_extension_horspool.h │ ├── jst_extension_myers_ukkonen.h │ ├── jst_extension_shiftand.h │ ├── jst_extension_shiftor.h │ ├── observable.h │ └── stack_observer.h │ ├── map.h │ ├── map │ ├── map_adapter_stl.h │ ├── map_base.h │ ├── map_chooser.h │ ├── map_skiplist.h │ ├── map_vector.h │ ├── sumlist.h │ ├── sumlist_mini.h │ └── sumlist_skip.h │ ├── math.h │ ├── math │ ├── math_common_factor.h │ ├── math_operators.h │ └── math_rational.h │ ├── misc │ ├── accumulators.h │ ├── base.h │ ├── bit_twiddling.h │ ├── bit_twiddling_functors.h │ ├── dequeue.h │ ├── edit_environment.h │ ├── interval_tree.h │ ├── map.h │ ├── memset.h │ ├── name_store_cache.h │ ├── priority_type_base.h │ ├── priority_type_heap.h │ ├── set.h │ ├── svg.h │ ├── terminal.h │ └── union_find.h │ ├── modifier.h │ ├── modifier │ ├── cyclic_shape.h │ ├── modifier_alphabet.h │ ├── modifier_alphabet_expansion.h │ ├── modifier_cyclic_shape.h │ ├── modifier_functors.h │ ├── modifier_iterator.h │ ├── modifier_padding.h │ ├── modifier_position.h │ ├── modifier_reverse.h │ ├── modifier_shortcuts.h │ ├── modifier_string.h │ └── modifier_view.h │ ├── parallel.h │ ├── parallel │ ├── parallel_algorithms.h │ ├── parallel_atomic_misc.h │ ├── parallel_atomic_primitives.h │ ├── parallel_lock.h │ ├── parallel_macros.h │ ├── parallel_queue.h │ ├── parallel_queue_suspendable.h │ ├── parallel_resource_pool.h │ ├── parallel_sequence.h │ ├── parallel_serializer.h │ ├── parallel_splitting.h │ └── parallel_tags.h │ ├── parse_lm.h │ ├── parse_lm │ ├── local_match_store.h │ ├── parse_blastn_tabular.h │ ├── parse_lastz_general.h │ └── parse_stellar_gff.h │ ├── pipe.h │ ├── pipe │ ├── pipe_base.h │ ├── pipe_caster.h │ ├── pipe_counter.h │ ├── pipe_echoer.h │ ├── pipe_edit_environment.h │ ├── pipe_filter.h │ ├── pipe_iterator.h │ ├── pipe_joiner.h │ ├── pipe_namer.h │ ├── pipe_sampler.h │ ├── pipe_shifter.h │ ├── pipe_source.h │ ├── pipe_tupler.h │ ├── pool_base.h │ ├── pool_mapper.h │ └── pool_sorter.h │ ├── platform.h │ ├── random.h │ ├── random │ ├── random_base.h │ ├── random_beta.h │ └── random_util.h │ ├── realign.h │ ├── realign │ ├── realign_base.h │ └── realign_helper_functions.h │ ├── reduced_aminoacid.h │ ├── reduced_aminoacid │ ├── reduced_aminoacid_base.h │ ├── reduced_aminoacid_base_late.h │ ├── reduced_aminoacid_cluster_red_base.h │ ├── reduced_aminoacid_cluster_red_tables_20_to_n_b62.h │ ├── reduced_aminoacid_cluster_red_tables_22_to_n_b62.h │ ├── reduced_aminoacid_cluster_red_tables_24_to_n_b62.h │ ├── reduced_aminoacid_murphy10_base.h │ └── reduced_aminoacid_murphy10_tables.h │ ├── rna_io.h │ ├── rna_io │ ├── bpseq_read_write.h │ ├── connect_read_write.h │ ├── dot_bracket_read_write.h │ ├── ebpseq_read_write.h │ ├── rna_header.h │ ├── rna_io_context.h │ ├── rna_record.h │ ├── rna_struct_file.h │ ├── stockholm_read_write.h │ └── vienna_read_write.h │ ├── roi_io.h │ ├── roi_io │ ├── read_roi.h │ ├── roi_file.h │ ├── roi_io_context.h │ ├── roi_record.h │ └── write_roi.h │ ├── score.h │ ├── score │ ├── score_base.h │ ├── score_edit.h │ ├── score_matrix.h │ ├── score_matrix_data.h │ ├── score_matrix_dyn.h │ ├── score_matrix_io.h │ ├── score_simd_wrapper.h │ └── score_simple.h │ ├── seeds.h │ ├── seeds │ ├── banded_chain_alignment.h │ ├── banded_chain_alignment_impl.h │ ├── banded_chain_alignment_profile.h │ ├── banded_chain_alignment_scout.h │ ├── banded_chain_alignment_traceback.h │ ├── basic_iter_indirect.h │ ├── my_seed.cpp │ ├── seeds_base.h │ ├── seeds_combination.h │ ├── seeds_extension.h │ ├── seeds_global_chaining.h │ ├── seeds_global_chaining_base.h │ ├── seeds_global_chaining_gusfield.h │ ├── seeds_seed_base.h │ ├── seeds_seed_chained.h │ ├── seeds_seed_diagonal.h │ ├── seeds_seed_set_base.h │ ├── seeds_seed_set_non_scored.h │ ├── seeds_seed_set_scored.h │ ├── seeds_seed_set_unordered.h │ └── seeds_seed_simple.h │ ├── seq_io.h │ ├── seq_io │ ├── bam_sam.h │ ├── fai_index.h │ ├── fasta_fastq.h │ ├── genomic_region.h │ ├── read_embl.h │ ├── read_genbank.h │ └── sequence_file.h │ ├── sequence.h │ ├── sequence │ ├── adapt_array_pointer.h │ ├── adapt_stl_container.h │ ├── container_view.h │ ├── container_view_zip.h │ ├── iter_concat_virtual.h │ ├── segment_base.h │ ├── segment_infix.h │ ├── segment_prefix.h │ ├── segment_suffix.h │ ├── segment_utils.h │ ├── sequence_concatenator.h │ ├── sequence_forwards.h │ ├── sequence_interface.h │ ├── sequence_lexical.h │ ├── sequence_shortcuts.h │ ├── string_alloc.h │ ├── string_array.h │ ├── string_base.h │ ├── string_block.h │ ├── string_cstyle.h │ ├── string_packed.h │ ├── string_packed_old.h │ ├── string_set_base.h │ ├── string_set_concat_direct.h │ ├── string_set_dependent_generous.h │ ├── string_set_dependent_tight.h │ ├── string_set_owner.h │ ├── string_set_segment.h │ └── string_set_view.h │ ├── sequence_journaled.h │ ├── sequence_journaled │ ├── journal_entries_sorted_array.h │ ├── journal_entry.h │ ├── sequence_journaled.h │ ├── sequence_journaled_iterator.h │ └── sequence_journaled_iterator_fast.h │ ├── simple_intervals_io.h │ ├── simple_intervals_io │ ├── simple_intervals_file.h │ └── simple_intervals_io.h │ ├── statistics.h │ ├── statistics │ ├── statistics_base.h │ └── statistics_markov_model.h │ ├── store.h │ ├── store │ ├── store_align.h │ ├── store_align_intervals.h │ ├── store_all.h │ ├── store_annotation.h │ ├── store_base.h │ ├── store_contig.h │ ├── store_intervaltree.h │ ├── store_io.h │ ├── store_io_gff.h │ ├── store_io_sam.h │ ├── store_io_ucsc.h │ ├── store_library.h │ ├── store_matepair.h │ └── store_read.h │ ├── stream.h │ ├── stream │ ├── adapt_ios.h │ ├── buffered_stream.h │ ├── file_stream.h │ ├── formatted_file.h │ ├── guess_format.h │ ├── iostream_bgzf.h │ ├── iostream_bzip2.h │ ├── iostream_bzip2_impl.h │ ├── iostream_zip.h │ ├── iostream_zip_impl.h │ ├── iostream_zutil.h │ ├── iter_stream.h │ ├── lexical_cast.h │ ├── stream_base.h │ ├── stream_compressor.h │ ├── tokenization.h │ └── virtual_stream.h │ ├── system.h │ ├── system │ ├── file_async.h │ ├── file_directory.h │ ├── file_forwards.h │ ├── file_sync.h │ ├── system_base.h │ ├── system_event_win.h │ └── system_forwards.h │ ├── tabix_io.h │ ├── tabix_io │ └── tabix_index_tbi.h │ ├── translation.h │ ├── translation │ ├── translation.h │ └── translation_tables.h │ ├── ucsc_io.h │ ├── ucsc_io │ ├── ucsc_file.h │ ├── ucsc_io.h │ └── ucsc_record.h │ ├── vcf_io.h │ ├── vcf_io │ ├── read_vcf.h │ ├── vcf_file.h │ ├── vcf_header.h │ ├── vcf_header_record.h │ ├── vcf_io_context.h │ ├── vcf_record.h │ └── write_vcf.h │ └── version.h ├── src ├── CSC.cpp ├── CSR.cpp ├── main.cpp ├── main.cu └── mkl_free_main.cpp └── xavier ├── README.md ├── demo.cpp ├── makefile ├── score.h ├── simdutils.h ├── tester.py ├── utils.h └── xavier.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.project 3 | *.cproject 4 | *.o 5 | *.out 6 | *.fastq 7 | selfSampleData.tar.gz 8 | bench 9 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | *** License Agreement *** 2 | 3 | Berkeley Efficient Long-Read to Long-Read Aligner and Overlapper (BELLA), Copyright (c) 2018, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) Giulia Guidi and Marco Santambrogio. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 9 | (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | 11 | (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, U.S. Dept. of Energy, Giulia Guidi, Marco Santambrogio, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | 15 | You are under no obligation whatsoever to provide any bug fixes, patches, or upgrades to the features, functionality or performance of the source code ("Enhancements") to anyone; however, if you choose to make your Enhancements available either publicly, or directly to Lawrence Berkeley National Laboratory, without imposing a separate written license agreement for such Enhancements, then you hereby grant the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form. -------------------------------------------------------------------------------- /benchmark/Makefile: -------------------------------------------------------------------------------- 1 | COMPILER = g++ 2 | CC = gcc 3 | CFLAGS = -I. -O3 -Wall -Wextra -pedantic -ansi -c 4 | OMPFLAG = -fopenmp -fpermissive 5 | 6 | optlist.o: ../optlist/optlist.c ../optlist/optlist.h 7 | $(CC) $(CFLAGS) $< 8 | 9 | # flags defined in mtspgemm2017/GTgraph/Makefile.var 10 | result: evaluation.cpp optlist.o evaluation.h 11 | $(COMPILER) -O3 -Wall -fopenmp -o result optlist.o evaluation.cpp 12 | 13 | # flags defined in mtspgemm2017/GTgraph/Makefile.var 14 | paf: lostintranslation.cpp optlist.o 15 | $(COMPILER) $(OMPFLAG) -o paf optlist.o lostintranslation.cpp 16 | 17 | clean: 18 | rm -f *.o 19 | rm -f paf 20 | rm -f result 21 | -------------------------------------------------------------------------------- /benchmark/def.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEF_H_ 2 | #define _DEF_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | struct entry { 26 | std::string a; 27 | std::string b; 28 | int overlap; 29 | }; 30 | 31 | struct overlap { 32 | std::string read; 33 | std::string ref; 34 | int start, end; 35 | }; 36 | 37 | bool operator< (const entry& lhs, const entry& rhs) 38 | { return (lhs.a < rhs.a) || ((!(rhs.a < lhs.a)) && (lhs.b < rhs.b)); } 39 | 40 | struct classcom { 41 | bool operator() (const entry& lhs, const entry& rhs) const 42 | { return (lhs.a < rhs.a) || ((!(rhs.a < lhs.a)) && (lhs.b < rhs.b)); } 43 | }; 44 | 45 | std::vector split (const std::string &s, char delim) 46 | { 47 | std::vector result; 48 | std::stringstream ss (s); 49 | std::string item; 50 | 51 | while (std::getline (ss, item, delim)) 52 | { 53 | result.push_back (item); 54 | } 55 | 56 | return result; 57 | } 58 | 59 | #endif -------------------------------------------------------------------------------- /dataset/selfSampleData/pacbio.spec: -------------------------------------------------------------------------------- 1 | # limit to 32GB. By default the pipeline will auto-detect memory and try to use maximum. This allow limiting it 2 | ovlMemory = 32 3 | ovlStoreMemory= 32000 4 | merylMemory = 32000 5 | -------------------------------------------------------------------------------- /include/common/CSR.h: -------------------------------------------------------------------------------- 1 | #ifndef _CSR_H_ 2 | #define _CSR_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "Deleter.h" 10 | #include "CSC.h" 11 | #include "Triple.h" 12 | 13 | using namespace std; 14 | 15 | template 16 | class CSR 17 | { 18 | public: 19 | CSR():nnz(0), rows(0), cols(0),zerobased(true) {} 20 | CSR(IT mynnz, IT m, IT n):nnz(mynnz),rows(m),cols(n),zerobased(true) 21 | { 22 | // Constructing empty Csc objects (size = 0) are allowed (why wouldn't they?). 23 | assert(rows != 0); 24 | 25 | rowptr = new IT[rows+1]; 26 | if(nnz > 0) 27 | { 28 | colids = new IT[nnz]; 29 | values = new NT[nnz]; 30 | } 31 | } 32 | CSR (const CSC & csc); // CSC -> CSR conversion 33 | CSR (const CSR & rhs); // copy constructor 34 | CSR & operator=(const CSR & rhs); // assignment operator 35 | 36 | ~CSR() 37 | { 38 | if( nnz > 0 ) 39 | DeleteAll(colids, values); 40 | if( rows > 0 ) 41 | delete [] rowptr; 42 | } 43 | bool ConvertOneBased() 44 | { 45 | if(!zerobased) // already one-based 46 | return false; 47 | transform(rowptr, rowptr + rows + 1, rowptr, bind2nd(plus(), static_cast(1))); 48 | transform(colids, colids + nnz, colids, bind2nd(plus(), static_cast(1))); 49 | zerobased = false; 50 | return true; 51 | } 52 | bool isEmpty() 53 | { 54 | return ( nnz == 0 ); 55 | } 56 | void Sorted(); 57 | 58 | IT rows; 59 | IT cols; 60 | IT nnz; // number of nonzeros 61 | 62 | IT * rowptr; 63 | IT * colids; 64 | NT * values; 65 | bool zerobased; 66 | }; 67 | 68 | #include "../../src/CSR.cpp" 69 | #endif 70 | -------------------------------------------------------------------------------- /include/common/Deleter.h: -------------------------------------------------------------------------------- 1 | #ifndef _DELETER_H_ 2 | #define _DELETER_H_ 3 | 4 | #include 5 | using namespace std; 6 | 7 | template 8 | void DeleteAll(A arr1) 9 | { 10 | delete [] arr1; 11 | } 12 | 13 | template 14 | void DeleteAll(A arr1, B arr2) 15 | { 16 | delete [] arr2; 17 | DeleteAll(arr1); 18 | } 19 | 20 | template 21 | void DeleteAll(A arr1, B arr2, C arr3) 22 | { 23 | delete [] arr3; 24 | DeleteAll(arr1, arr2); 25 | } 26 | 27 | template 28 | void DeleteAll(A arr1, B arr2, C arr3, D arr4) 29 | { 30 | delete [] arr4; 31 | DeleteAll(arr1, arr2, arr3); 32 | } 33 | 34 | 35 | template 36 | void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5) 37 | { 38 | delete [] arr5; 39 | DeleteAll(arr1, arr2, arr3, arr4); 40 | } 41 | 42 | template 43 | void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5, F arr6) 44 | { 45 | delete [] arr6; 46 | DeleteAll(arr1, arr2, arr3, arr4,arr5); 47 | } 48 | 49 | template 50 | void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5, F arr6, G arr7) 51 | { 52 | delete [] arr7; 53 | DeleteAll(arr1, arr2, arr3, arr4,arr5, arr6); 54 | } 55 | 56 | template 57 | void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5, F arr6, G arr7, H arr8) 58 | { 59 | delete [] arr8; 60 | DeleteAll(arr1, arr2, arr3, arr4,arr5,arr6,arr7); 61 | } 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /include/common/GTgraph/Makefile: -------------------------------------------------------------------------------- 1 | include Makefile.var 2 | 3 | all: sprng ssca rand rmat 4 | test-run: sprng ssca rand rmat run 5 | 6 | ssca: 7 | (cd $(SSCADIR); $(MAKE); cd ..) 8 | 9 | rand: 10 | (cd $(RANDDIR); $(MAKE); cd ..) 11 | 12 | rmat: 13 | (cd $(RMATDIR); $(MAKE); cd ..) 14 | 15 | sprng: 16 | (cd $(SPRNGDIR); $(MAKE); cd ..) 17 | 18 | run: 19 | SSCA2/GTgraph-ssca2 20 | mv sample.gr SSCA2.gr 21 | random/GTgraph-rand 22 | mv sample.gr random.gr 23 | R-MAT/GTgraph-rmat 24 | mv sample.gr RMAT.gr 25 | 26 | clean: clean-ssca clean-rand clean-rmat clean-sprng clean-gen 27 | 28 | clean-ssca: 29 | (cd $(SSCADIR); $(MAKE) clean; cd ..) 30 | 31 | clean-rand: 32 | (cd $(RANDDIR); $(MAKE) clean; cd ..) 33 | 34 | clean-rmat: 35 | (cd $(RMATDIR); $(MAKE) clean; cd ..) 36 | 37 | clean-sprng: 38 | (cd $(SPRNGDIR); $(MAKE) clean; cd ..) 39 | 40 | clean-gen: 41 | rm -rf *.dim log 42 | -------------------------------------------------------------------------------- /include/common/GTgraph/Makefile.var: -------------------------------------------------------------------------------- 1 | #################### 2 | # Common variables 3 | #################### 4 | #CC = icc 5 | CC = gcc 6 | #CC = cc 7 | MAKE = make 8 | #MAKE = gmake 9 | 10 | # Compiling in 64-bit by default 11 | OPT = -O2 12 | DEB = -g #-DDEBUG 13 | FLAGS = $(OPT) #-gcc-name=gcc-4.8 14 | LDFLAGS = $(OPT) 15 | 16 | TOP := $(dir $(lastword $(MAKEFILE_LIST))) 17 | 18 | SSCADIR = SSCA2 19 | SPRNGDIR = $(TOP)/sprng2.0-lite 20 | RANDDIR = random 21 | RMATDIR = R-MAT 22 | 23 | LIBS = -L$(SPRNGDIR)/lib -lsprng -lm 24 | INCS = -I$(SPRNGDIR)/include 25 | 26 | 27 | ########################### 28 | # SPRNG-specific variables 29 | ########################### 30 | 31 | F77 = g77 32 | FFLAGS = $(FLAGS) 33 | F77LDFLAGS = $(LDFLAGS) 34 | CFLAGS = $(FLAGS) 35 | CLDFLAGS = $(LDFLAGS) 36 | AR = ar 37 | ARFLAGS = cr 38 | SHELL = /bin/sh 39 | RANLIB = ranlib 40 | CLD = $(CC) 41 | F77LD = $(F77) 42 | FFXN = -DAdd_ 43 | FSUFFIX = F 44 | MPIF77 = $(F77) 45 | MPICC = $(CC) 46 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/COPYRIGHT: -------------------------------------------------------------------------------- 1 | /* 2 | * GTgraph-rmat: "Power law" graph generator based on the 3 | * R-MAT graph model 4 | * Copyright (C) 2006 Kamesh Madduri, David A. Bader 5 | * 6 | * Last Modified: Jan 25, 2006 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU General Public License 10 | * as published by the Free Software Foundation; either version 2 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 21 | * USA. 22 | * 23 | * Authors: David A. Bader 24 | * College of Computing 25 | * Georgia Institute of Technology 26 | * Atlanta, GA 30332 27 | * 28 | * Kamesh Madduri 29 | * College of Computing 30 | * Georgia Institute of Technology 31 | * Atlanta, GA 30332 32 | * 33 | */ 34 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.var 2 | TARGET = GTgraph-rmat 3 | TOCOMPILE = graph.o utils.o init.o globals.o drive.o 4 | 5 | all: ${TOCOMPILE} 6 | ${CC} $(LDFLAGS) -o $(TARGET) ${TOCOMPILE} ${LIBS} 7 | 8 | .c.o: 9 | $(CC) ${FLAGS} ${INCS} -c $*.c 10 | 11 | clean: 12 | rm -f *.o core* *~ sample.gr log $(TARGET) 13 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/config: -------------------------------------------------------------------------------- 1 | n 10000000 2 | m 100000000 3 | a 0.45 4 | b 0.15 5 | c 0.15 6 | d 0.25 7 | 8 | MAX_WEIGHT 100 9 | MIN_WEIGHT 0 10 | SELF_LOOPS 0 11 | 12 | STORE_IN_MEMORY 1 13 | SORT_EDGELISTS 0 14 | # Sorting alg. to use: 0 for counting sort (works only if n is 15 | # less than 2^31 - 1), 1 for heap sort 16 | SORT_TYPE 1 17 | WRITE_TO_FILE 0 18 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/defs.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEFS_H 2 | #define _DEFS_H 3 | 4 | /* Using longs to represent vertex numbers */ 5 | #define LONG_T long int 6 | 7 | /* Edge Weights are also longs */ 8 | #define WEIGHT_T long int 9 | 10 | typedef struct 11 | { 12 | /* No. of edges, represented by m */ 13 | LONG_T m; 14 | 15 | /* No. of vertices, represented by n */ 16 | LONG_T n; 17 | 18 | /* Arrays of size 'm' storing the edge information 19 | * A directed edge 'e' (0 <= e < m) from start[e] to end[e] 20 | * had an integer weight w[e] */ 21 | LONG_T* start; 22 | LONG_T* end; 23 | WEIGHT_T* w; 24 | 25 | } graph; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/drive.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "graph.h" 4 | #include "init.h" 5 | 6 | int main(int argc, char** argv) 7 | { 8 | 9 | /* data structure for representing the generated edge sets 10 | * see defs.h */ 11 | graph G; 12 | 13 | /* init.c */ 14 | parseUserInput(argc, argv); 15 | 16 | /* graph.c */ 17 | graphGen(&G); 18 | 19 | /* utils.c */ 20 | writeToFile(&G); 21 | 22 | /* Free memory */ 23 | if (STORE_IN_MEMORY) { 24 | free(G.start); 25 | free(G.end); 26 | free(G.w); 27 | } 28 | 29 | return(0); 30 | } 31 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/globals.c: -------------------------------------------------------------------------------- 1 | #include "globals.h" 2 | 3 | /* Global variables */ 4 | 5 | LONG_T n; 6 | LONG_T m; 7 | 8 | double a; 9 | double b; 10 | double c; 11 | double d; 12 | 13 | WEIGHT_T MAX_WEIGHT; 14 | WEIGHT_T MIN_WEIGHT; 15 | 16 | int SELF_LOOPS; 17 | 18 | int STORE_IN_MEMORY; 19 | 20 | int SORT_EDGELISTS; 21 | int SORT_TYPE; 22 | int WRITE_TO_FILE; 23 | 24 | char OUTFILE[30]; 25 | char LOGFILE[30]; 26 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/globals.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOBALS_H 2 | #define _GLOBALS_H 3 | 4 | #include 5 | #include "defs.h" 6 | 7 | /* Global Variables */ 8 | 9 | /* Total number of vertices */ 10 | extern LONG_T n; 11 | 12 | /* m, the no. of edges in graph model 0 */ 13 | extern LONG_T m; 14 | 15 | /* R-MAT algorithm parameters */ 16 | extern double a; 17 | extern double b; 18 | extern double c; 19 | extern double d; 20 | 21 | /* Max. and min. integer edge weights. Edge weights are 22 | * randomly chosen from [MIN_WEIGHT, MAX_WEIGHT) */ 23 | extern WEIGHT_T MAX_WEIGHT; 24 | extern WEIGHT_T MIN_WEIGHT; 25 | 26 | /* Are self loops allowed? */ 27 | extern int SELF_LOOPS; 28 | 29 | /* Sort edge list by start vertex before writing to file */ 30 | extern int SORT_EDGELISTS; 31 | 32 | /* Sorting alg. to use: 0 for counting sort, 1 for heap sort */ 33 | extern int SORT_TYPE; 34 | 35 | /* Should the graph be written to file? */ 36 | extern int WRITE_TO_FILE; 37 | 38 | /* If this option is selected, memory is allocated to the 39 | graph data structure in addition to / instead of 40 | writing the graph to disk */ 41 | extern int STORE_IN_MEMORY; 42 | 43 | /* Default output file */ 44 | extern char OUTFILE[30]; 45 | 46 | /* Default log file, for printing auxiliary information */ 47 | extern char LOGFILE[30]; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/graph.h: -------------------------------------------------------------------------------- 1 | #ifndef _GRAPH_H 2 | #define _GRAPH_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "sprng.h" 9 | #include "globals.h" 10 | #include "defs.h" 11 | #include "utils.h" 12 | 13 | #define SPRNG_SEED1 12619830 14 | #define SPRNG_SEED2 31219885 15 | #define SPRNG_SEED3 72824922 16 | #define SPRNG_SEED4 81984016 17 | 18 | #define DEBUG 0 19 | 20 | extern int *stream1, *stream2, *stream3, *stream4; 21 | 22 | void graphGen(graph*); 23 | void choosePartition(LONG_T*, LONG_T*, LONG_T); 24 | void varyParams(double*, double*, double*, double*); 25 | #endif 26 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/init.h: -------------------------------------------------------------------------------- 1 | #ifndef _INIT_H 2 | #define _INIT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "defs.h" 9 | #include "utils.h" 10 | #include "globals.h" 11 | #include "string.h" 12 | 13 | void parseUserInput(int, char**); 14 | void usage(void); 15 | 16 | void getParamsFromFile(char*); 17 | void getParams(void); 18 | void setGTgraphParams(int scale, int edgefactor, double a0, double b0, double c0, double d0); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /include/common/GTgraph/R-MAT/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTILS_H 2 | #define _UTILS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "defs.h" 8 | #include "globals.h" 9 | #include "string.h" 10 | 11 | #define mbits(x,k,j) ((x>>k) & ~(~0< 23 | * College of Computing 24 | * Georgia Institute of Technology 25 | * Atlanta, GA 30332 26 | * 27 | * Kamesh Madduri 28 | * College of Computing 29 | * Georgia Institute of Technology 30 | * Atlanta, GA 30332 31 | * 32 | */ 33 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.var 2 | TARGET = GTgraph-ssca2 3 | TOCOMPILE = graph.o utils.o init.o globals.o drive.o 4 | 5 | all: ${TOCOMPILE} 6 | ${CC} $(LDFLAGS) -o $(TARGET) ${TOCOMPILE} ${LIBS} 7 | 8 | .c.o: 9 | $(CC) ${FLAGS} ${INCS} -c $*.c 10 | 11 | clean: 12 | rm -f *.o core* *~ sample.gr log $(TARGET) 13 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/config: -------------------------------------------------------------------------------- 1 | SCALE 21 2 | # By default, TotVertices = 2^SCALE, MaxCliqueSize = floor (2^(SCALE/3.0)) and MaxWeight = 2^SCALE 3 | 4 | # These parameters can also be set separately 5 | # MaxCliqueSize 10 6 | 7 | MaxParallelEdges 3 8 | 9 | ProbIntercliqueEdges 0.5 10 | 11 | ProbUnidirectional 0.2 12 | 13 | MinWeight 0 14 | 15 | # Other parameters 16 | SORT_EDGELISTS 0 17 | 18 | # Sorting alg. to use: 0 for counting sort (works only if TOT_VERTICES is 19 | # less than 2^31 - 1, i.e SCALE <= 31), 1 for heap sort 20 | SORT_TYPE 0 21 | 22 | WRITE_TO_FILE 0 23 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/defs.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEFS_H 2 | #define _DEFS_H 3 | 4 | /* Using longs to represent vertex numbers */ 5 | #define LONG_T long int 6 | 7 | /* Edge Weights are also longs */ 8 | #define WEIGHT_T long int 9 | 10 | typedef struct 11 | { 12 | /* No. of edges, represented by m */ 13 | LONG_T m; 14 | 15 | /* No. of vertices, represented by n */ 16 | LONG_T n; 17 | 18 | /* Arrays of size 'm' storing the edge information 19 | * A directed edge 'e' (0 <= e < m) from start[e] to end[e] 20 | * had an integer weight w[e] */ 21 | LONG_T* start; 22 | LONG_T* end; 23 | WEIGHT_T* w; 24 | 25 | } graph; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/drive.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "graph.h" 4 | #include "init.h" 5 | 6 | int main(int argc, char** argv) 7 | { 8 | 9 | /* data structure for representing the generated edge sets 10 | * see defs.h */ 11 | graph G; 12 | 13 | /* init.c */ 14 | parseUserInput(argc, argv); 15 | 16 | /* graph.c */ 17 | graphGen(&G); 18 | 19 | /* utils.c */ 20 | writeToFile(&G); 21 | 22 | /* Free memory */ 23 | free(G.start); 24 | free(G.end); 25 | free(G.w); 26 | 27 | return(0); 28 | } 29 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/globals.c: -------------------------------------------------------------------------------- 1 | #include "globals.h" 2 | 3 | /* Global variables */ 4 | LONG_T SCALE; 5 | LONG_T TotVertices; 6 | LONG_T MaxCliqueSize; 7 | WEIGHT_T MaxWeight; 8 | WEIGHT_T MinWeight; 9 | LONG_T MaxParallelEdges; 10 | double ProbUnidirectional; 11 | double ProbIntercliqueEdges; 12 | int SORT_EDGELISTS; 13 | int SORT_TYPE; 14 | int WRITE_TO_FILE; 15 | char OUTFILE[30]; 16 | char LOGFILE[30]; 17 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/globals.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOBALS_H 2 | #define _GLOBALS_H 3 | 4 | #include 5 | #include "defs.h" 6 | 7 | /* Global Variables */ 8 | 9 | /* The number of vertices, max. 'clique size', and max. 10 | * integer 'edge weight' are expressed by default in terms of SCALE. 11 | * User-defined values can be specified in a config file */ 12 | extern LONG_T SCALE; 13 | 14 | /* Total number of vertices */ 15 | extern LONG_T TotVertices; 16 | 17 | /* The generated graph is a collection of highly interconnected 18 | * 'cliques' with 'inter-clique' edges added probabilistically 19 | * This parameter sets the maximum number of vertices in a 'clique' */ 20 | extern LONG_T MaxCliqueSize; 21 | 22 | /* Probability that two vertices in a 'clique' are connected by 23 | * a single directed edge, as opposed to edges in both directions. 24 | * If this value is set to 0, the cluster would become a 'clique'. 25 | * Self edges are not generated, and so a 'clique' thus defined 26 | * with n vertices would have n*(n-1) directed edges */ 27 | extern double ProbUnidirectional; 28 | 29 | /* initial probability of connecting two 'cliques' 30 | * inter-clique edges are assigned using a random distribution 31 | * that represents a hierarchical thinning as cliques become further apart 32 | * refer inter-clique edge generation code in graph.c for details */ 33 | extern double ProbIntercliqueEdges; 34 | 35 | /* maximum number of parallel edges between any two vertices in the graph * 36 | * note that we generate a multigraph */ 37 | extern LONG_T MaxParallelEdges; 38 | 39 | /* Max. and min. integer edge weights. Edge weights are 40 | * randomly chosen from [MinWeight, MaxWeight) */ 41 | extern WEIGHT_T MaxWeight; 42 | extern WEIGHT_T MinWeight; 43 | 44 | /* Sort edge list by start vertex? */ 45 | extern int SORT_EDGELISTS; 46 | 47 | /* Sorting alg. to use: 0 for counting sort, 1 for heap sort */ 48 | extern int SORT_TYPE; 49 | 50 | /* Should the graph be written to file? */ 51 | extern int WRITE_TO_FILE; 52 | 53 | /* Default output file */ 54 | extern char OUTFILE[30]; 55 | 56 | /* Default log file, for printing auxiliary information */ 57 | extern char LOGFILE[30]; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/graph.h: -------------------------------------------------------------------------------- 1 | #ifndef _GRAPH_H 2 | #define _GRAPH_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "sprng.h" 9 | #include "globals.h" 10 | #include "defs.h" 11 | #include "utils.h" 12 | 13 | #define SPRNG_SEED 1261983 14 | #define DEBUG 0 15 | 16 | void graphGen(graph*); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/init.h: -------------------------------------------------------------------------------- 1 | #ifndef _INIT_H 2 | #define _INIT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "defs.h" 9 | #include "utils.h" 10 | #include "globals.h" 11 | #include "string.h" 12 | 13 | void parseUserInput(int, char**); 14 | void usage(void); 15 | 16 | void getParamsFromFile(char*); 17 | void getParams(void); 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /include/common/GTgraph/SSCA2/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTILS_H 2 | #define _UTILS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "defs.h" 8 | #include "globals.h" 9 | #include "string.h" 10 | 11 | #define mbits(x,k,j) ((x>>k) & ~(~0< 23 | * College of Computing 24 | * Georgia Institute of Technology 25 | * Atlanta, GA 30332 26 | * 27 | * Kamesh Madduri 28 | * College of Computing 29 | * Georgia Institute of Technology 30 | * Atlanta, GA 30332 31 | * 32 | */ 33 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/Makefile: -------------------------------------------------------------------------------- 1 | include ../Makefile.var 2 | TARGET = GTgraph-random 3 | TOCOMPILE = graph.o utils.o init.o globals.o drive.o 4 | 5 | all: ${TOCOMPILE} 6 | ${CC} $(LDFLAGS) -o $(TARGET) ${TOCOMPILE} ${LIBS} 7 | 8 | .c.o: 9 | $(CC) ${FLAGS} ${INCS} -c $*.c 10 | 11 | clean: 12 | rm -f *.o core* *~ sample.gr log $(TARGET) 13 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/config: -------------------------------------------------------------------------------- 1 | # Random graph model to use: 2 | # G(n, m) -- 1 (add exactly m edges choosing n pairs of vertices randomly) 3 | # G(n, p) -- 0 (Erdos-Renyi graph -- prob. of having an edge between any pair of vertices is p) 4 | GRAPH_MODEL 1 5 | n 10000000 6 | p 0.000001 7 | m 100000000 8 | SELF_LOOPS 0 9 | MAX_WEIGHT 100 10 | MIN_WEIGHT 0 11 | STORE_IN_MEMORY 1 12 | SORT_EDGELISTS 0 13 | # Sorting alg. to use: 0 for counting sort (works only if n is 14 | # less than 2^31 - 1), 1 for heap sort 15 | SORT_TYPE 0 16 | WRITE_TO_FILE 0 17 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/defs.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEFS_H 2 | #define _DEFS_H 3 | 4 | /* Using longs to represent vertex numbers */ 5 | #define LONG_T long int 6 | 7 | /* Edge Weights are also longs */ 8 | #define WEIGHT_T long int 9 | 10 | typedef struct 11 | { 12 | /* No. of edges, represented by m */ 13 | LONG_T m; 14 | 15 | /* No. of vertices, represented by n */ 16 | LONG_T n; 17 | 18 | /* Arrays of size 'm' storing the edge information 19 | * A directed edge 'e' (0 <= e < m) from start[e] to end[e] 20 | * had an integer weight w[e] */ 21 | LONG_T* start; 22 | LONG_T* end; 23 | WEIGHT_T* w; 24 | 25 | } graph; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/drive.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "graph.h" 4 | #include "init.h" 5 | 6 | int main(int argc, char** argv) 7 | { 8 | 9 | /* data structure for representing the generated edge sets 10 | * see defs.h */ 11 | graph G; 12 | 13 | /* init.c */ 14 | parseUserInput(argc, argv); 15 | 16 | /* graph.c */ 17 | graphGen(&G); 18 | 19 | /* utils.c */ 20 | writeToFile(&G); 21 | 22 | /* Free memory */ 23 | if (STORE_IN_MEMORY) { 24 | free(G.start); 25 | free(G.end); 26 | free(G.w); 27 | } 28 | 29 | return(0); 30 | } 31 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/globals.c: -------------------------------------------------------------------------------- 1 | #include "globals.h" 2 | 3 | /* Global variables */ 4 | int GRAPH_MODEL; 5 | 6 | LONG_T n; 7 | double p; 8 | LONG_T m; 9 | 10 | WEIGHT_T MAX_WEIGHT; 11 | WEIGHT_T MIN_WEIGHT; 12 | 13 | int SELF_LOOPS; 14 | 15 | int STORE_IN_MEMORY; 16 | 17 | int SORT_EDGELISTS; 18 | int SORT_TYPE; 19 | int WRITE_TO_FILE; 20 | 21 | char OUTFILE[30]; 22 | char LOGFILE[30]; 23 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/globals.h: -------------------------------------------------------------------------------- 1 | #ifndef _GLOBALS_H 2 | #define _GLOBALS_H 3 | 4 | #include 5 | #include "defs.h" 6 | 7 | /* Global Variables */ 8 | 9 | /* The random graph model to use 10 | * GRAPH_MODEL 0 : G(n, m) -- m edges are added choosing 11 | * n pairs of vertices at random 12 | * GRAPH_MODEL 1 : G(n, p) -- Erdos-Renyi graph */ 13 | extern int GRAPH_MODEL; 14 | 15 | /* Total number of vertices */ 16 | extern LONG_T n; 17 | 18 | /* m, the no. of edges in graph model 0 */ 19 | extern LONG_T m; 20 | 21 | /* Probability of an edge between any two vertices in an 22 | * Erdos-Renyi random graph */ 23 | extern double p; 24 | 25 | /* Max. and min. integer edge weights. Edge weights are 26 | * randomly chosen from [MIN_WEIGHT, MAX_WEIGHT) */ 27 | extern WEIGHT_T MAX_WEIGHT; 28 | extern WEIGHT_T MIN_WEIGHT; 29 | 30 | /* Are self loops allowed? */ 31 | extern int SELF_LOOPS; 32 | 33 | /* Sort edge list by start vertex before writing to file */ 34 | extern int SORT_EDGELISTS; 35 | 36 | /* Sorting alg. to use: 0 for counting sort, 1 for heap sort */ 37 | extern int SORT_TYPE; 38 | 39 | /* Should the graph be written to file? */ 40 | extern int WRITE_TO_FILE; 41 | 42 | /* If this option is selected, memory is allocated to the 43 | graph data structure in addition to / instead of 44 | writing the graph to disk */ 45 | extern int STORE_IN_MEMORY; 46 | 47 | /* Default output file */ 48 | extern char OUTFILE[30]; 49 | 50 | /* Default log file, for printing auxiliary information */ 51 | extern char LOGFILE[30]; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/graph.h: -------------------------------------------------------------------------------- 1 | #ifndef _GRAPH_H 2 | #define _GRAPH_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "sprng.h" 9 | #include "globals.h" 10 | #include "defs.h" 11 | #include "utils.h" 12 | 13 | #define SPRNG_SEED1 1261983 14 | #define SPRNG_SEED2 3121988 15 | #define DEBUG 0 16 | 17 | void graphGen(graph*); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/init.h: -------------------------------------------------------------------------------- 1 | #ifndef _INIT_H 2 | #define _INIT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "defs.h" 9 | #include "utils.h" 10 | #include "globals.h" 11 | #include "string.h" 12 | 13 | void parseUserInput(int, char**); 14 | void usage(void); 15 | 16 | void getParamsFromFile(char*); 17 | void getParams(void); 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /include/common/GTgraph/random/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTILS_H 2 | #define _UTILS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "defs.h" 8 | #include "globals.h" 9 | #include "string.h" 10 | 11 | #define mbits(x,k,j) ((x>>k) & ~(~0< 2 | #include 3 | #include "memory.h" 4 | 5 | #define CHECK_MASK 0x1c /* Assumes exactly last two bits are 0 ... */ 6 | /* ... If not, change checklist dimension */ 7 | typedef struct checkidstruct 8 | { 9 | int *ID; 10 | struct checkidstruct *next; 11 | } Checklisttype; 12 | 13 | Checklisttype checklist[(CHECK_MASK>>2)+1] = {{NULL,NULL},{NULL,NULL},{NULL,NULL},{NULL,NULL}}; 14 | 15 | 16 | #ifdef __STDC__ 17 | int *checkID( int *ptr) 18 | #else 19 | int *checkID(ptr) 20 | int *ptr; 21 | #endif 22 | { 23 | int bucket; 24 | Checklisttype *next; 25 | 26 | if(ptr == NULL) 27 | return NULL; 28 | 29 | bucket = (((long) ptr)&CHECK_MASK)>>2; 30 | next = checklist[bucket].next; 31 | 32 | while(next != NULL) 33 | { 34 | if(next->ID == ptr) 35 | { 36 | return (int *) ptr; 37 | } 38 | else 39 | { 40 | next = next->next; 41 | } 42 | 43 | } 44 | 45 | fprintf(stderr,"ERROR: Invalid generator ID %p\n", ptr); 46 | return NULL; 47 | } 48 | 49 | 50 | 51 | #ifdef __STDC__ 52 | int *deleteID( int *ptr) 53 | #else 54 | int *deleteID(ptr) 55 | int *ptr; 56 | #endif 57 | { 58 | int bucket; 59 | Checklisttype *next, *temp; 60 | 61 | 62 | if(ptr == NULL) 63 | return NULL; 64 | 65 | bucket = (((long) ptr)&CHECK_MASK)>>2; 66 | next = &checklist[bucket]; 67 | 68 | while(next->next != NULL) 69 | if(next->next->ID == ptr) 70 | { 71 | temp = next->next; 72 | next->next = next->next->next; 73 | 74 | free(temp); 75 | return (int *) ptr; 76 | } 77 | else 78 | { 79 | next = next->next; 80 | } 81 | 82 | 83 | fprintf(stderr,"ERROR: Invalid generator ID %p\n", ptr); 84 | return NULL; 85 | } 86 | 87 | 88 | #ifdef __STDC__ 89 | int *addID( int *ptr) 90 | #else 91 | int *addID(ptr) 92 | int *ptr; 93 | #endif 94 | { 95 | int bucket; 96 | Checklisttype *temp; 97 | 98 | if(ptr == NULL) 99 | return NULL; 100 | 101 | 102 | bucket = (((long) ptr)&CHECK_MASK)>>2; 103 | 104 | temp = (Checklisttype *) mymalloc(sizeof(Checklisttype)); 105 | if(temp == NULL) 106 | return NULL; 107 | 108 | temp->ID = (int *) ptr; 109 | temp->next = checklist[bucket].next; 110 | checklist[bucket].next = temp; 111 | 112 | 113 | return (int *) ptr; 114 | } 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/cmrg/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.var 2 | 3 | SRCDIR = .. 4 | 5 | all : cmrg.o 6 | 7 | cmrg.o : $(SRCDIR)/interface.h cmrg.c cmrg.h $(SRCDIR)/memory.h \ 8 | $(SRCDIR)/primes_64.h $(SRCDIR)/multiply.h \ 9 | $(SRCDIR)/store.h $(SRCDIR)/fwrap_.h 10 | $(CC) -c $(CFLAGS) $(FFXN) $(INLINEOPT) cmrg.c -I$(SRCDIR) 11 | 12 | clean : 13 | rm -f *.o *.i 14 | 15 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/cmrg/cmrg.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _cmrg_h 3 | #define _cmrg_h 4 | 5 | #ifndef ANSI_ARGS 6 | #ifdef __STDC__ 7 | #define ANSI_ARGS(args) args 8 | #else 9 | #define ANSI_ARGS(args) () 10 | #endif 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | int cmrg_get_rn_int ANSI_ARGS((int *igenptr)); 18 | float cmrg_get_rn_flt ANSI_ARGS((int *igenptr)); 19 | double cmrg_get_rn_dbl ANSI_ARGS((int *igenptr)); 20 | int *cmrg_init_rng ANSI_ARGS((int rng_type, int gennum, int total_gen, int seed, 21 | int mult)); 22 | int cmrg_spawn_rng ANSI_ARGS((int *igenptr, int nspawned, int ***newgens, int checkid) ); 23 | int cmrg_get_seed_rng ANSI_ARGS((int *genptr)); 24 | int cmrg_free_rng ANSI_ARGS((int *genptr)); 25 | int cmrg_pack_rng ANSI_ARGS(( int *genptr, char **buffer)); 26 | int *cmrg_unpack_rng ANSI_ARGS(( char *packed)); 27 | int cmrg_print_rng ANSI_ARGS(( int *igen)); 28 | 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/communicate.c: -------------------------------------------------------------------------------- 1 | #ifdef SPRNG_MPI 2 | #include 3 | #endif 4 | #include 5 | #include "interface.h" 6 | 7 | 8 | #ifdef __STDC__ 9 | void get_proc_info_mpi(int *myid, int *nprocs) 10 | #else 11 | void get_proc_info_mpi(myid, nprocs) 12 | int *myid, *nprocs; 13 | #endif 14 | { 15 | #ifdef SPRNG_MPI 16 | MPI_Comm_rank(MPI_COMM_WORLD, myid); 17 | MPI_Comm_size(MPI_COMM_WORLD, nprocs); 18 | #else 19 | *myid = 0; 20 | *nprocs = 1; 21 | #endif 22 | } 23 | 24 | 25 | #ifdef __STDC__ 26 | int make_new_seed_mpi(void) 27 | #else 28 | int make_new_seed_mpi() 29 | #endif 30 | { 31 | #ifdef SPRNG_MPI 32 | unsigned int temp2; 33 | int myid, nprocs; 34 | MPI_Comm newcomm; 35 | 36 | MPI_Comm_dup(MPI_COMM_WORLD, &newcomm); /* create a temporary communicator */ 37 | 38 | MPI_Comm_rank(newcomm, &myid); 39 | MPI_Comm_size(newcomm, &nprocs); 40 | 41 | if(myid == 0) 42 | temp2 = make_new_seed(); 43 | 44 | MPI_Bcast(&temp2,1,MPI_UNSIGNED,0,newcomm); 45 | 46 | MPI_Comm_free(&newcomm); 47 | 48 | return temp2; 49 | #else 50 | return make_new_seed(); 51 | #endif 52 | } 53 | 54 | 55 | #if 0 56 | main() 57 | { 58 | printf("%u\n", make_new_seed()); 59 | printf("%u\n", make_new_seed()); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/cputime.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "fwrap.h" 5 | 6 | #ifdef __STDC__ 7 | double cputime(void) 8 | #else 9 | double cputime() 10 | #endif 11 | { 12 | double current_time; 13 | 14 | #ifdef RUSAGE_SELF 15 | struct rusage temp; 16 | 17 | getrusage(RUSAGE_SELF, &temp); 18 | 19 | current_time = (temp.ru_utime.tv_sec + temp.ru_stime.tv_sec + 20 | 1.0e-6*(temp.ru_utime.tv_usec + temp.ru_stime.tv_usec)); 21 | 22 | #elif defined(CLOCKS_PER_SEC) 23 | current_time = clock()/((double) CLOCKS_PER_SEC); 24 | 25 | #else 26 | fprintf(stderr,"\nERROR: Timing routines not available\n\n"); 27 | current_time = 0.0; 28 | #endif 29 | 30 | return (current_time); 31 | } 32 | 33 | 34 | 35 | 36 | 37 | #ifdef __STDC__ 38 | double FNAMEOF_fcpu_t(void) 39 | #else 40 | double FNAMEOF_fcpu_t() 41 | #endif 42 | { 43 | return cputime(); 44 | } 45 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/cputime.h: -------------------------------------------------------------------------------- 1 | #ifdef __STDC__ 2 | double cputime(void); 3 | #else 4 | double cputime(); 5 | #endif 6 | 7 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/drand.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "cputime.h" 4 | 5 | #define TIMING_TRIAL_SIZE 1000000 6 | 7 | main() 8 | { 9 | int i; 10 | double temp1, temp2, rn; 11 | double temp_mult = TIMING_TRIAL_SIZE/1.0e6; 12 | 13 | temp1 = cputime(); 14 | 15 | for(i=0; i %8.4f MRS\n", 32 | temp2-temp1, temp_mult/(temp2-temp1)); 33 | putchar('\n'); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/fwrap_mpi.c: -------------------------------------------------------------------------------- 1 | 2 | #include "fwrap.h" 3 | #include "interface.h" 4 | #include "memory.h" 5 | #include 6 | #include 7 | #include 8 | 9 | /************************************************************************/ 10 | /************************************************************************/ 11 | /* */ 12 | /* This package of C wrappers is intended to be called from a */ 13 | /* FORTRAN program. The main purpose of the package is to mediate */ 14 | /* between the call-by-address and call-by-value conventions in */ 15 | /* the two languages. In most cases, the arguments of the C */ 16 | /* routines and the wrappers are the same. There are two */ 17 | /* exceptions to this. The trivial exception is that the C number */ 18 | /* scheme of 0 thru N-1 is automatically converted to the FORTRAN */ 19 | /* scheme of 1 thru N, so when referring to a particular generator */ 20 | /* the FORTRAN user should number as is natural to that language. */ 21 | /* */ 22 | /* */ 23 | /* The wrappers should be treated as FORTRAN function calls. */ 24 | /* */ 25 | /************************************************************************/ 26 | /************************************************************************/ 27 | 28 | 29 | #ifdef __STDC__ 30 | int FNAMEOF_fseed_mpi(void) 31 | #else 32 | int FNAMEOF_fseed_mpi() 33 | #endif 34 | { 35 | #ifdef SPRNG_MPI 36 | return make_new_seed_mpi(); 37 | #else 38 | return -1; 39 | #endif 40 | } 41 | 42 | #ifdef SPRNG_MPI 43 | 44 | #ifdef __STDC__ 45 | int * FNAMEOF_finit_rng_simmpi(int *rng_type, int *seed, int *mult) 46 | #else 47 | int * FNAMEOF_finit_rng_simmpi(rng_type,seed,mult) 48 | int *rng_type,*mult,*seed; 49 | #endif 50 | { 51 | return init_rng_simple_mpi(*rng_type,*seed, *mult); 52 | } 53 | 54 | #ifdef __STDC__ 55 | int FNAMEOF_fget_rn_int_simmpi(void) 56 | #else 57 | int FNAMEOF_fget_rn_int_simmpi() 58 | #endif 59 | { 60 | return get_rn_int_simple_mpi(); 61 | } 62 | 63 | 64 | #ifdef __STDC__ 65 | float FNAMEOF_fget_rn_flt_simmpi(void) 66 | #else 67 | float FNAMEOF_fget_rn_flt_simmpi() 68 | #endif 69 | { 70 | return get_rn_flt_simple_mpi(); 71 | } 72 | 73 | 74 | 75 | #ifdef __STDC__ 76 | double FNAMEOF_fget_rn_dbl_simmpi(void) 77 | #else 78 | double FNAMEOF_fget_rn_dbl_simmpi() 79 | #endif 80 | { 81 | return get_rn_dbl_simple_mpi(); 82 | } 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/interface.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _interface_h_ 3 | #define _interface_h_ 4 | 5 | #define DEFAULT_RNG_TYPE SPRNG_LFG 6 | 7 | #ifndef ANSI_ARGS 8 | #ifdef __STDC__ 9 | #define ANSI_ARGS(args) args 10 | #else 11 | #define ANSI_ARGS(args) () 12 | #endif 13 | #endif 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | int get_rn_int ANSI_ARGS((int *igenptr)); 20 | float get_rn_flt ANSI_ARGS((int *igenptr)); 21 | double get_rn_dbl ANSI_ARGS((int *igenptr)); 22 | int *init_rng ANSI_ARGS((int rng_type, int gennum, int total_gen, int seed, 23 | int mult)); 24 | int spawn_rng ANSI_ARGS((int *igenptr, int nspawned, int ***newgens, int checkid) ); 25 | int make_new_seed ANSI_ARGS((void)); 26 | int make_new_seed_mpi ANSI_ARGS((void)); 27 | int get_seed_rng ANSI_ARGS((int *genptr)); 28 | int free_rng ANSI_ARGS((int *genptr)); 29 | int pack_rng ANSI_ARGS(( int *genptr, char **buffer)); 30 | int *unpack_rng ANSI_ARGS(( char *packed)); 31 | int print_rng ANSI_ARGS(( int *igen)); 32 | int *checkID ANSI_ARGS(( int *igen)); 33 | int *addID ANSI_ARGS(( int *igen)); 34 | int *deleteID ANSI_ARGS(( int *igen)); 35 | 36 | 37 | int *init_rng_simple ANSI_ARGS((int rng_type, int seed, int mult)); 38 | int *init_rng_simple_mpi ANSI_ARGS((int rng_type, int seed, int mult)); 39 | int get_rn_int_simple ANSI_ARGS((void)); 40 | int get_rn_int_simple_mpi ANSI_ARGS((void)); 41 | float get_rn_flt_simple ANSI_ARGS((void)); 42 | float get_rn_flt_simple_mpi ANSI_ARGS((void)); 43 | double get_rn_dbl_simple ANSI_ARGS((void)); 44 | double get_rn_dbl_simple_mpi ANSI_ARGS((void)); 45 | int pack_rng_simple ANSI_ARGS((char **buffer)); 46 | int *unpack_rng_simple ANSI_ARGS(( char *packed)); 47 | int print_rng_simple ANSI_ARGS((void)); 48 | 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/lcg/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.var 2 | 3 | SRCDIR = .. 4 | 5 | all : lcg.o 6 | 7 | lcg.o : $(SRCDIR)/interface.h lcg.c lcg.h $(SRCDIR)/memory.h \ 8 | $(SRCDIR)/primes_32.h $(SRCDIR)/multiply.h \ 9 | $(SRCDIR)/store.h $(SRCDIR)/fwrap_.h 10 | $(CC) -c $(CFLAGS) $(FFXN) $(INLINEOPT) lcg.c -I$(SRCDIR) 11 | 12 | clean : 13 | rm -f *.o *.f *~ *.i core a.out 14 | 15 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/lcg/READMEver2.CHANGES: -------------------------------------------------------------------------------- 1 | 7 June 1999; Chris S. 2 | Makefile: 3 | 1. in 'all ;' added 'checksprng' 4 | 2. added section 'checksprng'. 5 | ---------------------------------------------------------------------------- 6 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/lcg/lcg.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _lcg_h 3 | #define _lcg_h 4 | 5 | #ifndef ANSI_ARGS 6 | #ifdef __STDC__ 7 | #define ANSI_ARGS(args) args 8 | #else 9 | #define ANSI_ARGS(args) () 10 | #endif 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | int lcg_get_rn_int ANSI_ARGS((int *igenptr)); 18 | float lcg_get_rn_flt ANSI_ARGS((int *igenptr)); 19 | double lcg_get_rn_dbl ANSI_ARGS((int *igenptr)); 20 | int *lcg_init_rng ANSI_ARGS((int rng_type, 21 | int gennum, int total_gen, int seed, int mult)); 22 | int lcg_spawn_rng ANSI_ARGS((int *igenptr, int nspawned, 23 | int ***newgens, int checkid) ); 24 | int lcg_get_seed_rng ANSI_ARGS((int *genptr)); 25 | int lcg_free_rng ANSI_ARGS((int *genptr)); 26 | int lcg_pack_rng ANSI_ARGS(( int *genptr, char **buffer)); 27 | int *lcg_unpack_rng ANSI_ARGS(( char *packed)); 28 | int lcg_print_rng ANSI_ARGS(( int *igen)); 29 | 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/lcg64/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.var 2 | SRCDIR = .. 3 | 4 | all : lcg64.o 5 | 6 | lcg64.o : $(SRCDIR)/interface.h lcg64.c lcg64.h $(SRCDIR)/memory.h \ 7 | $(SRCDIR)/primes_64.h $(SRCDIR)/multiply.h \ 8 | $(SRCDIR)/store.h $(SRCDIR)/fwrap_.h 9 | $(CC) -c $(CFLAGS) $(FFXN) $(INLINEOPT) -I$(SRCDIR) lcg64.c 10 | 11 | clean : 12 | rm -f *.o *.f *~ *.i core a.out 13 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/lcg64/lcg64.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _lcg64_h 3 | #define _lcg64_h 4 | 5 | #ifndef ANSI_ARGS 6 | #ifdef __STDC__ 7 | #define ANSI_ARGS(args) args 8 | #else 9 | #define ANSI_ARGS(args) () 10 | #endif 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | int lcg64_get_rn_int ANSI_ARGS((int *igenptr)); 18 | float lcg64_get_rn_flt ANSI_ARGS((int *igenptr)); 19 | double lcg64_get_rn_dbl ANSI_ARGS((int *igenptr)); 20 | int *lcg64_init_rng ANSI_ARGS((int rng_type, int gennum, int total_gen, int seed, 21 | int mult)); 22 | int lcg64_spawn_rng ANSI_ARGS((int *igenptr, int nspawned, int ***newgens, int checkid) ); 23 | int lcg64_get_seed_rng ANSI_ARGS((int *genptr)); 24 | int lcg64_free_rng ANSI_ARGS((int *genptr)); 25 | int lcg64_pack_rng ANSI_ARGS(( int *genptr, char **buffer)); 26 | int *lcg64_unpack_rng ANSI_ARGS(( char *packed)); 27 | int lcg64_print_rng ANSI_ARGS(( int *igen)); 28 | 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/lfg/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.var 2 | SRCDIR = .. 3 | 4 | all : lfg.o 5 | 6 | lfg.o : $(SRCDIR)/interface.h lfg.c lfg.h $(SRCDIR)/multiply.h $(SRCDIR)/memory.h $(SRCDIR)/store.h $(SRCDIR)/fwrap_.h 7 | $(CC) -c $(CFLAGS) $(FFXN) $(INLINEOPT) lfg.c -I$(SRCDIR) 8 | 9 | clean : 10 | rm -f *.o *.i 11 | 12 | realclean : 13 | rm -f *.o *.f *~ *.i core a.out 14 | 15 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/lfg/lfg.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _lfg_h 3 | #define _lfg_h 4 | 5 | #ifndef ANSI_ARGS 6 | #ifdef __STDC__ 7 | #define ANSI_ARGS(args) args 8 | #else 9 | #define ANSI_ARGS(args) () 10 | #endif 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | int lfg_get_rn_int ANSI_ARGS((int *igenptr)); 18 | float lfg_get_rn_flt ANSI_ARGS((int *igenptr)); 19 | double lfg_get_rn_dbl ANSI_ARGS((int *igenptr)); 20 | int *lfg_init_rng ANSI_ARGS((int rng_type, int gennum, int total_gen, int seed, 21 | int mult)); 22 | int lfg_spawn_rng ANSI_ARGS((int *igenptr, int nspawned, int ***newgens, int checkid) ); 23 | int lfg_get_seed_rng ANSI_ARGS((int *genptr)); 24 | int lfg_free_rng ANSI_ARGS((int *genptr)); 25 | int lfg_pack_rng ANSI_ARGS(( int *genptr, char **buffer)); 26 | int *lfg_unpack_rng ANSI_ARGS(( char *packed)); 27 | int lfg_print_rng ANSI_ARGS(( int *igen)); 28 | 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/makeseed.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef __STDC__ 4 | int make_new_seed() 5 | #else 6 | int make_new_seed() 7 | #endif 8 | { 9 | time_t tp; 10 | struct tm *temp; 11 | unsigned int temp2, temp3; 12 | static unsigned int temp4 = 0xe0e1; 13 | 14 | time(&tp); 15 | temp = localtime(&tp); 16 | 17 | temp2 = (temp->tm_sec<<26)+(temp->tm_min<<20)+(temp->tm_hour<<15)+ 18 | (temp->tm_mday<<10)+(temp->tm_mon<<6); 19 | temp3 = (temp->tm_year<<13)+(temp->tm_wday<<10)+(temp->tm_yday<<1)+ 20 | temp->tm_isdst; 21 | temp2 ^= clock()^temp3; 22 | 23 | temp4 = (temp4*0xeeee)%0xffff; 24 | temp2 ^= temp4<<16; 25 | temp4 = (temp4*0xaeee)%0xffff; 26 | temp2 ^= temp4; 27 | 28 | temp2 &= 0x7fffffff; 29 | 30 | return temp2; 31 | } 32 | 33 | 34 | #if 0 35 | main() 36 | { 37 | printf("%u\n", make_new_seed()); 38 | } 39 | #endif 40 | 41 | 42 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/memory.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef __STDC__ 5 | void *_mymalloc(long size, int line, char *message) 6 | #else 7 | void *_mymalloc(size, line, message) 8 | long size; 9 | int line; 10 | char *message; 11 | #endif 12 | { 13 | char *temp; 14 | 15 | if(size == 0) 16 | return NULL; 17 | 18 | temp = (char *) malloc(size); 19 | 20 | if(temp == NULL) 21 | { 22 | fprintf(stderr,"\nmemory allocation failure in file: %s at line number: %d\n", message, line); 23 | return NULL; 24 | } 25 | 26 | return (void *) temp; 27 | } 28 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/memory.h: -------------------------------------------------------------------------------- 1 | #define mymalloc(a) (_mymalloc((a), __LINE__, __FILE__)) 2 | 3 | #ifndef ANSI_ARGS 4 | #ifdef __STDC__ 5 | #define ANSI_ARGS(args) args 6 | #else 7 | #define ANSI_ARGS(args) () 8 | #endif 9 | #endif 10 | 11 | void *_mymalloc ANSI_ARGS((long size, int line, char *message)); 12 | 13 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/mlfg/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.var 2 | SRCDIR = .. 3 | 4 | all : mlfg.o 5 | 6 | mlfg.o : $(SRCDIR)/interface.h mlfg.c mlfg.h int64.h $(SRCDIR)/memory.h $(SRCDIR)/store.h $(SRCDIR)/fwrap_.h 7 | $(CC) -c $(CFLAGS) $(FFXN) $(INLINEOPT) mlfg.c -I$(SRCDIR) 8 | #--------------------------------------------------------------------------- 9 | .F.f : 10 | @if [ -f $*.i ] ; then \ 11 | rm $*.i ;\ 12 | fi 13 | $(CPP) $*.F 14 | @if [ -f $*.i ] ; then \ 15 | mv $*.i $*.f ;\ 16 | fi 17 | 18 | 19 | #--------------------------------------------------------------------------- 20 | #--------------------------------------------------------------------------- 21 | clean : 22 | rm -f *.o *.i 23 | 24 | realclean : 25 | rm -f *.o *.f *~ *.i core a.out 26 | 27 | .SUFFIXES : 28 | 29 | .SUFFIXES : .f .F 30 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/mlfg/mlfg.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _mlfg_h 3 | #define _mlfg_h 4 | 5 | #ifndef ANSI_ARGS 6 | #ifdef __STDC__ 7 | #define ANSI_ARGS(args) args 8 | #else 9 | #define ANSI_ARGS(args) () 10 | #endif 11 | #endif 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | int mlfg_get_rn_int ANSI_ARGS((int *igenptr)); 18 | float mlfg_get_rn_flt ANSI_ARGS((int *igenptr)); 19 | double mlfg_get_rn_dbl ANSI_ARGS((int *igenptr)); 20 | int *mlfg_init_rng ANSI_ARGS((int rng_type, int gennum, int total_gen, int seed, 21 | int mult)); 22 | int mlfg_spawn_rng ANSI_ARGS((int *igenptr, int nspawned, int ***newgens, int checkid) ); 23 | int mlfg_get_seed_rng ANSI_ARGS((int *genptr)); 24 | int mlfg_free_rng ANSI_ARGS((int *genptr)); 25 | int mlfg_pack_rng ANSI_ARGS(( int *genptr, char **buffer)); 26 | int *mlfg_unpack_rng ANSI_ARGS(( char *packed)); 27 | int mlfg_print_rng ANSI_ARGS(( int *igen)); 28 | 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/multiply.h: -------------------------------------------------------------------------------- 1 | #ifdef LONG64 2 | #define mult_48_64(a,b,c) c = (a*b); 3 | 4 | #define multiply(genptr) mult_48_64(genptr->seed,genptr->multiplier,genptr->seed); genptr->seed += genptr->prime; genptr->seed &= LSB48; 5 | 6 | #else 7 | #define mult_48_32(a,b,c) c[0] = a[0]*b[0]; c[1] = a[1]*b[0]+a[0]*b[1];\ 8 | c[2] = a[0]*b[2]+a[1]*b[1]+a[2]*b[0];\ 9 | c[3] = a[3]*b[0]+a[2]*b[1]+a[1]*b[2]+a[0]*b[3]; 10 | 11 | #define multiply(genptr,m,s,res) s[3] = (unsigned int) genptr->seed[0] >> 12;\ 12 | s[2] = genptr->seed[0] & 4095; s[1] = genptr->seed[1] >> 12;\ 13 | s[0] = genptr->seed[1] & 4095;\ 14 | mult_48_32(m,s,res);\ 15 | genptr->seed[1] = res[0] + ((res[1]&4095) << 12) + genptr->prime;\ 16 | genptr->seed[0] = ( (unsigned int) genptr->seed[1] >> 24)\ 17 | + res[2] + ((unsigned int) res[1] >> 12 ) + (res[3] << 12);\ 18 | genptr->seed[1] &= 16777215; genptr->seed[0] &= 16777215; 19 | #endif 20 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/primes_32.h: -------------------------------------------------------------------------------- 1 | #ifndef _primes_32_h_ 2 | #define _primes_32_h_ 3 | 4 | #ifndef ANSI_ARGS 5 | #ifdef __STDC__ 6 | #define ANSI_ARGS(args) args 7 | #else 8 | #define ANSI_ARGS(args) () 9 | #endif 10 | #endif 11 | 12 | int getprime_32 ANSI_ARGS((int need, int *prime_array, int offset)); 13 | 14 | #define MAXPRIME 11863285 /* sqrt(2)*2^23 + 2 */ 15 | #define MINPRIME 3444 /* sqrt(MAXPRIME) */ 16 | #define MAXPRIMEOFFSET 779156 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/primes_64.h: -------------------------------------------------------------------------------- 1 | #ifndef _primes_64_h_ 2 | #define _primes_64_h_ 3 | 4 | #ifndef ANSI_ARGS 5 | #ifdef __STDC__ 6 | #define ANSI_ARGS(args) args 7 | #else 8 | #define ANSI_ARGS(args) () 9 | #endif 10 | #endif 11 | 12 | int getprime_64 ANSI_ARGS((int need, unsigned int *prime_array, int offset)); 13 | 14 | #define MAXPRIME 3037000501U /* largest odd # < sqrt(2)*2^31+2 */ 15 | #define MINPRIME 55108 /* sqrt(MAXPRIME) */ 16 | #define MAXPRIMEOFFSET 146138719U /* Total number of available primes */ 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/simple.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | 3 | #include 4 | #include 5 | #include "memory.h" 6 | #include "interface.h" 7 | 8 | #ifndef ANSI_ARGS 9 | #ifdef __STDC__ 10 | #define ANSI_ARGS(args) args 11 | #else 12 | #define ANSI_ARGS(args) () 13 | #endif 14 | #endif 15 | 16 | int *defaultgen=NULL; 17 | int junk; /* pass useless pointer at times */ 18 | 19 | #ifdef __STDC__ 20 | int *init_rng_simple( int seed, int mult) 21 | #else 22 | int *init_rng_simple(seed,mult) 23 | int mult,seed; 24 | #endif 25 | { 26 | int myid=0, nprocs=1, *temp; 27 | 28 | temp = init_rng(myid,nprocs,seed,mult); 29 | 30 | if(temp == NULL) 31 | return NULL; 32 | else 33 | { 34 | if(defaultgen != NULL) 35 | free_rng(defaultgen); 36 | defaultgen = temp; 37 | return &junk; /* return "garbage" value */ 38 | } 39 | } 40 | 41 | 42 | 43 | 44 | 45 | #ifdef __STDC__ 46 | int get_rn_int_simple(void) 47 | #else 48 | int get_rn_int_simple() 49 | #endif 50 | { 51 | if(defaultgen == NULL) 52 | if(init_rng_simple(0,0) == NULL) 53 | return -1.0; 54 | 55 | return get_rn_int(defaultgen); 56 | } 57 | 58 | 59 | 60 | 61 | #ifdef __STDC__ 62 | float get_rn_flt_simple(void) 63 | #else 64 | float get_rn_flt_simple() 65 | #endif 66 | { 67 | if(defaultgen == NULL) 68 | if(init_rng_simple(0,0) == NULL) 69 | return -1.0; 70 | 71 | return get_rn_flt(defaultgen); 72 | } 73 | 74 | 75 | #ifdef __STDC__ 76 | double get_rn_dbl_simple(void) 77 | #else 78 | double get_rn_dbl_simple() 79 | #endif 80 | { 81 | if(defaultgen == NULL) 82 | if(init_rng_simple(0,0) == NULL) 83 | return -1.0; 84 | 85 | return get_rn_dbl(defaultgen); 86 | } 87 | 88 | 89 | 90 | 91 | 92 | #ifdef __STDC__ 93 | int pack_rng_simple(char **buffer) 94 | #else 95 | int pack_rng_simple(buffer) 96 | char **buffer; 97 | #endif 98 | { 99 | if(defaultgen == NULL) 100 | return 0; 101 | 102 | return pack_rng(defaultgen,buffer); 103 | } 104 | 105 | 106 | 107 | #ifdef __STDC__ 108 | int *unpack_rng_simple( char *packed) 109 | #else 110 | int *unpack_rng_simple(packed) 111 | char *packed; 112 | #endif 113 | { 114 | int *temp; 115 | 116 | temp = unpack_rng(packed); 117 | 118 | if(temp == NULL) 119 | return NULL; 120 | else 121 | { 122 | if(defaultgen != NULL) 123 | free_rng(defaultgen); 124 | defaultgen = temp; 125 | return &junk; /* return "garbage" value */ 126 | } 127 | } 128 | 129 | 130 | 131 | #ifdef __STDC__ 132 | int print_rng_simple(void) 133 | #else 134 | int print_rng_simple() 135 | #endif 136 | { 137 | if(defaultgen == NULL) 138 | { 139 | fprintf(stderr,"WARNING: No generator initialized so far\n"); 140 | return 0; 141 | } 142 | 143 | return print_rng(defaultgen); 144 | } 145 | 146 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/simple_.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************/ 2 | 3 | #include 4 | #include 5 | #include "memory.h" 6 | #include "interface.h" 7 | 8 | #ifndef ANSI_ARGS 9 | #ifdef __STDC__ 10 | #define ANSI_ARGS(args) args 11 | #else 12 | #define ANSI_ARGS(args) () 13 | #endif 14 | #endif 15 | 16 | 17 | int *defaultgen=NULL; 18 | int junk; /* pass useless pointer at times */ 19 | 20 | #ifdef __STDC__ 21 | int *init_rng_simple(int rng_type, int seed, int mult) 22 | #else 23 | int *init_rng_simple(rng_type,seed,mult) 24 | int rng_type,mult,seed; 25 | #endif 26 | { 27 | int myid=0, nprocs=1, *temp; 28 | 29 | temp = init_rng(rng_type,myid,nprocs,seed,mult); 30 | 31 | if(temp == NULL) 32 | return NULL; 33 | else 34 | { 35 | if(defaultgen != NULL) 36 | free_rng(defaultgen); 37 | defaultgen = temp; 38 | return &junk; /* return "garbage" value */ 39 | } 40 | } 41 | 42 | 43 | 44 | 45 | 46 | #ifdef __STDC__ 47 | int get_rn_int_simple(void) 48 | #else 49 | int get_rn_int_simple() 50 | #endif 51 | { 52 | if(defaultgen == NULL) 53 | if(init_rng_simple(DEFAULT_RNG_TYPE,0,0) == NULL) 54 | return -1.0; 55 | 56 | return get_rn_int(defaultgen); 57 | } 58 | 59 | 60 | 61 | 62 | #ifdef __STDC__ 63 | float get_rn_flt_simple(void) 64 | #else 65 | float get_rn_flt_simple() 66 | #endif 67 | { 68 | if(defaultgen == NULL) 69 | if(init_rng_simple(DEFAULT_RNG_TYPE,0,0) == NULL) 70 | return -1.0; 71 | 72 | return get_rn_flt(defaultgen); 73 | } 74 | 75 | 76 | #ifdef __STDC__ 77 | double get_rn_dbl_simple(void) 78 | #else 79 | double get_rn_dbl_simple() 80 | #endif 81 | { 82 | if(defaultgen == NULL) 83 | if(init_rng_simple(DEFAULT_RNG_TYPE,0,0) == NULL) 84 | return -1.0; 85 | 86 | return get_rn_dbl(defaultgen); 87 | } 88 | 89 | 90 | 91 | 92 | 93 | #ifdef __STDC__ 94 | int pack_rng_simple(char **buffer) 95 | #else 96 | int pack_rng_simple(buffer) 97 | char **buffer; 98 | #endif 99 | { 100 | if(defaultgen == NULL) 101 | return 0; 102 | 103 | return pack_rng(defaultgen,buffer); 104 | } 105 | 106 | 107 | 108 | #ifdef __STDC__ 109 | int *unpack_rng_simple( char *packed) 110 | #else 111 | int *unpack_rng_simple(packed) 112 | char *packed; 113 | #endif 114 | { 115 | int *temp; 116 | 117 | temp = unpack_rng(packed); 118 | 119 | if(temp == NULL) 120 | return NULL; 121 | else 122 | { 123 | if(defaultgen != NULL) 124 | free_rng(defaultgen); 125 | defaultgen = temp; 126 | return &junk; /* return "garbage" value */ 127 | } 128 | } 129 | 130 | 131 | 132 | #ifdef __STDC__ 133 | int print_rng_simple(void) 134 | #else 135 | int print_rng_simple() 136 | #endif 137 | { 138 | if(defaultgen == NULL) 139 | { 140 | fprintf(stderr,"WARNING: No generator initialized so far\n"); 141 | return 0; 142 | } 143 | 144 | return print_rng(defaultgen); 145 | } 146 | 147 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/sprng.h: -------------------------------------------------------------------------------- 1 | #ifndef _sprng_h_ 2 | #define _sprng_h_ 3 | 4 | 5 | #define SPRNG_LFG 0 6 | #define SPRNG_LCG 1 7 | #define SPRNG_LCG64 2 8 | #define SPRNG_CMRG 3 9 | #define SPRNG_MLFG 4 10 | #define SPRNG_PMLCG 5 11 | 12 | #include "interface.h" 13 | #include "store.h" 14 | 15 | #define SPRNG_DEFAULT 0 16 | #define CRAYLCG 0 17 | #define DRAND48 1 18 | #define FISH1 2 19 | #define FISH2 3 20 | #define FISH3 4 21 | #define FISH4 5 22 | #define FISH5 6 23 | #define LECU1 0 24 | #define LECU2 1 25 | #define LECU3 2 26 | #define LAG1279 0 27 | #define LAG17 1 28 | #define LAG31 2 29 | #define LAG55 3 30 | #define LAG63 4 31 | #define LAG127 5 32 | #define LAG521 6 33 | #define LAG521B 7 34 | #define LAG607 8 35 | #define LAG607B 9 36 | #define LAG1279B 10 37 | 38 | #define CHECK 1 39 | 40 | #define MAX_PACKED_LENGTH 24000 41 | 42 | #ifdef USE_MPI 43 | #define MPINAME(A) A ## _mpi 44 | #else 45 | #define MPINAME(A) A 46 | #endif 47 | 48 | #define make_sprng_seed MPINAME(make_new_seed) 49 | 50 | #if defined(SIMPLE_SPRNG) 51 | 52 | #define pack_sprng pack_rng_simple 53 | #define unpack_sprng unpack_rng_simple 54 | #define isprng MPINAME(get_rn_int_simple) 55 | #define init_sprng MPINAME(init_rng_simple) 56 | #define print_sprng print_rng_simple 57 | 58 | #ifdef FLOAT_GEN 59 | #define sprng MPINAME(get_rn_flt_simple) 60 | #else 61 | #define sprng MPINAME(get_rn_dbl_simple) 62 | #endif 63 | 64 | #elif !defined(CHECK_POINTERS) 65 | 66 | #define free_sprng free_rng 67 | #define pack_sprng pack_rng 68 | #define unpack_sprng unpack_rng 69 | #define isprng get_rn_int 70 | #define spawn_sprng(A,B,C) spawn_rng(A,B,C,!CHECK) 71 | #define init_sprng init_rng 72 | #define print_sprng print_rng 73 | 74 | #ifdef FLOAT_GEN 75 | #define sprng get_rn_flt 76 | #else 77 | #define sprng get_rn_dbl 78 | #endif 79 | 80 | #else 81 | 82 | #define free_sprng(A) ((deleteID(A)==NULL) ? -1 : free_rng(A)) 83 | #define pack_sprng(A,B) ((checkID(A)==NULL) ? 0 : pack_rng(A,B)) 84 | #define unpack_sprng(A) addID(unpack_rng(A)) 85 | #define isprng(A) ((checkID(A)==NULL) ? -1 : get_rn_int(A)) 86 | #define spawn_sprng(A,B,C) ((checkID(A)==NULL) ? 0 : spawn_rng(A,B,C,CHECK)) 87 | #define init_sprng(A,B,C,D,E) addID(init_rng(A,B,C,D,E)) 88 | #define print_sprng(A) ((checkID(A)==NULL) ? 0 : print_rng(A)) 89 | 90 | #ifdef FLOAT_GEN 91 | #define sprng(A) ((checkID(A)==NULL) ? -1.0 : get_rn_flt(A)) 92 | #else 93 | #define sprng(A) ((checkID(A)==NULL) ? -1.0 : get_rn_dbl(A)) 94 | #endif 95 | 96 | #endif 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/sprng/Makefile: -------------------------------------------------------------------------------- 1 | include ../../../Makefile.var 2 | SRCDIR = .. 3 | GENLIST = lfg lcg lcg64 cmrg mlfg 4 | 5 | all : sprng 6 | 7 | #--------------------------------------------------------------------------- 8 | # Construct Library 9 | #--------------------------------------------------------------------------- 10 | SPRNG_COMMON_DEPEND = $(SRCDIR)/primes_32.o $(SRCDIR)/primes_64.o \ 11 | $(SRCDIR)/fwrap_mpi.o $(SRCDIR)/cputime.o \ 12 | $(SRCDIR)/makeseed.o $(SRCDIR)/simple_mpi.o \ 13 | $(SRCDIR)/memory.o $(SRCDIR)/communicate.o \ 14 | $(SRCDIR)/checkid.o $(SRCDIR)/store.o 15 | 16 | sprng : 17 | (cd ..; $(MAKE) sprng_common) 18 | @for g in $(GENLIST) ; do \ 19 | (cd ../$$g; $(MAKE) ) ; \ 20 | done 21 | rm -f ../../lib/libsprng.a 22 | $(MAKE) libsprng 23 | 24 | libsprng : sprng.o \ 25 | $(SRCDIR)/lcg/lcg.o $(SRCDIR)/lfg/lfg.o \ 26 | $(SRCDIR)/lcg64/lcg64.o \ 27 | $(SRCDIR)/mlfg/mlfg.o $(SRCDIR)/cmrg/cmrg.o \ 28 | $(SPRNG_COMMON_DEPEND) 29 | $(AR) $(ARFLAGS) ../../lib/libsprng.a sprng.o \ 30 | $(SRCDIR)/lcg/lcg.o $(SRCDIR)/lfg/lfg.o \ 31 | $(SRCDIR)/lcg64/lcg64.o \ 32 | $(SRCDIR)/mlfg/mlfg.o $(SRCDIR)/cmrg/cmrg.o \ 33 | $(SPRNG_COMMON_DEPEND) 34 | $(RANLIB) ../../lib/libsprng.a 35 | 36 | sprng.o : $(SRCDIR)/interface.h sprng.c $(SRCDIR)/memory.h \ 37 | $(SRCDIR)/multiply.h $(SRCDIR)/store.h $(SRCDIR)/fwrap_.h 38 | $(CC) -c $(CFLAGS) $(FFXN) $(INLINEOPT) sprng.c -I$(SRCDIR) 39 | 40 | 41 | .F.f : 42 | @if [ -f $*.i ] ; then \ 43 | rm $*.i ;\ 44 | fi 45 | $(CPP) $*.F 46 | @if [ -f $*.i ] ; then \ 47 | mv $*.i $*.f ;\ 48 | fi 49 | 50 | #--------------------------------------------------------------------------- 51 | clean : 52 | rm -f *.o *.i 53 | 54 | realclean : 55 | rm -f *.o *.f *~ *.i core a.out 56 | 57 | .SUFFIXES : 58 | 59 | .SUFFIXES : .f .F 60 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/sprng/READMEver2.CHANGES: -------------------------------------------------------------------------------- 1 | 3 June 1999: Chris S. 2 | In Makefile, line 'all' commented with # checksprng and timesprng. 3 | ------------------------------------------------------------------------------- 4 | 7 June 1999: Chris S. 5 | In Makefile, removed the line with 'cp' from 'checksprng' section. 6 | No file 'sprng.data'. There are such files for each generator 7 | individually. 8 | -------------------------------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/store.h: -------------------------------------------------------------------------------- 1 | #ifndef _STORE_H 2 | #define _STORE_H 3 | 4 | /* Numbers are stored with most significant bit first (left most) */ 5 | 6 | int store_long(unsigned long l, int nbytes, unsigned char *c); 7 | int store_longarray(unsigned long *l, int n, int nbytes, unsigned char *c); 8 | int load_long(unsigned char *c, int nbytes, unsigned long *l); 9 | int load_longarray(unsigned char *c, int n, int nbytes, unsigned long *l); 10 | int store_int(unsigned int l, int nbytes, unsigned char *c); 11 | int store_intarray(unsigned int *l, int n, int nbytes, unsigned char *c); 12 | int load_int(unsigned char *c, int nbytes, unsigned int *l); 13 | int load_intarray(unsigned char *c, int n, int nbytes, unsigned int *l); 14 | 15 | 16 | #ifdef _LONG_LONG 17 | 18 | int store_longlong(unsigned long long l, int nbytes, unsigned char *c); 19 | int store_longlongarray(unsigned long long *l, int n, int nbytes, unsigned char *c); 20 | int load_longlong(unsigned char *c, int nbytes, unsigned long long *l); 21 | int load_longlongarray(unsigned char *c, int n, int nbytes, unsigned long long *l); 22 | 23 | #endif /* _LONG_LONG */ 24 | 25 | 26 | #endif /* _STORE_H */ 27 | 28 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/timing.c: -------------------------------------------------------------------------------- 1 | /*--- Chris S.: June 10, 1999 */ 2 | /*--- reads in a generator type as an integer */ 3 | /*---adding 'int gentype' and read in + error handling */ 4 | /*--- generator numeral range is fix-set to 0-5 ? */ 5 | /*--- should 5 be change to some variable MAX_GEN_NUMBER ? */ 6 | #include 7 | #include 8 | #include "cputime.h" 9 | #include "interface.h" 10 | 11 | #define TIMING_TRIAL_SIZE 1000000 12 | #define PARAM 0 13 | 14 | main() 15 | { 16 | 17 | int i; 18 | int *gen; 19 | double temp1, temp2, temp3, temp4; 20 | double temp_mult = TIMING_TRIAL_SIZE/1.0e6; 21 | /*--- */ 22 | int gentype; 23 | 24 | scanf("%d\n", &gentype); 25 | if((gentype < 0) || (gentype > 5)) /*--- range to be adjusted if needed */ 26 | { 27 | printf("\nGenerator numeral out of range.\n\t...Exiting\n"); 28 | exit(1); 29 | } 30 | /*--- */ 31 | 32 | 33 | gen = init_rng(gentype,0,1,0,PARAM); 34 | /*--- Printing generator and stream information */ 35 | /* print_rng(gen); */ 36 | 37 | temp1 = cputime(); 38 | 39 | for(i=0; i %8.4f MRS\n", 67 | temp2-temp1, temp_mult/(temp2-temp1)); 68 | printf("\tFloat generator:\t Time = %7.3f seconds => %8.4f MRS\n", 69 | temp3-temp2, temp_mult/(temp3-temp2)); 70 | printf("\tDouble generator:\t Time = %7.3f seconds => %8.4f MRS\n", 71 | temp4-temp3, temp_mult/(temp4-temp3)); 72 | putchar('\n'); 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /include/common/GTgraph/sprng2.0-lite/src/timingf.f: -------------------------------------------------------------------------------- 1 | C--- 8 June 1999 Chris S. modified to read a file with the first argument 2 | C--- being a generator type 3 | C--- added 'integer gentype' 4 | C--- added 'Reading in a generator type' and 'read *, gentype' 5 | #define PARAM 0 6 | #define TIMING_TRIAL_SIZE 1000000 7 | 8 | #ifdef POINTER_SIZE 9 | #if POINTER_SIZE == 8 10 | #define SPRNG_POINTER integer*8 11 | #else 12 | #define SPRNG_POINTER integer*4 13 | #endif 14 | #else 15 | #define SPRNG_POINTER integer*4 16 | #endif 17 | 18 | program test_generator 19 | 20 | implicit none 21 | integer gentype 22 | external finit_rng, fget_rn_int, fget_rn_flt, fget_rn_dbl 23 | external fcpu_t 24 | 25 | SPRNG_POINTER finit_rng 26 | real*8 fget_rn_dbl, fcpu_t, tempd 27 | real*4 fget_rn_flt, tempf 28 | integer fget_rn_int, tempi 29 | 30 | integer i 31 | SPRNG_POINTER gen 32 | real*8 temp1, temp2, temp3, temp4 33 | real*8 temp_mult 34 | C--- Reading in a generator type 35 | read *, gentype 36 | 37 | temp_mult = TIMING_TRIAL_SIZE/1.0e6 38 | gen = finit_rng(gentype,0,1,0,PARAM) 39 | 40 | temp1 = fcpu_t() 41 | 42 | do 100 i = 1,TIMING_TRIAL_SIZE 43 | tempi = fget_rn_int(gen) 44 | 100 continue 45 | 46 | temp2 = fcpu_t() 47 | 48 | do 200 i = 1,TIMING_TRIAL_SIZE 49 | tempf = fget_rn_flt(gen) 50 | 200 continue 51 | 52 | temp3 = fcpu_t() 53 | 54 | 55 | do 300 i = 1,TIMING_TRIAL_SIZE 56 | tempd = fget_rn_dbl(gen) 57 | 300 continue 58 | 59 | temp4 = fcpu_t() 60 | 61 | if( temp2-temp1 .lt. 1.0e-15 ) then 62 | print *, 'Timing information not available or nor accurate' 63 | stop 64 | end if 65 | 66 | if( temp3-temp2 .lt. 1.0e-15 ) then 67 | print *, 'Timing information not available or nor accurate' 68 | stop 69 | end if 70 | 71 | if(temp4-temp3 .lt. 1.0e-15 ) then 72 | print *, 'Timing information not available or not accurate' 73 | stop 74 | end if 75 | 76 | temp1 = temp_mult/(temp2-temp1) 77 | temp2 = temp_mult/(temp3-temp2) 78 | temp3 = temp_mult/(temp4-temp3) 79 | 80 | print *, 'User + System time Information' 81 | print *, '(Note: MRS = Million Random Numbers Per Second)' 82 | write(6,500) temp1 83 | write(6,501) temp2 84 | write(6,502) temp3 85 | 86 | 500 format(' Integer generator: ', f7.3, ' MRS') 87 | 501 format(' real*4 generator: ', f7.3, ' MRS') 88 | 502 format(' real*8 generator: ', f7.3, ' MRS') 89 | 90 | end 91 | 92 | -------------------------------------------------------------------------------- /include/common/HeapEntry.h: -------------------------------------------------------------------------------- 1 | #ifndef _HEAP_ENTRY_H 2 | #define _HEAP_ENTRY_H 3 | 4 | template 5 | class HeapEntry 6 | { 7 | public: 8 | IT key; 9 | IT runr; 10 | IT loc; // location of the next nonzero that column of A 11 | FT value; 12 | 13 | // Operators are swapped for performance 14 | // If you want/need to convert them back to their normal definitions, don't forget to add 15 | // "greater< HeapEntry >()" optional parameter to all the heap operations operating on HeapEntry objects. 16 | // For example: push_heap(heap, heap + kisect, greater< HeapEntry >()); 17 | 18 | bool operator > (const HeapEntry & rhs) const 19 | { return (key < rhs.key); } 20 | bool operator < (const HeapEntry & rhs) const 21 | { return (key > rhs.key); } 22 | bool operator == (const HeapEntry & rhs) const 23 | { return (key == rhs.key); } 24 | }; 25 | 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /include/common/Triple.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRIPLE_H_ 2 | #define _TRIPLE_H_ 3 | 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | template 9 | struct Triple 10 | { 11 | IT row; // row index 12 | IT col; // col index 13 | NT val; // value 14 | Triple(IT myrow, IT mycol, NT myval):row(myrow),col(mycol),val(myval) {}; 15 | Triple():row(0),col(0),val(0) {}; 16 | 17 | }; 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/common/bellaio.h: -------------------------------------------------------------------------------- 1 | 2 | template // kmer_index, count_index 3 | void WriteToDisk(const vector>> & alltranstuples, 4 | const CuckooDict & countsreliable, 5 | KIND readcount, KIND tuplecount) 6 | { 7 | cout << "Writing to disk" << endl; 8 | string filename = "readbykmers.mtx"; 9 | vector ss(MAXTHREADS); 10 | vector text(MAXTHREADS); 11 | vector bytes(MAXTHREADS); 12 | 13 | ss[0] << readcount << '\t' << countsreliable.size() << '\t' << tuplecount << '\n'; 14 | #pragma omp parallel for 15 | for(int t=0; t(tlp)+1 << '\t' << get<0>(tlp)+1 << '\t' << get<2>(tlp) << '\n'; 20 | } 21 | text[t] = ss[t].str(); 22 | bytes[t] = text[t].size(); 23 | ss[t].clear(); 24 | } 25 | std::ofstream ofs(filename.c_str(), std::ios::binary | std::ios::out); 26 | vector bytesuntil(MAXTHREADS+1, 0); 27 | std::partial_sum(bytes.begin(), bytes.end(), bytesuntil.begin()+1); 28 | ofs.seekp(bytes[MAXTHREADS-1] - 1); 29 | ofs.write("", 1); // this will likely create a sparse file so the actual disks won't spin yet 30 | ofs.close(); 31 | struct stat st; // get file size 32 | if (stat(filename.c_str(), &st) != -1) 33 | { 34 | std::cout << "File is actually " << st.st_size << " bytes" << endl; 35 | } 36 | 37 | #pragma omp parallel for 38 | for(int t=0; t 5 | #include 6 | #include 7 | #include 8 | 9 | void* operator new(std::size_t sz) { 10 | return scalable_malloc(sz); 11 | } 12 | void operator delete(void* ptr) 13 | { 14 | scalable_free(ptr); 15 | } 16 | 17 | void* operator new[]( std::size_t sz ) { 18 | return scalable_malloc(sz); 19 | } 20 | void operator delete[]( void* ptr ) { 21 | scalable_free(ptr); 22 | }; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/common/transpose.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRANSPOSE_H_ 2 | #define _TRANSPOSE_H_ 3 | #include 4 | 5 | /** 6 | ** while the name suggests CSR -> CSC, 7 | ** one can simply use this to transpose a matrix in CSR format to its transpose also in CSR format 8 | ** or vice versa: transpose a matrix in CSC format to its transpose also in CSC format 9 | ** just read CSR related params as the "old matrix" and CSC related params as the "output/new matrix" 10 | ** currently only the nonsorted output case is implemented (i.e. rowids in each column of the output matrix is not sorted) 11 | **/ 12 | template 13 | void csr2csc_atomic_nosort (IT m, IT n, IT nnz, IT * csrRowPtr, IT * csrColIdx, NT * csrVal, 14 | IT * cscColPtr, IT * cscRowIdx, NT * cscVal) 15 | { 16 | std::atomic * atomicColPtr = new std::atomic[n]; 17 | for (IT i=0; i < n; i++) 18 | { 19 | atomicColPtr[i] = 0; 20 | } 21 | 22 | // construct an array of size nnz to record the relative 23 | // position of a nonzero element in corresponding column 24 | // this is what allows us to parallelize the last loop 25 | IT * dloc = new IT[nnz](); 26 | #pragma omp parallel for schedule(dynamic) 27 | for (IT i=0; i < m; i++) 28 | { 29 | for (IT j=csrRowPtr[i]; j < csrRowPtr[i+1]; j++) 30 | { 31 | dloc[j] = std::atomic_fetch_add(&(atomicColPtr[csrColIdx[j]]), 1); 32 | } 33 | } 34 | cscColPtr[0] = 0; 35 | for (IT i=0; i <= n; i++) 36 | { 37 | cscColPtr[i+1] = atomicColPtr[i] + cscColPtr[i]; 38 | } 39 | delete [] atomicColPtr; 40 | 41 | #pragma omp parallel for schedule(dynamic) 42 | for (IT i=0; i < m; i++) 43 | { 44 | for (IT j=csrRowPtr[i]; j < csrRowPtr[i+1]; j++) 45 | { 46 | IT loc = cscColPtr[csrColIdx[j]] + dloc[j]; // dloc[j] (as opposed to a O(N) work array) is what makes this loop race free 47 | cscRowIdx[loc] = i; 48 | cscVal[loc] = csrVal[j]; 49 | } 50 | } 51 | delete[] dloc; 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /include/minimizer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _BELLA_MINIMIZER_H_ 2 | #define _BELLA_MINIMIZER_H_ 3 | 4 | #include "../kmercode/hash_funcs.h" 5 | #include "../kmercode/Kmer.hpp" 6 | #include 7 | #include 8 | #include 9 | 10 | int robustwinnow = 1; 11 | 12 | void furtherPop(std::deque< std::pair > & deq) 13 | { 14 | if(robustwinnow) 15 | { 16 | while (deq.size() > 1 && deq.front().second == deq[1].second) 17 | { 18 | deq.pop_front(); 19 | } 20 | } 21 | } 22 | 23 | uint64_t getOrder(const Kmer & mer) 24 | { 25 | return mer.rep().hash(); 26 | } 27 | 28 | void sample(std::pair min, std::vector< int > & output) 29 | { 30 | if(output.empty() || min.first != output.back()) 31 | output.push_back(min.first); 32 | } 33 | 34 | 35 | void furtherSample(std::deque< std::pair > & deq, std::vector< int > & output) 36 | { 37 | if(!robustwinnow) 38 | { 39 | while (deq.size() > 1 && deq.front().second == deq[1].second) 40 | { 41 | deq.pop_front(); 42 | sample(deq.front(), output); 43 | } 44 | } 45 | } 46 | 47 | // this is a canonical strand minimizer 48 | // to avoid strand ambiguity, we advise choosing an odd number for kmer length 49 | void getMinimizers(size_t window, const std::vector& input, std::vector& output) 50 | { 51 | std::deque> deq; // this double-ended queue will naturally be sorted by construction 52 | 53 | size_t total = input.size(); 54 | for (size_t i = 0; i < total; ++i) 55 | { 56 | 57 | std::pair qentry = std::make_pair(i, getOrder(input[i])); 58 | while (!deq.empty() && deq.back().second > qentry.second) 59 | { 60 | deq.pop_back(); 61 | } 62 | deq.push_back(qentry); 63 | 64 | while(!deq.empty() && deq.front().first <= static_cast(i)-window) 65 | { 66 | furtherPop(deq); // discard all identical kmers to first 67 | deq.pop_front(); // discard first out-of-range k-mer 68 | } 69 | 70 | if (!deq.empty()) 71 | { 72 | sample(deq.front(), output); 73 | } 74 | 75 | furtherSample(deq, output); 76 | } 77 | } 78 | 79 | #endif 80 | 81 | 82 | -------------------------------------------------------------------------------- /include/syncmer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _BELLA_SYNCMER_H_ 2 | #define _BELLA_SYNCMER_H_ 3 | 4 | #include "../kmercode/hash_funcs.h" 5 | #include "../kmercode/Kmer.hpp" 6 | #include 7 | #include 8 | #include 9 | 10 | // int robustwinnow = 1; 11 | 12 | // void furtherPop(std::deque< std::pair > & deq) 13 | // { 14 | // if(robustwinnow) 15 | // { 16 | // while (deq.size() > 1 && deq.front().second == deq[1].second) 17 | // { 18 | // deq.pop_front(); 19 | // } 20 | // } 21 | // } 22 | 23 | // uint64_t getOrder(const Kmer & mer) 24 | // { 25 | // return mer.rep().hash(); 26 | // } 27 | 28 | // void sample(std::pair min, std::vector< int > & output) 29 | // { 30 | // if(output.empty() || min.first != output.back()) 31 | // output.push_back(min.first); 32 | // } 33 | 34 | 35 | // void furtherSample(std::deque< std::pair > & deq, std::vector< int > & output) 36 | // { 37 | // if(!robustwinnow) 38 | // { 39 | // while (deq.size() > 1 && deq.front().second == deq[1].second) 40 | // { 41 | // deq.pop_front(); 42 | // sample(deq.front(), output); 43 | // } 44 | // } 45 | // } 46 | 47 | const int smerlen = 5; //make it input param 48 | 49 | bool isSyncmer(const Kmer& mer, int& kmerlen) 50 | { 51 | string kmer = mer.toString(); 52 | Kmer stKmer(kmer.substr(0, smerlen).c_str(), smerlen); // first s-mer of the k-mer 53 | Kmer endKmer(kmer.substr(kmerlen - smerlen, smerlen).c_str(), smerlen); // last s-mer of the k-mer 54 | 55 | uint64_t stsmer = stKmer.hash(); //(kmer >> (2*(31-(smerlen - 1)))) & mask; // first s-mer of the k-mer 56 | uint64_t endsmer = endKmer.hash(); 57 | 58 | for (int i = 1; i < kmerlen - smerlen ; ++i) 59 | { 60 | Kmer tmpsmer(kmer.substr(i, kmerlen).c_str(), smerlen); 61 | 62 | if(tmpsmer.hash() < stsmer && tmpsmer.hash() < endsmer){ 63 | return false; 64 | } 65 | } 66 | return true; 67 | 68 | } 69 | 70 | // this is a canonical strand minimizer 71 | // to avoid strand ambiguity, we advise choosing an odd number for kmer length 72 | void getSyncmers(int klen, const std::vector& input, std::vector& output) 73 | { 74 | for (size_t i = 0; i < input.size(); ++i) 75 | { 76 | if(isSyncmer(input[i], klen)) 77 | output.push_back(i); 78 | } 79 | } 80 | 81 | #endif 82 | 83 | 84 | -------------------------------------------------------------------------------- /kmercode/Buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef _BUFFER_H_ 2 | #define _BUFFER_H_ 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include "common.h" 11 | 12 | #if defined (__cplusplus) 13 | extern "C" { 14 | #endif 15 | 16 | typedef struct { 17 | char *buf; 18 | size_t pos, len, size; 19 | } BufferBase; 20 | typedef BufferBase *Buffer; 21 | 22 | typedef struct _BufferList { 23 | Buffer buffer; 24 | struct _BufferList *next; 25 | } _BufferList; 26 | typedef struct { 27 | _BufferList *head; 28 | _BufferList *tail; 29 | } BufferList; 30 | 31 | Buffer initBuffer(size_t initSize); 32 | void attachBuffer(Buffer b, char *buf, size_t pos, size_t len, size_t size); 33 | size_t growBuffer(Buffer b, size_t appendSize); 34 | size_t growBufferMax(Buffer b, size_t requestedSize); 35 | void resetBuffer1(Buffer b); 36 | void resetBuffer(Buffer b); 37 | char * resetRawBuffer(Buffer b, size_t newSize); 38 | void freeBuffer(Buffer b); 39 | char * releaseBuffer(Buffer b); 40 | int isValidBuffer(Buffer b); 41 | 42 | BufferList initBufferList(); 43 | void freeBufferList(BufferList bl); 44 | Buffer extendBufferList(BufferList bl, size_t initSize); 45 | Buffer getBuffer(BufferList bl); 46 | 47 | size_t getPosBuffer(Buffer b); 48 | size_t getLengthBuffer(Buffer b); 49 | size_t getSizeBuffer(Buffer b); 50 | size_t appendNullBuffer(Buffer b); 51 | char * getStartBuffer(Buffer b); 52 | char *getEndBuffer(Buffer b); 53 | char *getCurBuffer(Buffer b); 54 | 55 | size_t writeBuffer(Buffer b, const void *data, size_t size); 56 | size_t readBuffer(Buffer b, void *data, size_t size); 57 | 58 | size_t writeFileBuffer(Buffer b, FILE *f, size_t myOffset); 59 | 60 | size_t printfBuffer(Buffer b, const char *fmt, ...); 61 | char *fgetsBuffer(Buffer b, int size, FILE *stream); 62 | #ifndef NO_GZIP 63 | #include 64 | char *gzgetsBuffer(Buffer b, int size, gzFile gz); 65 | #endif 66 | void *memcpyBuffer(Buffer b, const void *src, size_t n); 67 | void *memsetBuffer(Buffer b, int c, size_t n); 68 | char *strcpyBuffer(Buffer b, const char *src); 69 | char *strncpyBuffer(Buffer b, const char *src, size_t n); 70 | char *addNullBuffer(Buffer b); 71 | size_t chompBuffer(Buffer b); 72 | 73 | void setBufferForFile(Buffer b, FILE *f); 74 | 75 | void swapBuffer(Buffer *a, Buffer *b); 76 | 77 | #if defined (__cplusplus) 78 | } 79 | #endif 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /kmercode/ParallelFASTQ.h: -------------------------------------------------------------------------------- 1 | #ifndef _PARALLEL_FASTQ_H_ 2 | #define _PARALLEL_FASTQ_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "Buffer.h" 18 | #include "fq_reader.h" 19 | 20 | #ifndef DEFAULT_READ_LEN 21 | #define DEFAULT_READ_LEN 100000 22 | #endif 23 | 24 | #ifndef MAX_READ_NAME_LEN 25 | #define MAX_READ_NAME_LEN 100000 26 | #endif 27 | 28 | using namespace std; 29 | 30 | class ParallelFASTQ 31 | { 32 | public: 33 | 34 | ParallelFASTQ(void) 35 | :nrecords(0), elapsed_t(0) 36 | { 37 | fqr = create_fq_reader(); 38 | if (!fqr) 39 | fprintf(stderr,"Couldn't create fastq reader\n"); 40 | } 41 | 42 | ~ParallelFASTQ() 43 | { 44 | close_fq(fqr); 45 | destroy_fq_reader(fqr); 46 | } 47 | 48 | void open(const char *filename, bool cached_io, long knownSize = -1) 49 | { 50 | if(fqr->f) close_fq(fqr); 51 | open_fq(fqr, filename, cached_io); 52 | } 53 | 54 | int get_max_read_len() { 55 | return fqr->max_read_len; 56 | } 57 | 58 | size_t fill_block(vector & ids, vector & seqs, vector & quals, size_t maxMemoryUsed) 59 | { 60 | size_t memUsed = 0, avgMemPerRead = 0; 61 | Buffer id = initBuffer(MAX_READ_NAME_LEN); 62 | Buffer seq = initBuffer(DEFAULT_READ_LEN); 63 | Buffer qual = initBuffer(DEFAULT_READ_LEN); 64 | size_t records_read = 0; 65 | seqs.clear(); 66 | quals.clear(); 67 | ids.clear(); 68 | while ( memUsed + avgMemPerRead < maxMemoryUsed ) { 69 | if (!get_next_fq_record(fqr, id, seq, qual)) { 70 | elapsed_t += 0; 71 | freeBuffer(id); 72 | freeBuffer(seq); 73 | freeBuffer(qual); 74 | return records_read; 75 | } 76 | ids.push_back(getStartBuffer(id)); 77 | seqs.push_back(getStartBuffer(seq)); 78 | quals.push_back(getStartBuffer(qual)); 79 | records_read++; 80 | nrecords++; 81 | memUsed += getLengthBuffer(id) + getLengthBuffer(seq) + getLengthBuffer(qual) + 3 * sizeof(char*); 82 | avgMemPerRead = memUsed / records_read; 83 | } 84 | elapsed_t += 0; 85 | freeBuffer(id); 86 | freeBuffer(seq); 87 | freeBuffer(qual); 88 | return records_read; 89 | } 90 | 91 | int64_t getTotalRecordsRead() { return nrecords; } 92 | double get_elapsed_time() { return elapsed_t; } 93 | 94 | private: 95 | fq_reader_t fqr; 96 | int64_t nrecords; 97 | double elapsed_t; 98 | }; 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /kmercode/bound.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | //#include 24 | #include 25 | #include 26 | #include 27 | #include "bound.hpp" 28 | 29 | // GG: parallel factorial 30 | long double factorial(long double number) 31 | { 32 | long double fac = 1; 33 | #pragma omp parallel for reduction(*:fac) 34 | for(int n = 2; n <= (int)number; ++n) 35 | fac *= n; 36 | return fac; 37 | } 38 | 39 | // GG: depth, error rate, and k-mer length 40 | int computeUpper(int myCoverage, double errorRate, int kmerSize, double minProbability) 41 | { 42 | long double a, b, c; 43 | long double dfact = factorial(myCoverage); 44 | long double bbase = (1-errorRate); 45 | long double cbase = (1-pow(bbase, kmerSize)); 46 | long double probability = 1; 47 | long double sum = 0, prev; 48 | int m = myCoverage; 49 | 50 | while(sum < minProbability) 51 | { 52 | a = dfact / (factorial(m) * factorial(myCoverage - m)); 53 | b = pow(bbase, (m * kmerSize)); 54 | c = pow(cbase, (myCoverage - m)); 55 | 56 | probability = a * b * c; 57 | sum = sum + probability; 58 | 59 | if(sum == prev && sum < minProbability) 60 | break; 61 | --m; 62 | prev = sum; 63 | } 64 | return (m+1); 65 | } 66 | 67 | // GG: depth, error rate, and k-mer length 68 | int computeLower(int myCoverage, double errorRate, int kmerSize, double minProbability) 69 | { 70 | long double a, b, c; 71 | long double dfact = factorial(myCoverage); 72 | long double bbase = (1-errorRate); 73 | long double cbase = (1-pow(bbase, kmerSize)); 74 | long double probability = 1; 75 | long double sum = 0, prev; 76 | int mymin = 2; 77 | int m = mymin; 78 | 79 | while(sum < minProbability) 80 | { 81 | a = dfact / (factorial(m) * factorial(myCoverage - m)); 82 | b = pow(bbase, (m * kmerSize)); 83 | c = pow(cbase, (myCoverage - m)); 84 | 85 | probability = a * b * c; 86 | sum = sum + probability; 87 | 88 | if(sum == prev && sum < minProbability) 89 | break; 90 | ++m; 91 | prev = sum; 92 | } 93 | 94 | return std::max(m-1, mymin); 95 | } 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /kmercode/bound.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BELLA_KMERCODE_BOUND_H_ 2 | #define BELLA_KMERCODE_BOUND_H_ 3 | 4 | // GG: select upper and lower reliable bounds 5 | int computeUpper(int myCoverage, double errorRate, int kmerSize, double minProbability); 6 | int computeLower(int myCoverage, double errorRate, int kmerSize, double minProbability); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /kmercode/fq_reader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This can be used in either mpi or upc. Set USE_UPC_FOR_COMMON or USE_MPI_FOR_COMMON. 3 | */ 4 | 5 | #ifndef __FQ_READER_H 6 | #define __FQ_READER_H 7 | 8 | #include 9 | 10 | #ifndef NO_GZIP 11 | #include "zlib.h" 12 | #endif 13 | 14 | #include "Buffer.h" 15 | 16 | #ifndef FQ_READER_BUFFER_SIZE 17 | #define FQ_READER_BUFFER_SIZE 8192 18 | #endif 19 | 20 | #if defined (__cplusplus) 21 | extern "C" { 22 | #endif 23 | 24 | struct fq_reader { 25 | FILE *f; 26 | #ifndef NO_GZIP 27 | gzFile gz; 28 | #endif 29 | int64_t fpos; 30 | int64_t size; 31 | int64_t start_read; 32 | int64_t end_read; 33 | // using long long instead of int64_t prevents cross-platform format errors with printf 34 | long long line; 35 | Buffer buf; 36 | char name[MAX_FILE_PATH]; 37 | int max_read_len; 38 | }; 39 | 40 | typedef struct fq_reader *fq_reader_t; 41 | 42 | fq_reader_t create_fq_reader(void); 43 | void destroy_fq_reader(fq_reader_t fqr); 44 | void open_fq(fq_reader_t fqr, const char *fname, int cached_io); 45 | void close_fq(fq_reader_t fqr); 46 | //int get_next_fq_record_ptr(fq_reader_t fqr, char **id, char **nts, char **quals); 47 | void hexifyId(char *name, int64_t *id1, int64_t *id2, int64_t step); 48 | int get_next_fq_record(fq_reader_t fqr, Buffer id, Buffer nts, Buffer quals); 49 | int get_fq_name_dirn(char *header, char **name, int *end); 50 | 51 | int load_fq(fq_reader_t fqr, char *fname); 52 | int unload_fq(char *fname); 53 | 54 | int64_t estimate_fq(char *fname, int sampledReads, int64_t *estimatedReads, int64_t *estimatedBases); 55 | 56 | #if defined (__cplusplus) 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /kmercode/hash_funcs.h: -------------------------------------------------------------------------------- 1 | #ifndef HASH_FUNCS_H 2 | #define HASH_FUNCS_H 3 | 4 | #include 5 | 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | 12 | uint32_t rotl32(uint32_t x, int8_t r); 13 | 14 | uint64_t rotl64(uint64_t x, int8_t r); 15 | 16 | #define ROTL32(x,y) rotl32(x,y) 17 | #define ROTL64(x,y) rotl64(x,y) 18 | 19 | #define BIG_CONSTANT(x) (x##LLU) 20 | 21 | //----------------------------------------------------------------------------- 22 | // Block read - if your platform needs to do endian-swapping or can only 23 | // handle aligned reads, do the conversion here 24 | 25 | #define getblock(p, i) (p[i]) 26 | 27 | //----------------------------------------------------------------------------- 28 | // Finalization mix - force all bits of a hash block to avalanche 29 | 30 | uint64_t fmix64(uint64_t k); 31 | 32 | //----------------------------------------------------------------------------- 33 | 34 | void MurmurHash3_x64_128(const void * key, const uint32_t len, const uint32_t seed, void * out); 35 | 36 | 37 | //----------------------------------------------------------------------------- 38 | // If we need a smaller hash value, it's faster to just use a portion of the 39 | // 128-bit hash 40 | 41 | uint32_t MurmurHash3_x64_32(const void * key, uint32_t len); 42 | 43 | //---------- 44 | 45 | uint64_t MurmurHash3_x64_64(const void * key, uint32_t len); 46 | 47 | //----------------------------------------------------------------------------- 48 | 49 | // http://murmurhash.googlepages.com/MurmurHash2.cpp 50 | uint64_t murmur_hash2_32(const char * key, uint32_t len); 51 | 52 | uint64_t murmur_hash2_64(const void * key, uint32_t len); 53 | 54 | uint32_t SuperFastHash (const char * data, int len); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | 61 | 62 | #endif // HASH_FUNCS_H 63 | -------------------------------------------------------------------------------- /kmercode/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | #define KMERLONGS (MAX_KMER_SIZE/32) // 32 = numbits(uint64_t)/2- with 2 being the number of bits needed per nucleotide 8 | #define KMER_LENGTH 15 9 | 10 | #include "Kmer.hpp" 11 | #include "common.h" 12 | #include "ParallelFASTQ.h" 13 | 14 | struct filedata 15 | { 16 | char filename[MAX_FILE_PATH]; 17 | size_t filesize; 18 | }; 19 | 20 | vector< filedata > GetFiles(char * filename) 21 | { 22 | int64_t totalsize = 0; 23 | int numfiles = 0; 24 | vector< filedata > filesview; 25 | 26 | filedata fdata; 27 | ifstream allfiles(filename); 28 | if(!allfiles.is_open()) { 29 | cerr << "Could not open " << filename << endl; 30 | exit(1); 31 | } 32 | allfiles.getline(fdata.filename,MAX_FILE_PATH); 33 | while(!allfiles.eof()) 34 | { 35 | struct stat st; 36 | stat(fdata.filename, &st); 37 | fdata.filesize = st.st_size; 38 | 39 | filesview.push_back(fdata); 40 | std::cout << "inputFile: " << filesview.back().filename << std::endl; 41 | std::cout << "inputSize: " << filesview.back().filesize / (1024*1024) << " MB" << endl; 42 | allfiles.getline(fdata.filename,MAX_FILE_PATH); 43 | totalsize += fdata.filesize; 44 | numfiles++; 45 | } 46 | return filesview; 47 | } 48 | 49 | int main(int argc, char* argv[]) 50 | { 51 | Kmer::set_k(KMER_LENGTH); 52 | vector allfiles = GetFiles(argv[1]); 53 | size_t upperlimit = 1000; // a thousand reads at a time 54 | 55 | vector seqs; 56 | vector quals; 57 | for(auto itr= allfiles.begin(); itr != allfiles.end(); itr++) 58 | { 59 | ParallelFASTQ *pfq = new ParallelFASTQ(); 60 | pfq->open(itr->filename, false, itr->filesize); 61 | 62 | size_t fillstatus = 1; 63 | while(fillstatus) 64 | { 65 | fillstatus = pfq->fill_block(seqs, quals, upperlimit); 66 | size_t nreads = seqs.size(); 67 | 68 | for(size_t i=0; i< nreads; ++i) 69 | { 70 | size_t found; 71 | found = seqs[i].length(); 72 | 73 | // skip this sequence if the length is too short 74 | if (seqs[i].length() <= KMER_LENGTH) { 75 | continue; 76 | } 77 | int nkmers = (seqs[i].length()-KMER_LENGTH+1); 78 | 79 | 80 | std::vector kmers = Kmer::getKmers(seqs[i]); // calculate all the kmers 81 | assert(kmers.size() == nkmers); 82 | 83 | // Aydin: the following lines are just for debugging, comment out after you get a feeling of how it works 84 | cout << "printing the first k-mer and its reverse complement from this read: "; 85 | cout << kmers[0].toString() << " " << kmers[0].twin().toString() << endl; 86 | } 87 | 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /kmercode/makefile: -------------------------------------------------------------------------------- 1 | Buffer.o: Buffer.c 2 | gcc -O3 -c -o Buffer.o Buffer.c 3 | 4 | fq_reader.o: fq_reader.c 5 | gcc -O3 -c -o fq_reader.o fq_reader.c 6 | 7 | hash_funcs.o: hash_funcs.c 8 | gcc -O3 -c -o hash_funcs.o hash_funcs.c 9 | 10 | Kmer.o: Kmer.cpp 11 | g++ -std=c++11 -O3 -c -o Kmer.o Kmer.cpp 12 | 13 | parse: main.cpp hash_funcs.o fq_reader.o Buffer.o Kmer.o 14 | g++ -std=c++11 -O3 -o parse hash_funcs.o Kmer.o Buffer.o fq_reader.o main.cpp 15 | 16 | clean: 17 | rm -f *.o 18 | rm -f parse 19 | -------------------------------------------------------------------------------- /kmercode/usage: -------------------------------------------------------------------------------- 1 | make parse 2 | ./parse listofdata.txt 3 | 4 | -------------------------------------------------------------------------------- /libbloom/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /libbloom/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | message("Building libbloom") 3 | add_subdirectory(murmur2) 4 | include_directories(murmur2) 5 | 6 | if(HIPMER_BLOOM64) 7 | add_library(LIBBLOOM-NOUPC OBJECT bloom64.c) 8 | add_library(LIBBLOOM OBJECT bloom64.c) 9 | else() 10 | add_library(LIBBLOOM-NOUPC OBJECT bloom.c) 11 | add_library(LIBBLOOM OBJECT bloom.c) 12 | add_library(LIBBLOOM OBJECT bloom.c) 13 | endif() 14 | 15 | if (UPC_ALLOCATOR) 16 | target_compile_definitions(LIBBLOOM PUBLIC -DUPC_ALLOCATOR=${UPC_ALLOCATOR}) 17 | endif() 18 | 19 | 20 | -------------------------------------------------------------------------------- /libbloom/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2012, Jyri J. Virkki 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /libbloom/Makefile: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 2012, Jyri J. Virkki 3 | # All rights reserved. 4 | # 5 | # This file is under BSD license. See LICENSE file. 6 | # 7 | # By default, builds optimized 64bit libbloom (under ./build) 8 | # Requires GNU Make, so invoke appropriately (make or gmake) 9 | # 10 | # Other build options: 11 | # 12 | # DEBUG=1 make to build debug instead of optimized 13 | # 14 | # Other build targets: 15 | # 16 | # make test to build and run test code 17 | # make gcov to build with code coverage and run gcov 18 | # make lint to run lint 19 | # make clean the usual 20 | # 21 | 22 | TOP := $(shell /bin/pwd) 23 | BUILD_OS := $(shell uname) 24 | 25 | BUILD=$(TOP)/build 26 | INC=-I$(TOP) -I$(TOP)/murmur2 27 | CC=g++ -Wall ${OPT} 28 | 29 | 30 | ifeq ($(DEBUG),1) 31 | OPT=-g $(DEBUGOPT) 32 | else 33 | OPT=-O3 34 | endif 35 | 36 | 37 | all: $(BUILD)/libbloom.a 38 | 39 | $(BUILD)/libbloom.a: $(BUILD)/murmurhash2.o $(BUILD)/bloom64.o 40 | (cd $(BUILD) && ar rcs libbloom.a bloom64.o murmurhash2.o) 41 | ranlib $(BUILD)/libbloom.a 42 | 43 | $(BUILD)/test-libbloom: $(BUILD)/libbloom.a $(BUILD)/test.o 44 | (cd $(BUILD) && $(CC) test.o -L$(BUILD) -lbloom -o test-libbloom) 45 | 46 | $(BUILD)/%.o: %.cpp 47 | mkdir -p $(BUILD) 48 | $(CC) $(INC) -c $< -o $@ 49 | 50 | $(BUILD)/murmurhash2.o: murmur2/MurmurHash2.c murmur2/murmurhash2.h 51 | mkdir -p $(BUILD) 52 | $(CC) $(INC) -c murmur2/MurmurHash2.c -o $(BUILD)/murmurhash2.o 53 | 54 | clean: 55 | rm -rf $(BUILD) 56 | 57 | lint: 58 | lint -x -errfmt=simple $(INC) $(LIB) *.c murmur2/*.c 59 | 60 | test: $(BUILD)/test-libbloom 61 | $(BUILD)/test-libbloom 62 | 63 | gcov: 64 | $(MAKE) clean 65 | DEBUG=1 DEBUGOPT="-fprofile-arcs -ftest-coverage" $(MAKE) all 66 | (cd $(BUILD) && \ 67 | cp ../*.c . && \ 68 | ./test-libbloom && \ 69 | gcov -bf bloom64.cpp) 70 | @echo Remember to make clean to remove instrumented objects 71 | -------------------------------------------------------------------------------- /libbloom/README: -------------------------------------------------------------------------------- 1 | 2 | Introduction 3 | ------------ 4 | This is libbloom, a simple and small bloom filter implementation in C. 5 | 6 | If you are reading this you probably already know about bloom filters 7 | and why you might use one. If not, the wikipedia article is a good intro: 8 | http://en.wikipedia.org/wiki/Bloom_filter 9 | 10 | 11 | Building 12 | -------- 13 | The Makefile assumes GNU Make, so run 'make' or 'gmake' as appropriate 14 | on your system. 15 | 16 | By default it builds an optimized 32bit libbloom. See Makefile comments 17 | for other build options. 18 | 19 | The shared library will be in ./build/libbloom.so 20 | 21 | 22 | Sample Usage 23 | ------------ 24 | 25 | #include "bloom.h" 26 | 27 | struct bloom bloom; 28 | bloom_init(&bloom, 1000000, 0.01); 29 | bloom_add(&bloom, buffer, buflen); 30 | 31 | if (bloom_check(&bloom, buffer, buflen)) { 32 | printf("It may be there!\n"); 33 | } 34 | 35 | 36 | Documentation 37 | ------------- 38 | Read bloom.h for more detailed documentation on the public interfaces. 39 | 40 | 41 | License 42 | ------- 43 | This code (except MurmurHash2) is under BSD license. See LICENSE file. 44 | 45 | See murmur2/README for info on MurmurHash2. 46 | -------------------------------------------------------------------------------- /libbloom/murmur2/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_library(MURMURHASH OBJECT MurmurHash2.c) 3 | 4 | -------------------------------------------------------------------------------- /libbloom/murmur2/MurmurHash2.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // MurmurHash2, by Austin Appleby 3 | 4 | // Note - This code makes a few assumptions about how your machine behaves - 5 | 6 | // 1. We can read a 4-byte value from any address without crashing 7 | // 2. sizeof(int) == 4 8 | 9 | // And it has a few limitations - 10 | 11 | // 1. It will not work incrementally. 12 | // 2. It will not produce the same results on little-endian and big-endian 13 | // machines. 14 | 15 | unsigned int murmurhash2(const void * key, int len, const unsigned int seed) 16 | { 17 | // 'm' and 'r' are mixing constants generated offline. 18 | // They're not really 'magic', they just happen to work well. 19 | 20 | const unsigned int m = 0x5bd1e995; 21 | const int r = 24; 22 | 23 | // Initialize the hash to a 'random' value 24 | 25 | unsigned int h = seed ^ len; 26 | 27 | // Mix 4 bytes at a time into the hash 28 | 29 | const unsigned char * data = (const unsigned char *)key; 30 | 31 | while(len >= 4) 32 | { 33 | unsigned int k = *(unsigned int *)data; 34 | 35 | k *= m; 36 | k ^= k >> r; 37 | k *= m; 38 | 39 | h *= m; 40 | h ^= k; 41 | 42 | data += 4; 43 | len -= 4; 44 | } 45 | 46 | // Handle the last few bytes of the input array 47 | 48 | switch(len) 49 | { 50 | case 3: h ^= data[2] << 16; 51 | case 2: h ^= data[1] << 8; 52 | case 1: h ^= data[0]; 53 | h *= m; 54 | }; 55 | 56 | // Do a few final mixes of the hash to ensure the last few 57 | // bytes are well-incorporated. 58 | 59 | h ^= h >> 13; 60 | h *= m; 61 | h ^= h >> 15; 62 | 63 | return h; 64 | } 65 | -------------------------------------------------------------------------------- /libbloom/murmur2/README: -------------------------------------------------------------------------------- 1 | 2 | MurmurHash2.c is taken from 3 | 4 | http://sites.google.com/site/murmurhash/ 5 | 6 | According to the above document: 7 | 8 | All code is released to the public domain. For business purposes, 9 | Murmurhash is under the MIT license. 10 | -------------------------------------------------------------------------------- /libbloom/murmur2/murmurhash2.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _BLOOM_MURMURHASH2 3 | #define _BLOOM_MURMURHASH2 4 | 5 | unsigned int murmurhash2(const void * key, int len, const unsigned int seed); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /libcuckoo/cuckoohash_config.hh: -------------------------------------------------------------------------------- 1 | /** \file */ 2 | 3 | #ifndef _CUCKOOHASH_CONFIG_HH 4 | #define _CUCKOOHASH_CONFIG_HH 5 | 6 | #include 7 | #include 8 | 9 | //! The default maximum number of keys per bucket 10 | constexpr size_t LIBCUCKOO_DEFAULT_SLOT_PER_BUCKET = 4; 11 | 12 | //! The default number of elements in an empty hash table 13 | constexpr size_t LIBCUCKOO_DEFAULT_SIZE = 14 | (1U << 16) * LIBCUCKOO_DEFAULT_SLOT_PER_BUCKET; 15 | 16 | //! The default minimum load factor that the table allows for automatic 17 | //! expansion. It must be a number between 0.0 and 1.0. The table will throw 18 | //! libcuckoo_load_factor_too_low if the load factor falls below this value 19 | //! during an automatic expansion. 20 | constexpr double LIBCUCKOO_DEFAULT_MINIMUM_LOAD_FACTOR = 0.05; 21 | 22 | //! An alias for the value that sets no limit on the maximum hashpower. If this 23 | //! value is set as the maximum hashpower limit, there will be no limit. This 24 | //! is also the default initial value for the maximum hashpower in a table. 25 | constexpr size_t LIBCUCKOO_NO_MAXIMUM_HASHPOWER = 26 | std::numeric_limits::max(); 27 | 28 | //! set LIBCUCKOO_DEBUG to 1 to enable debug output 29 | #define LIBCUCKOO_DEBUG 0 30 | 31 | #endif // _CUCKOOHASH_CONFIG_HH 32 | -------------------------------------------------------------------------------- /loganGPU/logan.cuh: -------------------------------------------------------------------------------- 1 | //================================================================== 2 | // Title: Cuda x-drop seed-and-extend alignment algorithm 3 | // Author: G. Guidi, A. Zeni 4 | // Date: 6 March 2019 5 | //================================================================== 6 | 7 | #ifndef __LOGAN_CUH__ 8 | #define __LOGAN_CUH__ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include"seed.cuh" 20 | #include"score.cuh" 21 | #include"functions.cuh" 22 | //#include 23 | //#include 24 | //#include 25 | //#include 26 | //#include 27 | //#include 28 | 29 | // ======================================= // 30 | // GPU STRUCT // 31 | // ======================================= // 32 | 33 | struct loganResult { 34 | int score; 35 | std::string strand; 36 | SeedL seed; 37 | }; 38 | 39 | // __inline__ __device__ short simple_max(int *antidiag, int &dim, int &offset); 40 | // __inline__ __device__ void warpReduce(volatile int *input, int myTId); 41 | // __inline__ __device__ short warpReduceMax(short val); 42 | // __inline__ __device__ short blockReduceMax(short val); 43 | // __inline__ __device__ int reduce_max(int *antidiag); 44 | // __inline__ __device__ void updateExtendedSeedL(SeedL& seed, ExtensionDirectionL direction, int &cols, int &rows, int &lowerDiag, int &upperDiag); 45 | // __inline__ __device__ void computeAntidiag(int *antiDiag1, int *antiDiag2, int *antiDiag3, char* querySeg, char* databaseSeg, int &best, int &scoreDropOff, int &cols, int &rows, int &minCol, int &maxCol, int &antiDiagNo, int &offset1, int &offset2, ExtensionDirectionL direction); 46 | // __inline__ __device__ void calcExtendedLowerDiag(int *lowerDiag, int const &minCol, int const &antiDiagNo); 47 | // __inline__ __device__ void calcExtendedUpperDiag(int *upperDiag, int const &maxCol, int const &antiDiagNo); 48 | // __inline__ __device__ void initAntiDiag3(int *antiDiag3, int *a3size, int const &offset, int const &maxCol, int const &antiDiagNo, int const &minScore, int const &gapCost, int const &undefined); 49 | // __inline__ __device__ void initAntiDiags(int *antiDiag1,int *antiDiag2,int *antiDiag3,int *a2size,int *a3size,int const &dropOff,int const &gapCost,int const &undefined); 50 | // __global__ void extendSeedLGappedXDropOneDirection( SeedL *seed, char *querySegArray, char *databaseSegArray, ExtensionDirectionL direction, int scoreDropOff, int *res, int *qL, int *dbL, int *offsetQuery, int *offsetTarget); 51 | // inline void extendSeedL(vector &seeds, ExtensionDirectionL direction, vector &target, vector &query, vector &penalties, int const& XDrop, int const& kmer_length); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /makefile-mac: -------------------------------------------------------------------------------- 1 | RMATPATH = mtspgemm2017/GTgraph/R-MAT 2 | SPRNPATH = mtspgemm2017/GTgraph/sprng2.0-lite 3 | SEQANPATH = seqan 4 | include mtspgemm2017/GTgraph/Makefile.var 5 | INCLUDE = -I$(SPRNPATH)/include #-I$(CURDIR)/libgaba 6 | SEQINCLUDE = -I$(SEQANPATH) 7 | MLKINCLUDE = -I/opt/intel/composer_xe_2015.0.039/mkl/include 8 | LIBPATH = -L/opt/intel/composer_xe_2015.0.039/mkl/lib 9 | COMPILER = g++ 10 | CC = gcc 11 | CFLAGS = -I. -O3 -W -Wall -Wextra -pedantic -ansi -c 12 | #SEQFLAGS = -DSEQAN_ARCH_SSE4=1 -DSEQAN_ARCH_AVX2=1 -DSEQAN_BGZF_NUM_THREADS=1 13 | 14 | sprng: 15 | (cd $(SPRNPATH); $(MAKE); cd ../..) 16 | 17 | rmat: sprng 18 | (cd $(RMATPATH); $(MAKE); cd ../..) 19 | 20 | LIBS = -L$(CURDIR)/libbloom/build -lbloom #-L$(CURDIR)/libgaba -lgaba 21 | 22 | Buffer.o: kmercode/Buffer.c 23 | $(CC) -O3 -fopenmp -c -o Buffer.o kmercode/Buffer.c 24 | 25 | bound.o: kmercode/bound.cpp 26 | $(CC) -O3 -fopenmp -c -o bound.o kmercode/bound.cpp 27 | 28 | fq_reader.o: kmercode/fq_reader.c 29 | $(CC) -O3 -std=gnu99 -fopenmp -c -o fq_reader.o kmercode/fq_reader.c 30 | 31 | hash_funcs.o: kmercode/hash_funcs.c 32 | $(CC) -O3 -fopenmp -c -o hash_funcs.o kmercode/hash_funcs.c 33 | 34 | bloomlib: 35 | $(MAKE) -C libbloom all 36 | 37 | #gabalib: 38 | # $(MAKE) -C libgaba all 39 | 40 | optlist.o: optlist/optlist.c optlist/optlist.h 41 | $(CC) $(CFLAGS) $< 42 | 43 | Kmer.o: kmercode/Kmer.cpp 44 | $(COMPILER) -fopenmp -std=c++11 -O3 -c -o Kmer.o kmercode/Kmer.cpp 45 | 46 | # flags defined in mtspgemm2017/GTgraph/Makefile.var 47 | bella: main.cpp hash_funcs.o fq_reader.o Buffer.o Kmer.o bound.o optlist.o rmat bloomlib 48 | #gabalib 49 | $(COMPILER) -std=c++14 -O3 $(INCLUDE) -march=native -fopenmp -fpermissive $(SEQINCLUDE) -o bella hash_funcs.o Kmer.o Buffer.o fq_reader.o bound.o optlist.o main.cpp ${LIBS} 50 | # makes evaluation 51 | result: 52 | (cd bench; make result; cd ..) 53 | # add -D__LIBCUCKOO_SERIAL to run lubcuckoo in a single thread 54 | clean: 55 | (cd mtspgemm2017/GTgraph; make clean; cd ../..) 56 | rm -f *.o 57 | rm -f bella 58 | $(MAKE) -C libbloom clean 59 | $(MAKE) -C libgaba clean 60 | -------------------------------------------------------------------------------- /makefile-nersc: -------------------------------------------------------------------------------- 1 | RMATPATH = include/common/GTgraph/R-MAT 2 | SPRNPATH = include/common/GTgraph/sprng2.0-lite 3 | SEQANPATH = seqan 4 | CXXOPTPATH = cxxopts 5 | LOGANPATH = loganGPU 6 | XAVIER_DIR=xavier 7 | include include/common/GTgraph/Makefile.var 8 | INCLUDE = -I$(SPRNPATH)/include -I$(LOGANPATH) -I$(SEQANPATH) # -I${XAVIER_DIR}/include 9 | MLKINCLUDE = -I/opt/intel/composer_xe_2015.0.039/mkl/include 10 | LIBPATH = -L/opt/intel/composer_xe_2015.0.039/mkl/lib 11 | 12 | COMPILER = g++ 13 | COMPILER_GPU = nvcc 14 | CUDAFLAGS = -arch=sm_70 -O3 -maxrregcount=32 -std=c++14 -Xcompiler -fopenmp -w 15 | CC = gcc 16 | #ASFLAGS = -fsanitize=address -fsanitize-address-use-after-scope 17 | 18 | CFLAGS =-std=c++11 -fpermissive -w -O3 -I. -c 19 | PARCFLAGS = -O3 -fopenmp -c 20 | 21 | CFLAGS += $(ASFLAGS) 22 | PARCFLAGS += $(ASFLAGS) 23 | ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 24 | 25 | sprng: 26 | (cd $(SPRNPATH); $(MAKE); cd ../..) 27 | 28 | cxxopt: 29 | (cd $(CXXOPTPATH); cmake .; $(MAKE); cd ..) 30 | 31 | rmat: sprng 32 | (cd $(RMATPATH); $(MAKE); cd ../..) 33 | 34 | LIBS = -L$(CURDIR)/libbloom/build -lbloom -lpthread -lbz2 -lz 35 | 36 | Buffer.o: kmercode/Buffer.c 37 | $(CC) $(PARCFLAGS) -o Buffer.o kmercode/Buffer.c 38 | 39 | fq_reader.o: kmercode/fq_reader.c 40 | $(CC) $(PARCFLAGS) -std=gnu99 -o fq_reader.o kmercode/fq_reader.c 41 | 42 | hash_funcs.o: kmercode/hash_funcs.c 43 | $(CC) $(PARCFLAGS) -o hash_funcs.o kmercode/hash_funcs.c 44 | 45 | bloomlib: 46 | $(MAKE) -C libbloom all 47 | 48 | xavierlib: 49 | $(MAKE) -C libbloom all 50 | 51 | optlist.o: optlist/optlist.c optlist/optlist.h 52 | $(CC) $(CFLAGS) $< 53 | 54 | Kmer.o: kmercode/Kmer.cpp 55 | $(COMPILER) $(PARCFLAGS) -std=c++11 -o Kmer.o kmercode/Kmer.cpp 56 | 57 | # flags defined in include/common/GTgraph/Makefile.var 58 | bella: src/main.cpp hash_funcs.o fq_reader.o Buffer.o Kmer.o optlist.o rmat bloomlib 59 | $(COMPILER) -std=c++14 -w -O3 $(ASFLAGS) $(INCLUDE) -mavx2 -fopenmp -fpermissive -o bella hash_funcs.o Kmer.o Buffer.o fq_reader.o optlist.o src/main.cpp ${LIBS} 60 | 61 | # GPU build 62 | bella-gpu: src/main.cu hash_funcs.o fq_reader.o Buffer.o Kmer.o optlist.o rmat bloomlib 63 | $(COMPILER_GPU) $(CUDAFLAGS) $(INCLUDE) -o bella hash_funcs.o Kmer.o Buffer.o fq_reader.o optlist.o src/main.cu ${LIBS} -D__NVCC__ 64 | 65 | # makes evaluation 66 | result: 67 | (cd benchmark; make result; cd ..) 68 | # add -D__LIBCUCKOO_SERIAL to run lubcuckoo in a single thread 69 | clean: 70 | (cd include/common/GTgraph; make clean; cd ../..) 71 | rm -f *.o 72 | rm -f bella 73 | $(MAKE) -C libbloom clean 74 | -------------------------------------------------------------------------------- /sanitytests/reversecomptest.txt: -------------------------------------------------------------------------------- 1 | sanitytests/reversecomptest.fastq 2 | -------------------------------------------------------------------------------- /script/README.md: -------------------------------------------------------------------------------- 1 | # Compile BELLA and its evaluation program: 2 | 3 | ``` 4 | make bella 5 | cd bench 6 | make result 7 | cd .. 8 | ``` 9 | 10 | # Run pipeline script 11 | 12 | Pipeline script is dataset-specific right now, to run with a different dataset, make a copy and modify the path in the script accordingly. 13 | 14 | ``` 15 | ./run-bella-pipeline.sh 16 | ``` 17 | 18 | ```window-size``` has to be specified and = 0 when using regular k-mer. 19 | -------------------------------------------------------------------------------- /script/SAMparser.py: -------------------------------------------------------------------------------- 1 | from simplesam import Reader, Writer 2 | import inspect 3 | import sys, os, fileinput, string 4 | 5 | in_file = open(sys.argv[1], 'r') 6 | in_sam = Reader(in_file) 7 | out_file = open('full_ecoli_mapped_q10_truth.txt', 'w') 8 | # out_sam = Writer(out_file) 9 | 10 | x = next(in_sam) 11 | 12 | try: 13 | while(x.qname != ''): 14 | #if(x.reverse): 15 | # out_file.write("+" + " ") 16 | #else: 17 | # out_file.write("-" + " ") 18 | out_file.write(x.rname + " ") 19 | out_file.write(x.qname + " ") 20 | out_file.write(str(x.pos) + " ") 21 | out_file.write(str(x.pos + len(x.seq)) + "\n") 22 | #print str(type(x)) 23 | x = next(in_sam) 24 | except: 25 | print("Long read alignment ground truth generated") 26 | 27 | in_file.close() 28 | out_file.close() -------------------------------------------------------------------------------- /script/morescript/README.md: -------------------------------------------------------------------------------- 1 | ## Getting Started 2 | 3 | These instructions will guide you throught the utilization of the scripts we developed related to the main project, [BELLA](https://github.com/giuliaguidi/bella). 4 | 5 | ## Overlapping Feasibility via Markov Chain Model 6 | 7 | In the paper, we present a theory on how k-mers (subsequences) can be used to anchor alignments between two long reads, allowing an accurate overlap discovery among all the reads in a dataset. 8 | To run the script implementing the Markov Chain Model we developed to show the overlapping feasibility, do: 9 | ``` 10 | python exactMarkov.py 11 | ``` 12 | The default function setting is: 13 | ```python 14 | func(overlap=500, p=0.85, k=17) 15 | ``` 16 | 17 | The program with default setting computes the probability to get 17 consecutive successes on both the sequences given an overlap length of 500bp and a sequencing success probability equal to 0.85. 18 | 19 | ## Scripts for Consolidating dAligner alignment results in BELLA format 20 | 21 | ``` 22 | Run translateDalignerOut.sh with a script specifiying the desired local alignments (.las file) and corresponding (DAZZ_DB) database instance, 23 | along with the necessary executables. (The full detailed requirements list is specified in translateDalignerOut.sh). 24 | An example setup script (for NERSC's Cori) is example-environment-script.sh. 25 | ``` 26 | 27 | ## Authors 28 | 29 | * [**Giulia Guidi**](https://linkedin.com/in/giulia-guidi/) 30 | * [**Aydın Buluç**](https://people.eecs.berkeley.edu/~aydin/) 31 | * [**Marquita Ellis**](http://crd.lbl.gov/departments/computer-science/CLaSS/class-staff/marquita-ellis/) 32 | 33 | ## Contributors 34 | 35 | * [**Daniel Rokhsar**](https://mcb.berkeley.edu/labs/rokhsar/) 36 | * [**Katherine Yelick**](https://people.eecs.berkeley.edu/~yelick/?_ga=2.137275831.646808918.1523950603-1375276454.1515506755) 37 | 38 | ## Copyright Notice 39 | 40 | Berkeley Efficient Long-Read to Long-Read Aligner and Overlapper (BELLA), Copyright (c) 2018, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy) Giulia Guidi and Marco Santambrogio. All rights reserved. 41 | 42 | If you have questions about your rights to use or distribute this software, please contact Berkeley Lab's Innovation & Partnerships Office at IPO@lbl.gov. 43 | 44 | NOTICE. This Software was developed under funding from the U.S. Department of Energy and the U.S. Government consequently retains certain rights. As such, the U.S. Government has been granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the Software to reproduce, distribute copies to the public, prepare derivative works, and perform publicly and display publicly, and to permit other to do so. 45 | 46 | ## Acknowledgments 47 | 48 | Funding provided in part by DOE ASCR through the Exascale Computing Project, and computing provided by NERSC. Thanks to Rob Egan and Steven Hofmeyr for discussion. 49 | -------------------------------------------------------------------------------- /script/morescript/chainedMarkov.py: -------------------------------------------------------------------------------- 1 | # 2 | # @author: Giulia Guidi 3 | # 4 | 5 | import numpy as np 6 | import matplotlib.patches as mpatches 7 | import matplotlib.pyplot as plt 8 | 9 | # 10 | # Nested Markov Chain transition matrix to get the probability of having 2 (k) consecutive correct k-mers on two different 11 | # sequences given an overlap (t) between the two sequences and the probability of having a correct base (p) 12 | # NOTE: k-mers are found in the same location 13 | # 14 | 15 | def nmc(L, p, k, w): 16 | states = w*k+1 17 | transixMat = np.zeros((states, states)) 18 | for i in range(w): 19 | for j in range(k): 20 | transixMat[j+i*k, i*k] = (1-p*p) 21 | transixMat[j+i*k, j+i*k + 1] = p*p 22 | transixMat[k*w, k*w] = 1.0 23 | # print(transixMat) 24 | return np.linalg.matrix_power(transixMat, L)[0, w*k] 25 | 26 | ksize=17 27 | pcorr=0.85 28 | 29 | ## data generation 30 | 31 | # probs1 = [nmc(L=i, p=pcorr, k=ksize, w=1) for i in range(2000, 13005, 500)] 32 | # probs1 = np.asarray(probs1) 33 | 34 | # probs2 = [nmc(L=i, p=pcorr, k=ksize, w=2) for i in range(2000, 13005, 500)] 35 | # probs2 = np.asarray(probs2) 36 | 37 | # probs3 = [nmc(L=i, p=pcorr, k=ksize, w=3) for i in range(2000, 13005, 500)] 38 | # probs3 = np.asarray(probs3) 39 | 40 | # probs4 = [nmc(L=i, p=pcorr, k=ksize, w=4) for i in range(2000, 13005, 500)] 41 | # probs4 = np.asarray(probs4) 42 | 43 | # probs5 = [nmc(L=i, p=pcorr, k=ksize, w=5) for i in range(2000, 13005, 500)] 44 | # probs5 = np.asarray(probs5) 45 | 46 | # probs6 = [nmc(L=i, p=pcorr, k=ksize, w=6) for i in range(2000, 13005, 500)] 47 | # probs6 = np.asarray(probs6) 48 | 49 | # plt.hlines(0.90, 2000, 13000, colors='red', linestyles='--', label='0.90') 50 | 51 | # plt.plot(np.arange(2000, 13005, 500), probs1, color='black', label='BMC') 52 | # plt.plot(np.arange(2000, 13005, 500), probs2, color='royalblue', label='2-states NMC') 53 | # plt.plot(np.arange(2000, 13005, 500), probs3, color='darkorchid', label='3-states NMC') 54 | # plt.plot(np.arange(2000, 13005, 500), probs4, color='green', label='4-states NMC') 55 | # plt.plot(np.arange(2000, 13005, 500), probs5, color='darkorange', label='5-states NMC') 56 | # plt.plot(np.arange(2000, 13005, 500), probs6, color='firebrick', label='6-states NMC') 57 | # plt.title('Nested Markov Chain') 58 | # plt.xlabel('Overlap Length') 59 | # plt.ylabel('Cumulative Probability') 60 | # plt.legend() 61 | # plt.show() 62 | 63 | # 64 | # End of program 65 | # -------------------------------------------------------------------------------- /script/morescript/checkOutput.py: -------------------------------------------------------------------------------- 1 | #======================================================================= 2 | # Title: Python script to compare diBELLA and BELLA (alignment) output 3 | # Author: G. Guidi 4 | # Date: 11 Feb 2019 5 | #======================================================================= 6 | 7 | # Run: python3 checkOutput.py 8 | # file1 is supposed to be the query and file2 the reference 9 | 10 | import csv 11 | import sys 12 | import os 13 | import random 14 | 15 | cwd = os.getcwd() 16 | pair = {} 17 | list1 = [] # Reference pair names 18 | list2 = [] # Query pair names 19 | 20 | with open(sys.argv[1], 'r') as one, open(sys.argv[2], 'r') as two: 21 | # Here, we compare only read names, not alignment scores, etc. 22 | file1 = csv.reader(one, delimiter='\t') 23 | for row in file1: 24 | pair = [(row[0], row[1])] 25 | list1.append(pair) 26 | pair = [(row[1], row[0])] # Check reversed pair 27 | list1.append(pair) 28 | file2 = csv.reader(two, delimiter=' ') 29 | for row in file2: 30 | pair = [(row[2], row[3])] # diBELLA has names in position 2,3 31 | list2.append(pair) 32 | pair = [(row[3], row[2])] # Check reversed pair 33 | list2.append(pair) 34 | 35 | m = 0 36 | e = 0 37 | lines = 0 38 | randid = random.randint(1,100000) 39 | 40 | with open(cwd + '/missingPairj' + str(randid) + '.out', 'w') as missingPair: 41 | for pair in list1: # BELLA/reference 42 | lines = lines + 1 43 | if pair not in list2: # diBELLA/query 44 | for a, b in pair: 45 | missingPair.write(a + '\t' + b + '\n') 46 | m = m + 1 # number of missing lines 47 | 48 | with open(cwd + '/extraPairj' + str(randid) + '.out', 'w') as extraPair: 49 | for pair in list2: # diBELLA/query 50 | if pair not in list1: # BELLA/reference 51 | for a, b in pair: 52 | extraPair.write(a + '\t' + b + '\n') 53 | e = e + 1 # number of missing lines 54 | 55 | print(lines, "lines in BELLA (reference)") 56 | print(m, "missing lines in diBELLA (query)") 57 | print(e, "extra lines in diBELLA (query)") 58 | 59 | -------------------------------------------------------------------------------- /script/morescript/daligner_scripts/example-translation-environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | module unload python 3 | module avail python 4 | module load python/3.6-anaconda-5.2 #Cori 5 | module list #documentation 6 | set -x 7 | 8 | # path should contain path to DALIGNER and DAZZ_DB binaries 9 | SOFT=/global/common/software/m2865/bella-proj/bin 10 | export PATH=$SOFT:$PATH 11 | 12 | REPO=~/bella 13 | PYPARSE=$REPO/analysis/daligner_scripts/parserLAdump.py 14 | PYZIP=$REPO/analysis/daligner_scripts/zip_tag.py 15 | 16 | # don't forget to specify DBNAME for the run! 17 | 18 | -------------------------------------------------------------------------------- /script/morescript/daligner_scripts/run_daligner.slurm: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | # 3 | # Example slurm script for running daligner on Cori Haswell. 4 | # 5 | #SBATCH -N 1 6 | #SBATCH -t 00:30:00 7 | #SBATCH --time-min 00:30:00 8 | #SBATCH -L SCRATCH 9 | #SBATCH -C haswell 10 | set -x 11 | LOGICAL_CORES=64 12 | DATA_PATH=$CSCRATCH/pacbio_ecoli30x_ncbi #/pacbio_ecoli30x/ 13 | DATA=reads-ecoli-30x-full #pacbio_filtered 14 | K="" #"-k17" # form is e.g. -k17 15 | L="" # form is e.g. -l2000 # local alignments will involve 2000 base pairs 16 | DALIGNER_PARAMS="${K} ${L} -A -T"${LOGICAL_CORES} 17 | RUNDIR=$CSCRATCH/daligner${K}${L}_j${SLURM_JOB_ID} 18 | 19 | # ENV_SCRIPT should update PATH to include seqtk, DAZZ_DB, and DALIGNER binaries 20 | ENV_SCRIPT=~/bella/analysis/daligner_scripts/example-translation-environment.sh 21 | source $ENV_SCRIPT 22 | 23 | mkdir $RUNDIR 24 | cd ${RUNDIR} 25 | cp $0 ./ #documentation 26 | 27 | #only need to run the dazz_db setup once per directory 28 | seqtk seq -a ${DATA_PATH}/${DATA}.fastq > ${DATA}.fasta 29 | fasta2DB ${DATA} ${DATA}.fasta 30 | DBsplit ${DATA} 31 | 32 | HPC.daligner ${DALIGNER_PARAMS} ${DATA} > align.sh && \ 33 | time sh align.sh 34 | 35 | # The following can now be run (ideally in another batch job) to extract and reformat daligner's alignments into bella's format 36 | #DBNAME=${DATA} PATHTRANS=$HOME/bella/analysis/daligner_scripts/translateDalignerOut.sh translation-environment.sh 37 | 38 | -------------------------------------------------------------------------------- /script/morescript/daligner_scripts/run_daligner_celegans.slurm: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | # 3 | # Example slurm script for running daligner with celegans (multiple input files) 4 | # on Cori Haswell. 5 | # 6 | #SBATCH -N 1 7 | #SBATCH -t 04:00:00 8 | #SBATCH --time-min 00:00:30 9 | #SBATCH -L SCRATCH 10 | #SBATCH -C haswell 11 | 12 | set -x 13 | LOGICAL_CORES=32 14 | DATA_PATH=$CSCRATCH/pacbio_celegans 15 | DATA_FILES=${DATA_PATH}/all_fastq.txt 16 | DATA=celegans 17 | 18 | K="" #"-k17" # form is e.g. -k17 19 | L="" # form is e.g. -l2000 # local alignments will involve 2000 base pairs 20 | DALIGNER_PARAMS="${K} ${L} -A -T"${LOGICAL_CORES} 21 | RUNDIR=$CSCRATCH/daligner${K}${L}_j${SLURM_JOB_ID} 22 | 23 | # should update PATH to include bins for DAZZ_DB, DALIGNER, and seqtk 24 | ENV_SCRIPT=~/bella/analysis/daligner_scripts/example-translation-environment.sh 25 | source $ENV_SCRIPT 26 | 27 | mkdir $RUNDIR 28 | cd ${RUNDIR} 29 | cp $0 ./ #documentation 30 | 31 | #only need to run the dazz_db setup once per directory 32 | cat ${DATA_FILES} | 33 | while read NAME; do 34 | seqtk seq -a ${DATA_PATH}/${NAME} > ${NAME}.fasta # changed to -A in seqtk v1.2-8-gd210c57 35 | fasta2DB ${DATA} ${NAME}.fasta 36 | done 37 | DBsplit ${DATA} 38 | 39 | HPC.daligner ${DALIGNER_PARAMS} ${DATA} > align.sh && \ 40 | time sh align.sh 41 | 42 | -------------------------------------------------------------------------------- /script/morescript/daligner_scripts/tinytest.dump: -------------------------------------------------------------------------------- 1 | + P 2 2 | % P 4768 3 | P 1 315 n . 4 | L 18722 16683 5 | C 3596 8194 4464 9184 6 | P 1 315 n . 7 | L 18722 16683 8 | C 3596 8201 5515 10267 9 | -------------------------------------------------------------------------------- /script/morescript/daligner_scripts/translateDalignerOut.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Outputs alignment results from DALIGNER (with supplementary information from DAZZ_DB) in bella format, 4 | # ASSUMING alignment results have been generated and the below requirements have been met. 5 | # 6 | # Requires 7 | # (1) DBNAME to be set externally to the name of the database with which daligner was run. 8 | # (2) LAS to be set externally to e.g. LAS=$DBNAME".las" 9 | # (3) PYPARSE and PYZIP to specify the absolute paths to parserLAdump.py and zip_tag.py, respectively, (from dibella/bella repo) 10 | # 11 | # Requires in PATH: 12 | # - python (preferrably >= 3.6), 13 | # - LAmerge, LAdump (from DALIGNER), 14 | # - DBshow (from DAZZ_DB), 15 | # 16 | # An example setup script can be found in /global/homes/m/mme/cori/run-daligner/translation-environment.sh 17 | # also provided in this directory as example-translation-environment.sh 18 | # If a script is provided as argument 1, it will be executed in the current environment. 19 | # 20 | # @author mme 21 | # 22 | set -x 23 | if [ -z $1 ]; then 24 | echo "no environment script provided, proceeding under current settings" 25 | else 26 | source $1 27 | fi 28 | if [ -z $LAS ]; then 29 | LAS=$DBNAME".las" 30 | fi 31 | DUMP=$LAS".dump" 32 | IDS=$DUMP".ids" 33 | NAMES=$DUMP".names" 34 | BELLA=$DUMP".bella" 35 | 36 | # WARNING LAmerge only if blocks haven't been merged yet 37 | # WARNING LAmerge might fail merging all the blocks is beyond LAmerge's memory limits 38 | # Example merge: LAmerge $LAS *.las && \ 39 | LAdump -cl $DBNAME $LAS > $DUMP # was using -clo, but -o might be overly restrictive... 40 | srun -n 1 -c 64 python3 $PYPARSE $DUMP \ 41 | && DBshow -n $DBNAME $IDS > $NAMES \ 42 | && python3 $PYZIP $NAMES $IDS $BELLA \ 43 | && mv $BELLA $BELLA".txt" # final output if all commands succeed 44 | -------------------------------------------------------------------------------- /script/morescript/daligner_scripts/valgrind_daligner.slurm: -------------------------------------------------------------------------------- 1 | #!/bin/bash -l 2 | # 3 | # Example script for Cori Haswell. 4 | # Assumes a directory of daligner results (including align.sh) exists. 5 | # Valgrind will introduce additional memory overhead. 6 | # 7 | #SBATCH -N 1 8 | #SBATCH -c 64 9 | #SBATCH -C haswell 10 | #SBATCH --time-min=00:00:30 11 | #SBATCH -t 02:00:00 12 | 13 | module load valgrind 14 | set -x 15 | 16 | # 17 | # DIR should be set to the location of existing daligner results (database and align.sh). 18 | # To collect fresh results, see example script run_daligner.slurm. 19 | # 20 | # To run valgrind in a separate directory: 21 | # mkdir \ 22 | # && cd \ 23 | # && ln -s $DIR ./ 24 | # 25 | DIR=/global/cscratch1/sd/mme/daligner_j16235709 #ecoli 30x (sample) 26 | cd $DIR 27 | cp $0 ./ # copy this script to the run directory (documentation) 28 | # 29 | # PATH should include all tools required by align.sh (most notably daligner compiled with -g for valgrind) 30 | # 31 | export PATH=/global/common/software/m2865/bella-proj/g0-bin:$PATH 32 | # 33 | # generates a new script based on align.sh with valgrind... in place of daligner 34 | # 35 | NEW=valgrind_align.sh 36 | cp align.sh $NEW 37 | sed -i -e 's/daligner/valgrind --tool=massif --pages-as-heap=yes daligner/g' $NEW && cat $NEW 38 | set +x 39 | # 40 | # runs the valgrind script 41 | # 42 | sh $NEW 43 | 44 | 45 | -------------------------------------------------------------------------------- /script/morescript/daligner_scripts/zip_tag.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | from sys import argv 3 | from fileinput import FileInput 4 | 5 | if len(argv) < 4: 6 | print("3 arguments are required: (1) a text file containing a list of reads by name, 1 per line, (2) a text file containing a list of ID's for (1) in the corresponding order, and (3) a file containing the corresponding BELLA/diBELLA untagged alignment output") 7 | quit() 8 | 9 | tag_map=dict() 10 | namesfile=argv[1] 11 | idsfile=argv[2] 12 | with open(idsfile) as ids: 13 | with open(namesfile) as names: 14 | tag_map={k.rstrip():(v.split()[:1])[0].rstrip()[1:] for (k,v) in zip(ids,names)} 15 | 16 | #print(tag_map) 17 | 18 | #open alignments file and replace first two words with of each line with value from dictionary 19 | space=' ' 20 | filename=argv[3] 21 | with FileInput(filename, inplace=True, backup='.bak') as file: 22 | for line in file: 23 | linesplit=line.split() 24 | linesplit[0]=tag_map[linesplit[0]].rstrip() 25 | linesplit[1]=tag_map[linesplit[1]].rstrip() 26 | lineout=' '.join(x for x in linesplit) 27 | print(lineout) 28 | -------------------------------------------------------------------------------- /script/morescript/exactMarkov.py: -------------------------------------------------------------------------------- 1 | # 2 | # @author: Giulia Guidi 3 | # 4 | 5 | import numpy as np 6 | import matplotlib.patches as mpatches 7 | import matplotlib.pyplot as plt 8 | 9 | # 10 | # Markov Chain transition matrix to get the probability of having (k) consecutive correct bases on two different 11 | # sequences given an overlap (t) between the two sequences and the probability of having a correct base (p) 12 | # NOTE: k-mers are found in the same location 13 | # 14 | 15 | # 16 | # Expected value of out Markov chain 17 | # 18 | 19 | # Adding the entries in the top row, we get the expected number of steps 20 | def getresult(fundamentalMat): 21 | return fundamentalMat[1, :].sum() 22 | 23 | # The matrix N = (I −Q)^−1 is called the fundamental matrix for P 24 | def genn(transixMatQ, k): 25 | I = np.identity(k) 26 | tmp = I - transixMatQ 27 | fundamentalMat = np.linalg.inv(tmp) 28 | return fundamentalMat 29 | 30 | # Let Q be the sub-matrix of P without the rows and columns of any absorbing states 31 | def genq(transixMat, k): 32 | transixMatQ = transixMat[:-1, :-1] 33 | return transixMatQ 34 | 35 | def func(overlap, p, k): 36 | transixMat = np.zeros((k+1, k+1)) 37 | for i in range(k): 38 | transixMat[i, 0] = (1-p*p) 39 | transixMat[i, i + 1] = p*p 40 | transixMat[k, k] = 1.0 41 | transixMatQ = genq(transixMat, k) 42 | fundamentalMat = genn(transixMatQ, k) 43 | num = getresult(fundamentalMat) 44 | print("\nOverlap length to see a correct 17-mer with an error rate of", (1-p), "is", int(num)) 45 | return np.linalg.matrix_power(transixMat, overlap)[0, k] 46 | 47 | print(func(overlap=2000, p=0.85, k=17)) 48 | print() 49 | # 50 | # Plot probability function 51 | # 52 | #c = [] # overlap length array 53 | #d = [] # probability array 54 | #for i in range(15,10000): 55 | # d.append(func(overlap=i, p=0.85, k=15)) 56 | # c.append(i) 57 | # 58 | #x = [] # overlap length array 59 | #y = [] # probability array 60 | #for i in range(17,10000): 61 | # y.append(func(overlap=i, p=0.85, k=17)) 62 | # x.append(i) 63 | # 64 | #z = [] # overlap length array 65 | #w = [] # probability array 66 | #for i in range(19,10000): 67 | # w.append(func(overlap=i, p=0.85, k=19)) 68 | # z.append(i) 69 | # 70 | #a = [] # overlap length array 71 | #b = [] # probability array 72 | #for i in range(21,10000): 73 | # b.append(func(overlap=i, p=0.85, k=21)) 74 | # a.append(i) 75 | # 76 | # 77 | #plt.plot(c,d, '#87CEFA', linewidth = 2.0, label='K = 15') 78 | #plt.plot(x,y, '#3CB371', linewidth = 2.0, label='K = 17') 79 | #plt.plot(z,w, '#FF7F50', linewidth = 2.0, label='K = 19') 80 | #plt.plot(a,b, '#DC143C', linewidth = 2.0, label='K = 21') 81 | #plt.title("Probability to find at least one shared k-mer given the overlap length L", size=12.0) 82 | #plt.ylabel('P(L)', size=12.0) 83 | #plt.xlabel('Overlap length', size=12.0) 84 | #plt.show() 85 | 86 | # 87 | # End of program 88 | # -------------------------------------------------------------------------------- /script/morescript/filterby_overlap_length.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # 3 | # Convenience script for viewing alignments above a given THRESHOLD (optional argument 2, default THRESHOLD=2000). 4 | # Expects the alignments to be provided (argument 1) in bella format. 5 | # Does NOT change the original input file. 6 | # Outputs the filtered alignments into a separate file, with the naming convention _filtered. 7 | # 8 | # @author:mme 9 | # 10 | from sys import argv 11 | 12 | if (len(argv) < 2): 13 | print('Exactly 1 input file (in bella alignment format) required for filtering. Optionally provide integer threshold as arg 2. Exiting.') 14 | exit() 15 | 16 | THRESHOLD=int(2000) 17 | if (len(argv) > 2): 18 | THRESHOLD=int(argv[2]) 19 | 20 | # Constants for indexing a bella/dibella alignment output line 21 | TRUNC=4 #the line index at (inclusive) which to begin reading values (read names, similarity, and score, are not used in overlap length filtering) 22 | R1_ALGN_START=4-TRUNC 23 | R1_ALGN_END=5-TRUNC 24 | R1_READ_END=6-TRUNC 25 | R2_ALGN_START=7-TRUNC 26 | R2_ALGN_END=8-TRUNC 27 | R2_READ_END=9-TRUNC 28 | # output format after: 29 | #str << r1 << " " << r2 30 | # << data.similarity << " " << data.score << " " 31 | # << data.r1_al_start << " " << data.r1_al_end << " " << data.length_r1 << " " 32 | # << data.r2_al_start << " " << data.r2_al_end << " " << data.length_r2 33 | # 34 | ofilename=argv[1]+"_filtered"+str(THRESHOLD) 35 | with open(argv[1],'r') as alignments: 36 | for line in alignments: 37 | vals=[int(x) for x in line.split()[TRUNC:]] 38 | r1_algn_length=vals[R1_ALGN_END]-vals[R1_ALGN_START] 39 | r2_algn_length=vals[R2_ALGN_END]-vals[R2_ALGN_START] 40 | head=min(vals[R1_ALGN_START], vals[R2_ALGN_START]) 41 | tail=min( (vals[R1_READ_END] - vals[R1_ALGN_END]), (vals[R2_READ_END] - vals[R2_ALGN_END]) ) 42 | overlap = head + tail + int((r1_algn_length+r2_algn_length)/2) 43 | if (overlap >= THRESHOLD): 44 | with open(ofilename,'a') as ofile: 45 | ofile.write(line) 46 | -------------------------------------------------------------------------------- /script/morescript/makefile: -------------------------------------------------------------------------------- 1 | COMPILER = g++ 2 | CC = gcc 3 | CFLAGS = -I. -O3 -Wall -Wextra -pedantic -ansi -c 4 | 5 | optlist.o: ../optlist/optlist.c ../optlist/optlist.h 6 | $(CC) $(CFLAGS) $< 7 | 8 | # flags defined in mtspgemm2017/GTgraph/Makefile.var 9 | check: evaluation.cpp optlist.o 10 | $(COMPILER) -o evaluation optlist.o evaluation.cpp 11 | 12 | # flags defined in mtspgemm2017/GTgraph/Makefile.var 13 | label: mlEvaluation.cpp optlist.o 14 | $(COMPILER) -o mlEvaluation optlist.o mlEvaluation.cpp 15 | 16 | clean: 17 | rm -f *.o 18 | rm -f check 19 | rm -f label -------------------------------------------------------------------------------- /seqan/seqan/align_extend.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Hannes Hauswedell 33 | // ========================================================================== 34 | // Extras for the align module 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_ALIGN_EXTEND_H 38 | #define SEQAN_ALIGN_EXTEND_H 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /seqan/seqan/align_profile.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Facade header for module align_profile. 35 | // ========================================================================== 36 | 37 | #ifndef INCLUDE_SEQAN_ALIGN_PROFILE_H_ 38 | #define INCLUDE_SEQAN_ALIGN_PROFILE_H_ 39 | 40 | // =========================================================================== 41 | // Prerequisites 42 | // =========================================================================== 43 | 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | // =========================================================================== 51 | // Module Contents 52 | // =========================================================================== 53 | 54 | #include 55 | #include 56 | 57 | #endif // INCLUDE_SEQAN_ALIGN_PROFILE_H_ 58 | -------------------------------------------------------------------------------- /seqan/seqan/align_split.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Facade header for module align_split. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_INCLUDE_SEQAN_ALIGN_SPLIT_H_ 38 | #define SEQAN_INCLUDE_SEQAN_ALIGN_SPLIT_H_ 39 | 40 | // =========================================================================== 41 | // Prerequisites. 42 | // =========================================================================== 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | // =========================================================================== 49 | // Split Alignment Impelmentation. 50 | // =========================================================================== 51 | 52 | #include 53 | #include 54 | 55 | #endif // SEQAN_INCLUDE_SEQAN_ALIGN_SPLIT_H_ 56 | -------------------------------------------------------------------------------- /seqan/seqan/bed_io.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Facade header for module bed_io. 35 | // ========================================================================== 36 | 37 | #ifndef INCLUDE_SEQAN_BED_IO_H_ 38 | #define INCLUDE_SEQAN_BED_IO_H_ 39 | 40 | // =========================================================================== 41 | // Prerequisites. 42 | // =========================================================================== 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | // =========================================================================== 49 | // First Header Group. 50 | // =========================================================================== 51 | 52 | #include 53 | 54 | #include 55 | #include 56 | 57 | #include 58 | 59 | #endif // INCLUDE_SEQAN_BED_IO_H_ 60 | -------------------------------------------------------------------------------- /seqan/seqan/file/file_forwards.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: David Weese 33 | // ========================================================================== 34 | 35 | #ifndef SEQAN_HEADER_FILE_FORWARDS_H 36 | #define SEQAN_HEADER_FILE_FORWARDS_H 37 | 38 | ////////////////////////////////////////////////////////////////////////////// 39 | 40 | namespace seqan 41 | { 42 | 43 | ////////////////////////////////////////////////////////////////////////////// 44 | 45 | template 46 | class Align; 47 | //IOREV _todo_ 48 | 49 | 50 | ////////////////////////////////////////////////////////////////////////////// 51 | 52 | } //namespace seqan 53 | 54 | ////////////////////////////////////////////////////////////////////////////// 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /seqan/seqan/gff_io.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // gff_io 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: David Weese 33 | // ========================================================================== 34 | // Facade header for module gff_io. 35 | // ========================================================================== 36 | 37 | #ifndef INCLUDE_SEQAN_GFF_IO_H_ 38 | #define INCLUDE_SEQAN_GFF_IO_H_ 39 | 40 | // =========================================================================== 41 | // Prerequisites. 42 | // =========================================================================== 43 | 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | // =========================================================================== 50 | // First Header Group. 51 | // =========================================================================== 52 | 53 | #include 54 | #include 55 | 56 | #endif // INCLUDE_SEQAN_GFF_IO_H_ 57 | -------------------------------------------------------------------------------- /seqan/seqan/graph_align/graph_algorithm_refine_scoring.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Tobias Rausch 33 | // Author: Anne-Katrin Emde 34 | // ========================================================================== 35 | 36 | #ifndef SEQAN_INCLUDE_SEQAN_GRAPH_ALIGN_GRAPH_IMPL_REFINE_SCORING_H_ 37 | #define SEQAN_INCLUDE_SEQAN_GRAPH_ALIGN_GRAPH_IMPL_REFINE_SCORING_H_ 38 | 39 | namespace seqan { 40 | 41 | // Fake score function. 42 | 43 | template 44 | TScoreValue 45 | _getRefinedMatchScore(TScoreValue const &, TStringSet const &, TAlign const &, TValue, TValue, TSize, TSize) 46 | { 47 | return 1; 48 | } 49 | 50 | } // namespace seqan 51 | 52 | #endif // #ifndef SEQAN_INCLUDE_SEQAN_GRAPH_ALIGN_GRAPH_IMPL_REFINE_SCORING_H_ 53 | -------------------------------------------------------------------------------- /seqan/seqan/graph_msa.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | 33 | #ifndef SEQAN_HEADER_GRAPH_MSA_H 34 | #define SEQAN_HEADER_GRAPH_MSA_H 35 | 36 | // Seqan 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | //MSA 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | #endif //#ifndef SEQAN_HEADER_... 55 | -------------------------------------------------------------------------------- /seqan/seqan/map.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | 33 | #ifndef SEQAN_HEADER_MAP_H 34 | #define SEQAN_HEADER_MAP_H 35 | 36 | //____________________________________________________________________________ 37 | // prerequisites 38 | 39 | #include 40 | #include 41 | 42 | #include 43 | 44 | //____________________________________________________________________________ 45 | 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | //____________________________________________________________________________ 53 | 54 | /* 55 | #include 56 | #include 57 | #include 58 | */ 59 | 60 | //____________________________________________________________________________ 61 | 62 | #endif //#ifndef SEQAN_HEADER_... 63 | -------------------------------------------------------------------------------- /seqan/seqan/map/map_chooser.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | 33 | #ifndef SEQAN_HEADER_MAP_CHOOSER_H 34 | #define SEQAN_HEADER_MAP_CHOOSER_H 35 | 36 | ////////////////////////////////////////////////////////////////////////////// 37 | 38 | namespace seqan 39 | { 40 | 41 | ////////////////////////////////////////////////////////////////////////////// 42 | // Set meta-function to choose an efficient implementation 43 | 44 | template 45 | struct ChooseMap2_ 46 | { 47 | typedef Map > Type; 48 | }; 49 | template 50 | struct ChooseMap2_ 51 | { 52 | typedef Map > Type; 53 | }; 54 | 55 | 56 | template 57 | struct ChooseMap: 58 | ChooseMap2_::Type)> 59 | {}; 60 | 61 | 62 | ////////////////////////////////////////////////////////////////////////////// 63 | 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /seqan/seqan/math.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: David Weese 33 | // ========================================================================== 34 | // This is the facade header for the math module. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_MATH_H_ 38 | #define SEQAN_MATH_H_ 39 | 40 | // ========================================================================== 41 | // Prerequisites 42 | // ========================================================================== 43 | 44 | #include 45 | #include 46 | 47 | // ========================================================================== 48 | // Math Data Structures 49 | // ========================================================================== 50 | 51 | #include "math/math_common_factor.h" 52 | #include "math/math_operators.h" 53 | #include "math/math_rational.h" 54 | 55 | #endif // SEQAN_MATH_H_ 56 | -------------------------------------------------------------------------------- /seqan/seqan/misc/priority_type_heap.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PASSIONLab/BELLA/67ac170f47d4c9cce88a6158c1e00baa58ddbcb0/seqan/seqan/misc/priority_type_heap.h -------------------------------------------------------------------------------- /seqan/seqan/random.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Umbrella header for the random module. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_RANDOM_H_ 38 | #define SEQAN_RANDOM_H_ 39 | 40 | //____________________________________________________________________________ 41 | // Prerequisites 42 | 43 | #include 44 | #include 45 | 46 | #include 47 | #include 48 | 49 | //____________________________________________________________________________ 50 | // Module Headers 51 | 52 | // Basic Definitions 53 | #include 54 | 55 | // Rng With Special Distributions not contained in the STL. 56 | #include 57 | 58 | // Functions with randomness. 59 | #include 60 | 61 | //____________________________________________________________________________ 62 | 63 | #endif // SEQAN_RANDOM_H_ 64 | -------------------------------------------------------------------------------- /seqan/seqan/realign.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Facade header for module realign. 35 | // ========================================================================== 36 | 37 | #ifndef INCLUDE_SEQAN_REALIGN_H_ 38 | #define INCLUDE_SEQAN_REALIGN_H_ 39 | 40 | // =========================================================================== 41 | // Prerequisites. 42 | // =========================================================================== 43 | 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | // =========================================================================== 51 | // Realignment Code 52 | // =========================================================================== 53 | 54 | #include 55 | #include 56 | 57 | #endif // INCLUDE_SEQAN_REALIGN_H_ 58 | -------------------------------------------------------------------------------- /seqan/seqan/roi_io.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Facade header for module roi_io. 35 | // ========================================================================== 36 | 37 | #ifndef INCLUDE_SEQAN_ROI_IO_H_ 38 | #define INCLUDE_SEQAN_ROI_IO_H_ 39 | 40 | // =========================================================================== 41 | // Prerequisites. 42 | // =========================================================================== 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | // =========================================================================== 49 | // Module Contents 50 | // =========================================================================== 51 | 52 | #include 53 | 54 | #include 55 | #include 56 | #include 57 | #include 58 | 59 | #endif // INCLUDE_SEQAN_ROI_IO_H_ 60 | -------------------------------------------------------------------------------- /seqan/seqan/score.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Andreas Gogol-Doering 33 | // ========================================================================== 34 | // This is the facade header for the score module. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_SH_ 38 | #define SEQAN_SH_ 39 | 40 | #include 41 | 42 | #include 43 | 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #ifdef SEQAN_SIMD_ENABLED 53 | #include 54 | #endif // SEQAN_SIMD_ENABLED 55 | 56 | #endif // SEQAN_SH_ 57 | -------------------------------------------------------------------------------- /seqan/seqan/seeds/seeds_base.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Basic definitions for the module seeds. 33 | // ========================================================================== 34 | 35 | #ifndef SEQAN_SEEDS_SEEDS_BASE_H_ 36 | #define SEQAN_SEEDS_SEEDS_BASE_H_ 37 | 38 | namespace seqan { 39 | 40 | } // namespace seqan 41 | 42 | #endif // SEQAN_SEEDS_SEEDS_BASE_H_ 43 | -------------------------------------------------------------------------------- /seqan/seqan/seeds/seeds_global_chaining_base.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Generic parts of the global chaining algorithms and basic definitions. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_SEEDS_SEEDS_GLOBAL_CHAINING_BASE_H_ 38 | #define SEQAN_SEEDS_SEEDS_GLOBAL_CHAINING_BASE_H_ 39 | 40 | namespace seqan { 41 | 42 | } // namespace seqan 43 | 44 | #endif // SEQAN_SEEDS_SEEDS_GLOBAL_CHAINING_BASE_H_ 45 | -------------------------------------------------------------------------------- /seqan/seqan/seeds/seeds_global_chaining_gusfield.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Global chaining after Gusfield [1]. 35 | // 36 | // [1] Dan Gusfield. Algorithms on Strings, Trees, and Sequences: 37 | // Computer Science and Computational Biology. Cambridge University 38 | // Press, January 1997. 39 | // ==========================================================================*/ 40 | 41 | #ifndef SEQAN_SEEDS_SEEDS_GLOBAL_CHAINING_BASE_H_ 42 | #define SEQAN_SEEDS_SEEDS_GLOBAL_CHAINING_BASE_H_ 43 | 44 | namespace seqan { 45 | 46 | } // namespace seqan 47 | 48 | #endif // SEQAN_SEEDS_SEEDS_GLOBAL_CHAINING_BASE_H_ 49 | -------------------------------------------------------------------------------- /seqan/seqan/simple_intervals_io.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Facade header for the intervals_io module. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_SIMPLE_INTERVALS_IO_H_ 38 | #define SEQAN_SIMPLE_INTERVALS_IO_H_ 39 | 40 | // =========================================================================== 41 | // Prerequisites 42 | // =========================================================================== 43 | 44 | #include 45 | #include 46 | 47 | // =========================================================================== 48 | // Module Contents 49 | // =========================================================================== 50 | 51 | #include // read/write record functions, tags 52 | #include // FormattedFile 53 | 54 | #endif // SEQAN_SIMPLE_INTERVALS_IO_H_ 55 | -------------------------------------------------------------------------------- /seqan/seqan/statistics.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | 33 | #ifndef SEQAN_HEADER_STATISTICS_H 34 | #define SEQAN_HEADER_STATISTICS_H 35 | 36 | //____________________________________________________________________________ 37 | // prerequisites 38 | 39 | #include 40 | #include 41 | #include 42 | //____________________________________________________________________________ 43 | 44 | #include 45 | #include 46 | 47 | //____________________________________________________________________________ 48 | 49 | #endif //#ifndef SEQAN_HEADER_... 50 | -------------------------------------------------------------------------------- /seqan/seqan/store/store_base.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: David Weese 33 | // ========================================================================== 34 | 35 | #ifndef SEQAN_HEADER_STORE_BASE_H 36 | #define SEQAN_HEADER_STORE_BASE_H 37 | 38 | namespace seqan 39 | { 40 | 41 | ////////////////////////////////////////////////////////////////////////////// 42 | // Base structs 43 | ////////////////////////////////////////////////////////////////////////////// 44 | 45 | }// namespace seqan 46 | 47 | #endif //#ifndef SEQAN_HEADER_... 48 | -------------------------------------------------------------------------------- /seqan/seqan/translation.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Hannes Hauswedell 33 | // ========================================================================== 34 | // Code for Dna(5) to AminoAcid Translation 35 | // ========================================================================== 36 | 37 | 38 | #ifndef INCLUDE_SEQAN_TRANSLATION_H_ 39 | #define INCLUDE_SEQAN_TRANSLATION_H_ 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | #include 46 | #include 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /seqan/seqan/ucsc_io.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Facade header for module ucsc_io. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_INCLUDE_SEQAN_UCSC_IO_H_ 38 | #define SEQAN_INCLUDE_SEQAN_UCSC_IO_H_ 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | #endif // SEQAN_INCLUDE_SEQAN_UCSC_IO_H_ 45 | 46 | -------------------------------------------------------------------------------- /seqan/seqan/version.h: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // SeqAn - The Library for Sequence Analysis 3 | // ========================================================================== 4 | // Copyright (c) 2006-2016, Knut Reinert, FU Berlin 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions are met: 9 | // 10 | // * Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // * Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // * Neither the name of Knut Reinert or the FU Berlin nor the names of 16 | // its contributors may be used to endorse or promote products derived 17 | // from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | // ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE 23 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 29 | // DAMAGE. 30 | // 31 | // ========================================================================== 32 | // Author: Manuel Holtgrewe 33 | // ========================================================================== 34 | // Define SeqAn version. 35 | // ========================================================================== 36 | 37 | #ifndef SEQAN_VERSION_H_ 38 | #define SEQAN_VERSION_H_ 39 | 40 | #define SEQAN_VERSION_MAJOR 2 41 | 42 | #define SEQAN_VERSION_MINOR 3 43 | 44 | #define SEQAN_VERSION_PATCH 2 45 | 46 | #define SEQAN_VERSION_PRE_RELEASE 0 47 | 48 | #endif // SEQAN_VERSION_H_ 49 | -------------------------------------------------------------------------------- /src/CSR.cpp: -------------------------------------------------------------------------------- 1 | #include "../include/common/CSR.h" 2 | #include "../include/common/utility.h" 3 | 4 | // copy constructor 5 | template 6 | CSR::CSR (const CSR & rhs): nnz(rhs.nnz), rows(rhs.rows), cols(rhs.cols),zerobased(rhs.zerobased) 7 | { 8 | if(nnz > 0) 9 | { 10 | values = new NT[nnz]; 11 | colids = new IT[nnz]; 12 | copy(rhs.values, rhs.values+nnz, values); 13 | copy(rhs.colids, rhs.colids+nnz, colids); 14 | } 15 | if ( rows > 0) 16 | { 17 | rowptr = new IT[rows+1]; 18 | copy(rhs.rowptr, rhs.rowptr+rows+1, rowptr); 19 | } 20 | } 21 | 22 | template 23 | CSR & CSR::operator= (const CSR & rhs) 24 | { 25 | if(this != &rhs) 26 | { 27 | if(nnz > 0) // if the existing object is not empty 28 | { 29 | delete [] colids; // empty it 30 | delete [] values; 31 | } 32 | if(rows > 0) 33 | { 34 | delete [] rowptr; 35 | } 36 | 37 | nnz = rhs.nnz; 38 | rows = rhs.rows; 39 | cols = rhs.cols; 40 | zerobased = rhs.zerobased; 41 | if(rhs.nnz > 0) // if the copied object is not empty 42 | { 43 | values = new NT[nnz]; 44 | colids = new IT[nnz]; 45 | copy(rhs.values, rhs.values+nnz, values); 46 | copy(rhs.colids, rhs.colids+nnz, colids); 47 | } 48 | if(rhs.cols > 0) 49 | { 50 | rowptr = new IT[rows+1]; 51 | copy(rhs.rowptr, rhs.rowptr+rows+1, rowptr); 52 | } 53 | } 54 | return *this; 55 | } 56 | 57 | //! Construct a CSR object from a CSC 58 | //! Accepts only zero based CSC inputs 59 | template 60 | CSR::CSR(const CSC & csc):nnz(csc.nnz), rows(csc.rows), cols(csc.cols),zerobased(true) 61 | { 62 | rowptr = new IT[rows+1]; 63 | colids = new IT[nnz]; 64 | values = new NT[nnz]; 65 | 66 | IT * work = new IT[rows]; // workspace 67 | std::fill(work, work+rows, (IT) 0); // initilized to zero 68 | 69 | for (IT k = 0 ; k < nnz ; ++k) 70 | { 71 | IT tmp = csc.rowids[k]; 72 | work [ tmp ]++ ; // row counts (i.e, w holds the "row difference array") 73 | } 74 | 75 | if(nnz > 0) 76 | { 77 | rowptr[rows] = CumulativeSum (work, rows); // cumulative sum of w 78 | copy(work, work+rows, rowptr); 79 | 80 | IT last; 81 | for (IT i = 0; i < cols; ++i) 82 | { 83 | for (IT j = csc.colptr[i]; j < csc.colptr[i+1] ; ++j) 84 | { 85 | colids[ last = work[ csc.rowids[j] ]++ ] = i ; 86 | values[last] = csc.values[j] ; 87 | } 88 | } 89 | } 90 | delete [] work; 91 | } 92 | 93 | 94 | // check if sorted within rows? 95 | template 96 | void CSR::Sorted() 97 | { 98 | bool sorted = true; 99 | for(IT i=0; i< rows; ++i) 100 | { 101 | sorted &= my_is_sorted (colids + rowptr[i], colids + rowptr[i+1], std::less()); 102 | } 103 | cout << "Sorted ? " << sorted << endl; 104 | } 105 | -------------------------------------------------------------------------------- /xavier/README.md: -------------------------------------------------------------------------------- 1 | # Xavier 2 | Xavier: High-Performance X-Drop Adaptive Banded Pairwise Alignment 3 | -------------------------------------------------------------------------------- /xavier/makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | CXX = g++ 3 | CFLAGS = -I. -O3 -Wall -Wextra -pedantic -ansi -c -Wno-write-strings 4 | 5 | demo: demo.cpp 6 | $(CXX) -march=native -std=c++14 -O3 -fpermissive -o demo demo.cpp -DDEBUG 7 | 8 | clean: 9 | rm -f *.o 10 | rm -f demo 11 | 12 | --------------------------------------------------------------------------------