├── .github └── workflows │ └── ci.yaml ├── .gitignore ├── .travis.yml ├── CITATION.cff ├── CMakeLists.txt ├── LICENSE.txt ├── Makefile ├── README.md ├── apps ├── CMakeLists.txt └── README.md ├── doc ├── .gitignore ├── Makefile ├── README.md ├── code │ ├── demos │ │ ├── compare_jplace_files.cpp │ │ ├── compare_jplace_files │ │ │ ├── jplace_a.jplace │ │ │ └── jplace_b.jplace │ │ ├── extract_clade_placements.cpp │ │ ├── extract_clade_placements │ │ │ ├── clades.tsv │ │ │ ├── example.jplace │ │ │ └── output │ │ │ │ └── .gitignore │ │ ├── labelled_tree.cpp │ │ ├── placement_histograms.cpp │ │ └── visualize_placements.cpp │ └── tutorials │ │ ├── color.cpp │ │ ├── placement_analyses.cpp │ │ ├── placement_basics.cpp │ │ ├── sequence.cpp │ │ ├── taxonomy.cpp │ │ ├── tree.newick │ │ ├── tree_advanced.cpp │ │ ├── tree_basics.cpp │ │ └── tree_visualization.cpp ├── doxygen │ ├── Doxyfile │ ├── footer.html │ ├── header.html │ ├── layout.xml │ └── style.css ├── logo │ ├── colors.svg │ ├── favicon.ico │ ├── icon.svg │ ├── icon_bw.svg │ ├── logo.svg │ ├── logo_bw.svg │ ├── logo_doxygen.png │ ├── logo_large.png │ ├── logo_readme.png │ └── tangerine.zip ├── manual │ ├── demos.md │ ├── demos │ │ ├── compare_jplace_files.md │ │ ├── extract_clade_placements.md │ │ ├── labelled_tree.md │ │ ├── placement_histograms.md │ │ └── visualize_placements.md │ ├── main.md │ ├── setup.md │ ├── supplement.md │ ├── supplement │ │ ├── acknowledgements.md │ │ ├── acknowledgements.sh │ │ ├── acknowledgements │ │ │ ├── a_00_header.inc │ │ │ ├── b_00_dependencies.inc │ │ │ ├── b_01_gtest.inc │ │ │ ├── b_02_pybind.inc │ │ │ ├── b_03_htslib.inc │ │ │ ├── c_00_code_reuse.inc │ │ │ ├── c_01_json_document.inc │ │ │ ├── c_02_input_stream.inc │ │ │ ├── c_03_gzip_stream.inc │ │ │ ├── c_04_optional_bare.inc │ │ │ ├── c_05_interval_tree.inc │ │ │ ├── c_06_threadsafe_queue.inc │ │ │ ├── c_07_concurrent_queue.inc │ │ │ ├── d_01_srmq.inc │ │ │ ├── d_02_mds.inc │ │ │ ├── d_03_glm.inc │ │ │ ├── d_04_gsl.inc │ │ │ ├── d_05_stocc.inc │ │ │ ├── d_06_min_enc_can_kmer.inc │ │ │ ├── e_01_md5.inc │ │ │ ├── e_02_sha1.inc │ │ │ ├── e_03_sha256.inc │ │ │ ├── f_01_matplotlib_colors.inc │ │ │ ├── f_02_xkcd_colors.inc │ │ │ ├── f_03_colorbrewer_colors.inc │ │ │ └── f_04_nextstrain_colors.inc │ │ ├── build_process.md │ │ └── license.md │ ├── tutorials.md │ └── tutorials │ │ ├── color.md │ │ ├── placement_analyses.md │ │ ├── placement_basics.md │ │ ├── sequence.md │ │ ├── taxonomy.md │ │ ├── tree_advanced.md │ │ ├── tree_basics.md │ │ └── tree_visualization.md ├── png │ ├── demos │ │ ├── hist_edpl.png │ │ └── hist_lwr.png │ ├── placement │ │ ├── edpl.png │ │ ├── epa_input.png │ │ ├── epa_placement.png │ │ ├── epca_scatter.png │ │ ├── epca_trees.png │ │ ├── labelled_tree_fully_resolved.png │ │ ├── labelled_tree_multifurcating.png │ │ ├── squash_clustering.png │ │ └── visualize_placements.png │ ├── tree │ │ ├── add_new_leaf_node.png │ │ ├── add_new_node_edge.png │ │ ├── add_new_node_node.png │ │ ├── branch_length_tree.png │ │ ├── monophyletic_subtrees.png │ │ ├── nodes_and_edges.png │ │ ├── red_blue_tree.png │ │ ├── structure.png │ │ ├── subtree.png │ │ ├── traversal.png │ │ ├── traversal_levelorder.png │ │ └── tree_rooting.png │ └── utils │ │ └── color_lists.png └── svg │ ├── placement │ ├── edpl.svg │ ├── epa_input.svg │ ├── epa_placement.svg │ ├── epca_scatter.svg │ ├── epca_trees.svg │ ├── labelled_tree_fully_resolved.svg │ ├── labelled_tree_multifurcating.svg │ ├── squash_clustering.svg │ └── visualize_placements.svg │ ├── tree │ ├── add_new_leaf_node.svg │ ├── add_new_node_edge.svg │ ├── add_new_node_node.svg │ ├── branch_length_tree.svg │ ├── monophyletic_subtrees.svg │ ├── nodes_and_edges.svg │ ├── red_blue_tree.svg │ ├── structure.svg │ ├── subtree.svg │ ├── traversal.svg │ ├── traversal_levelorder.svg │ └── tree_rooting.svg │ └── utils │ ├── color_lists.cpp │ └── color_lists.svg ├── lib └── genesis │ ├── CMakeLists.txt │ ├── genesis.hpp │ ├── placement.hpp │ ├── placement │ ├── formats │ │ ├── edge_color.cpp │ │ ├── edge_color.hpp │ │ ├── jplace_reader.cpp │ │ ├── jplace_reader.hpp │ │ ├── jplace_writer.cpp │ │ ├── jplace_writer.hpp │ │ ├── newick_reader.hpp │ │ ├── newick_writer.hpp │ │ ├── serializer.cpp │ │ └── serializer.hpp │ ├── function │ │ ├── cog.cpp │ │ ├── cog.hpp │ │ ├── distances.cpp │ │ ├── distances.hpp │ │ ├── emd.cpp │ │ ├── emd.hpp │ │ ├── epca.cpp │ │ ├── epca.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── helper.cpp │ │ ├── helper.hpp │ │ ├── manipulation.cpp │ │ ├── manipulation.hpp │ │ ├── masses.cpp │ │ ├── masses.hpp │ │ ├── measures.cpp │ │ ├── measures.hpp │ │ ├── nhd.cpp │ │ ├── nhd.hpp │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ ├── sample_set.cpp │ │ ├── sample_set.hpp │ │ ├── tree.cpp │ │ └── tree.hpp │ ├── placement_tree.hpp │ ├── pquery.cpp │ ├── pquery.hpp │ ├── pquery │ │ ├── name.hpp │ │ ├── placement.hpp │ │ └── plain.hpp │ ├── sample.cpp │ ├── sample.hpp │ ├── sample_set.hpp │ └── simulator │ │ ├── distributions.cpp │ │ ├── distributions.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── simulator.cpp │ │ └── simulator.hpp │ ├── population.hpp │ ├── population │ ├── filter │ │ ├── filter_stats.hpp │ │ ├── filter_status.hpp │ │ ├── sample_counts_filter.cpp │ │ ├── sample_counts_filter.hpp │ │ ├── sample_counts_filter_numerical.cpp │ │ ├── sample_counts_filter_numerical.hpp │ │ ├── sample_counts_filter_positional.hpp │ │ ├── variant_filter.cpp │ │ ├── variant_filter.hpp │ │ ├── variant_filter_numerical.cpp │ │ ├── variant_filter_numerical.hpp │ │ └── variant_filter_positional.hpp │ ├── format │ │ ├── bed_reader.cpp │ │ ├── bed_reader.hpp │ │ ├── frequency_table_input_stream.cpp │ │ ├── frequency_table_input_stream.hpp │ │ ├── genome_region_reader.cpp │ │ ├── genome_region_reader.hpp │ │ ├── gff_reader.cpp │ │ ├── gff_reader.hpp │ │ ├── hts_file.cpp │ │ ├── hts_file.hpp │ │ ├── map_bim_reader.cpp │ │ ├── map_bim_reader.hpp │ │ ├── sam_flags.cpp │ │ ├── sam_flags.hpp │ │ ├── sam_variant_input_stream.cpp │ │ ├── sam_variant_input_stream.hpp │ │ ├── simple_pileup_common.cpp │ │ ├── simple_pileup_common.hpp │ │ ├── simple_pileup_input_stream.hpp │ │ ├── simple_pileup_reader.cpp │ │ ├── simple_pileup_reader.hpp │ │ ├── sync_common.cpp │ │ ├── sync_common.hpp │ │ ├── sync_input_stream.hpp │ │ ├── sync_reader.cpp │ │ ├── sync_reader.hpp │ │ ├── vcf_common.cpp │ │ ├── vcf_common.hpp │ │ ├── vcf_format_iterator.cpp │ │ ├── vcf_format_iterator.hpp │ │ ├── vcf_header.cpp │ │ ├── vcf_header.hpp │ │ ├── vcf_input_stream.cpp │ │ ├── vcf_input_stream.hpp │ │ ├── vcf_record.cpp │ │ └── vcf_record.hpp │ ├── function │ │ ├── diversity_pool_calculator.hpp │ │ ├── diversity_pool_functions.cpp │ │ ├── diversity_pool_functions.hpp │ │ ├── diversity_pool_processor.hpp │ │ ├── fst_cathedral.cpp │ │ ├── fst_cathedral.hpp │ │ ├── fst_pool_calculator.hpp │ │ ├── fst_pool_functions.hpp │ │ ├── fst_pool_karlsson.hpp │ │ ├── fst_pool_kofler.hpp │ │ ├── fst_pool_processor.hpp │ │ ├── fst_pool_unbiased.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── genome_locus.hpp │ │ ├── genome_locus_set.cpp │ │ ├── genome_locus_set.hpp │ │ ├── genome_region.cpp │ │ ├── genome_region.hpp │ │ ├── subsample.cpp │ │ ├── subsample.hpp │ │ ├── variant_input_stream.cpp │ │ ├── variant_input_stream.hpp │ │ └── window_average.hpp │ ├── genome_locus.hpp │ ├── genome_locus_set.cpp │ ├── genome_locus_set.hpp │ ├── genome_region.hpp │ ├── genome_region_list.hpp │ ├── plotting │ │ ├── af_spectrum.cpp │ │ ├── af_spectrum.hpp │ │ ├── cathedral_plot.cpp │ │ ├── cathedral_plot.hpp │ │ ├── genome_heatmap.cpp │ │ ├── genome_heatmap.hpp │ │ ├── heatmap_colorization.cpp │ │ └── heatmap_colorization.hpp │ ├── sample_counts.hpp │ ├── stream │ │ ├── variant_gapless_input_stream.cpp │ │ ├── variant_gapless_input_stream.hpp │ │ ├── variant_input_stream.hpp │ │ ├── variant_input_stream_adapters.cpp │ │ ├── variant_input_stream_adapters.hpp │ │ ├── variant_input_stream_sources.cpp │ │ ├── variant_input_stream_sources.hpp │ │ ├── variant_parallel_input_stream.cpp │ │ └── variant_parallel_input_stream.hpp │ ├── variant.hpp │ └── window │ │ ├── base_window.hpp │ │ ├── base_window_stream.hpp │ │ ├── chromosome_window_stream.hpp │ │ ├── functions.hpp │ │ ├── genome_window_stream.hpp │ │ ├── interval_window_stream.hpp │ │ ├── position_window_stream.hpp │ │ ├── queue_window_stream.hpp │ │ ├── region_window_stream.hpp │ │ ├── sliding_window_generator.hpp │ │ ├── variant_window_stream.hpp │ │ ├── vcf_window.hpp │ │ ├── window.hpp │ │ ├── window_view.hpp │ │ └── window_view_stream.hpp │ ├── sequence.hpp │ ├── sequence │ ├── counts.cpp │ ├── counts.hpp │ ├── formats │ │ ├── fai_input_stream.hpp │ │ ├── fasta_reader.cpp │ │ ├── fasta_reader.hpp │ │ ├── fasta_writer.cpp │ │ ├── fasta_writer.hpp │ │ ├── fastq_reader.cpp │ │ ├── fastq_reader.hpp │ │ ├── fastq_writer.cpp │ │ ├── fastq_writer.hpp │ │ ├── fastx_input_stream.hpp │ │ ├── fastx_input_view_stream.hpp │ │ ├── fastx_output_stream.hpp │ │ ├── phylip_reader.cpp │ │ ├── phylip_reader.hpp │ │ ├── phylip_writer.cpp │ │ └── phylip_writer.hpp │ ├── functions │ │ ├── codes.cpp │ │ ├── codes.hpp │ │ ├── consensus.cpp │ │ ├── consensus.hpp │ │ ├── dict.cpp │ │ ├── dict.hpp │ │ ├── entropy.cpp │ │ ├── entropy.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── labels.cpp │ │ ├── labels.hpp │ │ ├── quality.cpp │ │ ├── quality.hpp │ │ ├── signature_specifications.cpp │ │ ├── signature_specifications.hpp │ │ ├── signatures.cpp │ │ ├── signatures.hpp │ │ ├── stats.cpp │ │ └── stats.hpp │ ├── kmer │ │ ├── alphabet.cpp │ │ ├── alphabet.hpp │ │ ├── bitfield.cpp │ │ ├── bitfield.hpp │ │ ├── canonical_encoding.cpp │ │ ├── canonical_encoding.hpp │ │ ├── color_gamut.cpp │ │ ├── color_gamut.hpp │ │ ├── color_gamut_functions.cpp │ │ ├── color_gamut_functions.hpp │ │ ├── extractor.hpp │ │ ├── function.hpp │ │ ├── kmer.hpp │ │ └── microvariant_scanner.hpp │ ├── printers │ │ ├── bitmap.cpp │ │ ├── bitmap.hpp │ │ ├── simple.cpp │ │ └── simple.hpp │ ├── reference_genome.hpp │ ├── sequence.hpp │ ├── sequence_dict.hpp │ └── sequence_set.hpp │ ├── taxonomy.hpp │ ├── taxonomy │ ├── accession_lookup.hpp │ ├── formats │ │ ├── accession_lookup_reader.hpp │ │ ├── json_reader.cpp │ │ ├── json_reader.hpp │ │ ├── json_writer.cpp │ │ ├── json_writer.hpp │ │ ├── ncbi.cpp │ │ ├── ncbi.hpp │ │ ├── taxonomy_reader.cpp │ │ ├── taxonomy_reader.hpp │ │ ├── taxonomy_writer.cpp │ │ ├── taxonomy_writer.hpp │ │ ├── taxopath_generator.cpp │ │ ├── taxopath_generator.hpp │ │ ├── taxopath_parser.cpp │ │ └── taxopath_parser.hpp │ ├── functions │ │ ├── entropy.cpp │ │ ├── entropy.hpp │ │ ├── entropy_data.hpp │ │ ├── kmer.cpp │ │ ├── kmer.hpp │ │ ├── kmer_data.hpp │ │ ├── kmer_grouping.cpp │ │ ├── kmer_grouping.hpp │ │ ├── kmer_partitioning.cpp │ │ ├── kmer_partitioning.hpp │ │ ├── operators.hpp │ │ ├── ranks.cpp │ │ ├── ranks.hpp │ │ ├── taxonomy.cpp │ │ ├── taxonomy.hpp │ │ ├── taxopath.cpp │ │ ├── taxopath.hpp │ │ ├── tree.cpp │ │ └── tree.hpp │ ├── iterator │ │ ├── levelorder.hpp │ │ ├── postorder.hpp │ │ └── preorder.hpp │ ├── printers │ │ ├── nested.cpp │ │ └── nested.hpp │ ├── taxon.hpp │ ├── taxon_data.hpp │ ├── taxonomy.cpp │ ├── taxonomy.hpp │ └── taxopath.hpp │ ├── tree.hpp │ ├── tree │ ├── attribute_tree │ │ ├── indexed_newick_reader.cpp │ │ ├── indexed_newick_reader.hpp │ │ ├── keyed_newick_reader.cpp │ │ ├── keyed_newick_reader.hpp │ │ └── tree.hpp │ ├── bipartition │ │ ├── bipartition.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── rf.cpp │ │ └── rf.hpp │ ├── common_tree │ │ ├── distances.cpp │ │ ├── distances.hpp │ │ ├── edge_color.cpp │ │ ├── edge_color.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── newick_reader.hpp │ │ ├── newick_writer.hpp │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ ├── phyloxml_writer.hpp │ │ └── tree.hpp │ ├── drawing │ │ ├── circular_layout.cpp │ │ ├── circular_layout.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── heat_tree.cpp │ │ ├── heat_tree.hpp │ │ ├── layout_base.cpp │ │ ├── layout_base.hpp │ │ ├── layout_tree.hpp │ │ ├── rectangular_layout.cpp │ │ └── rectangular_layout.hpp │ ├── formats │ │ ├── color_writer_plugin.hpp │ │ ├── newick │ │ │ ├── broker.cpp │ │ │ ├── broker.hpp │ │ │ ├── color_writer_plugin.hpp │ │ │ ├── element.hpp │ │ │ ├── input_iterator.hpp │ │ │ ├── reader.cpp │ │ │ ├── reader.hpp │ │ │ ├── simple_reader.hpp │ │ │ ├── simple_tree.hpp │ │ │ ├── simple_writer.hpp │ │ │ ├── writer.cpp │ │ │ └── writer.hpp │ │ ├── phyloxml │ │ │ ├── color_writer_plugin.hpp │ │ │ ├── writer.cpp │ │ │ └── writer.hpp │ │ └── table │ │ │ ├── reader.cpp │ │ │ └── reader.hpp │ ├── function │ │ ├── accumulate.hpp │ │ ├── distances.cpp │ │ ├── distances.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── lca_lookup.cpp │ │ ├── lca_lookup.hpp │ │ ├── manipulation.cpp │ │ ├── manipulation.hpp │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ ├── tree_set.cpp │ │ └── tree_set.hpp │ ├── iterator │ │ ├── eulertour.hpp │ │ ├── levelorder.hpp │ │ ├── node_links.hpp │ │ ├── path.hpp │ │ ├── path_set.hpp │ │ ├── postorder.hpp │ │ └── preorder.hpp │ ├── mass_tree │ │ ├── balances.cpp │ │ ├── balances.hpp │ │ ├── emd.cpp │ │ ├── emd.hpp │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── kmeans.cpp │ │ ├── kmeans.hpp │ │ ├── phylo_factor.cpp │ │ ├── phylo_factor.hpp │ │ ├── phylo_factor_colors.cpp │ │ ├── phylo_factor_colors.hpp │ │ ├── phylo_ilr.cpp │ │ ├── phylo_ilr.hpp │ │ ├── squash_clustering.cpp │ │ ├── squash_clustering.hpp │ │ └── tree.hpp │ ├── printer │ │ ├── compact.cpp │ │ ├── compact.hpp │ │ ├── detailed.cpp │ │ ├── detailed.hpp │ │ ├── table.cpp │ │ └── table.hpp │ ├── tree.cpp │ ├── tree.hpp │ ├── tree │ │ ├── edge.hpp │ │ ├── edge_data.hpp │ │ ├── link.hpp │ │ ├── node.hpp │ │ ├── node_data.hpp │ │ └── subtree.hpp │ └── tree_set.hpp │ ├── utils.hpp │ └── utils │ ├── bit │ ├── bit.hpp │ ├── bitvector.cpp │ ├── bitvector.hpp │ ├── bitvector │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── operators.cpp │ │ └── operators.hpp │ ├── twobit_vector.cpp │ ├── twobit_vector.hpp │ └── twobit_vector │ │ ├── functions.cpp │ │ ├── functions.hpp │ │ ├── iterator_deletions.hpp │ │ ├── iterator_insertions.hpp │ │ └── iterator_substitutions.hpp │ ├── color │ ├── color.cpp │ ├── color.hpp │ ├── functions.cpp │ ├── functions.hpp │ ├── heat_map.cpp │ ├── heat_map.hpp │ ├── helpers.cpp │ ├── helpers.hpp │ ├── list_diverging.cpp │ ├── list_diverging.hpp │ ├── list_misc.cpp │ ├── list_misc.hpp │ ├── list_qualitative.cpp │ ├── list_qualitative.hpp │ ├── list_sequential.cpp │ ├── list_sequential.hpp │ ├── map.cpp │ ├── map.hpp │ ├── names.cpp │ ├── names.hpp │ ├── norm_boundary.hpp │ ├── norm_diverging.hpp │ ├── norm_linear.hpp │ ├── norm_logarithmic.hpp │ └── normalization.hpp │ ├── containers │ ├── bitpacked_vector.hpp │ ├── dataframe.hpp │ ├── dataframe │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ └── reader.hpp │ ├── deref_iterator.hpp │ ├── filter_iterator.hpp │ ├── function_cache.hpp │ ├── generic_input_stream.hpp │ ├── hash_tuple.hpp │ ├── interval_tree.hpp │ ├── interval_tree │ │ ├── functions.hpp │ │ ├── fwd.hpp │ │ ├── interval.hpp │ │ ├── iterator.hpp │ │ └── node.hpp │ ├── matrix.hpp │ ├── matrix │ │ ├── col.hpp │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ ├── reader.hpp │ │ ├── row.hpp │ │ ├── simple_reader.hpp │ │ └── writer.hpp │ ├── mru_cache.hpp │ ├── optional.hpp │ ├── range.hpp │ └── transform_iterator.hpp │ ├── core │ ├── algorithm.hpp │ ├── exception.hpp │ ├── fs.cpp │ ├── fs.hpp │ ├── info.cpp │ ├── info.hpp │ ├── logging.cpp │ ├── logging.hpp │ ├── options.hpp │ ├── resource_logger.hpp │ ├── std.hpp │ └── version.hpp │ ├── formats │ ├── bmp │ │ ├── writer.cpp │ │ └── writer.hpp │ ├── csv │ │ ├── input_iterator.hpp │ │ ├── reader.cpp │ │ └── reader.hpp │ ├── json │ │ ├── document.cpp │ │ ├── document.hpp │ │ ├── iterator.hpp │ │ ├── reader.cpp │ │ ├── reader.hpp │ │ ├── writer.cpp │ │ └── writer.hpp │ ├── nexus │ │ ├── block.cpp │ │ ├── block.hpp │ │ ├── document.cpp │ │ ├── document.hpp │ │ ├── taxa.hpp │ │ ├── trees.hpp │ │ ├── writer.cpp │ │ └── writer.hpp │ ├── svg │ │ ├── attributes.cpp │ │ ├── attributes.hpp │ │ ├── axis.cpp │ │ ├── axis.hpp │ │ ├── color_bar.cpp │ │ ├── color_bar.hpp │ │ ├── definitions.hpp │ │ ├── document.cpp │ │ ├── document.hpp │ │ ├── gradient.cpp │ │ ├── gradient.hpp │ │ ├── group.cpp │ │ ├── group.hpp │ │ ├── helper.cpp │ │ ├── helper.hpp │ │ ├── image.cpp │ │ ├── image.hpp │ │ ├── matrix.cpp │ │ ├── matrix.hpp │ │ ├── object.hpp │ │ ├── pie_chart.cpp │ │ ├── pie_chart.hpp │ │ ├── shapes.cpp │ │ ├── shapes.hpp │ │ ├── svg.hpp │ │ ├── text.cpp │ │ └── text.hpp │ └── xml │ │ ├── document.cpp │ │ ├── document.hpp │ │ ├── helper.cpp │ │ ├── helper.hpp │ │ ├── writer.cpp │ │ └── writer.hpp │ ├── io │ ├── base64.cpp │ ├── base64.hpp │ ├── base_input_source.hpp │ ├── base_output_target.hpp │ ├── deserializer.hpp │ ├── file_input_source.hpp │ ├── file_output_target.hpp │ ├── gzip.cpp │ ├── gzip.hpp │ ├── gzip_block_ostream.cpp │ ├── gzip_block_ostream.hpp │ ├── gzip_input_source.cpp │ ├── gzip_input_source.hpp │ ├── gzip_output_target.hpp │ ├── gzip_stream.cpp │ ├── gzip_stream.hpp │ ├── input_buffer.hpp │ ├── input_reader.hpp │ ├── input_source.hpp │ ├── input_stream.cpp │ ├── input_stream.hpp │ ├── output_stream.hpp │ ├── output_target.hpp │ ├── parser.cpp │ ├── parser.hpp │ ├── scanner.hpp │ ├── serializer.hpp │ ├── stream_input_source.hpp │ ├── stream_output_target.hpp │ ├── strict_fstream.cpp │ ├── strict_fstream.hpp │ ├── string_input_source.hpp │ └── string_output_target.hpp │ ├── math │ ├── binomial.cpp │ ├── binomial.hpp │ ├── common.hpp │ ├── compensated_sum.hpp │ ├── correlation.cpp │ ├── correlation.hpp │ ├── distance.cpp │ ├── distance.hpp │ ├── distribution.cpp │ ├── distribution.hpp │ ├── euclidean_kmeans.cpp │ ├── euclidean_kmeans.hpp │ ├── hac.hpp │ ├── hac │ │ ├── functions.hpp │ │ └── linkage.hpp │ ├── histogram.cpp │ ├── histogram.hpp │ ├── histogram │ │ ├── accumulator.cpp │ │ ├── accumulator.hpp │ │ ├── distances.cpp │ │ ├── distances.hpp │ │ ├── operations.cpp │ │ ├── operations.hpp │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ ├── stats.cpp │ │ └── stats.hpp │ ├── kmeans.hpp │ ├── matrix.cpp │ ├── matrix.hpp │ ├── mds.cpp │ ├── mds.hpp │ ├── moments.hpp │ ├── pca.cpp │ ├── pca.hpp │ ├── random.cpp │ ├── random.hpp │ ├── range_minimum_query.cpp │ ├── range_minimum_query.hpp │ ├── ranking.hpp │ ├── regression │ │ ├── dataframe.cpp │ │ ├── dataframe.hpp │ │ ├── factor.hpp │ │ ├── family.hpp │ │ ├── glm.cpp │ │ ├── glm.hpp │ │ ├── helper.cpp │ │ ├── helper.hpp │ │ ├── link.hpp │ │ └── slr.hpp │ └── statistics.hpp │ ├── text │ ├── char.cpp │ ├── char.hpp │ ├── convert.cpp │ ├── convert.hpp │ ├── light_string.hpp │ ├── string.cpp │ ├── string.hpp │ ├── style.cpp │ ├── style.hpp │ ├── table.cpp │ └── table.hpp │ ├── threading │ ├── blocking_concurrent_queue.hpp │ ├── concurrent_queue.hpp │ ├── concurrent_vector_guard.hpp │ ├── lightweight_semaphore.hpp │ ├── multi_future.hpp │ ├── sequential_output_buffer.hpp │ ├── serial_task_queue.hpp │ ├── thread_functions.hpp │ ├── thread_local_cache.hpp │ ├── thread_pool.hpp │ └── threadsafe_queue.hpp │ └── tools │ ├── char_lookup.hpp │ ├── date_time.cpp │ ├── date_time.hpp │ ├── geodesy │ ├── functions.cpp │ ├── functions.hpp │ └── geo_coordinate.hpp │ ├── hash │ ├── functions.cpp │ ├── functions.hpp │ ├── md5.cpp │ ├── md5.hpp │ ├── sha1.cpp │ ├── sha1.hpp │ ├── sha256.cpp │ └── sha256.hpp │ ├── tickmarks.cpp │ ├── tickmarks.hpp │ └── timer.hpp ├── python ├── CMakeLists.txt └── src │ ├── common.hpp │ ├── docstrings.cpp │ ├── module.cpp │ ├── placement │ ├── formats │ │ ├── edge_color.cpp │ │ ├── jplace_reader.cpp │ │ ├── jplace_writer.cpp │ │ ├── newick_reader.cpp │ │ ├── newick_writer.cpp │ │ └── serializer.cpp │ ├── function │ │ ├── cog.cpp │ │ ├── distances.cpp │ │ ├── emd.cpp │ │ ├── epca.cpp │ │ ├── functions.cpp │ │ ├── helper.cpp │ │ ├── masses.cpp │ │ ├── measures.cpp │ │ ├── nhd.cpp │ │ ├── operators.cpp │ │ ├── sample_set.cpp │ │ └── tree.cpp │ ├── placement_tree.cpp │ ├── pquery.cpp │ ├── pquery │ │ ├── name.cpp │ │ ├── placement.cpp │ │ └── plain.cpp │ ├── sample.cpp │ ├── sample_set.cpp │ └── simulator │ │ ├── distributions.cpp │ │ ├── functions.cpp │ │ └── simulator.cpp │ ├── sequence │ ├── counts.cpp │ ├── formats │ │ ├── fasta_input_iterator.cpp │ │ ├── fasta_output_iterator.cpp │ │ ├── fasta_reader.cpp │ │ ├── fasta_writer.cpp │ │ ├── phylip_reader.cpp │ │ └── phylip_writer.cpp │ ├── functions │ │ ├── codes.cpp │ │ ├── consensus.cpp │ │ ├── entropy.cpp │ │ ├── functions.cpp │ │ ├── labels.cpp │ │ ├── signature_specifications.cpp │ │ ├── signatures.cpp │ │ └── stats.cpp │ ├── printers │ │ ├── bitmap.cpp │ │ └── simple.cpp │ ├── sequence.cpp │ └── sequence_set.cpp │ ├── taxonomy │ ├── formats │ │ ├── ncbi.cpp │ │ ├── taxonomy_reader.cpp │ │ ├── taxonomy_writer.cpp │ │ ├── taxopath_generator.cpp │ │ └── taxopath_parser.cpp │ ├── functions │ │ ├── entropy.cpp │ │ ├── entropy_data.cpp │ │ ├── operators.hpp │ │ ├── ranks.cpp │ │ ├── taxonomy.cpp │ │ ├── taxonomy.hpp │ │ └── taxopath.cpp │ ├── iterator │ │ ├── levelorder.cpp │ │ ├── postorder.cpp │ │ ├── preorder.cpp │ │ └── preorder.hpp │ ├── printers │ │ └── nested.cpp │ ├── taxon.cpp │ ├── taxon_data.cpp │ ├── taxonomy.cpp │ └── taxopath.cpp │ ├── tree │ ├── attribute_tree │ │ ├── indexed_newick_reader.cpp │ │ ├── keyed_newick_reader.cpp │ │ └── tree.cpp │ ├── bipartition │ │ ├── bipartition.cpp │ │ └── functions.cpp │ ├── common_tree │ │ ├── distances.cpp │ │ ├── edge_color.cpp │ │ ├── functions.cpp │ │ ├── newick_reader.cpp │ │ ├── newick_writer.cpp │ │ ├── operators.cpp │ │ ├── phyloxml_writer.cpp │ │ └── tree.cpp │ ├── drawing │ │ ├── circular_layout.cpp │ │ ├── functions.cpp │ │ ├── layout_base.cpp │ │ ├── layout_tree.cpp │ │ └── rectangular_layout.cpp │ ├── formats │ │ ├── color_writer_plugin.cpp │ │ ├── newick │ │ │ ├── broker.cpp │ │ │ ├── color_writer_plugin.cpp │ │ │ ├── element.cpp │ │ │ ├── input_iterator.cpp │ │ │ ├── reader.cpp │ │ │ └── writer.cpp │ │ └── phyloxml │ │ │ ├── color_writer_plugin.cpp │ │ │ └── writer.cpp │ ├── function │ │ ├── distances.cpp │ │ ├── functions.cpp │ │ ├── lca_lookup.cpp │ │ ├── manipulation.cpp │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ └── tree_set.cpp │ ├── iterator │ │ ├── eulertour.hpp │ │ ├── levelorder.hpp │ │ ├── node_links.hpp │ │ ├── path.hpp │ │ ├── path_set.hpp │ │ ├── postorder.hpp │ │ └── preorder.hpp │ ├── mass_tree │ │ ├── emd.cpp │ │ ├── functions.cpp │ │ ├── kmeans.cpp │ │ ├── squash_clustering.cpp │ │ └── tree.cpp │ ├── printer │ │ ├── compact.cpp │ │ ├── detailed.cpp │ │ └── table.cpp │ ├── tree.cpp │ ├── tree │ │ ├── edge.cpp │ │ ├── edge_data.cpp │ │ ├── link.cpp │ │ ├── node.cpp │ │ └── node_data.cpp │ └── tree_set.cpp │ └── utils │ ├── containers │ ├── dataframe.hpp │ ├── dataframe │ │ └── reader.hpp │ ├── matrix.hpp │ ├── matrix │ │ ├── col.hpp │ │ ├── operators.cpp │ │ ├── operators.hpp │ │ ├── reader.hpp │ │ ├── row.hpp │ │ └── writer.hpp │ ├── mru_cache.hpp │ ├── sorted_vector.hpp │ └── sorted_vector │ │ └── operators.hpp │ ├── core │ ├── algorithm.hpp │ ├── fs.cpp │ ├── indexed_list.hpp │ ├── logging.cpp │ ├── options.cpp │ ├── range.hpp │ ├── std.hpp │ └── version.cpp │ ├── formats │ ├── bmp │ │ └── writer.cpp │ ├── csv │ │ └── reader.cpp │ ├── nexus │ │ ├── block.cpp │ │ ├── document.cpp │ │ ├── taxa.cpp │ │ ├── trees.cpp │ │ └── writer.cpp │ └── xml │ │ ├── document.cpp │ │ ├── helper.cpp │ │ ├── helper.hpp │ │ └── writer.cpp │ ├── math │ ├── bitvector.cpp │ ├── bitvector │ │ └── operators.cpp │ ├── common.cpp │ ├── common.hpp │ ├── euclidean_kmeans.cpp │ ├── histogram.cpp │ ├── histogram │ │ ├── accumulator.cpp │ │ ├── distances.cpp │ │ ├── operations.cpp │ │ └── stats.cpp │ ├── kmeans.cpp │ ├── kmeans.hpp │ ├── matrix.cpp │ ├── matrix.hpp │ ├── pca.cpp │ ├── random.cpp │ ├── range_minimum_query.cpp │ ├── statistics.cpp │ ├── statistics.hpp │ ├── twobit_vector.cpp │ └── twobit_vector │ │ ├── functions.cpp │ │ ├── iterator_deletions.cpp │ │ ├── iterator_insertions.cpp │ │ └── iterator_substitutions.cpp │ ├── text │ ├── char.cpp │ ├── string.cpp │ ├── string.hpp │ ├── style.cpp │ └── table.cpp │ └── tools │ ├── char_lookup.hpp │ ├── color.cpp │ ├── color │ ├── diverging_lists.cpp │ ├── functions.cpp │ ├── helpers.cpp │ ├── map.cpp │ ├── names.cpp │ ├── norm_boundary.cpp │ ├── norm_diverging.cpp │ ├── norm_linear.cpp │ ├── norm_logarithmic.cpp │ ├── normalization.cpp │ ├── qualitative_lists.cpp │ └── sequential_lists.cpp │ ├── date_time.cpp │ ├── geodesy.cpp │ ├── geodesy │ └── functions.cpp │ ├── gzip.cpp │ ├── hashing.cpp │ ├── md5.cpp │ ├── sha1.cpp │ ├── sha256.cpp │ └── tickmarks.cpp ├── test ├── CMakeLists.txt ├── README.md ├── data │ ├── placement │ │ ├── duplicates_a.jplace │ │ ├── duplicates_b.jplace │ │ ├── rooted.jplace │ │ ├── test_a.jplace │ │ ├── test_a.jplace.gz │ │ ├── test_b.jplace │ │ ├── test_b.jplace.gz │ │ ├── test_c.jplace │ │ ├── test_c.jplace.gz │ │ ├── unrooted.jplace │ │ ├── version_1.jplace │ │ ├── version_2.jplace │ │ └── version_3.jplace │ ├── population │ │ ├── 78.pileup.gz │ │ ├── README.txt │ │ ├── cram_cache │ │ │ ├── 426e31835a6dfdcbf6c534671edf02f7 │ │ │ └── b6853ffe730ece50076db834dea18e3b │ │ ├── empty.pileup │ │ ├── ex1.bam │ │ ├── ex1.cram │ │ ├── ex1.fa │ │ ├── ex1.fa.fai │ │ ├── ex1.sam.gz │ │ ├── example.pileup │ │ ├── example.vcf │ │ ├── example2.pileup │ │ ├── example3.pileup │ │ ├── example_ad.vcf │ │ ├── freq1.csv │ │ ├── long.sync │ │ ├── mask.bed │ │ ├── mask.fasta │ │ ├── masked.sync │ │ ├── p1_p2.sync.gz │ │ ├── parallel.pileup │ │ ├── parallel.vcf │ │ ├── parallel_a.sync │ │ ├── parallel_b.sync │ │ ├── parallel_chrs_1.sync │ │ ├── regions.vcf │ │ ├── regions_1.bim │ │ ├── regions_1.map │ │ ├── regions_1.txt │ │ ├── regions_2.bim │ │ ├── regions_2.map │ │ ├── regions_2.txt │ │ ├── sample-names.sync │ │ ├── sample.gff2 │ │ ├── sample.gff3 │ │ ├── sample.gtf │ │ ├── test.sync │ │ ├── test_header.sync │ │ ├── ucsc.bed │ │ ├── unordered.csv │ │ ├── unordered.pileup │ │ ├── unordered.sam.gz │ │ ├── unordered.sync │ │ ├── unordered.vcf │ │ ├── wiki1.bed3 │ │ └── wiki2.bed │ ├── sequence │ │ ├── SP1.fq │ │ ├── TAIR10_chr_all.dict │ │ ├── TAIR10_chr_all.fa.fai │ │ ├── aa_3_384_i.phylip │ │ ├── aa_3_384_s.phylip │ │ ├── dna_10.fasta │ │ ├── dna_10.fasta.gz │ │ ├── dna_10_single.fasta │ │ ├── dna_5_42_i.phylip │ │ ├── dna_5_42_s.phylip │ │ ├── grouped_taxonomy.json.gz │ │ ├── grouped_taxonomy_trunk.json.gz │ │ └── wiki.fastq │ ├── taxonomy │ │ ├── tax_slv_ssu_123.1.clean │ │ ├── tax_slv_ssu_123.1.ordered │ │ └── tax_slv_ssu_123.1.unordered │ ├── tree │ │ ├── distances.newick │ │ ├── indexed_attributes_0.newick │ │ ├── indexed_attributes_1.newick │ │ ├── keyed_attributes_0.newick │ │ ├── keyed_attributes_1.newick │ │ ├── multiple.newick │ │ ├── multiple_named.newick │ │ ├── random-trees.newick │ │ └── rooted.newick │ └── utils │ │ ├── csv │ │ ├── comment_empty.csv │ │ ├── complex.csv │ │ ├── linear_regression.R │ │ ├── linear_regression.csv │ │ ├── logistic_regression.R │ │ ├── logistic_regression.csv │ │ ├── mixed.csv │ │ ├── mixed_nan.csv │ │ ├── simple.csv │ │ ├── tab_esc.csv │ │ └── table.csv │ │ ├── hash │ │ ├── aaa.txt.gz │ │ ├── abc.txt │ │ └── empty.txt │ │ ├── json │ │ ├── README.md │ │ ├── _fail13.jtest │ │ ├── _fail15.jtest │ │ ├── _fail17.jtest │ │ ├── _fail25.jtest │ │ ├── _fail26.jtest │ │ ├── _fail27.jtest │ │ ├── _fail28.jtest │ │ ├── fail10.jtest │ │ ├── fail11.jtest │ │ ├── fail12.jtest │ │ ├── fail14.jtest │ │ ├── fail16.jtest │ │ ├── fail19.jtest │ │ ├── fail2.jtest │ │ ├── fail20.jtest │ │ ├── fail21.jtest │ │ ├── fail22.jtest │ │ ├── fail23.jtest │ │ ├── fail24.jtest │ │ ├── fail29.jtest │ │ ├── fail3.jtest │ │ ├── fail30.jtest │ │ ├── fail31.jtest │ │ ├── fail32.jtest │ │ ├── fail33.jtest │ │ ├── fail4.jtest │ │ ├── fail5.jtest │ │ ├── fail6.jtest │ │ ├── fail7.jtest │ │ ├── fail8.jtest │ │ ├── fail9.jtest │ │ ├── pass1.jtest │ │ ├── pass2.jtest │ │ ├── pass3.jtest │ │ └── pass4.jtest.gz │ │ └── matrix │ │ ├── README.md │ │ ├── headers.mat │ │ ├── iris.data.csv │ │ ├── iris.names.txt │ │ ├── iris.pca_projection.csv │ │ ├── iris.standardized.csv │ │ ├── iris.standardized_means.csv │ │ ├── iris.standardized_stddevs.csv │ │ └── simple.mat ├── run.sh └── src │ ├── common.hpp │ ├── main.cpp │ ├── placement │ ├── edge_color.cpp │ ├── epca.cpp │ ├── functions.cpp │ ├── jplace_reader.cpp │ ├── jplace_writer.cpp │ ├── manipulation.cpp │ ├── measures.cpp │ ├── sample.cpp │ ├── serializer.cpp │ └── simulator.cpp │ ├── population │ ├── bed_reader.cpp │ ├── chromosome_window_stream.cpp │ ├── diversity.cpp │ ├── frequency_table.cpp │ ├── fst_pool.cpp │ ├── functions.cpp │ ├── genome_locus.cpp │ ├── genome_locus_set.cpp │ ├── genome_region.cpp │ ├── gff_reader.cpp │ ├── interval_window_stream.cpp │ ├── map_bim_reader.cpp │ ├── position_window_stream.cpp │ ├── queue_window_stream.cpp │ ├── random_variants.cpp │ ├── region_window_stream.cpp │ ├── sam_variant.cpp │ ├── simple_pileup.cpp │ ├── subsample.cpp │ ├── sync.cpp │ ├── variant.cpp │ ├── variant_gapless_input_stream.cpp │ ├── variant_input_stream.cpp │ ├── variant_parallel_input_stream.cpp │ ├── variant_pileup.cpp │ ├── vcf_basics.cpp │ ├── vcf_window.cpp │ └── window_view_stream.cpp │ ├── sequence │ ├── codes.cpp │ ├── counts.cpp │ ├── dict.cpp │ ├── fasta.cpp │ ├── fastq.cpp │ ├── functions.cpp │ ├── kmer.cpp │ ├── kmer_color_gamut.cpp │ ├── labels.cpp │ ├── phylip.cpp │ ├── print.cpp │ ├── quality.cpp │ ├── reference_genome.cpp │ └── signatures.cpp │ ├── taxonomy │ ├── accession_lookup.cpp │ ├── functions.cpp │ ├── iterator.cpp │ ├── printer.cpp │ ├── rank.cpp │ ├── reader.cpp │ ├── taxonomy.cpp │ ├── taxopath.cpp │ └── tree.cpp │ ├── tree │ ├── attribute_tree │ │ └── newick_reader.cpp │ ├── common_tree │ │ ├── common_tree.cpp │ │ ├── distances.cpp │ │ └── rf.cpp │ ├── drawing.cpp │ ├── functions.cpp │ ├── iterator │ │ ├── eulertour.cpp │ │ ├── levelorder.cpp │ │ ├── path.cpp │ │ ├── path_set.cpp │ │ ├── postorder.cpp │ │ └── preorder.cpp │ ├── manipulation.cpp │ ├── mass_tree.cpp │ ├── newick.cpp │ ├── printer.cpp │ ├── table.cpp │ └── tree.cpp │ └── utils │ ├── bit │ ├── bit.cpp │ ├── bitvector.cpp │ └── twobit_vector.cpp │ ├── containers │ ├── bitpacked_vector.cpp │ ├── dataframe.cpp │ ├── interval_tree.cpp │ ├── iterators.cpp │ ├── matrix │ │ ├── basics.cpp │ │ ├── iterators.cpp │ │ ├── operators.cpp │ │ ├── reader.cpp │ │ └── writer.cpp │ ├── mru_cache.cpp │ └── optional.cpp │ ├── core │ ├── algorithm.cpp │ ├── fs.cpp │ └── info.cpp │ ├── formats │ ├── bmp.cpp │ ├── csv.cpp │ ├── json.cpp │ ├── nexus.cpp │ └── svg.cpp │ ├── io │ ├── base64.cpp │ ├── gzip_stream.cpp │ ├── input_stream.cpp │ ├── lexing.cpp │ ├── output_target.cpp │ └── serializer.cpp │ ├── math │ ├── common.cpp │ ├── correlation.cpp │ ├── hac.cpp │ ├── histogram.cpp │ ├── kmeans.cpp │ ├── matrix.cpp │ ├── moments.cpp │ ├── pca.cpp │ ├── random.cpp │ ├── range_minimum_query.cpp │ ├── ranking.cpp │ ├── regression.cpp │ └── statistics.cpp │ ├── text │ ├── char.cpp │ ├── convert.cpp │ ├── light_string.cpp │ ├── string.cpp │ └── text.cpp │ ├── threading │ ├── concurrent_vector_guard.cpp │ ├── sequential_output_buffer.cpp │ ├── serial_task_queue.cpp │ ├── thread_local_cache.cpp │ ├── thread_pool.cpp │ └── threadsafe_queue.cpp │ └── tools │ ├── char_lookup.cpp │ ├── color.cpp │ ├── date_time.cpp │ ├── geodesy.cpp │ ├── md5.cpp │ ├── sha1.cpp │ ├── sha256.cpp │ ├── tickmarks.cpp │ └── timer.cpp └── tools ├── cmake ├── AssembleMonolith.cmake ├── CMakeParseImplicitLinkInfo.cmake ├── DetectCppVersion.cmake ├── FindAVX.cmake ├── FindDeflate.cmake ├── FindOpenMP_patch.cmake ├── FindOpenMP_patch2.cmake ├── GTestDownload.cmake ├── IncludeAVX.cmake ├── IncludeHtslib.cmake ├── IncludeOpenMP.cmake ├── IncludePthreads.cmake ├── IncludeSamtools.cmake ├── IncludeZlib.cmake └── Pybind11Download.cmake ├── deploy ├── build_example_apps.sh ├── check_header_guards.sh ├── make_genesis_header.sh ├── notable_changes.sh ├── release.sh ├── update_api_doc.sh └── xkcd.py ├── extract_todos.sh ├── plot_resources.py └── py_bindings ├── .gitignore ├── Doxyfile ├── generate.sh ├── py_binder.py └── py_binder ├── __init__.py ├── boost_writer.py ├── cpp_entities.py ├── doxygen_reader.py └── pybind11_writer.py /.gitignore: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------- 2 | # Project Build Folders 3 | # -------------------------------------------------------------------- 4 | 5 | bin/ 6 | build/ 7 | tools/googletest/ 8 | tools/pybind11/ 9 | 10 | # -------------------------------------------------------------------- 11 | # C++ Compiled Object files 12 | # -------------------------------------------------------------------- 13 | 14 | *.slo 15 | *.lo 16 | *.o 17 | *.obj 18 | 19 | # -------------------------------------------------------------------- 20 | # C++ Precompiled Headers 21 | # -------------------------------------------------------------------- 22 | 23 | *.gch 24 | *.pch 25 | 26 | # -------------------------------------------------------------------- 27 | # C++ Compiled Dynamic Libraries 28 | # -------------------------------------------------------------------- 29 | 30 | *.so 31 | *.dylib 32 | *.dll 33 | 34 | # -------------------------------------------------------------------- 35 | # C++ Compiled Static Libraries 36 | # -------------------------------------------------------------------- 37 | 38 | *.lai 39 | *.la 40 | *.a 41 | *.lib 42 | 43 | # -------------------------------------------------------------------- 44 | # Python Byte-Compiled Files 45 | # -------------------------------------------------------------------- 46 | 47 | __pycache__/ 48 | *.pyc 49 | *.pyo 50 | *.pyd 51 | 52 | # -------------------------------------------------------------------- 53 | # Executables 54 | # -------------------------------------------------------------------- 55 | 56 | *.exe 57 | *.out 58 | *.app 59 | 60 | # -------------------------------------------------------------------- 61 | # Misc 62 | # -------------------------------------------------------------------- 63 | 64 | .* 65 | *~ 66 | *.swp 67 | TODO 68 | extern/ 69 | apps/*.cpp 70 | apps/*.hpp 71 | apps/*/ 72 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | authors: 3 | - family-names: "Czech" 4 | given-names: "Lucas" 5 | orcid: "https://orcid.org/0000-0002-1340-9644" 6 | - family-names: "Barbera" 7 | given-names: "Pierre" 8 | orcid: "https://orcid.org/0000-0002-3437-150X" 9 | - family-names: "Stamatakis" 10 | given-names: "Alexandros" 11 | orcid: "https://orcid.org/0000-0003-0353-0691" 12 | title: "Genesis and Gappa: processing, analyzing and visualizing phylogenetic (placement) data" 13 | doi: 10.1093/bioinformatics/btaa070 14 | url: "http://github.com/lczech/genesis" 15 | preferred-citation: 16 | type: article 17 | authors: 18 | - family-names: "Czech" 19 | given-names: "Lucas" 20 | orcid: "https://orcid.org/0000-0002-1340-9644" 21 | - family-names: "Barbera" 22 | given-names: "Pierre" 23 | orcid: "https://orcid.org/0000-0002-3437-150X" 24 | - family-names: "Stamatakis" 25 | given-names: "Alexandros" 26 | orcid: "https://orcid.org/0000-0003-0353-0691" 27 | doi: "10.1093/bioinformatics/btaa070" 28 | journal: "Bioinformatics" 29 | start: 3263 # First page number 30 | end: 3265 # Last page number 31 | title: "Genesis and Gappa: processing, analyzing and visualizing phylogenetic (placement) data" 32 | volume: 36 33 | issue: 10 34 | year: 2020 35 | -------------------------------------------------------------------------------- /apps/README.md: -------------------------------------------------------------------------------- 1 | genesis applications 2 | ==================== 3 | 4 | This directory is provided for conveniently and quickly developing small applications which use 5 | genesis as their main C++ library. This is a way of using C++ similar to a scripting language. 6 | 7 | Reasons to use this method (instead of the genesis python bindings) include: 8 | 9 | * If Boost Python is not available on your target system. 10 | * If not all needed functions of genesis are exported to python (yet). 11 | * If you simply feel more comfortable developing in C++ than in python. 12 | 13 | To create a new application, create a `*.cpp` file in the `./apps` directory and provide it with 14 | a main function: 15 | 16 | int main( int argc, const char* argv[] ) 17 | { 18 | // [Your code here.] 19 | } 20 | 21 | Include all needed headers and write the desired functionality. 22 | Of course, you can use other local functions in addition to the main function in order to structure 23 | your code. 24 | 25 | The app is automatically compiled by the main build process and linked against the shared library 26 | version of genesis by calling 27 | 28 | make update 29 | 30 | in the main directory. The resulting executable is placed in `./bin` and named after the `*.cpp` 31 | file (without the ending). 32 | 33 | Apart from that, there are no further requirements. Simply include the needed genesis headers (or 34 | any other headers you might need) and compile. Happy coding! 35 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------- 2 | # Documentation 3 | # -------------------------------------------------------------------- 4 | 5 | html/ 6 | index.html 7 | -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | # Genesis - A toolkit for working with phylogenetic data. 2 | # Copyright (C) 2014-2016 Lucas Czech 3 | # 4 | # This program is free software: you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation, either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program. If not, see . 16 | # 17 | # Contact: 18 | # Lucas Czech 19 | # Exelixis Lab, Heidelberg Institute for Theoretical Studies 20 | # Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 21 | 22 | # -------------------------------------------------------------------------------------------------- 23 | # This makefile wraps around doxygen for easily creating the documentation. 24 | # -------------------------------------------------------------------------------------------------- 25 | 26 | .PHONY: doc clean 27 | 28 | # Make Doxygen documentation 29 | doc: 30 | @cd doxygen && doxygen Doxyfile 31 | @ln -fs ./html/index.html index.html 32 | 33 | # Remove all generated files 34 | clean: 35 | -@$(RM) -r ./html 36 | -@$(RM) ./index.html 37 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | genesis documentation 2 | ===================== 3 | 4 | This directory contains the files needed for the tutorials and demos. 5 | The genesis documentation is available at [doc.genesis-lib.org](http://doc.genesis-lib.org/). 6 | 7 | Also, the files that are used to generate the documentation with doxygen are stored here. 8 | The documentation of genesis contains both, the user manual with tutorials and code examples, 9 | and the API Reference with more details about classes and functions: 10 | 11 | * The files of the user manual are written in 12 | [doxygen-flavored markdown format](https://www.stack.nl/~dimitri/doxygen/manual/markdown.html) 13 | and thus human-readable. They are stored in the subdirectory `manual`. 14 | * The API Reference is generated from the doc-blocks in the C++ source code. 15 | 16 | In order to generate the full documentation, [doxygen](http://www.doxygen.org/) 1.8.13 and 17 | [graphviz](http://www.graphviz.org/) need to be installed. 18 | The files can then be generated into the subdirectory `html` by calling `make` in this directory. 19 | A symlink to the index page is also created for convenience. 20 | -------------------------------------------------------------------------------- /doc/code/demos/extract_clade_placements/clades.tsv: -------------------------------------------------------------------------------- 1 | Taxon_1 clade_b 2 | Taxon_13 clade_b 3 | Taxon_15 clade_b 4 | Taxon_16 clade_b 5 | Taxon_19 clade_b 6 | Taxon_21 clade_b 7 | Taxon_22 clade_b 8 | Taxon_23 clade_b 9 | Taxon_26 clade_b 10 | Taxon_27 clade_b 11 | Taxon_28 clade_b 12 | Taxon_3 clade_b 13 | Taxon_31 clade_b 14 | Taxon_33 clade_b 15 | Taxon_35 clade_b 16 | Taxon_36 clade_b 17 | Taxon_40 clade_b 18 | Taxon_41 clade_b 19 | Taxon_44 clade_b 20 | Taxon_45 clade_b 21 | Taxon_6 clade_b 22 | Taxon_71 clade_a 23 | Taxon_74 clade_a 24 | Taxon_77 clade_a 25 | Taxon_78 clade_a 26 | Taxon_79 clade_a 27 | Taxon_8 clade_b 28 | Taxon_82 clade_a 29 | Taxon_83 clade_a 30 | Taxon_84 clade_a 31 | Taxon_87 clade_a 32 | Taxon_88 clade_a 33 | Taxon_89 clade_a 34 | Taxon_9 clade_b 35 | Taxon_95 clade_b 36 | -------------------------------------------------------------------------------- /doc/code/demos/extract_clade_placements/output/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | 4 | # Except this file 5 | !.gitignore 6 | -------------------------------------------------------------------------------- /doc/code/tutorials/color.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2020 Lucas Czech and HITS gGmbH 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 21 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 22 | */ 23 | 24 | #include "genesis/genesis.hpp" 25 | 26 | int main() 27 | { 28 | using namespace genesis::utils; 29 | 30 | // Some ways to obtian a color. 31 | Color c1 = Color( 1.0, 0.0, 1.0 ); 32 | Color c2 = Color::from_bytes( 255, 0, 255 ); 33 | Color c3 = Color::from_hex( "#FF00FF" ); 34 | 35 | // Basic usage of a Color Map. 36 | auto color_map = ColorMap( color_list_viridis() ); 37 | auto some_color = color_map( 0.3 ); 38 | 39 | // Some exemplary values for log scaling. 40 | auto values = std::vector{ 2.3, 43.5, 195.8, 566.0, 846.2 }; 41 | auto color_norm = ColorNormalizationLogarithmic( 1.0, 1000.0); 42 | auto colors = color_map( color_norm, values ); 43 | 44 | // Let's avoid ugly compiler warnings about unused variables. 45 | // Not part of the tutorial. Just part of being clean. 46 | (void) c1; 47 | (void) c2; 48 | (void) c3; 49 | (void) some_color; 50 | } 51 | -------------------------------------------------------------------------------- /doc/code/tutorials/tree.newick: -------------------------------------------------------------------------------- 1 | ((A:0.132,(B:0.212,C:0.183):0.066):0.129,((F:0.154,(G:0.121,H:0.196):0.11):0.30,K:0.164):0.063):0.094; 2 | -------------------------------------------------------------------------------- /doc/doxygen/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /doc/logo/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/logo/favicon.ico -------------------------------------------------------------------------------- /doc/logo/logo_doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/logo/logo_doxygen.png -------------------------------------------------------------------------------- /doc/logo/logo_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/logo/logo_large.png -------------------------------------------------------------------------------- /doc/logo/logo_readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/logo/logo_readme.png -------------------------------------------------------------------------------- /doc/logo/tangerine.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/logo/tangerine.zip -------------------------------------------------------------------------------- /doc/manual/demos/labelled_tree.md: -------------------------------------------------------------------------------- 1 | Labelled Tree {#demos_labelled_tree} 2 | =========== 3 | 4 | # Summary 5 | 6 | Takes a `jplace` file and optionally a `Newick` tree (for example, with additional bootstrap 7 | support values) and produces a `Newick` tree where each 8 | @ref genesis::placement::PqueryPlacement "Placement" is turned into an individual branch on the 9 | original tree. 10 | 11 | This demo is located at 12 | 13 | genesis/doc/code/demos/labelled_tree.cpp 14 | 15 | # Details 16 | 17 | The program takes either two or three arguments: 18 | 19 | ./labelled_tree [] 20 | 21 | It then produces a labelled tree for the given `jplace` @ref genesis::placement::Sample "Sample". 22 | That is, the resulting tree contains a leaf node for each 23 | @ref genesis::placement::PqueryPlacement "Placement" of the Sample. 24 | See @ref genesis::placement::labelled_tree( Sample const&, bool, std::string const& ) "labelled_tree()" 25 | for details. 26 | 27 | If the optional `` is given, this tree is used instead of the tree contained in 28 | the `jplace` file. It has to be topologically identical to the `jplace` tree, but can contain 29 | additional values like bootstrap support values. Currently, we only support such values that are 30 | stored as inner node names. This is for example given if a bootstrap tree of RAxML is used. 31 | When working with trees containing such values at inner nodes, also be aware of issues that might 32 | arise with other programs. See https://academic.oup.com/mbe/article-lookup/doi/10.1093/molbev/msx055 for details. 33 | 34 | In the beginning of the main function of the program, there are two settings `fully_resolve` and 35 | `name_prefix`, according to the two optional arguments of 36 | @ref genesis::placement::labelled_tree( Sample const&, bool, std::string const& ) "labelled_tree()", 37 | that can be changed if needed. 38 | -------------------------------------------------------------------------------- /doc/manual/supplement.md: -------------------------------------------------------------------------------- 1 | Supplement {#supplement} 2 | =========== 3 | 4 | * @subpage supplement_build_process details for troubleshooting and for those who want to contribute 5 | to Genesis. 6 | * @subpage supplement_acknowledgements for saying Thanks and for the dependencies of Genesis. 7 | * @subpage supplement_license for the full GNU GPL v3 license text. 8 | 9 | 16 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # We use this helper script to concatenate the files in the `acknowledgements` sub directory. 4 | # This keeps these files separated, which gives better overview and maintainability. 5 | # Not a big thing, but helps a bit. 6 | 7 | rm -f acknowledgements.md 8 | for f in `ls acknowledgements/*.inc` ; do 9 | echo "Adding $f" 10 | 11 | # Concat all files, followed by an empty line 12 | cat $f >> acknowledgements.md 13 | echo "" >> acknowledgements.md 14 | done 15 | 16 | # Remove excess blank line at end of the file 17 | stripped=$( acknowledgements.md 19 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/a_00_header.inc: -------------------------------------------------------------------------------- 1 | Acknowledgements {#supplement_acknowledgements} 2 | ================ 3 | 4 | # Acknowledgements @anchor supplement_acknowledgements_acknowledgements 5 | 6 | This work is financially supported: 7 | 8 | * 2014-2019: [Klaus Tschira Foundation](http://www.klaus-tschira-stiftung.de/) and 9 | [HITS gGmbH - Heidelberg Institute for Theoretical Studies](http://www.h-its.org) 10 | in Heiderberg, Germany. 11 | * 2020-2021: [Carnegie Institution For Science](https://carnegiescience.edu/) in Stanford, USA. 12 | 13 | See the webpages of the [Exelixis Lab](http://exelixis-lab.org/) and the 14 | [Moi Lab](http://moisesexpositoalonso.org/) for our other projects. 15 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/b_00_dependencies.inc: -------------------------------------------------------------------------------- 1 | # Dependencies @anchor supplement_acknowledgements_dependencies 2 | 3 | In the following, we list all direct dependencies of Genesis and their licenses. 4 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/c_00_code_reuse.inc: -------------------------------------------------------------------------------- 1 | # Code Reuse @anchor supplement_acknowledgements_code_reuse 2 | 3 | In the following, we list all sources that were adapted and incorporated in Genesis in modified 4 | form. 5 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/c_01_json_document.inc: -------------------------------------------------------------------------------- 1 | ## Json Document @anchor supplement_acknowledgements_code_reuse_json_document 2 | 3 | Our @link genesis::utils::JsonDocument JsonDocument@endlink data structure as well as the accompanying @link genesis::utils::JsonIterator JsonIterator@endlink are based on the excellent 4 | [JSON for Modern C++](https://github.com/nlohmann/json) library by Niels Lohmann. 5 | 6 | @htmlonly
License @endhtmlonly 7 | > MIT License 8 | > 9 | > Copyright (c) 2013-2017 Niels Lohmann 10 | > 11 | > Permission is hereby granted, free of charge, to any person obtaining a copy 12 | > of this software and associated documentation files (the "Software"), to deal 13 | > in the Software without restriction, including without limitation the rights 14 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | > copies of the Software, and to permit persons to whom the Software is 16 | > furnished to do so, subject to the following conditions: 17 | > 18 | > The above copyright notice and this permission notice shall be included in all 19 | > copies or substantial portions of the Software. 20 | > 21 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | > SOFTWARE. 28 | @htmlonly
@endhtmlonly 29 | 30 | The license information above was copied from 31 | https://github.com/nlohmann/json/blob/develop/LICENSE.MIT 32 | on 2017-03-09. 33 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/d_01_srmq.inc: -------------------------------------------------------------------------------- 1 | ## Succinct Range Minimum Query @anchor supplement_acknowledgements_code_reuse_succinct_rmq 2 | 3 | The implementation of our @link genesis::utils::RangeMinimumQuery RangeMinimumQuery@endlink data 4 | structure is based on the 5 | [Succinct RMQ implementation](https://www.bio.ifi.lmu.de/forschung/succinct/#software) by Johannes 6 | Fischer, with his 7 | explicit permission to use his code in Genesis. 8 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/d_02_mds.inc: -------------------------------------------------------------------------------- 1 | ## Multi-Dimensional Scaling (MDS) @anchor supplement_acknowledgements_code_reuse_mds 2 | 3 | The implementation of our 4 | @link genesis::utils::multi_dimensional_scaling() multi_dimensional_scaling()@endlink function 5 | is based on the [SimpleMatrix library](https://sites.google.com/site/simpmatrix/) 6 | by [Quan Wang](https://github.com/wq2012), with his explicit permission to use this code in Genesis. 7 | The copyright (C) of the implementation is held by Quan Wang, 2013. 8 | We adapted the implementation to our @link genesis::utils::Matrix Matrix@endlink class and 9 | changed the error reporting mechanism to exceptions. 10 | 11 | The implementation by Quan Wang (and our adaptation) offers two variants of MDS. The code of these 12 | variants is based on two Matlab implementations, and re-implements those in C++. 13 | The original sources are: 14 | 15 | * The @link genesis::utils::MdsAlgorithm::kUcf UCF@endlink variant re-implements 16 | Laurens van der Maaten's MDS in his 17 | [Matlab Toolbox for Dimensionality Reduction](http://crcv.ucf.edu/source/dimension). 18 | It is free to use, change, or redistribute this code for non-commercial purposes. 19 | * The @link genesis::utils::MdsAlgorithm::kSmacof SMACOF@endlink variant re-implements 20 | Michael Bronstein's SMACOF in his 21 | [Matlab Toolbox for Surface Comparison and Analysis](http://tosca.cs.technion.ac.il/). 22 | It may be used for academic purposes, which we consider Genesis to be. 23 | 24 | See there for further details. Note however that none of the original code of these two 25 | implementations is used in Genesis, as we solely rely on the ported and re-implemented code 26 | by Quan Wang. 27 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/d_03_glm.inc: -------------------------------------------------------------------------------- 1 | ## Generalized Linear Model (GLM) @anchor supplement_acknowledgements_code_reuse_glm 2 | 3 | The implementation of our Generalized Linear Model, in particular 4 | @link genesis::utils::glm_fit() glm_fit()@endlink, but also some related helper functions, 5 | is based on the snp.matrix and X.snp.matrix classes by 6 | David Clayton and Hin-Tak Leung . 7 | The source is in C, but is originally intended for usage in R. 8 | 9 | The package does not seem to be maintained any more, and does not seem to 10 | have a proper repository. For more information, try these sites: 11 | - https://bioconductor.org/packages/release/bioc/html/snpStats.html 12 | - https://www.rdocumentation.org/packages/snpStats/ 13 | - http://www-gene.cimr.cam.ac.uk/clayton/software/ 14 | 15 | The original code is published under the GNU General Public Licence version 3 (GPLv3). 16 | 17 | > The snp.matrix and X.snp.matrix classes. 18 | > Copyright (C) 2008 David Clayton and Hin-Tak Leung 19 | 20 | As we use the same license, see @ref supplement_license for the complete license. 21 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/d_04_gsl.inc: -------------------------------------------------------------------------------- 1 | ## GSL (GNU Scientific Library) @anchor supplement_acknowledgements_code_reuse_gsl 2 | 3 | The implementation of the multinomial distribution 4 | @link genesis::utils::multinomial_distribution() multinomial_distribution()@endlink 5 | is based on the GSL (GNU Scientific Library) function `gsl_ran_multinomial()`. 6 | We further have an unused function 7 | @link genesis::utils::hypergeometric_distribution_gsl() hypergeometric_distribution_gsl()@endlink 8 | based on `gsl_ran_hypergeometric()` from the GSL. 9 | 10 | The original code is published under the GNU General Public Licence version 3 (GPLv3). 11 | 12 | > randist/multinomial.c 13 | > Copyright (C) 2002 Gavin E. Crooks 14 | > 15 | > randist/hyperg.c 16 | > Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 James Theiler, Brian Gough 17 | 18 | As we use the same license, see @ref supplement_license for the complete license. 19 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/d_05_stocc.inc: -------------------------------------------------------------------------------- 1 | ## stocc random project @anchor supplement_acknowledgements_code_reuse_stocc 2 | 3 | The implementation of the hypergeometric distribution functions 4 | @link genesis::utils::multivariate_hypergeometric_distribution() multivariate_hypergeometric_distribution()@endlink, 5 | @link genesis::utils::hypergeometric_distribution() hypergeometric_distribution()@endlink, 6 | @link genesis::utils::hypergeometric_distribution_inversion_mode_() hypergeometric_distribution_inversion_mode_()@endlink, 7 | @link genesis::utils::hypergeometric_distribution_ratio_of_unifoms_() hypergeometric_distribution_ratio_of_unifoms_()@endlink, 8 | are based on the stocc.zip non-uniform random number generator functions by Agner Fog. 9 | The original code is published under the GNU General Public Licence. 10 | 11 | > Author: Agner Fog 12 | > Date created: 2002-01-04 13 | > Last modified: 2008-11-30 14 | > Project: stocc.zip 15 | > Source URL: www.agner.org/random 16 | > 17 | > Description: 18 | > Non-uniform random number generator functions. 19 | > 20 | > This file contains source code for the class StochasticLib1 defined in stocc.h. 21 | > 22 | > Documentation: 23 | > ============== 24 | > The file stocc.h contains class definitions. 25 | > The file stocc.htm contains further instructions. 26 | > The file distrib.pdf contains definitions of the statistic distributions. 27 | > The file sampmet.pdf contains theoretical descriptions of the methods used 28 | > for sampling from these distributions. 29 | > The file ran-instructions.pdf contains general instructions. 30 | > 31 | > Copyright 2002-2008 by Agner Fog. 32 | > GNU General Public License http://www.gnu.org/licenses/gpl.html 33 | 34 | As we use the same license, see @ref supplement_license for the complete license. 35 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/d_06_min_enc_can_kmer.inc: -------------------------------------------------------------------------------- 1 | ## MinEncCanKmer @anchor supplement_acknowledgements_code_reuse_min_enc_can_kmer 2 | 3 | The implementation of the minimal encoding of canonical k-mers in 4 | @link genesis::sequence::MinimalCanonicalEncoding MinimalCanonicalEncoding@endlink 5 | is based on the implementation at https://gitlab.ub.uni-bielefeld.de/gi/MinEncCanKmer 6 | which is published under the GNU General Public License v3.0 or later, 7 | with copyright (C) 2022-2023 Roland Wittler . 8 | 9 | The concept is described in the following excellent manuscript: 10 | 11 | > Wittler, Roland. 2023. “General Encoding of Canonical k-Mers.” Peer Community Journal 3 (e87). 12 | > https://doi.org/10.24072/pcjournal.323. 13 | 14 | See there and the original code repository for details. 15 | As we use the same license, see @ref supplement_license for the complete license. 16 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/e_01_md5.inc: -------------------------------------------------------------------------------- 1 | ## MD5 @anchor supplement_acknowledgements_code_reuse_md 2 | 3 | Our implementation of the @link genesis::utils::MD5 MD5 hashing function@endlink is based on 4 | http://www.zedwood.com/article/cpp-md5-function, 5 | which itself was converted to C++ class by Frank Thilo (thilo@unix-ag.org) for bzflag 6 | (http://www.bzflag.org), and is based on the reference implementation of `RFC 1321`: 7 | 8 | @htmlonly
License @endhtmlonly 9 | > Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. 10 | > 11 | > License to copy and use this software is granted provided that it 12 | > is identified as the "RSA Data Security, Inc. MD5 Message-Digest 13 | > Algorithm" in all material mentioning or referencing this software 14 | > or this function. 15 | > 16 | > License is also granted to make and use derivative works provided 17 | > that such works are identified as "derived from the RSA Data 18 | > Security, Inc. MD5 Message-Digest Algorithm" in all material 19 | > mentioning or referencing the derived work. 20 | > 21 | > RSA Data Security, Inc. makes no representations concerning either 22 | > the merchantability of this software or the suitability of this 23 | > software for any particular purpose. It is provided "as is" 24 | > without express or implied warranty of any kind. 25 | > 26 | > These notices must be retained in any copies of any part of this 27 | > documentation and/or software. 28 | @htmlonly
@endhtmlonly 29 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/e_02_sha1.inc: -------------------------------------------------------------------------------- 1 | ## SHA1 @anchor supplement_acknowledgements_code_reuse_sha 2 | 3 | Our implementation of the @link genesis::utils::SHA1 SHA1 hashing function@endlink is based on 4 | [https://github.com/vog/sha1](https://github.com/vog/sha1), which is 100% Public Domain. 5 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/f_01_matplotlib_colors.inc: -------------------------------------------------------------------------------- 1 | ## Matplotlib Color Maps @anchor supplement_acknowledgements_code_reuse_matplotlib_color_maps 2 | 3 | The color codes for the color maps @link genesis::utils::color_list_magma magma@endlink, 4 | @link genesis::utils::color_list_inferno inferno@endlink, 5 | @link genesis::utils::color_list_plasma plasma@endlink and 6 | @link genesis::utils::color_list_viridis viridis@endlink are taken from 7 | https://github.com/BIDS/colormap. They were created by Nathaniel J. Smith, Stefan van der Walt, 8 | and (in the case of viridis) Eric Firing. These colormaps are released under the CC0 license / 9 | public domain dedication. See https://creativecommons.org/publicdomain/zero/1.0/ for the license. 10 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/f_02_xkcd_colors.inc: -------------------------------------------------------------------------------- 1 | ## xkcd Color Names @anchor supplement_acknowledgements_code_reuse_xkcd_color_names 2 | 3 | The color names and codes for the list used in 4 | @link genesis::utils::color_from_name_xkcd() color_from_name_xkcd()@endlink and 5 | @link genesis::utils::is_xkcd_color_name() is_xkcd_color_name()@endlink are taken from 6 | [https://xkcd.com/color/rgb.txt](https://xkcd.com/color/rgb.txt). 7 | They were published under Public Domain, see https://xkcd.com/color/rgb/ and 8 | https://blog.xkcd.com/2010/05/03/color-survey-results/ for details. 9 | -------------------------------------------------------------------------------- /doc/manual/supplement/acknowledgements/f_04_nextstrain_colors.inc: -------------------------------------------------------------------------------- 1 | ## Nextstrain @anchor supplement_acknowledgements_code_reuse_nextstrain 2 | 3 | The color list @link genesis::utils::color_list_nextstrain() color_list_nextstrain()@endlink 4 | is adapted from the Nextstrain build for novel coronavirus (nCoV) at 5 | https://nextstrain.org/ncov, using their color scheme 6 | https://github.com/nextstrain/ncov/blob/master/config/color_schemes.tsv 7 | and converting it to RGB `double` values. 8 | The repository at https://github.com/nextstrain/ncov is published under the 9 | [MIT license](https://opensource.org/licenses/MIT): 10 | 11 | @htmlonly
License @endhtmlonly 12 | > MIT License 13 | > 14 | > Copyright (c) 2020 Nextstrain 15 | > 16 | > Permission is hereby granted, free of charge, to any person obtaining a copy 17 | > of this software and associated documentation files (the "Software"), to deal 18 | > in the Software without restriction, including without limitation the rights 19 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 20 | > copies of the Software, and to permit persons to whom the Software is 21 | > furnished to do so, subject to the following conditions: 22 | > 23 | > The above copyright notice and this permission notice shall be included in all 24 | > copies or substantial portions of the Software. 25 | > 26 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 27 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 28 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 29 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 30 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 31 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 | > SOFTWARE. 33 | @htmlonly
@endhtmlonly 34 | 35 | The license information above was copied from 36 | https://github.com/nextstrain/ncov/blob/master/LICENSE 37 | on 2020-04-05. 38 | -------------------------------------------------------------------------------- /doc/png/demos/hist_edpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/demos/hist_edpl.png -------------------------------------------------------------------------------- /doc/png/demos/hist_lwr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/demos/hist_lwr.png -------------------------------------------------------------------------------- /doc/png/placement/edpl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/edpl.png -------------------------------------------------------------------------------- /doc/png/placement/epa_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/epa_input.png -------------------------------------------------------------------------------- /doc/png/placement/epa_placement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/epa_placement.png -------------------------------------------------------------------------------- /doc/png/placement/epca_scatter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/epca_scatter.png -------------------------------------------------------------------------------- /doc/png/placement/epca_trees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/epca_trees.png -------------------------------------------------------------------------------- /doc/png/placement/labelled_tree_fully_resolved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/labelled_tree_fully_resolved.png -------------------------------------------------------------------------------- /doc/png/placement/labelled_tree_multifurcating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/labelled_tree_multifurcating.png -------------------------------------------------------------------------------- /doc/png/placement/squash_clustering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/squash_clustering.png -------------------------------------------------------------------------------- /doc/png/placement/visualize_placements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/placement/visualize_placements.png -------------------------------------------------------------------------------- /doc/png/tree/add_new_leaf_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/add_new_leaf_node.png -------------------------------------------------------------------------------- /doc/png/tree/add_new_node_edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/add_new_node_edge.png -------------------------------------------------------------------------------- /doc/png/tree/add_new_node_node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/add_new_node_node.png -------------------------------------------------------------------------------- /doc/png/tree/branch_length_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/branch_length_tree.png -------------------------------------------------------------------------------- /doc/png/tree/monophyletic_subtrees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/monophyletic_subtrees.png -------------------------------------------------------------------------------- /doc/png/tree/nodes_and_edges.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/nodes_and_edges.png -------------------------------------------------------------------------------- /doc/png/tree/red_blue_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/red_blue_tree.png -------------------------------------------------------------------------------- /doc/png/tree/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/structure.png -------------------------------------------------------------------------------- /doc/png/tree/subtree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/subtree.png -------------------------------------------------------------------------------- /doc/png/tree/traversal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/traversal.png -------------------------------------------------------------------------------- /doc/png/tree/traversal_levelorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/traversal_levelorder.png -------------------------------------------------------------------------------- /doc/png/tree/tree_rooting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/tree/tree_rooting.png -------------------------------------------------------------------------------- /doc/png/utils/color_lists.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/doc/png/utils/color_lists.png -------------------------------------------------------------------------------- /lib/genesis/genesis.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENESIS_H_ 2 | #define GENESIS_H_ 3 | 4 | /* 5 | Genesis - A toolkit for working with phylogenetic data. 6 | Copyright (C) 2014-2025 Lucas Czech 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (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, see . 20 | 21 | Contact: 22 | Lucas Czech 23 | University of Copenhagen, Globe Institute, Section for GeoGenetics 24 | Oster Voldgade 5-7, 1350 Copenhagen K, Denmark 25 | */ 26 | 27 | /** 28 | * @brief This header includes all other genesis headers (*.hpp). 29 | * This makes it easy to integrate the code as a library, as all 30 | * symbols of these headers are available after including this header. 31 | * 32 | * You do not need to edit this file manually. Simply run the script 33 | * make_genesis_header.sh in ./tools/deploy to update this file. 34 | */ 35 | 36 | #include "genesis/placement.hpp" 37 | #include "genesis/population.hpp" 38 | #include "genesis/sequence.hpp" 39 | #include "genesis/taxonomy.hpp" 40 | #include "genesis/tree.hpp" 41 | #include "genesis/utils.hpp" 42 | 43 | #endif // include guard 44 | -------------------------------------------------------------------------------- /lib/genesis/sequence/kmer/alphabet.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2025 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | University of Copenhagen, Globe Institute, Section for GeoGenetics 21 | Oster Voldgade 5-7, 1350 Copenhagen K, Denmark 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup sequence 29 | */ 30 | 31 | #include "genesis/sequence/kmer/alphabet.hpp" 32 | 33 | #include 34 | #include 35 | 36 | namespace genesis { 37 | namespace sequence { 38 | 39 | // ================================================================================================ 40 | // Nucleotide Alphabet 41 | // ================================================================================================ 42 | 43 | // Need out-of-line definition in C++11... Just to make the compiler happy. 44 | 45 | std::string const KmerAlphabet::ALPHABET = "ACGT"; 46 | 47 | // std::array constexpr KmerAlphabet::ascii_to_nt4; 48 | 49 | } // namespace sequence 50 | } // namespace genesis 51 | -------------------------------------------------------------------------------- /lib/genesis/sequence/kmer/bitfield.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2025 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | University of Copenhagen, Globe Institute, Section for GeoGenetics 21 | Oster Voldgade 5-7, 1350 Copenhagen K, Denmark 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup sequence 29 | */ 30 | 31 | #include "genesis/sequence/kmer/bitfield.hpp" 32 | 33 | #include 34 | #include 35 | 36 | namespace genesis { 37 | namespace sequence { 38 | 39 | // ================================================================================================ 40 | // Definitions 41 | // ================================================================================================ 42 | 43 | // Need out-of-line definition in C++11... Just to make the compiler happy. 44 | 45 | constexpr KmerBitfield::WordType KmerBitfield::ALL_0; 46 | constexpr KmerBitfield::WordType KmerBitfield::ALL_1; 47 | constexpr std::array KmerBitfield::char_mask; 48 | constexpr std::array KmerBitfield::ones_mask; 49 | 50 | } // namespace sequence 51 | } // namespace genesis 52 | -------------------------------------------------------------------------------- /lib/genesis/sequence/kmer/canonical_encoding.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2025 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | University of Copenhagen, Globe Institute, Section for GeoGenetics 21 | Oster Voldgade 5-7, 1350 Copenhagen K, Denmark 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup sequence 29 | */ 30 | 31 | #include "genesis/sequence/kmer/canonical_encoding.hpp" 32 | 33 | namespace genesis { 34 | namespace sequence { 35 | 36 | // ================================================================================================ 37 | // Definitions 38 | // ================================================================================================ 39 | 40 | // Need out-of-line definition in C++11... Just to make the compiler happy. 41 | 42 | constexpr std::array MinimalCanonicalEncoding::replace_; 43 | // constexpr std::array MinimalCanonicalEncoding::reverse_; 44 | 45 | } // namespace sequence 46 | } // namespace genesis 47 | -------------------------------------------------------------------------------- /lib/genesis/taxonomy/functions/ranks.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENESIS_TAXONOMY_FUNCTIONS_RANKS_H_ 2 | #define GENESIS_TAXONOMY_FUNCTIONS_RANKS_H_ 3 | 4 | /* 5 | Genesis - A toolkit for working with phylogenetic data. 6 | Copyright (C) 2014-2017 Lucas Czech 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (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, see . 20 | 21 | Contact: 22 | Lucas Czech 23 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 24 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 25 | */ 26 | 27 | /** 28 | * @brief 29 | * 30 | * @file 31 | * @ingroup taxonomy 32 | */ 33 | 34 | #include 35 | #include 36 | 37 | namespace genesis { 38 | namespace taxonomy { 39 | 40 | // ================================================================================================= 41 | // Ranks 42 | // ================================================================================================= 43 | 44 | std::string rank_from_abbreviation( char r ); 45 | std::string rank_to_abbreviation( std::string const& rank ); 46 | 47 | std::pair< std::string, std::string > resolve_rank_abbreviation( std::string const& entry ); 48 | 49 | } // namespace taxonomy 50 | } // namespace genesis 51 | 52 | #endif // include guard 53 | -------------------------------------------------------------------------------- /lib/genesis/utils/containers/interval_tree/fwd.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENESIS_UTILS_CONTAINERS_INTERVAL_TREE_FWD_H_ 2 | #define GENESIS_UTILS_CONTAINERS_INTERVAL_TREE_FWD_H_ 3 | 4 | /* 5 | Genesis - A toolkit for working with phylogenetic data. 6 | Copyright (C) 2014-2021 Lucas Czech 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (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, see . 20 | 21 | Contact: 22 | Lucas Czech 23 | Department of Plant Biology, Carnegie Institution For Science 24 | 260 Panama Street, Stanford, CA 94305, USA 25 | */ 26 | 27 | /** 28 | * @brief 29 | * 30 | * @file 31 | * @ingroup utils 32 | */ 33 | 34 | namespace genesis { 35 | namespace utils { 36 | 37 | // ================================================================================================= 38 | // Forward Declarations 39 | // ================================================================================================= 40 | 41 | template 42 | struct Interval; 43 | 44 | template 45 | class IntervalTree; 46 | 47 | template 48 | class IntervalTreeNode; 49 | 50 | template 51 | class IntervalTreeIterator; 52 | 53 | } // namespace utils 54 | } // namespace genesis 55 | 56 | #endif // include guard 57 | -------------------------------------------------------------------------------- /lib/genesis/utils/formats/nexus/block.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2017 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 21 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup utils 29 | */ 30 | 31 | 32 | #include "genesis/utils/formats/nexus/block.hpp" 33 | 34 | // #include 35 | 36 | namespace genesis { 37 | namespace utils { 38 | 39 | // ================================================================================================= 40 | // Operators 41 | // ================================================================================================= 42 | 43 | // std::ostream& operator<< ( std::ostream& os, Block const& block ) 44 | // { 45 | // block.to_stream( os ); 46 | // return os; 47 | // } 48 | 49 | } // namespace utils 50 | } // namespace genesis 51 | -------------------------------------------------------------------------------- /lib/genesis/utils/io/base64.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENESIS_UTILS_IO_BASE64_H_ 2 | #define GENESIS_UTILS_IO_BASE64_H_ 3 | 4 | /* 5 | Genesis - A toolkit for working with phylogenetic data. 6 | Copyright (C) 2014-2020 Lucas Czech 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (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, see . 20 | 21 | Contact: 22 | Lucas Czech 23 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 24 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 25 | */ 26 | 27 | /** 28 | * @brief 29 | * 30 | * @file 31 | * @ingroup utils 32 | */ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | namespace genesis { 39 | namespace utils { 40 | 41 | // ================================================================================================ 42 | // Base 64 Encode/Decode 43 | // ================================================================================================ 44 | 45 | std::string base64_encode( std::vector const& input, size_t line_length = 76 ); 46 | std::string base64_encode( std::string const& input, size_t line_length = 76 ); 47 | 48 | std::vector base64_decode_uint8( std::string const& input ); 49 | std::string base64_decode_string( std::string const& input ); 50 | 51 | } // namespace utils 52 | } // namespace genesis 53 | 54 | #endif // include guard 55 | -------------------------------------------------------------------------------- /lib/genesis/utils/math/histogram/distances.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENESIS_UTILS_MATH_HISTOGRAM_DISTANCES_H_ 2 | #define GENESIS_UTILS_MATH_HISTOGRAM_DISTANCES_H_ 3 | 4 | /* 5 | Genesis - A toolkit for working with phylogenetic data. 6 | Copyright (C) 2014-2017 Lucas Czech 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (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, see . 20 | 21 | Contact: 22 | Lucas Czech 23 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 24 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 25 | */ 26 | 27 | /** 28 | * @brief Header of Histogram distance functions. 29 | * 30 | * @file 31 | * @ingroup utils 32 | */ 33 | 34 | namespace genesis { 35 | namespace utils { 36 | 37 | // ================================================================================================= 38 | // Forward Declarations 39 | // ================================================================================================= 40 | 41 | class Histogram; 42 | 43 | // ================================================================================================= 44 | // Histogram Distances 45 | // ================================================================================================= 46 | 47 | double earth_movers_distance (const Histogram& h1, const Histogram& h2, bool normalize = true); 48 | 49 | } // namespace utils 50 | } // namespace genesis 51 | 52 | #endif // include guard 53 | -------------------------------------------------------------------------------- /lib/genesis/utils/math/histogram/operations.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GENESIS_UTILS_MATH_HISTOGRAM_OPERATIONS_H_ 2 | #define GENESIS_UTILS_MATH_HISTOGRAM_OPERATIONS_H_ 3 | 4 | /* 5 | Genesis - A toolkit for working with phylogenetic data. 6 | Copyright (C) 2014-2017 Lucas Czech 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (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, see . 20 | 21 | Contact: 22 | Lucas Czech 23 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 24 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 25 | */ 26 | 27 | /** 28 | * @brief Header of Histogram operations functions. 29 | * 30 | * @file 31 | * @ingroup utils 32 | */ 33 | 34 | namespace genesis { 35 | namespace utils { 36 | 37 | // ================================================================================================= 38 | // Forward Declarations 39 | // ================================================================================================= 40 | 41 | class Histogram; 42 | 43 | // ================================================================================================= 44 | // Histogram Operations 45 | // ================================================================================================= 46 | 47 | void offset (Histogram& h, double value); 48 | 49 | void scale (Histogram& h, double factor); 50 | 51 | void normalize (Histogram& h, double total = 1.0); 52 | 53 | } // namespace utils 54 | } // namespace genesis 55 | 56 | #endif // include guard 57 | -------------------------------------------------------------------------------- /python/src/placement/formats/edge_color.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::placement; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( placement_formats_edge_color_export, ::genesis::placement, scope ) 15 | { 16 | 17 | scope.def( 18 | "placement_color_count_gradient", 19 | ( std::vector< utils::Color > ( * )( Sample const &, bool ))( &::genesis::placement::placement_color_count_gradient ), 20 | pybind11::arg("smp"), 21 | pybind11::arg("linear")=(bool)(false) 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /python/src/placement/formats/serializer.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::placement; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::placement::SampleSerializer, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class SampleSerializer 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::placement::SampleSerializer, std::shared_ptr<::genesis::placement::SampleSerializer> > ( scope, "SampleSerializer" ) 22 | 23 | // Public Member Functions 24 | 25 | .def_static( 26 | "load", 27 | ( Sample ( * )( std::string const & ))( &::genesis::placement::SampleSerializer::load ), 28 | pybind11::arg("file_name") 29 | ) 30 | .def_static( 31 | "load", 32 | ( SampleSet ( * )( std::vector< std::string > const & ))( &::genesis::placement::SampleSerializer::load ), 33 | pybind11::arg("file_names") 34 | ) 35 | .def_static( 36 | "load", 37 | ( void ( * )( std::vector< std::string > const &, SampleSet & ))( &::genesis::placement::SampleSerializer::load ), 38 | pybind11::arg("file_names"), 39 | pybind11::arg("sample_set") 40 | ) 41 | .def_static( 42 | "save", 43 | ( void ( * )( Sample const &, std::string const & ))( &::genesis::placement::SampleSerializer::save ), 44 | pybind11::arg("map"), 45 | pybind11::arg("file_name") 46 | ) 47 | ; 48 | } 49 | -------------------------------------------------------------------------------- /python/src/placement/function/cog.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::placement; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( placement_function_cog_export, ::genesis::placement, scope ) 15 | { 16 | 17 | scope.def( 18 | "center_of_gravity_distance", 19 | ( double ( * )( Sample const &, Sample const &, bool const ))( &::genesis::placement::center_of_gravity_distance ), 20 | pybind11::arg("smp_a"), 21 | pybind11::arg("smp_b"), 22 | pybind11::arg("with_pendant_length")=(bool const)(false), 23 | get_docstring("double ::genesis::placement::center_of_gravity_distance (Sample const & smp_a, Sample const & smp_b, bool const with_pendant_length=false)") 24 | ); 25 | 26 | scope.def( 27 | "center_of_gravity_variance", 28 | ( double ( * )( Sample const &, bool const ))( &::genesis::placement::center_of_gravity_variance ), 29 | pybind11::arg("smp"), 30 | pybind11::arg("with_pendant_length")=(bool const)(false), 31 | get_docstring("double ::genesis::placement::center_of_gravity_variance (Sample const & smp, bool const with_pendant_length=false)") 32 | ); 33 | 34 | scope.def( 35 | "center_of_gravity", 36 | ( std::pair< PlacementTreeEdge const *, double > ( * )( Sample const &, bool const ))( &::genesis::placement::center_of_gravity ), 37 | pybind11::arg("smp"), 38 | pybind11::arg("with_pendant_length")=(bool const)(false), 39 | get_docstring("std::pair< PlacementTreeEdge const *, double > ::genesis::placement::center_of_gravity (Sample const & smp, bool const with_pendant_length=false)") 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /python/src/placement/function/emd.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::placement; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( placement_function_emd_export, ::genesis::placement, scope ) 15 | { 16 | 17 | scope.def( 18 | "earth_movers_distance", 19 | ( double ( * )( Sample const &, Sample const &, double const, bool const ))( &::genesis::placement::earth_movers_distance ), 20 | pybind11::arg("lhs"), 21 | pybind11::arg("rhs"), 22 | pybind11::arg("p")=(double const)(1.0), 23 | pybind11::arg("with_pendant_length")=(bool const)(false), 24 | get_docstring("double ::genesis::placement::earth_movers_distance (Sample const & lhs, Sample const & rhs, double const p=1.0, bool const with_pendant_length=false)") 25 | ); 26 | 27 | scope.def( 28 | "earth_movers_distance", 29 | ( utils::Matrix< double > ( * )( SampleSet const &, double const, bool const ))( &::genesis::placement::earth_movers_distance ), 30 | pybind11::arg("sample_set"), 31 | pybind11::arg("p")=(double const)(1.0), 32 | pybind11::arg("with_pendant_length")=(bool const)(false), 33 | get_docstring("utils::Matrix< double > ::genesis::placement::earth_movers_distance (SampleSet const & sample_set, double const p=1.0, bool const with_pendant_length=false)") 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /python/src/placement/function/tree.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::placement; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( placement_function_tree_export, ::genesis::placement, scope ) 15 | { 16 | 17 | scope.def( 18 | "labelled_tree", 19 | ( tree::Tree ( * )( Sample const &, bool, std::string const & ))( &::genesis::placement::labelled_tree ), 20 | pybind11::arg("sample"), 21 | pybind11::arg("fully_resolve")=(bool)(false), 22 | pybind11::arg("name_prefix")=(std::string const &)(""), 23 | get_docstring("tree::Tree ::genesis::placement::labelled_tree (Sample const & sample, bool fully_resolve=false, std::string const & name_prefix=\"\")") 24 | ); 25 | 26 | scope.def( 27 | "labelled_tree", 28 | ( tree::Tree ( * )( Sample const &, tree::Tree const &, bool, std::string const & ))( &::genesis::placement::labelled_tree ), 29 | pybind11::arg("sample"), 30 | pybind11::arg("tree"), 31 | pybind11::arg("fully_resolve")=(bool)(false), 32 | pybind11::arg("name_prefix")=(std::string const &)(""), 33 | get_docstring("tree::Tree ::genesis::placement::labelled_tree (Sample const & sample, tree::Tree const & tree, bool fully_resolve=false, std::string const & name_prefix=\"\")") 34 | ); 35 | } 36 | -------------------------------------------------------------------------------- /python/src/placement/pquery/name.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::placement; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::placement::PqueryName, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class PqueryName 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::placement::PqueryName, std::shared_ptr<::genesis::placement::PqueryName> > ( scope, "PqueryName" ) 22 | .def( 23 | pybind11::init< >(), 24 | get_docstring("::genesis::placement::PqueryName::PqueryName ()") 25 | ) 26 | .def( 27 | pybind11::init< std::string, double >(), 28 | pybind11::arg("name"), 29 | pybind11::arg("multiplicity")=(double)(1.0), 30 | get_docstring("::genesis::placement::PqueryName::PqueryName (std::string name, double multiplicity=1.0)") 31 | ) 32 | .def( 33 | pybind11::init< PqueryName const & >(), 34 | pybind11::arg("arg") 35 | ) 36 | ; 37 | } 38 | -------------------------------------------------------------------------------- /python/src/placement/pquery/plain.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::placement; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::placement::PqueryPlain, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class PqueryPlain 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::placement::PqueryPlain, std::shared_ptr<::genesis::placement::PqueryPlain> > ( scope, "PqueryPlain" ) 22 | ; 23 | } 24 | 25 | PYTHON_EXPORT_CLASS( ::genesis::placement::PqueryPlacementPlain, scope ) 26 | { 27 | 28 | // ------------------------------------------------------------------- 29 | // Class PqueryPlacementPlain 30 | // ------------------------------------------------------------------- 31 | 32 | pybind11::class_< ::genesis::placement::PqueryPlacementPlain, std::shared_ptr<::genesis::placement::PqueryPlacementPlain> > ( scope, "PqueryPlacementPlain" ) 33 | ; 34 | } 35 | -------------------------------------------------------------------------------- /python/src/sequence/formats/fasta_output_iterator.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::sequence; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::sequence::FastaOutputIterator, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class FastaOutputIterator 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::sequence::FastaOutputIterator, std::shared_ptr<::genesis::sequence::FastaOutputIterator> > ( scope, "FastaOutputIterator" ) 22 | // .def( 23 | // pybind11::init< >() 24 | // ) 25 | .def( 26 | pybind11::init< std::ostream & >(), 27 | pybind11::arg("out") 28 | ) 29 | .def( 30 | pybind11::init< std::ostream &, FastaWriter const & >(), 31 | pybind11::arg("out"), 32 | pybind11::arg("writer") 33 | ) 34 | .def( 35 | pybind11::init< ::genesis::sequence::FastaOutputIterator::self_type const & >(), 36 | pybind11::arg("arg") 37 | ) 38 | // .def( 39 | // pybind11::init< ::genesis::sequence::FastaOutputIterator::self_type && >(), 40 | // pybind11::arg("arg") 41 | // ) 42 | 43 | // Public Member Functions 44 | 45 | .def( 46 | "writer", 47 | ( FastaWriter & ( ::genesis::sequence::FastaOutputIterator::* )( ))( &::genesis::sequence::FastaOutputIterator::writer ), 48 | get_docstring("FastaWriter & ::genesis::sequence::FastaOutputIterator::writer ()") 49 | ) 50 | ; 51 | } 52 | -------------------------------------------------------------------------------- /python/src/taxonomy/functions/entropy_data.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::taxonomy::EntropyTaxonData, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class EntropyTaxonData 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::taxonomy::EntropyTaxonData, std::shared_ptr<::genesis::taxonomy::EntropyTaxonData> > ( scope, "EntropyTaxonData" ) 22 | 23 | // Public Member Functions 24 | 25 | .def( 26 | "clone", 27 | ( std::unique_ptr< BaseTaxonData > ( ::genesis::taxonomy::EntropyTaxonData::* )( ) const )( &::genesis::taxonomy::EntropyTaxonData::clone ), 28 | get_docstring("std::unique_ptr< BaseTaxonData > ::genesis::taxonomy::EntropyTaxonData::clone () const") 29 | ) 30 | .def_static( 31 | "create", 32 | ( std::unique_ptr< EntropyTaxonData > ( * )( ))( &::genesis::taxonomy::EntropyTaxonData::create ) 33 | ) 34 | // .def_static( 35 | // "status_abbreviation", 36 | // ( std::string ( * )( PruneStatus ))( &::genesis::taxonomy::EntropyTaxonData::status_abbreviation ), 37 | // pybind11::arg("stat") 38 | // ) 39 | // .def_static( 40 | // "status_text", 41 | // ( std::string ( * )( PruneStatus ))( &::genesis::taxonomy::EntropyTaxonData::status_text ), 42 | // pybind11::arg("stat") 43 | // ) 44 | ; 45 | } 46 | -------------------------------------------------------------------------------- /python/src/taxonomy/functions/operators.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | template 15 | void python_export_function_taxonomy_functions_operators_TaxonDataType () 16 | { 17 | scope.def( 18 | "taxonomy_data_is", 19 | ( bool ( * )( Taxonomy const & ))( &::genesis::taxonomy::taxonomy_data_is ), 20 | pybind11::arg("taxonomy"), 21 | get_docstring("bool ::genesis::taxonomy::taxonomy_data_is (Taxonomy const & taxonomy)") 22 | ); 23 | 24 | scope.def( 25 | "taxonomy_data_is_derived_from", 26 | ( bool ( * )( Taxonomy const & ))( &::genesis::taxonomy::taxonomy_data_is_derived_from ), 27 | pybind11::arg("taxonomy"), 28 | get_docstring("bool ::genesis::taxonomy::taxonomy_data_is_derived_from (Taxonomy const & taxonomy)") 29 | ); 30 | 31 | scope.def( 32 | "reset_taxonomy_data", 33 | ( void ( * )( Taxonomy &, bool ))( &::genesis::taxonomy::reset_taxonomy_data ), 34 | pybind11::arg("taxonomy"), 35 | pybind11::arg("allow_overwrite")=(bool)(true), 36 | get_docstring("void ::genesis::taxonomy::reset_taxonomy_data (Taxonomy & taxonomy, bool allow_overwrite=true)") 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /python/src/taxonomy/functions/ranks.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( taxonomy_functions_ranks_export, ::genesis::taxonomy, scope ) 15 | { 16 | 17 | scope.def( 18 | "resolve_rank_abbreviation", 19 | ( std::pair< std::string, std::string > ( * )( std::string const & ))( &::genesis::taxonomy::resolve_rank_abbreviation ), 20 | pybind11::arg("entry") 21 | ); 22 | 23 | scope.def( 24 | "rank_from_abbreviation", 25 | ( std::string ( * )( char ))( &::genesis::taxonomy::rank_from_abbreviation ), 26 | pybind11::arg("r") 27 | ); 28 | 29 | scope.def( 30 | "rank_to_abbreviation", 31 | ( std::string ( * )( std::string const & ))( &::genesis::taxonomy::rank_to_abbreviation ), 32 | pybind11::arg("rank") 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /python/src/taxonomy/functions/taxopath.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( taxonomy_functions_taxopath_export, ::genesis::taxonomy, scope ) 15 | { 16 | 17 | scope.def( 18 | "add_from_taxopath", 19 | ( Taxon & ( * )( Taxonomy &, Taxopath const &, bool ))( &::genesis::taxonomy::add_from_taxopath ), 20 | pybind11::arg("taxonomy"), 21 | pybind11::arg("taxopath"), 22 | pybind11::arg("expect_parents")=(bool)(false) 23 | ); 24 | 25 | scope.def( 26 | "find_taxon_by_taxopath", 27 | ( Taxon * ( * )( Taxonomy &, Taxopath const & ))( &::genesis::taxonomy::find_taxon_by_taxopath ), 28 | pybind11::arg("tax"), 29 | pybind11::arg("taxopath") 30 | ); 31 | 32 | scope.def( 33 | "find_taxon_by_taxopath", 34 | ( Taxon const * ( * )( Taxonomy const &, Taxopath const & ))( &::genesis::taxonomy::find_taxon_by_taxopath ), 35 | pybind11::arg("tax"), 36 | pybind11::arg("taxopath") 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /python/src/taxonomy/iterator/levelorder.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( taxonomy_iterator_levelorder_export, ::genesis::taxonomy, scope ) 15 | { 16 | 17 | scope.def( 18 | "levelorder_for_each", 19 | ( void ( * )( Taxonomy &, std::function< void(Taxon &)>, bool ))( &::genesis::taxonomy::levelorder_for_each ), 20 | pybind11::arg("tax"), 21 | pybind11::arg("fn"), 22 | pybind11::arg("include_inner_taxa")=(bool)(true), 23 | get_docstring("void ::genesis::taxonomy::levelorder_for_each (Taxonomy & tax, std::function< void(Taxon &)> fn, bool include_inner_taxa=true)") 24 | ); 25 | 26 | scope.def( 27 | "levelorder_for_each", 28 | ( void ( * )( Taxonomy const &, std::function< void(Taxon const &)>, bool ))( &::genesis::taxonomy::levelorder_for_each ), 29 | pybind11::arg("tax"), 30 | pybind11::arg("fn"), 31 | pybind11::arg("include_inner_taxa")=(bool)(true), 32 | get_docstring("void ::genesis::taxonomy::levelorder_for_each (Taxonomy const & tax, std::function< void(Taxon const &)> fn, bool include_inner_taxa=true)") 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /python/src/taxonomy/iterator/postorder.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( taxonomy_iterator_postorder_export, ::genesis::taxonomy, scope ) 15 | { 16 | 17 | scope.def( 18 | "postorder_for_each", 19 | ( void ( * )( Taxonomy &, std::function< void(Taxon &)>, bool ))( &::genesis::taxonomy::postorder_for_each ), 20 | pybind11::arg("tax"), 21 | pybind11::arg("fn"), 22 | pybind11::arg("include_inner_taxa")=(bool)(true), 23 | get_docstring("void ::genesis::taxonomy::postorder_for_each (Taxonomy & tax, std::function< void(Taxon &)> fn, bool include_inner_taxa=true)") 24 | ); 25 | 26 | scope.def( 27 | "postorder_for_each", 28 | ( void ( * )( Taxonomy const &, std::function< void(Taxon const &)>, bool ))( &::genesis::taxonomy::postorder_for_each ), 29 | pybind11::arg("tax"), 30 | pybind11::arg("fn"), 31 | pybind11::arg("include_inner_taxa")=(bool)(true), 32 | get_docstring("void ::genesis::taxonomy::postorder_for_each (Taxonomy const & tax, std::function< void(Taxon const &)> fn, bool include_inner_taxa=true)") 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /python/src/taxonomy/iterator/preorder.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( taxonomy_iterator_preorder_export, ::genesis::taxonomy, scope ) 15 | { 16 | 17 | scope.def( 18 | "preorder_for_each", 19 | ( void ( * )( Taxonomy &, std::function< void(Taxon &)>, bool ))( &::genesis::taxonomy::preorder_for_each ), 20 | pybind11::arg("tax"), 21 | pybind11::arg("fn"), 22 | pybind11::arg("include_inner_taxa")=(bool)(true), 23 | get_docstring("void ::genesis::taxonomy::preorder_for_each (Taxonomy & tax, std::function< void(Taxon &)> fn, bool include_inner_taxa=true)") 24 | ); 25 | 26 | scope.def( 27 | "preorder_for_each", 28 | ( void ( * )( Taxonomy const &, std::function< void(Taxon const &)>, bool ))( &::genesis::taxonomy::preorder_for_each ), 29 | pybind11::arg("tax"), 30 | pybind11::arg("fn"), 31 | pybind11::arg("include_inner_taxa")=(bool)(true), 32 | get_docstring("void ::genesis::taxonomy::preorder_for_each (Taxonomy const & tax, std::function< void(Taxon const &)> fn, bool include_inner_taxa=true)") 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /python/src/taxonomy/taxon_data.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::taxonomy; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::taxonomy::BaseTaxonData, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class BaseTaxonData 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::taxonomy::BaseTaxonData, std::shared_ptr<::genesis::taxonomy::BaseTaxonData> > ( scope, "BaseTaxonData" ) 22 | 23 | // Public Member Functions 24 | 25 | .def( 26 | "clone", 27 | ( std::unique_ptr< BaseTaxonData > ( ::genesis::taxonomy::BaseTaxonData::* )( ) const )( &::genesis::taxonomy::BaseTaxonData::clone ), 28 | get_docstring("std::unique_ptr< BaseTaxonData > ::genesis::taxonomy::BaseTaxonData::clone () const") 29 | ) 30 | .def_static( 31 | "create", 32 | ( std::unique_ptr< BaseTaxonData > ( * )( ))( &::genesis::taxonomy::BaseTaxonData::create ), 33 | get_docstring("static std::unique_ptr< BaseTaxonData > ::genesis::taxonomy::BaseTaxonData::create ()") 34 | ) 35 | ; 36 | } 37 | -------------------------------------------------------------------------------- /python/src/tree/bipartition/bipartition.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::Bipartition, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class Bipartition 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::Bipartition, std::shared_ptr<::genesis::tree::Bipartition> > ( scope, "Bipartition" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< TreeLink const &, utils::Bitvector const & >(), 27 | pybind11::arg("link"), 28 | pybind11::arg("leaf_nodes") 29 | ) 30 | .def( 31 | pybind11::init< Bipartition const & >(), 32 | pybind11::arg("arg") 33 | ) 34 | 35 | // Public Member Functions 36 | 37 | .def( 38 | "bitvector", 39 | ( utils::Bitvector & ( ::genesis::tree::Bipartition::* )( ))( &::genesis::tree::Bipartition::bitvector ) 40 | ) 41 | .def( 42 | "empty", 43 | ( bool ( ::genesis::tree::Bipartition::* )( ) const )( &::genesis::tree::Bipartition::empty ) 44 | ) 45 | .def( 46 | "invert", 47 | ( void ( ::genesis::tree::Bipartition::* )( ))( &::genesis::tree::Bipartition::invert ) 48 | ) 49 | .def( 50 | "leaf_nodes", 51 | ( utils::Bitvector const & ( ::genesis::tree::Bipartition::* )( ) const )( &::genesis::tree::Bipartition::leaf_nodes ) 52 | ) 53 | .def( 54 | "link", 55 | ( TreeLink const & ( ::genesis::tree::Bipartition::* )( ) const )( &::genesis::tree::Bipartition::link ) 56 | ) 57 | ; 58 | } 59 | -------------------------------------------------------------------------------- /python/src/tree/common_tree/edge_color.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( tree_common_tree_edge_color_export, ::genesis::tree, scope ) 15 | { 16 | 17 | scope.def( 18 | "edge_color_branch_length_gradient", 19 | ( std::vector< utils::Color > ( * )( Tree const &, bool ))( &::genesis::tree::edge_color_branch_length_gradient ), 20 | pybind11::arg("tree"), 21 | pybind11::arg("zero_based")=(bool)(false) 22 | ); 23 | } 24 | -------------------------------------------------------------------------------- /python/src/tree/common_tree/operators.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( tree_common_tree_operators_export, ::genesis::tree, scope ) 15 | { 16 | 17 | scope.def( 18 | "convert_to_common_tree", 19 | ( CommonTree ( * )( Tree const & ))( &::genesis::tree::convert_to_common_tree ), 20 | pybind11::arg("source_tree"), 21 | get_docstring("CommonTree ::genesis::tree::convert_to_common_tree (Tree const & source_tree)") 22 | ); 23 | 24 | scope.def( 25 | "equal_common_trees", 26 | ( bool ( * )( Tree const &, Tree const &, bool, bool ))( &::genesis::tree::equal_common_trees ), 27 | pybind11::arg("lhs"), 28 | pybind11::arg("rhs"), 29 | pybind11::arg("compare_node_names")=(bool)(true), 30 | pybind11::arg("compare_branch_lengths")=(bool)(true), 31 | get_docstring("bool ::genesis::tree::equal_common_trees (Tree const & lhs, Tree const & rhs, bool compare_node_names=true, bool compare_branch_lengths=true)") 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /python/src/tree/drawing/circular_layout.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::CircularLayout, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class CircularLayout 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::CircularLayout, std::shared_ptr<::genesis::tree::CircularLayout> > ( scope, "CircularLayout" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< Tree const &, LayoutType const, bool >(), 27 | pybind11::arg("orig_tree"), 28 | pybind11::arg("drawing_type"), 29 | pybind11::arg("ladderize")=(bool)(true) 30 | ) 31 | .def( 32 | pybind11::init< CircularLayout const & >(), 33 | pybind11::arg("arg") 34 | ) 35 | 36 | // Public Member Functions 37 | 38 | .def( 39 | "radius", 40 | ( CircularLayout & ( ::genesis::tree::CircularLayout::* )( double const ))( &::genesis::tree::CircularLayout::radius ), 41 | pybind11::arg("value") 42 | ) 43 | .def( 44 | "radius", 45 | ( double ( ::genesis::tree::CircularLayout::* )( ) const )( &::genesis::tree::CircularLayout::radius ) 46 | ) 47 | ; 48 | } 49 | -------------------------------------------------------------------------------- /python/src/tree/drawing/rectangular_layout.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::RectangularLayout, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class RectangularLayout 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::RectangularLayout, std::shared_ptr<::genesis::tree::RectangularLayout> > ( scope, "RectangularLayout" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< Tree const &, LayoutType const, bool >(), 27 | pybind11::arg("orig_tree"), 28 | pybind11::arg("drawing_type"), 29 | pybind11::arg("ladderize")=(bool)(true) 30 | ) 31 | .def( 32 | pybind11::init< RectangularLayout const & >(), 33 | pybind11::arg("arg") 34 | ) 35 | 36 | // Public Member Functions 37 | 38 | .def( 39 | "height", 40 | ( RectangularLayout & ( ::genesis::tree::RectangularLayout::* )( double const ))( &::genesis::tree::RectangularLayout::height ), 41 | pybind11::arg("value") 42 | ) 43 | .def( 44 | "height", 45 | ( double ( ::genesis::tree::RectangularLayout::* )( ) const )( &::genesis::tree::RectangularLayout::height ) 46 | ) 47 | .def( 48 | "width", 49 | ( RectangularLayout & ( ::genesis::tree::RectangularLayout::* )( double const ))( &::genesis::tree::RectangularLayout::width ), 50 | pybind11::arg("value") 51 | ) 52 | .def( 53 | "width", 54 | ( double ( ::genesis::tree::RectangularLayout::* )( ) const )( &::genesis::tree::RectangularLayout::width ) 55 | ) 56 | ; 57 | } 58 | -------------------------------------------------------------------------------- /python/src/tree/formats/phyloxml/color_writer_plugin.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::PhyloxmlColorWriterPlugin, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class PhyloxmlColorWriterPlugin 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::PhyloxmlColorWriterPlugin, std::shared_ptr<::genesis::tree::PhyloxmlColorWriterPlugin> > ( scope, "PhyloxmlColorWriterPlugin" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< PhyloxmlColorWriterPlugin const & >(), 27 | pybind11::arg("arg") 28 | ) 29 | 30 | // Public Member Functions 31 | 32 | .def( 33 | "edge_to_element", 34 | ( void ( ::genesis::tree::PhyloxmlColorWriterPlugin::* )( TreeEdge const &, utils::XmlElement & ) const )( &::genesis::tree::PhyloxmlColorWriterPlugin::edge_to_element ), 35 | pybind11::arg("edge"), 36 | pybind11::arg("element") 37 | ) 38 | .def( 39 | "prepare_writing", 40 | ( void ( ::genesis::tree::PhyloxmlColorWriterPlugin::* )( Tree const &, utils::XmlDocument & ) const )( &::genesis::tree::PhyloxmlColorWriterPlugin::prepare_writing ), 41 | pybind11::arg("tree"), 42 | pybind11::arg("xml") 43 | ) 44 | .def( 45 | "register_with", 46 | ( void ( ::genesis::tree::PhyloxmlColorWriterPlugin::* )( PhyloxmlWriter & ) const )( &::genesis::tree::PhyloxmlColorWriterPlugin::register_with ), 47 | pybind11::arg("writer") 48 | ) 49 | ; 50 | } 51 | -------------------------------------------------------------------------------- /python/src/tree/function/lca_lookup.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::LcaLookup, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class LcaLookup 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::LcaLookup, std::shared_ptr<::genesis::tree::LcaLookup> > ( scope, "LcaLookup" ) 22 | // .def( 23 | // pybind11::init< >() 24 | // ) 25 | .def( 26 | pybind11::init< Tree const & >(), 27 | pybind11::arg("tree") 28 | ) 29 | .def( 30 | pybind11::init< LcaLookup const & >(), 31 | pybind11::arg("other") 32 | ) 33 | ; 34 | } 35 | -------------------------------------------------------------------------------- /python/src/tree/function/operators.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | template 15 | void python_export_function_tree_function_operators_NodeDataType_EdgeDataType () 16 | { 17 | scope.def( 18 | "tree_data_is", 19 | ( bool ( * )( Tree const & ))( &::genesis::tree::tree_data_is ), 20 | pybind11::arg("tree"), 21 | get_docstring("bool ::genesis::tree::tree_data_is (Tree const & tree)") 22 | ); 23 | 24 | scope.def( 25 | "tree_data_is_derived_from", 26 | ( bool ( * )( Tree const & ))( &::genesis::tree::tree_data_is_derived_from ), 27 | pybind11::arg("tree"), 28 | get_docstring("bool ::genesis::tree::tree_data_is_derived_from (Tree const & tree)") 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /python/src/tree/function/tree_set.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( tree_function_tree_set_export, ::genesis::tree, scope ) 15 | { 16 | 17 | scope.def( 18 | "find_tree", 19 | ( Tree * ( * )( TreeSet &, std::string const & ))( &::genesis::tree::find_tree ), 20 | pybind11::arg("tset"), 21 | pybind11::arg("name"), 22 | get_docstring("Tree * ::genesis::tree::find_tree (TreeSet & tset, std::string const & name)") 23 | ); 24 | 25 | scope.def( 26 | "find_tree", 27 | ( Tree const * ( * )( TreeSet const &, std::string const & ))( &::genesis::tree::find_tree ), 28 | pybind11::arg("tset"), 29 | pybind11::arg("name"), 30 | get_docstring("Tree const * ::genesis::tree::find_tree (TreeSet const & tset, std::string const & name)") 31 | ); 32 | 33 | scope.def( 34 | "all_equal", 35 | ( bool ( * )( TreeSet const &, std::function< bool(TreeNode const &, TreeNode const &)>, std::function< bool(TreeEdge const &, TreeEdge const &)> ))( &::genesis::tree::all_equal ), 36 | pybind11::arg("tset"), 37 | pybind11::arg("node_comparator"), 38 | pybind11::arg("edge_comparator"), 39 | get_docstring("bool ::genesis::tree::all_equal (TreeSet const & tset, std::function< bool(TreeNode const &, TreeNode const &)> node_comparator, std::function< bool(TreeEdge const &, TreeEdge const &)> edge_comparator)") 40 | ); 41 | 42 | scope.def( 43 | "all_identical_topology", 44 | ( bool ( * )( TreeSet const & ))( &::genesis::tree::all_identical_topology ), 45 | pybind11::arg("tset"), 46 | get_docstring("bool ::genesis::tree::all_identical_topology (TreeSet const & tset)") 47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /python/src/tree/mass_tree/emd.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( tree_mass_tree_emd_export, ::genesis::tree, scope ) 15 | { 16 | 17 | scope.def( 18 | "earth_movers_distance", 19 | ( double ( * )( MassTree const &, MassTree const &, double ))( &::genesis::tree::earth_movers_distance ), 20 | pybind11::arg("lhs"), 21 | pybind11::arg("rhs"), 22 | pybind11::arg("p")=(double)(1.0), 23 | get_docstring("double ::genesis::tree::earth_movers_distance (MassTree const & lhs, MassTree const & rhs, double p=1.0)") 24 | ); 25 | 26 | scope.def( 27 | "earth_movers_distance", 28 | ( std::pair< double, double > ( * )( MassTree const &, double ))( &::genesis::tree::earth_movers_distance ), 29 | pybind11::arg("tree"), 30 | pybind11::arg("p")=(double)(1.0), 31 | get_docstring("std::pair< double, double > ::genesis::tree::earth_movers_distance (MassTree const & tree, double p=1.0)") 32 | ); 33 | 34 | scope.def( 35 | "earth_movers_distance", 36 | ( utils::Matrix< double > ( * )( std::vector< MassTree > const &, double ))( &::genesis::tree::earth_movers_distance ), 37 | pybind11::arg("trees"), 38 | pybind11::arg("p")=(double)(1.0), 39 | get_docstring("utils::Matrix< double > ::genesis::tree::earth_movers_distance (std::vector< MassTree > const & trees, double p=1.0)") 40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /python/src/tree/mass_tree/kmeans.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::MassTreeKmeans, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class MassTreeKmeans 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::MassTreeKmeans, std::shared_ptr<::genesis::tree::MassTreeKmeans> > ( scope, "MassTreeKmeans" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< MassTreeKmeans const & >(), 27 | pybind11::arg("arg") 28 | ) 29 | 30 | // Public Member Functions 31 | 32 | .def( 33 | "accumulate_centroid_masses", 34 | ( size_t ( ::genesis::tree::MassTreeKmeans::* )( ) const )( &::genesis::tree::MassTreeKmeans::accumulate_centroid_masses ) 35 | ) 36 | .def( 37 | "accumulate_centroid_masses", 38 | ( void ( ::genesis::tree::MassTreeKmeans::* )( size_t ))( &::genesis::tree::MassTreeKmeans::accumulate_centroid_masses ), 39 | pybind11::arg("value") 40 | ) 41 | ; 42 | } 43 | -------------------------------------------------------------------------------- /python/src/tree/printer/detailed.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::PrinterDetailed, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class PrinterDetailed 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::PrinterDetailed, std::shared_ptr<::genesis::tree::PrinterDetailed> > ( scope, "PrinterDetailed" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< PrinterDetailed const & >(), 27 | pybind11::arg("arg") 28 | ) 29 | 30 | // Public Member Functions 31 | 32 | .def( 33 | "print", 34 | ( std::string ( ::genesis::tree::PrinterDetailed::* )( Tree const & ) const )( &::genesis::tree::PrinterDetailed::print ), 35 | pybind11::arg("tree") 36 | ) 37 | .def( 38 | "print", 39 | ( void ( ::genesis::tree::PrinterDetailed::* )( std::ostream &, Tree const & ) const )( &::genesis::tree::PrinterDetailed::print ), 40 | pybind11::arg("out"), 41 | pybind11::arg("tree") 42 | ) 43 | .def( 44 | "use_color", 45 | ( PrinterDetailed & ( ::genesis::tree::PrinterDetailed::* )( bool ))( &::genesis::tree::PrinterDetailed::use_color ), 46 | pybind11::arg("value") 47 | ) 48 | .def( 49 | "use_color", 50 | ( bool ( ::genesis::tree::PrinterDetailed::* )( ) const )( &::genesis::tree::PrinterDetailed::use_color ) 51 | ) 52 | ; 53 | } 54 | -------------------------------------------------------------------------------- /python/src/tree/printer/table.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::PrinterTable, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class PrinterTable 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::PrinterTable, std::shared_ptr<::genesis::tree::PrinterTable> > ( scope, "PrinterTable" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< PrinterTable const & >(), 27 | pybind11::arg("arg") 28 | ) 29 | 30 | // Public Member Functions 31 | 32 | .def( 33 | "print", 34 | ( std::string ( ::genesis::tree::PrinterTable::* )( Tree const & ))( &::genesis::tree::PrinterTable::print ), 35 | pybind11::arg("tree") 36 | ) 37 | .def( 38 | "print", 39 | ( void ( ::genesis::tree::PrinterTable::* )( std::ostream &, Tree const & ))( &::genesis::tree::PrinterTable::print ), 40 | pybind11::arg("out"), 41 | pybind11::arg("tree") 42 | ) 43 | ; 44 | } 45 | -------------------------------------------------------------------------------- /python/src/tree/tree/edge_data.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::BaseEdgeData, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class BaseEdgeData 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::BaseEdgeData, std::shared_ptr<::genesis::tree::BaseEdgeData> > ( scope, "BaseEdgeData" ) 22 | 23 | // Public Member Functions 24 | 25 | .def( 26 | "clone", 27 | ( std::unique_ptr< BaseEdgeData > ( ::genesis::tree::BaseEdgeData::* )( ) const )( &::genesis::tree::BaseEdgeData::clone ), 28 | get_docstring("std::unique_ptr< BaseEdgeData > ::genesis::tree::BaseEdgeData::clone () const") 29 | ) 30 | .def( 31 | "recreate", 32 | ( std::unique_ptr< BaseEdgeData > ( ::genesis::tree::BaseEdgeData::* )( ) const )( &::genesis::tree::BaseEdgeData::recreate ), 33 | get_docstring("std::unique_ptr< BaseEdgeData > ::genesis::tree::BaseEdgeData::recreate () const") 34 | ) 35 | .def_static( 36 | "create", 37 | ( std::unique_ptr< BaseEdgeData > ( * )( ))( &::genesis::tree::BaseEdgeData::create ), 38 | get_docstring("static std::unique_ptr< BaseEdgeData > ::genesis::tree::BaseEdgeData::create ()") 39 | ) 40 | ; 41 | } 42 | -------------------------------------------------------------------------------- /python/src/tree/tree/node_data.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::tree; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::tree::BaseNodeData, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class BaseNodeData 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::tree::BaseNodeData, std::shared_ptr<::genesis::tree::BaseNodeData> > ( scope, "BaseNodeData" ) 22 | 23 | // Public Member Functions 24 | 25 | .def( 26 | "clone", 27 | ( std::unique_ptr< BaseNodeData > ( ::genesis::tree::BaseNodeData::* )( ) const )( &::genesis::tree::BaseNodeData::clone ), 28 | get_docstring("std::unique_ptr< BaseNodeData > ::genesis::tree::BaseNodeData::clone () const") 29 | ) 30 | .def( 31 | "recreate", 32 | ( std::unique_ptr< BaseNodeData > ( ::genesis::tree::BaseNodeData::* )( ) const )( &::genesis::tree::BaseNodeData::recreate ), 33 | get_docstring("std::unique_ptr< BaseNodeData > ::genesis::tree::BaseNodeData::recreate () const") 34 | ) 35 | .def_static( 36 | "create", 37 | ( std::unique_ptr< BaseNodeData > ( * )( ))( &::genesis::tree::BaseNodeData::create ), 38 | get_docstring("static std::unique_ptr< BaseNodeData > ::genesis::tree::BaseNodeData::create ()") 39 | ) 40 | ; 41 | } 42 | -------------------------------------------------------------------------------- /python/src/utils/containers/matrix/operators.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_containers_matrix_operators_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "triangular_index", 19 | ( size_t ( * )( size_t, size_t, size_t ))( &::genesis::utils::triangular_index ), 20 | pybind11::arg("i"), 21 | pybind11::arg("j"), 22 | pybind11::arg("n"), 23 | get_docstring("size_t ::genesis::utils::triangular_index (size_t i, size_t j, size_t n)") 24 | ); 25 | 26 | scope.def( 27 | "triangular_size", 28 | ( size_t ( * )( size_t ))( &::genesis::utils::triangular_size ), 29 | pybind11::arg("n"), 30 | get_docstring("size_t ::genesis::utils::triangular_size (size_t n)") 31 | ); 32 | 33 | scope.def( 34 | "triangular_indices", 35 | ( std::pair< size_t, size_t > ( * )( size_t, size_t ))( &::genesis::utils::triangular_indices ), 36 | pybind11::arg("k"), 37 | pybind11::arg("n"), 38 | get_docstring("std::pair< size_t, size_t > ::genesis::utils::triangular_indices (size_t k, size_t n)") 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /python/src/utils/containers/sorted_vector/operators.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | template 15 | void python_export_function_utils_containers_sorted_vector_operators_T () 16 | { 17 | scope.def( 18 | "equals", 19 | ( bool ( * )( SortedVector< T > const &, SortedVector< T > const & ))( &::genesis::utils::equals ), 20 | pybind11::arg("lhs"), 21 | pybind11::arg("rhs") 22 | ); 23 | 24 | scope.def( 25 | "is_subset_of", 26 | ( bool ( * )( SortedVector< T > const &, SortedVector< T > const & ))( &::genesis::utils::is_subset_of ), 27 | pybind11::arg("subset"), 28 | pybind11::arg("superset") 29 | ); 30 | 31 | scope.def( 32 | "is_subset_or_equal", 33 | ( bool ( * )( SortedVector< T > const &, SortedVector< T > const & ))( &::genesis::utils::is_subset_or_equal ), 34 | pybind11::arg("subset"), 35 | pybind11::arg("superset") 36 | ); 37 | 38 | scope.def( 39 | "operator!=", 40 | ( bool ( * )( SortedVector< T > const &, SortedVector< T > const & ))( &::genesis::utils::operator!= ), 41 | pybind11::arg("lhs"), 42 | pybind11::arg("rhs") 43 | ); 44 | 45 | scope.def( 46 | "operator==", 47 | ( bool ( * )( SortedVector< T > const &, SortedVector< T > const & ))( &::genesis::utils::operator== ), 48 | pybind11::arg("lhs"), 49 | pybind11::arg("rhs") 50 | ); 51 | } -------------------------------------------------------------------------------- /python/src/utils/core/range.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | template 13 | void PythonExportClass_::genesis::utils::Range(std::string name) 14 | { 15 | 16 | // ------------------------------------------------------------------- 17 | // Class Range 18 | // ------------------------------------------------------------------- 19 | 20 | using namespace ::genesis::utils; 21 | 22 | using RangeType = Range; 23 | 24 | pybind11::class_< RangeType, std::shared_ptr > ( scope, name.c_str() ) 25 | .def( 26 | pybind11::init< >() 27 | ) 28 | .def( 29 | pybind11::init< Container & >(), 30 | pybind11::arg("cont") 31 | ) 32 | .def( 33 | pybind11::init< Container const & >(), 34 | pybind11::arg("cont") 35 | ) 36 | .def( 37 | pybind11::init< iterator, iterator >(), 38 | pybind11::arg("begin"), 39 | pybind11::arg("end") 40 | ) 41 | .def( 42 | pybind11::init< Range const & >(), 43 | pybind11::arg("arg") 44 | ) 45 | 46 | // Iterators 47 | 48 | .def( 49 | "__iter__", 50 | []( ::genesis::utils::Range& obj ){ 51 | return pybind11::make_iterator( obj.begin(), obj.end() ); 52 | }, 53 | py::keep_alive<0, 1>() 54 | ) 55 | ; 56 | } 57 | -------------------------------------------------------------------------------- /python/src/utils/core/std.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | template 15 | void PythonExportClass_::genesis::utils::ArrowOperatorProxy(std::string name) 16 | { 17 | 18 | // ------------------------------------------------------------------- 19 | // Class ArrowOperatorProxy 20 | // ------------------------------------------------------------------- 21 | 22 | using namespace ::genesis::utils; 23 | 24 | using ArrowOperatorProxyType = ArrowOperatorProxy; 25 | 26 | pybind11::class_< ArrowOperatorProxyType, std::shared_ptr > ( scope, name.c_str() ) 27 | .def( 28 | pybind11::init< T const & >(), 29 | pybind11::arg("t") 30 | ) 31 | ; 32 | } 33 | 34 | template 35 | void python_export_function_utils_core_std_T_...Args () 36 | { 37 | scope.def( 38 | "make_unique", 39 | ( std::unique_ptr< T > ( * )( Args &&... ))( &::genesis::utils::make_unique ), 40 | pybind11::arg("args"), 41 | get_docstring("std::unique_ptr< T > ::genesis::utils::make_unique (Args &&... args)") 42 | ); 43 | } -------------------------------------------------------------------------------- /python/src/utils/core/version.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_core_version_export, ::genesis, scope ) 15 | { 16 | 17 | scope.def( 18 | "ee", 19 | ( std::string ( * )( int ))( &::genesis::ee ), 20 | pybind11::arg("r") 21 | ); 22 | 23 | scope.def( 24 | "genesis_header", 25 | ( std::string ( * )( ))( &::genesis::genesis_header ), 26 | get_docstring("std::string ::genesis::genesis_header ()") 27 | ); 28 | 29 | scope.def( 30 | "genesis_license", 31 | ( std::string ( * )( ))( &::genesis::genesis_license ), 32 | get_docstring("std::string ::genesis::genesis_license ()") 33 | ); 34 | 35 | scope.def( 36 | "genesis_url", 37 | ( std::string ( * )( ))( &::genesis::genesis_url ), 38 | get_docstring("std::string ::genesis::genesis_url ()") 39 | ); 40 | 41 | scope.def( 42 | "genesis_version", 43 | ( std::string ( * )( ))( &::genesis::genesis_version ), 44 | get_docstring("std::string ::genesis::genesis_version ()") 45 | ); 46 | 47 | scope.def( 48 | "genesis_version_name", 49 | ( std::string ( * )( ))( &::genesis::genesis_version_name ), 50 | get_docstring("std::string ::genesis::genesis_version_name ()") 51 | ); 52 | } 53 | -------------------------------------------------------------------------------- /python/src/utils/formats/nexus/block.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::NexusBlock, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class NexusBlock 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::NexusBlock, std::shared_ptr<::genesis::utils::NexusBlock> > ( scope, "NexusBlock" ) 22 | // .def( 23 | // pybind11::init< >() 24 | // ) 25 | // .def( 26 | // pybind11::init< NexusBlock const & >(), 27 | // pybind11::arg("arg") 28 | // ) 29 | 30 | // Public Member Functions 31 | 32 | .def( 33 | "block_name", 34 | ( std::string ( ::genesis::utils::NexusBlock::* )( ) const )( &::genesis::utils::NexusBlock::block_name ) 35 | ) 36 | .def( 37 | "to_stream", 38 | ( void ( ::genesis::utils::NexusBlock::* )( std::ostream & ) const )( &::genesis::utils::NexusBlock::to_stream ), 39 | pybind11::arg("os") 40 | ) 41 | 42 | // Operators 43 | 44 | .def( 45 | "__str__", 46 | []( ::genesis::utils::NexusBlock const& obj ) -> std::string { 47 | std::ostringstream s; 48 | s << obj; 49 | return s.str(); 50 | } 51 | ) 52 | ; 53 | } 54 | -------------------------------------------------------------------------------- /python/src/utils/formats/nexus/document.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::NexusDocument, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class NexusDocument 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::NexusDocument, std::shared_ptr<::genesis::utils::NexusDocument> > ( scope, "NexusDocument" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | 26 | // Public Member Functions 27 | 28 | .def( 29 | "get_block", 30 | ( NexusBlock * ( ::genesis::utils::NexusDocument::* )( std::string ))( &::genesis::utils::NexusDocument::get_block ), 31 | pybind11::arg("block_name") 32 | ) 33 | .def( 34 | "get_block", 35 | ( NexusBlock const * ( ::genesis::utils::NexusDocument::* )( std::string ) const )( &::genesis::utils::NexusDocument::get_block ), 36 | pybind11::arg("block_name") 37 | ) 38 | .def( 39 | "has_block", 40 | ( bool ( ::genesis::utils::NexusDocument::* )( std::string ) const )( &::genesis::utils::NexusDocument::has_block ), 41 | pybind11::arg("block_name") 42 | ) 43 | // .def( 44 | // "set_block", 45 | // ( NexusBlock * ( ::genesis::utils::NexusDocument::* )( std::unique_ptr< NexusBlock > ))( &::genesis::utils::NexusDocument::set_block ), 46 | // pybind11::arg("block") 47 | // ) 48 | 49 | // Iterators 50 | 51 | // .def( 52 | // "__iter__", 53 | // []( ::genesis::utils::NexusDocument& obj ){ 54 | // return pybind11::make_iterator( obj.begin(), obj.end() ); 55 | // } 56 | // // , 57 | // // py::keep_alive<0, 1>() 58 | // ) 59 | ; 60 | } 61 | -------------------------------------------------------------------------------- /python/src/utils/formats/nexus/writer.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::NexusWriter, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class NexusWriter 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::NexusWriter, std::shared_ptr<::genesis::utils::NexusWriter> > ( scope, "NexusWriter" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< NexusWriter const & >(), 27 | pybind11::arg("arg") 28 | ) 29 | 30 | // Public Member Functions 31 | 32 | .def( 33 | "to_file", 34 | ( void ( ::genesis::utils::NexusWriter::* )( NexusDocument const &, std::string const & ) const )( &::genesis::utils::NexusWriter::to_file ), 35 | pybind11::arg("doc"), 36 | pybind11::arg("filename") 37 | ) 38 | .def( 39 | "to_stream", 40 | ( void ( ::genesis::utils::NexusWriter::* )( NexusDocument const &, std::ostream & ) const )( &::genesis::utils::NexusWriter::to_stream ), 41 | pybind11::arg("doc"), 42 | pybind11::arg("out") 43 | ) 44 | .def( 45 | "to_string", 46 | ( std::string ( ::genesis::utils::NexusWriter::* )( NexusDocument const & ) const )( &::genesis::utils::NexusWriter::to_string ), 47 | pybind11::arg("doc") 48 | ) 49 | .def( 50 | "to_string", 51 | ( void ( ::genesis::utils::NexusWriter::* )( NexusDocument const &, std::string & ) const )( &::genesis::utils::NexusWriter::to_string ), 52 | pybind11::arg("doc"), 53 | pybind11::arg("output") 54 | ) 55 | ; 56 | } 57 | -------------------------------------------------------------------------------- /python/src/utils/formats/xml/helper.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_formats_xml_helper_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "xml_comment", 19 | ( std::string ( * )( std::string const & ))( &::genesis::utils::xml_comment ), 20 | pybind11::arg("content") 21 | ); 22 | 23 | scope.def( 24 | "xml_deescape", 25 | ( std::string ( * )( std::string const & ))( &::genesis::utils::xml_deescape ), 26 | pybind11::arg("content") 27 | ); 28 | 29 | scope.def( 30 | "xml_escape", 31 | ( std::string ( * )( std::string const & ))( &::genesis::utils::xml_escape ), 32 | pybind11::arg("content") 33 | ); 34 | } 35 | -------------------------------------------------------------------------------- /python/src/utils/formats/xml/helper.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | template 15 | void python_export_function_utils_formats_xml_helper_T () 16 | { 17 | scope.def( 18 | "xml_attribute", 19 | ( std::string ( * )( std::string const &, T const & ))( &::genesis::utils::xml_attribute ), 20 | pybind11::arg("name"), 21 | pybind11::arg("value") 22 | ); 23 | } -------------------------------------------------------------------------------- /python/src/utils/formats/xml/writer.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::XmlWriter, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class XmlWriter 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::XmlWriter, std::shared_ptr<::genesis::utils::XmlWriter> > ( scope, "XmlWriter" ) 22 | 23 | // Public Member Functions 24 | 25 | .def( 26 | "to_file", 27 | ( void ( ::genesis::utils::XmlWriter::* )( const XmlDocument &, const std::string & ))( &::genesis::utils::XmlWriter::to_file ), 28 | pybind11::arg("document"), 29 | pybind11::arg("filename") 30 | ) 31 | .def( 32 | "to_string", 33 | ( std::string ( ::genesis::utils::XmlWriter::* )( const XmlDocument & ))( &::genesis::utils::XmlWriter::to_string ), 34 | pybind11::arg("document") 35 | ) 36 | .def( 37 | "to_string", 38 | ( void ( ::genesis::utils::XmlWriter::* )( const XmlDocument &, std::string & ))( &::genesis::utils::XmlWriter::to_string ), 39 | pybind11::arg("document"), 40 | pybind11::arg("output") 41 | ) 42 | ; 43 | } 44 | -------------------------------------------------------------------------------- /python/src/utils/math/common.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_math_common_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "almost_equal_relative", 19 | ( bool ( * )( double, double, double ))( &::genesis::utils::almost_equal_relative ), 20 | pybind11::arg("lhs"), 21 | pybind11::arg("rhs"), 22 | pybind11::arg("max_rel_diff")=(double)(std::numeric_limits< double >::epsilon()), 23 | get_docstring("bool ::genesis::utils::almost_equal_relative (double lhs, double rhs, double max_rel_diff=std::numeric_limits< double >::epsilon())") 24 | ); 25 | 26 | scope.def( 27 | "is_valid_int_pow", 28 | ( bool ( * )( size_t, size_t ))( &::genesis::utils::is_valid_int_pow ), 29 | pybind11::arg("base"), 30 | pybind11::arg("exp"), 31 | get_docstring("bool ::genesis::utils::is_valid_int_pow (size_t base, size_t exp)") 32 | ); 33 | 34 | scope.def( 35 | "round_to", 36 | ( double ( * )( double, size_t ))( &::genesis::utils::round_to ), 37 | pybind11::arg("x"), 38 | pybind11::arg("accuracy_order"), 39 | get_docstring("double ::genesis::utils::round_to (double x, size_t accuracy_order)") 40 | ); 41 | 42 | scope.def( 43 | "int_pow", 44 | ( size_t ( * )( size_t, size_t ))( &::genesis::utils::int_pow ), 45 | pybind11::arg("base"), 46 | pybind11::arg("exp"), 47 | get_docstring("size_t ::genesis::utils::int_pow (size_t base, size_t exp)") 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /python/src/utils/math/common.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | template 15 | void python_export_function_utils_math_common_T () 16 | { 17 | scope.def( 18 | "abs_diff", 19 | ( constexpr T ( * )( T const &, T const & ))( &::genesis::utils::abs_diff ), 20 | pybind11::arg("lhs"), 21 | pybind11::arg("rhs"), 22 | get_docstring("constexpr T ::genesis::utils::abs_diff (T const & lhs, T const & rhs)") 23 | ); 24 | 25 | scope.def( 26 | "signum", 27 | ( constexpr int ( * )( T ))( &::genesis::utils::signum ), 28 | pybind11::arg("x"), 29 | get_docstring("constexpr int ::genesis::utils::signum (T x)") 30 | ); 31 | 32 | scope.def( 33 | "signum", 34 | ( constexpr int ( * )( T, std::false_type ))( &::genesis::utils::signum ), 35 | pybind11::arg("x"), 36 | pybind11::arg(""), 37 | get_docstring("constexpr int ::genesis::utils::signum (T x, std::false_type )") 38 | ); 39 | 40 | scope.def( 41 | "signum", 42 | ( constexpr int ( * )( T, std::true_type ))( &::genesis::utils::signum ), 43 | pybind11::arg("x"), 44 | pybind11::arg(""), 45 | get_docstring("constexpr int ::genesis::utils::signum (T x, std::true_type )") 46 | ); 47 | } -------------------------------------------------------------------------------- /python/src/utils/math/euclidean_kmeans.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::EuclideanKmeans, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class EuclideanKmeans 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::EuclideanKmeans, std::shared_ptr<::genesis::utils::EuclideanKmeans> > ( scope, "EuclideanKmeans" ) 22 | .def( 23 | pybind11::init< size_t >(), 24 | pybind11::arg("dimensions") 25 | ) 26 | .def( 27 | pybind11::init< EuclideanKmeans const & >(), 28 | pybind11::arg("arg") 29 | ) 30 | ; 31 | } 32 | -------------------------------------------------------------------------------- /python/src/utils/math/histogram/distances.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_math_histogram_distances_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "earth_movers_distance", 19 | ( double ( * )( const Histogram &, const Histogram &, bool ))( &::genesis::utils::earth_movers_distance ), 20 | pybind11::arg("h1"), 21 | pybind11::arg("h2"), 22 | pybind11::arg("normalize")=(bool)(true) 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /python/src/utils/math/histogram/operations.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_math_histogram_operations_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "normalize", 19 | ( void ( * )( Histogram &, double ))( &::genesis::utils::normalize ), 20 | pybind11::arg("h"), 21 | pybind11::arg("total")=(double)(1.0) 22 | ); 23 | 24 | scope.def( 25 | "offset", 26 | ( void ( * )( Histogram &, double ))( &::genesis::utils::offset ), 27 | pybind11::arg("h"), 28 | pybind11::arg("value") 29 | ); 30 | 31 | scope.def( 32 | "scale", 33 | ( void ( * )( Histogram &, double ))( &::genesis::utils::scale ), 34 | pybind11::arg("h"), 35 | pybind11::arg("factor") 36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /python/src/utils/math/histogram/stats.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_math_histogram_stats_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "max_value", 19 | ( double ( * )( const Histogram & ))( &::genesis::utils::max_value ), 20 | pybind11::arg("h") 21 | ); 22 | 23 | scope.def( 24 | "mean", 25 | ( double ( * )( const Histogram & ))( &::genesis::utils::mean ), 26 | pybind11::arg("h"), 27 | get_docstring("double ::genesis::utils::mean (const Histogram & h)") 28 | ); 29 | 30 | scope.def( 31 | "median", 32 | ( double ( * )( const Histogram & ))( &::genesis::utils::median ), 33 | pybind11::arg("h") 34 | ); 35 | 36 | scope.def( 37 | "min_value", 38 | ( double ( * )( const Histogram & ))( &::genesis::utils::min_value ), 39 | pybind11::arg("h") 40 | ); 41 | 42 | scope.def( 43 | "sigma", 44 | ( double ( * )( const Histogram & ))( &::genesis::utils::sigma ), 45 | pybind11::arg("h"), 46 | get_docstring("double ::genesis::utils::sigma (const Histogram & h)") 47 | ); 48 | 49 | scope.def( 50 | "sum", 51 | ( double ( * )( const Histogram & ))( &::genesis::utils::sum ), 52 | pybind11::arg("h") 53 | ); 54 | 55 | scope.def( 56 | "max_bin", 57 | ( size_t ( * )( const Histogram & ))( &::genesis::utils::max_bin ), 58 | pybind11::arg("h") 59 | ); 60 | 61 | scope.def( 62 | "min_bin", 63 | ( size_t ( * )( const Histogram & ))( &::genesis::utils::min_bin ), 64 | pybind11::arg("h") 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /python/src/utils/math/kmeans.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::KmeansClusteringInfo, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class KmeansClusteringInfo 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::KmeansClusteringInfo, std::shared_ptr<::genesis::utils::KmeansClusteringInfo> > ( scope, "KmeansClusteringInfo" ) 22 | ; 23 | } 24 | -------------------------------------------------------------------------------- /python/src/utils/math/random.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_math_random_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "select_without_replacement", 19 | ( std::vector< size_t > ( * )( size_t, size_t ))( &::genesis::utils::select_without_replacement ), 20 | pybind11::arg("k"), 21 | pybind11::arg("n"), 22 | get_docstring("std::vector< size_t > ::genesis::utils::select_without_replacement (size_t k, size_t n)") 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /python/src/utils/math/range_minimum_query.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::RangeMinimumQuery, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class RangeMinimumQuery 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::RangeMinimumQuery, std::shared_ptr<::genesis::utils::RangeMinimumQuery> > ( scope, "RangeMinimumQuery" ) 22 | .def( 23 | pybind11::init< >() 24 | ) 25 | .def( 26 | pybind11::init< std::vector< ::genesis::utils::RangeMinimumQuery::IntType > const & >(), 27 | pybind11::arg("array") 28 | ) 29 | // .def( 30 | // pybind11::init< std::vector< ::genesis::utils::RangeMinimumQuery::IntType > && >(), 31 | // pybind11::arg("array") 32 | // ) 33 | .def( 34 | pybind11::init< RangeMinimumQuery const & >(), 35 | pybind11::arg("arg") 36 | ) 37 | 38 | // Public Member Functions 39 | 40 | .def( 41 | "query", 42 | ( size_t ( ::genesis::utils::RangeMinimumQuery::* )( size_t, size_t ) const )( &::genesis::utils::RangeMinimumQuery::query ), 43 | pybind11::arg("i"), 44 | pybind11::arg("j") 45 | ) 46 | ; 47 | } 48 | -------------------------------------------------------------------------------- /python/src/utils/math/twobit_vector/functions.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_math_twobit_vector_functions_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "from_nucleic_acids", 19 | ( TwobitVector ( * )( std::string const & ))( &::genesis::utils::from_nucleic_acids ), 20 | pybind11::arg("sequence") 21 | ); 22 | 23 | scope.def( 24 | "translate_from_nucleic_acid", 25 | ( TwobitVector::ValueType ( * )( char ))( &::genesis::utils::translate_from_nucleic_acid ), 26 | pybind11::arg("site") 27 | ); 28 | 29 | scope.def( 30 | "translate_to_nucleic_acid", 31 | ( char ( * )( TwobitVector::ValueType ))( &::genesis::utils::translate_to_nucleic_acid ), 32 | pybind11::arg("value") 33 | ); 34 | 35 | scope.def( 36 | "bitstring", 37 | ( std::string ( * )( TwobitVector const & ))( &::genesis::utils::bitstring ), 38 | pybind11::arg("vec") 39 | ); 40 | 41 | scope.def( 42 | "bitstring", 43 | ( std::string ( * )( TwobitVector::WordType const & ))( &::genesis::utils::bitstring ), 44 | pybind11::arg("vec") 45 | ); 46 | 47 | scope.def( 48 | "to_nucleic_acids", 49 | ( std::string ( * )( TwobitVector const & ))( &::genesis::utils::to_nucleic_acids ), 50 | pybind11::arg("vec") 51 | ); 52 | } 53 | -------------------------------------------------------------------------------- /python/src/utils/text/string.hpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | template 15 | void python_export_function_utils_text_string_T () 16 | { 17 | scope.def( 18 | "join", 19 | ( std::string ( * )( T const &, std::string const & ))( &::genesis::utils::join ), 20 | pybind11::arg("v"), 21 | pybind11::arg("delimiter"), 22 | get_docstring("std::string ::genesis::utils::join (T const & v, std::string const & delimiter)") 23 | ); 24 | 25 | scope.def( 26 | "to_string", 27 | ( std::string ( * )( T const & ))( &::genesis::utils::to_string ), 28 | pybind11::arg("v"), 29 | get_docstring("std::string ::genesis::utils::to_string (T const & v)") 30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /python/src/utils/tools/color/normalization.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_CLASS( ::genesis::utils::ColorNormalization, scope ) 15 | { 16 | 17 | // ------------------------------------------------------------------- 18 | // Class ColorNormalization 19 | // ------------------------------------------------------------------- 20 | 21 | pybind11::class_< ::genesis::utils::ColorNormalization, std::shared_ptr<::genesis::utils::ColorNormalization> > ( scope, "ColorNormalization" ) 22 | // .def( 23 | // pybind11::init< >() 24 | // ) 25 | // .def( 26 | // pybind11::init< ColorNormalization const & >(), 27 | // pybind11::arg("arg") 28 | // ) 29 | 30 | // Public Member Functions 31 | 32 | .def( 33 | "is_valid", 34 | ( bool ( ::genesis::utils::ColorNormalization::* )( ) const )( &::genesis::utils::ColorNormalization::is_valid ), 35 | get_docstring("bool ::genesis::utils::ColorNormalization::is_valid () const") 36 | ) 37 | .def( 38 | "mask_value", 39 | ( ColorNormalization & ( ::genesis::utils::ColorNormalization::* )( double ))( &::genesis::utils::ColorNormalization::mask_value ), 40 | pybind11::arg("value"), 41 | get_docstring("ColorNormalization & ::genesis::utils::ColorNormalization::mask_value (double value)") 42 | ) 43 | .def( 44 | "mask_value", 45 | ( double ( ::genesis::utils::ColorNormalization::* )( ) const )( &::genesis::utils::ColorNormalization::mask_value ), 46 | get_docstring("double ::genesis::utils::ColorNormalization::mask_value () const") 47 | ) 48 | ; 49 | } 50 | -------------------------------------------------------------------------------- /python/src/utils/tools/date_time.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_tools_date_time_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "current_date", 19 | ( std::string ( * )( ))( &::genesis::utils::current_date ), 20 | get_docstring("std::string ::genesis::utils::current_date ()") 21 | ); 22 | 23 | scope.def( 24 | "current_time", 25 | ( std::string ( * )( ))( &::genesis::utils::current_time ), 26 | get_docstring("std::string ::genesis::utils::current_time ()") 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /python/src/utils/tools/geodesy/functions.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_tools_geodesy_functions_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "convert_geo_coordinate", 19 | ( GeoCoordinate ( * )( std::string const & ))( &::genesis::utils::convert_geo_coordinate ), 20 | pybind11::arg("coordinate"), 21 | get_docstring("GeoCoordinate ::genesis::utils::convert_geo_coordinate (std::string const & coordinate)") 22 | ); 23 | 24 | scope.def( 25 | "convert_geo_coordinate", 26 | ( GeoCoordinate ( * )( std::string const &, std::string const & ))( &::genesis::utils::convert_geo_coordinate ), 27 | pybind11::arg("latitude"), 28 | pybind11::arg("longitude"), 29 | get_docstring("GeoCoordinate ::genesis::utils::convert_geo_coordinate (std::string const & latitude, std::string const & longitude)") 30 | ); 31 | 32 | scope.def( 33 | "geo_distance", 34 | ( double ( * )( GeoCoordinate const &, GeoCoordinate const & ))( &::genesis::utils::geo_distance ), 35 | pybind11::arg("c1"), 36 | pybind11::arg("c2"), 37 | get_docstring("double ::genesis::utils::geo_distance (GeoCoordinate const & c1, GeoCoordinate const & c2)") 38 | ); 39 | 40 | scope.def( 41 | "sanitize_geo_coordinate", 42 | ( std::string ( * )( std::string const &, bool ))( &::genesis::utils::sanitize_geo_coordinate ), 43 | pybind11::arg("coordinate"), 44 | pybind11::arg("two_components")=(bool)(true), 45 | get_docstring("std::string ::genesis::utils::sanitize_geo_coordinate (std::string const & coordinate, bool two_components=true)") 46 | ); 47 | } 48 | -------------------------------------------------------------------------------- /python/src/utils/tools/gzip.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_tools_gzip_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "is_gzip_compressed_file", 19 | ( bool ( * )( std::string const & ))( &::genesis::utils::is_gzip_compressed_file ), 20 | pybind11::arg("file_name") 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /python/src/utils/tools/hashing.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief 3 | * 4 | * @file 5 | * @ingroup python 6 | */ 7 | 8 | #include 9 | 10 | #include "genesis/genesis.hpp" 11 | 12 | using namespace ::genesis::utils; 13 | 14 | PYTHON_EXPORT_FUNCTIONS( utils_tools_hashing_export, ::genesis::utils, scope ) 15 | { 16 | 17 | scope.def( 18 | "hash_from_file_hex", 19 | ( std::string ( * )( std::string const &, HashingFunctions ))( &::genesis::utils::hash_from_file_hex ), 20 | pybind11::arg("filename"), 21 | pybind11::arg("hash_fct"), 22 | get_docstring("std::string ::genesis::utils::hash_from_file_hex (std::string const & filename, HashingFunctions hash_fct)") 23 | ); 24 | 25 | scope.def( 26 | "hash_from_stream_hex", 27 | ( std::string ( * )( std::istream &, HashingFunctions ))( &::genesis::utils::hash_from_stream_hex ), 28 | pybind11::arg("is"), 29 | pybind11::arg("hash_fct"), 30 | get_docstring("std::string ::genesis::utils::hash_from_stream_hex (std::istream & is, HashingFunctions hash_fct)") 31 | ); 32 | 33 | scope.def( 34 | "hash_from_string_hex", 35 | ( std::string ( * )( std::string const &, HashingFunctions ))( &::genesis::utils::hash_from_string_hex ), 36 | pybind11::arg("input"), 37 | pybind11::arg("hash_fct"), 38 | get_docstring("std::string ::genesis::utils::hash_from_string_hex (std::string const & input, HashingFunctions hash_fct)") 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /test/data/placement/duplicates_a.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0{0},(D:2.0{1},E:2.0{2})C:2.0{3})A:2.0{4},F:2.0{5},(H:2.0{6},I:2.0{7})G:2.0{8})R:2.0{9};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 0.5, 1.2, 0.1], [2, 1.0, 0.5, 1.2, 0.1]], 7 | "n": ["a"] 8 | }, 9 | { 10 | "p": [[0, 1.0, 1.0, 0.8, 0.1]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[1, 1.0, 1.0, 1.5, 0.5]], 15 | "n": ["c"] 16 | }, 17 | { 18 | "p": [[1, 1.0, 1.0, 1.0, 0.4]], 19 | "n": ["a"] 20 | }, 21 | { 22 | "p": [[1, 1.0, 1.0, 0.5, 0.3]], 23 | "n": ["a"] 24 | }, 25 | { 26 | "p": [[4, 1.0, 1.0, 1.2, 0.8]], 27 | "n": ["b"] 28 | }, 29 | { 30 | "p": [[5, 1.0, 1.0, 1.5, 0.9]], 31 | "n": ["b"] 32 | } 33 | ], 34 | "version": 3, 35 | "fields": 36 | [ 37 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /test/data/placement/duplicates_b.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0{0},(D:2.0{1},E:2.0{2})C:2.0{3})A:2.0{4},F:2.0{5},(H:2.0{6},I:2.0{7})G:2.0{8})R:2.0{9};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 0.5, 1.2, 0.1], [1, 1.0, 0.5, 1.8, 0.3]], 7 | "n": ["a", "b"] 8 | }, 9 | { 10 | "p": [[0, 1.0, 1.0, 0.8, 0.1]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[1, 1.0, 0.7, 1.5, 0.4], [4, 1.0, 0.3, 0.4, 0.6]], 15 | "n": ["b", "c"] 16 | }, 17 | { 18 | "p": [[1, 1.0, 1.0, 1.0, 0.9]], 19 | "n": ["c"] 20 | }, 21 | { 22 | "p": [[1, 1.0, 1.0, 0.5, 0.2]], 23 | "n": ["c", "d"] 24 | }, 25 | { 26 | "p": [[4, 1.0, 0.6, 1.2, 0.7], [5, 1.0, 0.4, 0.3, 0.3]], 27 | "n": ["d"] 28 | }, 29 | { 30 | "p": [[5, 1.0, 1.0, 1.5, 0.1]], 31 | "n": ["b", "d"] 32 | } 33 | ], 34 | "version": 3, 35 | "fields": 36 | [ 37 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /test/data/placement/rooted.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:1.0{0},(D:1.0{1},E:1.0{2})C:1.0{3})A:1.0{4},(G:1.0{5},(I:1.0{6},J:1.0{7})H:1.0{8})F:1.0{9})R:1.0{10};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 1.0, 0.5, 0.0]], 7 | "n": ["a"] 8 | }, 9 | { 10 | "p": [[0, 1.0, 1.0, 0.5, 0.0]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[0, 1.0, 1.0, 0.5, 0.0]], 15 | "n": ["c"] 16 | }, 17 | { 18 | "p": [[1, 1.0, 1.0, 0.5, 0.0]], 19 | "n": ["d"] 20 | }, 21 | { 22 | "p": [[1, 1.0, 1.0, 0.5, 0.0]], 23 | "n": ["e"] 24 | }, 25 | { 26 | "p": [[2, 1.0, 1.0, 0.5, 0.0]], 27 | "n": ["f"] 28 | }, 29 | { 30 | "p": [[4, 1.0, 1.0, 0.5, 0.0]], 31 | "n": ["g"] 32 | }, 33 | { 34 | "p": [[4, 1.0, 1.0, 0.5, 0.0]], 35 | "n": ["h"] 36 | }, 37 | { 38 | "p": [[5, 1.0, 1.0, 0.5, 0.0]], 39 | "n": ["i"] 40 | }, 41 | { 42 | "p": [[5, 1.0, 1.0, 0.5, 0.0]], 43 | "n": ["j"] 44 | }, 45 | { 46 | "p": [[5, 1.0, 1.0, 0.5, 0.0]], 47 | "n": ["k"] 48 | }, 49 | { 50 | "p": [[6, 1.0, 1.0, 0.5, 0.0]], 51 | "n": ["l"] 52 | }, 53 | { 54 | "p": [[6, 1.0, 1.0, 0.5, 0.0]], 55 | "n": ["m"] 56 | }, 57 | { 58 | "p": [[7, 1.0, 1.0, 0.5, 0.0]], 59 | "n": ["n"] 60 | }, 61 | { 62 | "p": [[8, 1.0, 1.0, 0.5, 0.0]], 63 | "n": ["o"] 64 | }, 65 | { 66 | "p": [[8, 1.0, 1.0, 0.5, 0.0]], 67 | "n": ["p"] 68 | } 69 | ], 70 | "version": 3, 71 | "fields": 72 | [ 73 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /test/data/placement/test_a.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0{0},(D:2.0{1},E:2.0{2})C:2.0{3})A:2.0{4},F:2.0{5},(H:2.0{6},I:2.0{7})G:2.0{8})R:2.0{9};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[1, 1.0, 1.0, 0.8, 0.1]], 7 | "nm": [[ "f", 3.0 ]] 8 | }, 9 | { 10 | "p": [[2, 1.0, 1.0, 0.5, 0.2]], 11 | "n": ["g"] 12 | }, 13 | { 14 | "p": [[3, 1.0, 1.0, 1.0, 0.3]], 15 | "n": ["h"] 16 | }, 17 | { 18 | "p": [[7, 1.0, 1.0, 0.8, 0.4]], 19 | "nm": [[ "l", 2.0 ]] 20 | }, 21 | { 22 | "p": [[7, 1.0, 1.0, 0.6, 0.5]], 23 | "n": ["m"] 24 | } 25 | ], 26 | "version": 3, 27 | "fields": 28 | [ 29 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /test/data/placement/test_a.jplace.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/placement/test_a.jplace.gz -------------------------------------------------------------------------------- /test/data/placement/test_b.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0{0},(D:2.0{1},E:2.0{2})C:2.0{3})A:2.0{4},F:2.0{5},(H:2.0{6},I:2.0{7})G:2.0{8})R:2.0{9};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 1.0, 1.2, 0.1]], 7 | "nm": [[ "a", 4.0 ]] 8 | }, 9 | { 10 | "p": [[0, 1.0, 1.0, 0.8, 0.2]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[1, 1.0, 1.0, 1.5, 0.3]], 15 | "n": ["c"] 16 | }, 17 | { 18 | "p": [[1, 1.0, 1.0, 1.0, 0.4]], 19 | "n": ["d"] 20 | }, 21 | { 22 | "p": [[1, 1.0, 1.0, 0.5, 0.5]], 23 | "n": ["e"] 24 | }, 25 | { 26 | "p": [[4, 1.0, 1.0, 1.2, 0.6]], 27 | "n": ["i"] 28 | }, 29 | { 30 | "p": [[5, 1.0, 1.0, 1.5, 0.7]], 31 | "nm": [[ "j", 2.0 ]] 32 | }, 33 | { 34 | "p": [[6, 1.0, 1.0, 0.5, 0.8]], 35 | "n": ["k"] 36 | } 37 | ], 38 | "version": 3, 39 | "fields": 40 | [ 41 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 42 | ] 43 | } 44 | -------------------------------------------------------------------------------- /test/data/placement/test_b.jplace.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/placement/test_b.jplace.gz -------------------------------------------------------------------------------- /test/data/placement/test_c.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0{0},(D:2.0{1},E:2.0{2})C:2.0{3})A:2.0{4},F:2.0{5},(H:2.0{6},I:2.0{7})G:2.0{8})R:2.0{9};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 0.6, 1.2, 0.1], [2, 1.0, 0.3, 1.2, 0.1]], 7 | "n": ["a"] 8 | }, 9 | { 10 | "p": [[2, 1.0, 0.2, 0.5, 0.7], [0, 1.0, 0.7, 0.8, 0.1]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[1, 1.0, 1.0, 1.5, 0.5]], 15 | "nm": [[ "c", 3.0 ]] 16 | }, 17 | { 18 | "p": [[1, 1.0, 1.0, 1.0, 0.4]], 19 | "n": ["d"] 20 | }, 21 | { 22 | "p": [[1, 1.0, 1.0, 0.5, 0.3]], 23 | "nm": [[ "e", 5.0 ]] 24 | }, 25 | { 26 | "p": [[4, 1.0, 1.0, 1.2, 0.8]], 27 | "n": ["f"] 28 | }, 29 | { 30 | "p": [[5, 1.0, 1.0, 1.5, 0.9]], 31 | "n": ["g", "h"] 32 | } 33 | ], 34 | "version": 3, 35 | "fields": 36 | [ 37 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /test/data/placement/test_c.jplace.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/placement/test_c.jplace.gz -------------------------------------------------------------------------------- /test/data/placement/unrooted.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "(A:1.0{0},(B:1.0{1},(C:1.0{2},D:1.0{3})E:1.0{4})F:1.0{5},(G:1.0{6},H:1.0{7})I:1.0{8})R:1.0;", 3 | "placements": 4 | [ 5 | {"p": [ 6 | [8, -332481.006816, 0.700564, 0.3, 0.201565], 7 | [6, -332482.554048, 0.149105, 0.6, 0.201505], 8 | [0, -332483.401552, 0.063889, 0.9, 0.172159] 9 | ], 10 | "n": ["X"] 11 | }, 12 | {"p": [ 13 | [2, -332592.702719, 0.999978, 0.1, 0.816126], 14 | [1, -332592.702719, 0.999978, 0.7, 0.816126] 15 | ], 16 | "n": ["Y"] 17 | }, 18 | {"p": [ 19 | [5, -332592.702719, 0.999978, 1.0, 0.816126] 20 | ], 21 | "n": ["Z"] 22 | } 23 | ], 24 | "metadata": {"invocation": ""}, 25 | "version": 3, 26 | "fields": ["edge_num", "likelihood", "like_weight_ratio", "proximal_length", "pendant_length"] 27 | } 28 | -------------------------------------------------------------------------------- /test/data/placement/version_1.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0[0],(D:2.0[1],E:2.0[2])C:2.0[3])A:2.0[4],F:2.0[5],(H:2.0[6],I:2.0[7])G:2.0[8])R:2.0[9];", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 0.6, 1.2, 0.1], [2, 1.0, 0.3, 1.2, 0.1]], 7 | "n": ["a"] 8 | }, 9 | { 10 | "p": [[2, 1.0, 0.2, 0.5, 0.7], [0, 1.0, 0.7, 0.8, 0.1]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[1, 1.0, 1.0, 1.5, 0.5]], 15 | "n": [ "c" ], 16 | "m": 3.0 17 | }, 18 | { 19 | "p": [[1, 1.0, 1.0, 1.0, 0.4]], 20 | "n": ["d"] 21 | }, 22 | { 23 | "p": [[1, 1.0, 1.0, 0.5, 0.3]], 24 | "n": "e", 25 | "m": 5.0 26 | }, 27 | { 28 | "p": [[4, 1.0, 1.0, 1.2, 0.8]], 29 | "n": "f" 30 | }, 31 | { 32 | "p": [[5, 1.0, 1.0, 1.5, 0.9]], 33 | "n": ["g", "h"] 34 | } 35 | ], 36 | "version": 1, 37 | "fields": 38 | [ 39 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /test/data/placement/version_2.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0{0},(D:2.0{1},E:2.0{2})C:2.0{3})A:2.0{4},F:2.0{5},(H:2.0{6},I:2.0{7})G:2.0{8})R:2.0{9};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 0.6, 1.2, 0.1], [2, 1.0, 0.3, 1.2, 0.1]], 7 | "n": ["a"] 8 | }, 9 | { 10 | "p": [[2, 1.0, 0.2, 0.5, 0.7], [0, 1.0, 0.7, 0.8, 0.1]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[1, 1.0, 1.0, 1.5, 0.5]], 15 | "n": [ "c" ], 16 | "m": 3.0 17 | }, 18 | { 19 | "p": [[1, 1.0, 1.0, 1.0, 0.4]], 20 | "n": ["d"] 21 | }, 22 | { 23 | "p": [[1, 1.0, 1.0, 0.5, 0.3]], 24 | "n": "e", 25 | "m": 5.0 26 | }, 27 | { 28 | "p": [[4, 1.0, 1.0, 1.2, 0.8]], 29 | "n": "f" 30 | }, 31 | { 32 | "p": [[5, 1.0, 1.0, 1.5, 0.9]], 33 | "n": ["g", "h"] 34 | } 35 | ], 36 | "version": 2, 37 | "fields": 38 | [ 39 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /test/data/placement/version_3.jplace: -------------------------------------------------------------------------------- 1 | { 2 | "tree": "((B:2.0{0},(D:2.0{1},E:2.0{2})C:2.0{3})A:2.0{4},F:2.0{5},(H:2.0{6},I:2.0{7})G:2.0{8})R:2.0{9};", 3 | "placements": 4 | [ 5 | { 6 | "p": [[0, 1.0, 0.6, 1.2, 0.1], [2, 1.0, 0.3, 1.2, 0.1]], 7 | "n": ["a"] 8 | }, 9 | { 10 | "p": [[2, 1.0, 0.2, 0.5, 0.7], [0, 1.0, 0.7, 0.8, 0.1]], 11 | "n": ["b"] 12 | }, 13 | { 14 | "p": [[1, 1.0, 1.0, 1.5, 0.5]], 15 | "nm": [[ "c", 3.0 ]] 16 | 17 | }, 18 | { 19 | "p": [[1, 1.0, 1.0, 1.0, 0.4]], 20 | "n": ["d"] 21 | }, 22 | { 23 | "p": [[1, 1.0, 1.0, 0.5, 0.3]], 24 | "nm": [[ "e", 5.0 ]] 25 | 26 | }, 27 | { 28 | "p": [[4, 1.0, 1.0, 1.2, 0.8]], 29 | "n": "f" 30 | }, 31 | { 32 | "p": [[5, 1.0, 1.0, 1.5, 0.9]], 33 | "n": ["g", "h"] 34 | } 35 | ], 36 | "version": 3, 37 | "fields": 38 | [ 39 | "edge_num", "likelihood", "like_weight_ratio", "distal_length", "pendant_length" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /test/data/population/78.pileup.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/population/78.pileup.gz -------------------------------------------------------------------------------- /test/data/population/cram_cache/426e31835a6dfdcbf6c534671edf02f7: -------------------------------------------------------------------------------- 1 | CACTAGTGGCTCATTGTAAATGTGTGGTTTAACTCGTCCATGGCCCAGCATTAGGGAGCTGTGGACCCTGCAGCCTGGCTGTGGGGGCCGCAGTGGCTGAGGGGTGCAGAGCCGAGTCACGGGGTTGCCAGCACAGGGGCTTAACCTCTGGTGACTGCCAGAGCTGCTGGCAAGCTAGAGTCCCATTTGGAGCCCCTCTAAGCCGTTCTATTTGTAATGAAAACTATATTTATGCTATTCAGTTCTAAATATAGAAATTGAAACAGCTGTGTTTAGTGCCTTTGTTCAACCCCCTTGCAACAACCTTGAGAACCCCAGGGAATTTGTCAATGTCAGGGAAGGAGCATTTTGTCAGTTACCAAATGTGTTTATTACCAGAGGGATGGAGGGAAGAGGGACGCTGAAGAACTTTGATGCCCTCTTCTTCCAAAGATGAAACGCGTAACTGCGCTCTCATTCACTCCAGCTCCCTGTCACCCAATGGACCTGTGATATCTGGATTCTGGGAAATTCTTCATCCTGGACCCTGAGAGATTCTGCAGCCCAGCTCCAGATTGCTTGTGGTCTGACAGGCTGCAACTGTGAGCCATCACAATGAACAACAGGAAGAAAAGGTCTTTCAAAAGGTGATGTGTGTTCTCATCAACCTCATACACACACATGGTTTAGGGGTATAATACCTCTACATGGCTGATTATGAAAACAATGTTCCCCAGATACCATCCCTGTCTTACTTCCAGCTCCCCAGAGGGAAAGCTTTCAACGCTTCTAGCCATTTCTTTTGGCATTTGCCTTCAGACCCTACACGAATGCGTCTCTACCACAGGGGGCTGCGCGGTTTCCCATCATGAAGCACTGAACTTCCACGTCTCATCTAGGGGAACAGGGAGGTGCACTAATGCGCTCCACGCCCAAGCCCTTCTCACAGTTTCTGCCCCCAGCATGGTTGTACTGGGCAATACATGAGATTATTAGGAAATGCTTTACTGTCATAACTATGAAGAGACTATTGCCAGATGAACCACACATTAATACTATGTTTCTTATCTGCACATTACTACCCTGCAATTAATATAATTGTGTCCATGTACACACGCTGTCCTATGTACTTATCATGACTCTATCCCAAATTCCCAATTACGTCCTATCTTCTTCTTAGGGAAGAACAGCTTAGGTATCAATTTGGTGTTCTGTGTAAAGTCTCAGGGAGCCGTCCGTGTCCTCCCATCTGGCCTCGTCCACACTGGTTCTCTTGAAAGCTTGGGCTGTAATGATGCCCCTTGGCCATCACCCAGTCCCTGCCCCATCTCTTGTAATCTCTCTCCTTTTTGCTGCATCCCTGTCTTCCTCTGTCTTGATTTACTTGTTGTTGGTTTTCTGTTTCTTTGTTTGATTTGGTGGAAGACATAATCCCACGCTTCCTATGGAAAGGTTGTTGGGAGATTTTTAATGATTCCTCAATGTTAAAATGTCTATTTTTGTCTTGACACCCAACTAATATTTGTCTGAGCAAAACAGTCTAGATGAGAGAGAACTTCCCTGGAGGTCTGATGGCGTTTCTCCCTCGTCTTCTTA -------------------------------------------------------------------------------- /test/data/population/cram_cache/b6853ffe730ece50076db834dea18e3b: -------------------------------------------------------------------------------- 1 | TTCAAATGAACTTCTGTAATTGAAAAATTCATTTAAGAAATTACAAAATATAGTTGAAAGCTCTAACAATAGACTAAACCAAGCAGAAGAAAGAGGTTCAGAACTTGAAGACAAGTCTCTTATGAATTAACCCAGTCAGACAAAAATAAAGAAAAAAATTTTAAAAATGAACAGAGCTTTCAAGAAGTATGAGATTATGTAAAGTAACTGAACCTATGAGTCACAGGTATTCCTGAGGAAAAAGAAAAAGTGAGAAGTTTGGAAAAACTATTTGAGGAAGTAATTGGGGAAAACCTCTTTAGTCTTGCTAGAGATTTAGACATCTAAATGAAAGAGGCTCAAAGAATGCCAGGAAGATACATTGCAAGACAGACTTCATCAAGATATGTAGTCATCAGACTATCTAAAGTCAACATGAAGGAAAAAAATTCTAAAATCAGCAAGAGAAAAGCATACAGTCATCTATAAAGGAAATCCCATCAGAATAACAATGGGCTTCTCAGCAGAAACCTTACAAGCCAGAAGAGATTGGATCTAATTTTTGGACTTCTTAAAGAAAAAAAAACCTGTCAAACACGAATGTTATGCCCTGCTAAACTAAGCATCATAAATGAAGGGGAAATAAAGTCAAGTCTTTCCTGACAAGCAAATGCTAAGATAATTCATCATCACTAAACCAGTCCTATAAGAAATGCTCAAAAGAATTGTAAAAGTCAAAATTAAAGTTCAATACTCACCATCATAAATACACACAAAAGTACAAAACTCACAGGTTTTATAAAACAATTGAGACTACAGAGCAACTAGGTAAAAAATTAACATTACAACAGGAACAAAACCTCATATATCAATATTAACTTTGAATAAAAAGGGATTAAATTCCCCCACTTAAGAGATATAGATTGGCAGAACAGATTTAAAAACATGAACTAACTATATGCTGTTTACAAGAAACTCATTAATAAAGACATGAGTTCAGGTAAAGGGGTGGAAAAAGATGTTCTACGCAAACAGAAACCAAATGAGAGAAGGAGTAGCTATACTTATATCAGATAAAGCACACTTTAAATCAACAACAGTAAAATAAAACAAAGGAGGTCATCATACAATGATAAAAAGATCAATTCAGCAAGAAGATATAACCATCCTACTAAATACATATGCACCTAACACAAGACTACCCAGATTCATAAAACAAATACTACTAGACCTAAGAGGGATGAGAAATTACCTAATTGGTACAATGTACAATATTCTGATGATGGTTACACTAAAAGCCCATACTTTACTGCTACTCAATATATCCATGTAACAAATCTGCGCTTGTACTTCTAAATCTATAAAAAAATTAAAATTTAACAAAAGTAAATAAAACACATAGCTAAAACTAAAAAAGCAAAAACAAAAACTATGCTAAGTATTGGTAAAGATGTGGGGAAAAAAGTAAACTCTCAAATATTGCTAGTGGGAGTATAAATTGTTTTCCACTTTGGAAAACAATTTGGTAATTTCGTTTTTTTTTTTTTCTTTTCTCTTTTTTTTTTTTTTTTTTTTGCATGCCAGAAAAAAATATTTACAGTAACT -------------------------------------------------------------------------------- /test/data/population/empty.pileup: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/population/empty.pileup -------------------------------------------------------------------------------- /test/data/population/ex1.bam: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/population/ex1.bam -------------------------------------------------------------------------------- /test/data/population/ex1.cram: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/population/ex1.cram -------------------------------------------------------------------------------- /test/data/population/ex1.fa.fai: -------------------------------------------------------------------------------- 1 | seq1 1575 6 60 61 2 | seq2 1584 1614 60 61 3 | -------------------------------------------------------------------------------- /test/data/population/ex1.sam.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/population/ex1.sam.gz -------------------------------------------------------------------------------- /test/data/population/example.pileup: -------------------------------------------------------------------------------- 1 | seq1 272 T 24 ,.$.....,,.,.,...,,,.,..^+. <<<+;<<<<<<<<<<<=<;<;7<& 2 | seq1 273 T 23 NN....,,.,.,...,,,.,..A <<<;<<<<<<<<<3<=<<<;<<+ 3 | seq1 274 T 23 ,.$..**,,.,.,...,,,.,... 7<7;<;<<<<<<<<<=<;<;<<6 4 | seq1 275 A 23 ,$..-3TTT..,,.,.,...,,,.,...^l. <+;9*<<<<<<<<<=<<:;<<<< 5 | seq1 276 G 22 ...T,,.,.,...,,,.,.... 33;+<<7=7<<7<&<<1;<<6< 6 | seq1 277 T 22 ....,,.,.,.C.,,,.,..G. +7<;<<<<<<<&<=<<:;<<&< 7 | seq1 278 G 23 ..+4ACGT..,,.,.,...,,,.,....^k. %38*<<;<7<<7<=<<<;<<<<< 8 | seq1 279 C 23 A..T,,.,.<><>,,,.,..... ;75&<<<<<<<<<=<<<9<<:<< 9 | -------------------------------------------------------------------------------- /test/data/population/example.vcf: -------------------------------------------------------------------------------- 1 | ##fileformat=VCFv4.3 2 | ##fileDate=20090805 3 | ##source=myImputationProgramV3.1 4 | ##reference=file:///seq/references/1000GenomesPilot-NCBI36.fasta 5 | ##contig= 6 | ##phasing=partial 7 | ##INFO= 8 | ##INFO= 9 | ##INFO= 10 | ##INFO= 11 | ##INFO= 12 | ##INFO= 13 | ##FILTER= 14 | ##FILTER= 15 | ##FORMAT= 16 | ##FORMAT= 17 | ##FORMAT= 18 | ##FORMAT= 19 | ##FORMAT= 20 | ##FORMAT= 21 | #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002 NA00003 22 | 20 14370 rs6054257 G A 29 PASS NS=3;DP=14;AF=0.5;DB;H2 GT:GQ:GL:DP:HQ 0|.:48:-1.0,-2.0,-3.0:1:51,51 1|0:48:-4.0,-5.0,-6.0:8:51,51 1/1:43:-7.0,-8.0,-9.0:5:.,. 23 | 20 17330 . T A 3 q10 NS=3;DP=11;AF=0.017 GT:GQ:DP:HQ:STR 0|0:49:3:58,50:Hello 0|1:3:5:65,3:beautiful 0/0:41:3:.:world 24 | 20 1110696 rs6040355 A G,T 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:GQ:DP:HQ 1|2:21:6:23,27 2|1:2:0:18,2 2/2:35:4 25 | 20 1230237 . T . 47 PASS NS=3;DP=13;AA=T GT:GQ:DP:HQ 0|0:54:7:56,60 0|0:48:4:51,51 0/0:61:2 26 | 20 1234567 microsat1 GTC G,GTCT 50 PASS NS=3;DP=9;AA=G GT:GQ:GL:DP ./1:35:-1.1,-1.2,-1.3,-1.4,-1.5,-1.6:4 0/2:17:-2.1,-2.2,-2.3,-2.4,-2.5,-2.6:2 1/1:40:-3.1,-3.2,-3.3,-3.4,-3.5,-3.6:3 27 | -------------------------------------------------------------------------------- /test/data/population/example2.pileup: -------------------------------------------------------------------------------- 1 | 1 18149 T 1 .$ C 2 | 1 18150 C 1 ^]. A 3 | 1 18151 C 1 . A 4 | 1 18152 T 1 . F 5 | 1 18153 T 0 6 | 1 18154 T 1 . F 7 | 1 18155 C 1 . J 8 | 1 18156 A 1 . J 9 | 1 18157 A 1 . J 10 | 1 18158 A 1 . J 11 | -------------------------------------------------------------------------------- /test/data/population/example3.pileup: -------------------------------------------------------------------------------- 1 | 1 18149 T 1 .$ C 2 .. CC 2 | 1 18150 C 1 ^]. A 2 .. AA 3 | 1 18151 C 1 . A 2 .. AA 4 | 1 18152 T 1 . F 2 .. FF 5 | 1 18153 T 0 0 6 | 1 18154 T 1 . F 2 .. FF 7 | 1 18155 C 1 . J 2 .. JJ 8 | 1 18156 A 1 . J 2 .. JJ 9 | 1 18157 A 1 . J 2 .. JJ 10 | 1 18158 A 1 . J 2 .. JJ 11 | -------------------------------------------------------------------------------- /test/data/population/freq1.csv: -------------------------------------------------------------------------------- 1 | chr pos ref alt empty Smp1.freq SmpA.cov refcntSmpC SmpCaltcount SmpA.frequency smp2-reference-count coverage-smp2 2 | 1 1 T C foo 0.4 20 5 5 0.8 8 12 3 | 1 5 C G bar 0.5 15 8 4 0.2 5 15 4 | 1 6 A G baz nan 15 . 4 . 5 na 5 | -------------------------------------------------------------------------------- /test/data/population/long.sync: -------------------------------------------------------------------------------- 1 | 2R 2302 N 0:1:2:3:4:5 10:11:12:13:14:15 2 | 2R 2303 N 100:101:102:103:104:105 1000:1001:1002:1003:1004:1005 3 | 2R 2304 N 10000:10001:10002:10003:10004:10005 100000:100001:100002:100003:100004:100005 4 | 2R 2305 N 1000000:1000001:1000002:1000003:1000004:1000005 10000000:10000001:10000002:10000003:10000004:10000005 5 | 2R 2306 N 10000000:10000001:10000002:10000003:10000004:10000005 100000000:100000001:100000002:100000003:100000004:100000005 6 | -------------------------------------------------------------------------------- /test/data/population/mask.bed: -------------------------------------------------------------------------------- 1 | agouti_scaf_1001 3380 3390 2 | agouti_scaf_1001 1200 1700 3 | agouti_scaf_1001 4000 5000 4 | agouti_scaf_1001 6782 6790 5 | -------------------------------------------------------------------------------- /test/data/population/mask.fasta: -------------------------------------------------------------------------------- 1 | >1 2 | 0000011111222 3 | >2 4 | 2222211111000 5 | -------------------------------------------------------------------------------- /test/data/population/masked.sync: -------------------------------------------------------------------------------- 1 | XYZ 10 T .:.:.:.:.:. .:.:.:.:.:. 2 | -------------------------------------------------------------------------------- /test/data/population/p1_p2.sync.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/population/p1_p2.sync.gz -------------------------------------------------------------------------------- /test/data/population/parallel.pileup: -------------------------------------------------------------------------------- 1 | XYZ 5 G 24 ,.$.....,,.,.,...,,,.,..^+. <<<+;<<<<<<<<<<<=<;<;7<& 2 | XYZ 8 T 23 NN....,,.,.,...,,,.,..A <<<;<<<<<<<<<3<=<<<;<<+ 3 | XYZ 10 T 23 ,.$..**,,.,.,...,,,.,... 7<7;<;<<<<<<<<<=<;<;<<6 4 | XYZ 15 A 23 ,$..-3TTT..,,.,.,...,,,.,...^l. <+;9*<<<<<<<<<=<<:;<<<< 5 | XYZ 17 G 22 ...T,,.,.,...,,,.,.... 33;+<<7=7<<7<&<<1;<<6< 6 | XYZ 22 T 22 ....,,.,.,.C.,,,.,..G. +7<;<<<<<<<&<=<<:;<<&< 7 | XYZ 28 C 23 A..T,,.,.<><>,,,.,..... ;75&<<<<<<<<<=<<<9<<:<< 8 | -------------------------------------------------------------------------------- /test/data/population/parallel.vcf: -------------------------------------------------------------------------------- 1 | ##fileformat=VCFv4.3 2 | ##contig= 3 | ##INFO= 4 | ##INFO= 5 | ##INFO= 6 | ##INFO= 7 | ##INFO= 8 | ##INFO= 9 | ##FORMAT= 10 | ##FORMAT= 11 | ##FORMAT= 12 | ##FORMAT= 13 | ##FORMAT= 14 | ##FORMAT= 15 | ##FORMAT= 16 | #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT VCF1 VCF2 VCF3 17 | XYZ 5 . G A 29 PASS NS=3;DP=14;AF=0.5;DB;H2 GT:AD:GQ:GL:DP:HQ 0|.:5,8:48:-1.0,-2.0,-3.0:1:51,51 1|0:2,5:48:-4.0,-5.0,-6.0:8:51,51 1/1:6,2:43:-7.0,-8.0,-9.0:5:.,. 18 | XYZ 10 . T A 3 PASS NS=3;DP=11;AF=0.017 GT:AD:GQ:DP:HQ:STR 0|0:4,8:49:3:58,50:Hello 0|1:2,5:3:5:65,3:beautiful 0/0:0,9:41:3:.:world 19 | XYZ 15 . A G 67 PASS NS=2;DP=10;AF=0.333,0.667;AA=T;DB GT:AD:GQ:DP:HQ 1|0:23,12:21:6:23,27 0|1:3,43:2:0:18,2 1/1:3,7:35:4 20 | XYZ 20 . T A 47 PASS NS=3;DP=13;AA=T GT:AD:GQ:DP:HQ 0|0:43,23:54:7:56,60 0|0:5,7:48:4:51,51 0/0:5,7:61:2 21 | XYZ 25 . A G 50 PASS NS=3;DP=9;AA=G GT:AD:GQ:GL:DP ./1:54,2:35:-1.1,-1.2,-1.3,-1.4,-1.5,-1.6:4 0/1:3,4:17:-2.1,-2.2,-2.3,-2.4,-2.5,-2.6:2 1/1:4,5:40:-3.1,-3.2,-3.3,-3.4,-3.5,-3.6:3 22 | -------------------------------------------------------------------------------- /test/data/population/parallel_a.sync: -------------------------------------------------------------------------------- 1 | XYZ 10 T 0:7:0:0:0:0 0:7:0:0:0:0 2 | XYZ 12 A 0:8:0:0:0:0 0:8:0:0:0:0 3 | XYZ 17 G 0:0:9:0:0:0 0:0:9:0:0:0 4 | XYZ 25 A 2:0:5:0:0:0 0:0:3:4:0:0 5 | XYZ 28 C 0:0:2:0:4:0 0:4:9:0:0:0 6 | XYZ 30 T 0:0:6:3:0:0 0:4:0:0:5:0 7 | -------------------------------------------------------------------------------- /test/data/population/parallel_b.sync: -------------------------------------------------------------------------------- 1 | XYZ 5 G 0:8:0:0:0:0 0:8:0:0:0:0 0:8:0:0:0:0 2 | XYZ 10 T 0:7:0:0:0:0 0:7:0:0:0:0 0:7:0:0:0:0 3 | XYZ 15 A 0:0:9:0:0:0 0:0:9:0:0:0 0:0:9:0:0:0 4 | XYZ 20 T 0:0:2:0:4:0 0:4:9:0:0:0 0:4:9:0:0:0 5 | XYZ 25 A 2:0:5:0:0:0 0:0:3:4:0:0 0:0:3:4:0:0 6 | -------------------------------------------------------------------------------- /test/data/population/parallel_chrs_1.sync: -------------------------------------------------------------------------------- 1 | XYZ 10 T 0:7:0:0:0:0 0:7:0:0:0:0 2 | XYZ 12 A 0:8:0:0:0:0 0:8:0:0:0:0 3 | XYZ 17 G 0:0:9:0:0:0 0:0:9:0:0:0 4 | XYZ 25 A 2:0:5:0:0:0 0:0:3:4:0:0 5 | XYZ 28 C 0:0:2:0:4:0 0:4:9:0:0:0 6 | XYZ 30 T 0:0:6:3:0:0 0:4:0:0:5:0 7 | ABC 10 T 0:7:0:0:0:0 0:7:0:0:0:0 8 | ABC 12 A 0:8:0:0:0:0 0:8:0:0:0:0 9 | ABC 17 G 0:0:9:0:0:0 0:0:9:0:0:0 10 | ABC 25 A 2:0:5:0:0:0 0:0:3:4:0:0 11 | ABC 28 C 0:0:2:0:4:0 0:4:9:0:0:0 12 | ABC 30 T 0:0:6:3:0:0 0:4:0:0:5:0 13 | -------------------------------------------------------------------------------- /test/data/population/regions_1.bim: -------------------------------------------------------------------------------- 1 | 2 2_71210 0 71210 C A 2 | 2 2_71228 0 71228 G C 3 | 2 2_71229 0 71229 T C 4 | 2 2_71230 0 71230 G A 5 | 2 2_71282 0 71282 T C 6 | 2 2_71399 0 71399 A C 7 | 2 2_71531 0 71531 A C 8 | 2 2_71532 0 71532 C T 9 | 2 2_71533 0 71533 A G 10 | 2 2_71534 0 71534 A T 11 | -------------------------------------------------------------------------------- /test/data/population/regions_1.map: -------------------------------------------------------------------------------- 1 | 2 2_71210 0 71210 2 | 2 2_71228 0 71228 3 | 2 2_71229 0 71229 4 | 2 2_71230 0 71230 5 | 2 2_71282 0 71282 6 | 2 2_71399 0 71399 7 | 2 2_71531 0 71531 8 | 2 2_71532 0 71532 9 | 2 2_71533 0 71533 10 | 2 2_71534 0 71534 11 | -------------------------------------------------------------------------------- /test/data/population/regions_1.txt: -------------------------------------------------------------------------------- 1 | A 2 | B 10 20 3 | B 30 40 4 | C:10 5 | C:15..20 6 | C:25-30 7 | D 8 | -------------------------------------------------------------------------------- /test/data/population/regions_2.bim: -------------------------------------------------------------------------------- 1 | 2 2_71210 71210 C A 2 | 2 2_71228 71228 G C 3 | 2 2_71229 71229 T C 4 | 2 2_71230 71230 G A 5 | 2 2_71282 71282 T C 6 | 2 2_71399 71399 A C 7 | 2 2_71531 71531 A C 8 | 2 2_71532 71532 C T 9 | 2 2_71533 71533 A G 10 | 2 2_71534 71534 A T 11 | -------------------------------------------------------------------------------- /test/data/population/regions_2.map: -------------------------------------------------------------------------------- 1 | 2 2_71210 71210 2 | 2 2_71228 71228 3 | 2 2_71229 71229 4 | 2 2_71230 71230 5 | 2 2_71282 71282 6 | 2 2_71399 71399 7 | 2 2_71531 71531 8 | 2 2_71532 71532 9 | 2 2_71533 71533 10 | 2 2_71534 71534 11 | -------------------------------------------------------------------------------- /test/data/population/regions_2.txt: -------------------------------------------------------------------------------- 1 | A 5 10 2 | B 15 25 3 | B 35 45 4 | C:15 5 | C:15..20 6 | C:30 7 | D 8 | E 10 20 9 | -------------------------------------------------------------------------------- /test/data/population/sample-names.sync: -------------------------------------------------------------------------------- 1 | #chr pos ref sample_1 sample_2 sample_3 sample_4 2 | ABC 10 T 1:0:0:0:0:0 0:2:0:0:0:0 0:0:3:0:0:0 0:0:0:4:0:0 3 | ABC 12 A 1:0:0:0:0:0 0:2:0:0:0:0 0:0:3:0:0:0 0:0:0:4:0:0 4 | ABC 17 G 1:0:0:0:0:0 0:2:0:0:0:0 0:0:3:0:0:0 0:0:0:4:0:0 5 | ABC 25 A 1:0:0:0:0:0 0:2:0:0:0:0 0:0:3:0:0:0 0:0:0:4:0:0 6 | ABC 28 C 1:0:0:0:0:0 0:2:0:0:0:0 0:0:3:0:0:0 0:0:0:4:0:0 7 | ABC 30 T 1:0:0:0:0:0 0:2:0:0:0:0 0:0:3:0:0:0 0:0:0:4:0:0 8 | -------------------------------------------------------------------------------- /test/data/population/sample.gff2: -------------------------------------------------------------------------------- 1 | # ================================================================================================== 2 | # from http://genome.ucsc.edu/FAQ/FAQformat.html#format3 3 | # ================================================================================================== 4 | 5 | browser position chr22:10000000-10025000 6 | browser hide all 7 | track name=regulatory description="TeleGene(tm) Regulatory Regions" visibility=2 8 | chr22 TeleGene enhancer 10000000 10001000 500 + . touch1 9 | chr22 TeleGene promoter 10010000 10010100 900 + . touch1 10 | chr22 TeleGene promoter 10020000 10025000 800 - . touch2 11 | 12 | # ================================================================================================== 13 | # from http://gmod.org/wiki/GFF2 14 | # ================================================================================================== 15 | 16 | IV curated exon 5506900 5506996 . + . Transcript B0273.1 17 | IV curated exon 5506026 5506382 . + . Transcript B0273.1 18 | IV curated exon 5506558 5506660 . + . Transcript B0273.1 19 | IV curated exon 5506738 5506852 . + . Transcript B0273.1 20 | 21 | IV curated mRNA 5506800 5508917 . + . Transcript B0273.1; Note "Zn-Finger" 22 | IV curated 5'UTR 5506800 5508999 . + . Transcript B0273.1 23 | IV curated exon 5506900 5506996 . + . Transcript B0273.1 24 | IV curated exon 5506026 5506382 . + . Transcript B0273.1 25 | IV curated exon 5506558 5506660 . + . Transcript B0273.1 26 | IV curated exon 5506738 5506852 . + . Transcript B0273.1 27 | IV curated 3'UTR 5506852 5508917 . + . Transcript B0273.1 28 | 29 | chr3 giemsa heterochromatin 4500000 6000000 . . . Band 3q12.1 ; Note "Marfan's syndrome" and 3q12.1 ; Note "Marfan's syndrome" ; Note "dystrophic dysplasia" 30 | chr3 giemsa heterochromatin 4500000 6000000 . . . Band 3q12.1 ; Alias MFX 31 | chr1 assembly chromosome 1 14972282 . + . Sequence Chr1 32 | chr1 BLASTX similarity 76953 77108 132 + 0 Target Protein:SW:ABL_DROME 493 544 33 | chr1 assembly Link 10922906 11177731 . . . Target Sequence:LINK_H06O01 1 254826 34 | LINK_H06O01 assembly Cosmid 32386 64122 . . . Target Sequence:F49B2 6 31742 35 | -------------------------------------------------------------------------------- /test/data/population/sample.gtf: -------------------------------------------------------------------------------- 1 | # ================================================================================================== 2 | # from http://uswest.ensembl.org/info/website/upload/gff.html 3 | # ================================================================================================== 4 | 5 | 1 transcribed_unprocessed_pseudogene gene 11869 14409 . + . gene_id "ENSG00000223972"; gene_name "DDX11L1"; gene_source "havana"; gene_biotype "transcribed_unprocessed_pseudogene"; 6 | 1 processed_transcript transcript 11869 14409 . + . gene_id "ENSG00000223972"; transcript_id "ENST00000456328"; gene_name "DDX11L1"; gene_source "havana"; gene_biotype "transcribed_unprocessed_pseudogene"; transcript_name "DDX11L1-002"; transcript_source "havana"; 7 | -------------------------------------------------------------------------------- /test/data/population/test.sync: -------------------------------------------------------------------------------- 1 | 2R 2302 N 0:7:0:0:0:0 0:6:0:0:0:0 2 | 2R 2303 N 0:8:0:0:0:0 0:8:0:0:0:0 3 | 2R 2304 N 0:0:9:0:0:0 0:0:9:0:0:0 4 | 2R 2305 N 1:0:9:0:0:0 0:0:9:1:0:0 5 | -------------------------------------------------------------------------------- /test/data/population/test_header.sync: -------------------------------------------------------------------------------- 1 | #chr pos ref S1 S2 2 | 2R 2302 N 0:7:0:0:0:0 0:6:0:0:0:0 3 | 2R 2303 N 0:8:0:0:0:0 0:8:0:0:0:0 4 | 2R 2304 N 0:0:9:0:0:0 0:0:9:0:0:0 5 | 2R 2305 N 1:0:9:0:0:0 0:0:9:1:0:0 6 | -------------------------------------------------------------------------------- /test/data/population/ucsc.bed: -------------------------------------------------------------------------------- 1 | # file from https://genome.ucsc.edu/FAQ/FAQformat.html#format1 2 | track name=pairedReads description="Clone Paired Reads" useScore=1 3 | chr22 1000 5000 cloneA 960 + 1000 5000 0 2 567,488, 0,3512 4 | chr22 2000 6000 cloneB 900 - 2000 6000 0 2 433,399, 0,3601 5 | -------------------------------------------------------------------------------- /test/data/population/unordered.csv: -------------------------------------------------------------------------------- 1 | chr pos ref alt S1.ref_cnt S1.alt_cnt S2.ref_cnt S2.alt_cnt 2 | XYZ 1 T C 5 0 10 5 3 | XYZ 5 C G 8 2 12 6 4 | XYZ 10 T C 0 0 10 5 5 | XYZ 15 T C 1 0 0 4 6 | ABC 1 T C 5 0 10 5 7 | ABC 5 C G 8 2 12 6 8 | ABC 10 T C 0 0 10 5 9 | ABC 15 T C 1 0 0 4 10 | -------------------------------------------------------------------------------- /test/data/population/unordered.pileup: -------------------------------------------------------------------------------- 1 | XYZ 272 T 24 ,.$.....,,.,.,...,,,.,..^+. <<<+;<<<<<<<<<<<=<;<;7<& 2 | XYZ 273 T 23 NN....,,.,.,...,,,.,..A <<<;<<<<<<<<<3<=<<<;<<+ 3 | XYZ 274 T 23 ,.$..**,,.,.,...,,,.,... 7<7;<;<<<<<<<<<=<;<;<<6 4 | XYZ 275 A 23 ,$..-3TTT..,,.,.,...,,,.,...^l. <+;9*<<<<<<<<<=<<:;<<<< 5 | XYZ 276 G 22 ...T,,.,.,...,,,.,.... 33;+<<7=7<<7<&<<1;<<6< 6 | XYZ 277 T 22 ....,,.,.,.C.,,,.,..G. +7<;<<<<<<<&<=<<:;<<&< 7 | XYZ 278 G 23 ..+4ACGT..,,.,.,...,,,.,....^k. %38*<<;<7<<7<=<<<;<<<<< 8 | XYZ 279 C 23 A..T,,.,.<><>,,,.,..... ;75&<<<<<<<<<=<<<9<<:<< 9 | ABC 272 T 24 ,.$.....,,.,.,...,,,.,..^+. <<<+;<<<<<<<<<<<=<;<;7<& 10 | ABC 273 T 23 NN....,,.,.,...,,,.,..A <<<;<<<<<<<<<3<=<<<;<<+ 11 | ABC 274 T 23 ,.$..**,,.,.,...,,,.,... 7<7;<;<<<<<<<<<=<;<;<<6 12 | ABC 275 A 23 ,$..-3TTT..,,.,.,...,,,.,...^l. <+;9*<<<<<<<<<=<<:;<<<< 13 | ABC 276 G 22 ...T,,.,.,...,,,.,.... 33;+<<7=7<<7<&<<1;<<6< 14 | ABC 277 T 22 ....,,.,.,.C.,,,.,..G. +7<;<<<<<<<&<=<<:;<<&< 15 | ABC 278 G 23 ..+4ACGT..,,.,.,...,,,.,....^k. %38*<<;<7<<7<=<<<;<<<<< 16 | ABC 279 C 23 A..T,,.,.<><>,,,.,..... ;75&<<<<<<<<<=<<<9<<:<< 17 | -------------------------------------------------------------------------------- /test/data/population/unordered.sam.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/population/unordered.sam.gz -------------------------------------------------------------------------------- /test/data/population/unordered.sync: -------------------------------------------------------------------------------- 1 | XYZ 10 T 0:7:0:0:0:0 0:7:0:0:0:0 2 | XYZ 12 A 0:8:0:0:0:0 0:8:0:0:0:0 3 | XYZ 17 G 0:0:9:0:0:0 0:0:9:0:0:0 4 | XYZ 25 A 2:0:5:0:0:0 0:0:3:4:0:0 5 | XYZ 28 C 0:0:2:0:4:0 0:4:9:0:0:0 6 | XYZ 30 T 0:0:6:3:0:0 0:4:0:0:5:0 7 | ABC 10 T 0:7:0:0:0:0 0:7:0:0:0:0 8 | ABC 12 A 0:8:0:0:0:0 0:8:0:0:0:0 9 | ABC 17 G 0:0:9:0:0:0 0:0:9:0:0:0 10 | ABC 25 A 2:0:5:0:0:0 0:0:3:4:0:0 11 | ABC 28 C 0:0:2:0:4:0 0:4:9:0:0:0 12 | ABC 30 T 0:0:6:3:0:0 0:4:0:0:5:0 13 | -------------------------------------------------------------------------------- /test/data/population/wiki1.bed3: -------------------------------------------------------------------------------- 1 | # We took the example from https://en.wikipedia.org/wiki/BED_(file_format), 2 | # but changed the coordinates slightly to have gaps in them, so that we can 3 | # properly test the interval boundaries. 4 | chr7 127471196 127472363 5 | chr7 127472364 127473530 6 | chr7 127473531 127474697 7 | -------------------------------------------------------------------------------- /test/data/population/wiki2.bed: -------------------------------------------------------------------------------- 1 | browser position chr7:127471196-127495720 2 | browser hide all 3 | track name="ItemRGBDemo" description="Item RGB demonstration" visibility=2 itemRgb="On" 4 | chr7 127471196 127472363 Pos1 0 + 127471196 127472363 255,0,0 5 | chr7 127472363 127473530 Pos2 0 + 127472363 127473530 255,0,0 6 | chr7 127473530 127474697 Pos3 0 + 127473530 127474697 255,0,0 7 | chr7 127474697 127475864 Pos4 0 + 127474697 127475864 255,0,0 8 | chr7 127475864 127477031 Neg1 0 - 127475864 127477031 0,0,255 9 | chr7 127477031 127478198 Neg2 0 - 127477031 127478198 0,0,255 10 | chr7 127478198 127479365 Neg3 0 - 127478198 127479365 0,0,255 11 | chr7 127479365 127480532 Pos5 0 + 127479365 127480532 255,0,0 12 | chr7 127480532 127481699 Neg4 0 - 127480532 127481699 0,0,255 13 | -------------------------------------------------------------------------------- /test/data/sequence/TAIR10_chr_all.dict: -------------------------------------------------------------------------------- 1 | @HD VN:1.6 2 | @SQ SN:1 LN:30427671 M5:66bcd0ba0c2303c318cfa2742cfb4203 UR:file:/home/lucas/Dropbox/GitHub/grenepipe/test/reference/TAIR10_chr_all.fa 3 | @SQ SN:2 LN:19698289 M5:837e6cf18d30dda428a08ac2cb4061f2 UR:file:/home/lucas/Dropbox/GitHub/grenepipe/test/reference/TAIR10_chr_all.fa 4 | @SQ SN:3 LN:23459830 M5:bd4bc6259143f4b4f3921367c28d07ff UR:file:/home/lucas/Dropbox/GitHub/grenepipe/test/reference/TAIR10_chr_all.fa 5 | @SQ SN:4 LN:18585056 M5:21f56163f7e34510232448b14fce7578 UR:file:/home/lucas/Dropbox/GitHub/grenepipe/test/reference/TAIR10_chr_all.fa 6 | @SQ SN:5 LN:26975502 M5:d6cb9d0b2cf3f54e5308adaa2af79e08 UR:file:/home/lucas/Dropbox/GitHub/grenepipe/test/reference/TAIR10_chr_all.fa 7 | @SQ SN:mitochondria LN:366924 M5:41eb7f2aefd77bd60d1d204a5e2aa876 UR:file:/home/lucas/Dropbox/GitHub/grenepipe/test/reference/TAIR10_chr_all.fa 8 | @SQ SN:chloroplast LN:154478 M5:23eeba58f0f2b65fcfaeb887856c8bfb UR:file:/home/lucas/Dropbox/GitHub/grenepipe/test/reference/TAIR10_chr_all.fa 9 | -------------------------------------------------------------------------------- /test/data/sequence/TAIR10_chr_all.fa.fai: -------------------------------------------------------------------------------- 1 | 1 30427671 71 79 80 2 | 2 19698289 30812975 79 80 3 | 3 23459830 50760682 79 80 4 | 4 18585056 74517544 79 80 5 | 5 26975502 93337926 79 80 6 | mitochondria 366924 120654974 79 80 7 | chloroplast 154478 121026625 79 80 8 | -------------------------------------------------------------------------------- /test/data/sequence/aa_3_384_i.phylip: -------------------------------------------------------------------------------- 1 | 3 384 2 | CYS1_DICDI -----MKVIL LFVLAVFTVF VSS------- --------RG IPPEEQ---- --------SQ 3 | ALEU_HORVU MAHARVLLLA LAVLATAAVA VASSSSFADS NPIRPVTDRA ASTLESAVLG ALGRTRHALR 4 | CATH_HUMAN ------MWAT LPLLCAGAWL LGV------- -PVCGAAELS VNSLEK---- --------FH 5 | 6 | FLEFQDKFNK KY-SHEEYLE RFEIFKSNLG KIEELNLIAI NHKADTKFGV NKFADLSSDE 7 | FARFAVRYGK SYESAAEVRR RFRIFSESLE EVRSTN---- RKGLPYRLGI NRFSDMSWEE 8 | FKSWMSKHRK TY-STEEYHH RLQTFASNWR KINAHN---- NGNHTFKMAL NQFSDMSFAE 9 | 10 | FKNYYLNNKE AIFTDDLPVA DYLDDEFINS IPTAFDWRTR G-AVTPVKNQ GQCGSCWSFS 11 | FQATRL-GAA QTCSATLAGN HLMRDA--AA LPETKDWRED G-IVSPVKNQ AHCGSCWTFS 12 | IKHKYLWSEP QNCSAT--KS NYLRGT--GP YPPSVDWRKK GNFVSPVKNQ GACGSCWTFS 13 | 14 | TTGNVEGQHF ISQNKLVSLS EQNLVDCDHE CMEYEGEEAC DEGCNGGLQP NAYNYIIKNG 15 | TTGALEAAYT QATGKNISLS EQQLVDCAGG FNNF------ --GCNGGLPS QAFEYIKYNG 16 | TTGALESAIA IATGKMLSLA EQQLVDCAQD FNNY------ --GCQGGLPS QAFEYILYNK 17 | 18 | GIQTESSYPY TAETGTQCNF NSANIGAKIS NFTMIP-KNE TVMAGYIVST GPLAIAADAV 19 | GIDTEESYPY KGVNGV-CHY KAENAAVQVL DSVNITLNAE DELKNAVGLV RPVSVAFQVI 20 | GIMGEDTYPY QGKDGY-CKF QPGKAIGFVK DVANITIYDE EAMVEAVALY NPVSFAFEVT 21 | 22 | E-WQFYIGGV F-DIPCN--P NSLDHGILIV GYSAKNTIFR KNMPYWIVKN SWGADWGEQG 23 | DGFRQYKSGV YTSDHCGTTP DDVNHAVLAV GYGVENGV-- ---PYWLIKN SWGADWGDNG 24 | QDFMMYRTGI YSSTSCHKTP DKVNHAVLAV GYGEKNGI-- ---PYWIVKN SWGPQWGMNG 25 | 26 | YIYLRRGKNT CGVSNFVSTS II-- 27 | YFKMEMGKNM CAIATCASYP VVAA 28 | YFLIERGKNM CGLAACASYP IPLV 29 | -------------------------------------------------------------------------------- /test/data/sequence/aa_3_384_s.phylip: -------------------------------------------------------------------------------- 1 | 3 384 2 | CYS1_DICDI-----MKVILLFVLAVFTVFVSS---------------RGIPPEEQ------------SQFLEFQDKFNKKY-SHEEY 3 | LERFEIFKSNLGKIEELNLIAINHKADTKFGVNKFADLSSDEFKNYYLNNKEAIFTDDLPVADYLDDEFINSIPTAFDWRTRG-AVTP 4 | VKNQGQCGSCWSFSTTGNVEGQHFISQNKLVSLSEQNLVDCDHECMEYEGEEACDEGCNGGLQPNAYNYIIKNGGIQTESSYPYTAET 5 | GTQCNFNSANIGAKISNFTMIP-KNETVMAGYIVSTGPLAIAADAVE-WQFYIGGVF-DIPCN--PNSLDHGILIVGYSAKNTIFRKN 6 | MPYWIVKNSWGADWGEQGYIYLRRGKNTCGVSNFVSTSII-- 7 | ALEU_HORVUMAHARVLLLALAVLATAAVAVASSSSFADSNPIRPVTDRAASTLESAVLGALGRTRHALRFARFAVRYGKSYESAAEVR 8 | RRFRIFSESLEEVRSTN----RKGLPYRLGINRFSDMSWEEFQATRL-GAAQTCSATLAGNHLMRDA--AALPETKDWREDG-IVSPVK 9 | NQAHCGSCWTFSTTGALEAAYTQATGKNISLSEQQLVDCAGGFNNF--------GCNGGLPSQAFEYIKYNGGIDTEESYPYKGVNGV- 10 | CHYKAENAAVQVLDSVNITLNAEDELKNAVGLVRPVSVAFQVIDGFRQYKSGVYTSDHCGTTPDDVNHAVLAVGYGVENGV-----PYW 11 | LIKNSWGADWGDNGYFKMEMGKNMCAIATCASYPVVAA 12 | CATH_HUMAN------MWATLPLLCAGAWLLGV--------PVCGAAELSVNSLEK------------FHFKSWMSKHRKTY-STEEYH 13 | HRLQTFASNWRKINAHN----NGNHTFKMALNQFSDMSFAEIKHKYLWSEPQNCSAT--KSNYLRGT--GPYPPSVDWRKKGNFVSPVK 14 | NQGACGSCWTFSTTGALESAIAIATGKMLSLAEQQLVDCAQDFNNY--------GCQGGLPSQAFEYILYNKGIMGEDTYPYQGKDGY- 15 | CKFQPGKAIGFVKDVANITIYDEEAMVEAVALYNPVSFAFEVTQDFMMYRTGIYSSTSCHKTPDKVNHAVLAVGYGEKNGI-----PYW 16 | IVKNSWGPQWGMNGYFLIERGKNMCGLAACASYPIPLV 17 | -------------------------------------------------------------------------------- /test/data/sequence/dna_10.fasta.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/sequence/dna_10.fasta.gz -------------------------------------------------------------------------------- /test/data/sequence/dna_5_42_i.phylip: -------------------------------------------------------------------------------- 1 | 5 42 2 | Turkey AAGCTNGGGC ATTTCAGGGT 3 | Salmo gairAAGCCTTGGC AGTGCAGGGT 4 | H. SapiensACCGGTTGGC CGTTCAGGGT 5 | Chimp AAACCCTTGC CGTTACGCTT 6 | Gorilla AAACCCTTGC CGGTACGCTT 7 | 8 | GAGCCCGGGC AATACAGGGT AT 9 | GAGCCGTGGC CGGGCACGGT AT 10 | ACAGGTTGGC CGTTCAGGGT AA 11 | AAACCGAGGC CGGGACACTC AT 12 | AAACCATTGC CGGTACGCTT AA 13 | -------------------------------------------------------------------------------- /test/data/sequence/dna_5_42_s.phylip: -------------------------------------------------------------------------------- 1 | 5 42 2 | Turkey AAGCTNGGGC ATTTCAGGGT 3 | GAGCCCGGGC AATACAGGGT AT 4 | Salmo gairAAGCCTTGGC AGTGCAGGGT 5 | GAGCCGTGGC CGGGCACGGT AT 6 | H. SapiensACCGGTTGGC CGTTCAGGGT 7 | ACAGGTTGGC CGTTCAGGGT AA 8 | Chimp AAACCCTTGC CGTTACGCTT 9 | AAACCGAGGC CGGGACACTC AT 10 | Gorilla AAACCCTTGC CGGTACGCTT 11 | AAACCATTGC CGGTACGCTT AA 12 | -------------------------------------------------------------------------------- /test/data/sequence/grouped_taxonomy.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/sequence/grouped_taxonomy.json.gz -------------------------------------------------------------------------------- /test/data/sequence/grouped_taxonomy_trunk.json.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/sequence/grouped_taxonomy_trunk.json.gz -------------------------------------------------------------------------------- /test/data/sequence/wiki.fastq: -------------------------------------------------------------------------------- 1 | @SEQ_ID 2 | GATTTGGGGTTCAAAGCAGTATCGATCAAATAGTAAATCCATTTGTTCAACTCACAGTTT 3 | + 4 | !''*((((***+))%%%++)(%%%%).1***-+*''))**55CCF>>>>>>CCCCCCC65 5 | @HWI-EAS209_0006_FC706VJ:5:58:5894:21141#ATCACG/1 6 | TTAATTGGTAAATAAATCTCCTAATAGCTTAGATNTTACCTTNNNNNNNNNNTAGTTTCTTGAGATTTGTTGGGGGAGACATTTTTGTGATTGCCTTGAT 7 | +HWI-EAS209_0006_FC706VJ:5:58:5894:21141#ATCACG/1 8 | efcfffffcfeefffcffffffddf`fcef]`]_Ba_^__[YBBBBBBBBBBRTT\]][]dddd`ddd^dddadd^BBBBBBBBBBBBBBBBBBBBBBBB 9 | -------------------------------------------------------------------------------- /test/data/tree/distances.newick: -------------------------------------------------------------------------------- 1 | ((A:1.0,(B:2.0,C:4.0)D:8.0)E:16.0,((F:32.0,(G:64.0,H:128.0)I:256.0)J:512.0,K:1024.0)L:2048.0)R:4096.0; 2 | -------------------------------------------------------------------------------- /test/data/tree/indexed_attributes_0.newick: -------------------------------------------------------------------------------- 1 | ((C,D)[0.1],(A,(B,X)[0.3])[0.2],E); 2 | -------------------------------------------------------------------------------- /test/data/tree/indexed_attributes_1.newick: -------------------------------------------------------------------------------- 1 | ((C[0.3],D[0.5])[0.1][inner_0],(A[0.13],(B[0.87],X[0.14])[0.3][inner_1])[0.2][inner_2],E[0.99]); 2 | -------------------------------------------------------------------------------- /test/data/tree/keyed_attributes_0.newick: -------------------------------------------------------------------------------- 1 | ((C,D)[&!color=#009966],(A,(B,X)[&bs=82,!color=#009966])[&bs=70],E); 2 | -------------------------------------------------------------------------------- /test/data/tree/keyed_attributes_1.newick: -------------------------------------------------------------------------------- 1 | (((ADH2:0.1[&&NHX:S=human:E=1.1.1.1],ADH1:0.11[&&NHX:S=human:E=1.1.1.1]):0.05 2 | [&&NHX:S=Primates:E=1.1.1.1:D=Y:B=100],ADHY:0.1[&&NHX:S=nematode:E=1.1.1.1], 3 | ADHX:0.12[&&NHX:S=insect:E=1.1.1.1]):0.1[&&NHX:S=Metazoa:E=1.1.1.1:D=N], 4 | (ADH4:0.09[&&NHX:S=yeast:E=1.1.1.1],ADH3:0.13[&&NHX:S=yeast:E=1.1.1.1], 5 | ADH2:0.12[&&NHX:S=yeast:E=1.1.1.1],ADH1:0.11[&&NHX:S=yeast:E=1.1.1.1]):0.1 6 | [&&NHX:S=Fungi])[&&NHX:E=1.1.1.1:D=N]; 7 | -------------------------------------------------------------------------------- /test/data/tree/multiple.newick: -------------------------------------------------------------------------------- 1 | (,,(,)); 2 | (A,B,(C,D)); 3 | (A,B,(C,D)E)F; 4 | (:0.1,:0.2,(:0.3,:0.4):0.5); 5 | (:0.1,:0.2,(:0.3,:0.4):0.5):0.0; 6 | (A:0.1,B:0.2,(C:0.3,D:0.4):0.5); 7 | (A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5)F; 8 | -------------------------------------------------------------------------------- /test/data/tree/multiple_named.newick: -------------------------------------------------------------------------------- 1 | Tree1=(,,(,)); 2 | "Tree 2"=(A,B,(C,D)); 3 | 'Tree 3' = (A,B,(C,D)E)F; 4 | (:0.1,:0.2,(:0.3,:0.4):0.5); 5 | [foo]Tree_4=(:0.1,:0.2,(:0.3,:0.4):0.5):0.0; 6 | "Tree_5" = [&r] (A:0.1,B:0.2,(C:0.3,D:0.4):0.5); 7 | [foo]'Tree 6'=[baz](A:0.1,B:0.2,(C:0.3,D:0.4)E:0.5)F; 8 | -------------------------------------------------------------------------------- /test/data/tree/random-trees.newick: -------------------------------------------------------------------------------- 1 | ((j:0.517775,((i:0.622172,(d:0.478244,a:0.438536):0.157822):0.885923,((b:0.479852,f:0.966861):0.209956,h:0.25374):0.802266):0.249583):0.986278,(c:0.566471,g:0.822948):0.701827,e:0.616214); 2 | (((((d:0.826438,i:0.582708):0.91063,g:0.877015):0.456482,(a:0.375368,(b:0.082285,(h:0.757446,j:0.700638):0.514866):0.448603):0.649565):0.529164,c:0.677756):0.688848,e:0.372713,f:0.143171); 3 | (((((c:0.293492,e:0.186704):0.955126,i:0.008615):0.678819,a:0.496637):0.627372,(b:0.365243,(d:0.423057,h:0.680307):0.770482):0.805736):0.020807,(f:0.524275,j:0.184286):0.956598,g:0.78015); 4 | (((a:0.098026,(b:0.710619,f:0.373232):0.286992):0.190266,((c:0.542704,i:0.898454):0.888068,(e:0.733712,h:0.80756):0.65694):0.677872):0.061254,(d:0.470073,g:0.149245):0.74625,j:0.618376); 5 | (((((c:0.506674,(d:0.494587,e:0.145661):0.371883):0.665227,i:0.311089):0.139589,(f:0.99576,j:0.594268):0.240412):0.711438,(g:0.54742,a:0.21354):0.504656):0.962903,b:0.562681,h:0.958911); 6 | (a:0.329131,(b:0.63437,(((((c:0.393848,h:0.614236):0.562114,f:0.610259):0.604001,(e:0.04189,g:0.938036):0.13596):0.250839,j:0.060291):0.836205,d:0.677113):0.235551):0.779035,i:0.22515); 7 | (a:0.546126,((((b:0.589627,(g:0.221228,j:0.968565):0.70355):0.894238,f:0.326229):0.477656,(d:0.529047,h:0.3922):0.776839):0.968304,(c:0.487387,i:0.522296):0.765796):0.802141,e:0.094806); 8 | ((j:0.925748,(g:0.088538,((c:0.35219,h:0.035754):0.784431,((e:0.09415,i:0.427253):0.577055,(d:0.578428,a:0.15633):0.800584):0.905325):0.636812):0.117101):0.46218,b:0.81225,f:0.189002); 9 | ((h:0.67879,((g:0.471931,(i:0.828179,a:0.26654):0.199264):0.144289,b:0.303987):0.801285):0.171997,((c:0.20228,j:0.38125):0.123469,(d:0.006288,e:0.059171):0.378583):0.728741,f:0.049039); 10 | ((f:0.912305,(j:0.340605,(h:0.323844,(e:0.542589,(d:0.181072,a:0.877637):0.447421):0.609885):0.995736):0.944921):0.647888,(b:0.473203,(c:0.673091,g:0.858339):0.320275):0.80779,i:0.733872); 11 | -------------------------------------------------------------------------------- /test/data/tree/rooted.newick: -------------------------------------------------------------------------------- 1 | ((B,(D,E)C)A,(H,I)G)R; 2 | -------------------------------------------------------------------------------- /test/data/utils/csv/comment_empty.csv: -------------------------------------------------------------------------------- 1 | 1,Cersei,Lannister 2 | 3 | 4 | 5 | 2,Ned,Stark 6 | 7 | 3,Khal,Drogo 8 | ,, 9 | # this is a comment 10 | # this one, too 11 | # this is not, but, no! 12 | 13 | 4,Daario,Naharis 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/data/utils/csv/complex.csv: -------------------------------------------------------------------------------- 1 | 1,Bran, 2 | 2,,Bolton 3 | ,Tormund,Giantsbane 4 | 4,, 5 | ,Joffrey, 6 | ,,Stark 7 | ,, 8 | 8 ,Jaime ""The Kingslayer"",Lannister 9 | 9, "Sandor, called The Hound","" 10 | 10,"Daenerys ""Mother of Dragons""", """" 11 | -------------------------------------------------------------------------------- /test/data/utils/csv/linear_regression.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/Rscript 2 | 3 | data <- read.csv( file="linear_regression.csv", sep=",", head=TRUE ) 4 | 5 | x <- data[,'x1'] 6 | y <- data[,'x5'] 7 | 8 | # # Normal 9 | # res <- lm(formula = y ~ x, model=TRUE, x=TRUE, y=TRUE, qr=TRUE ) 10 | # 11 | # # No intercept 12 | # # res <- lm(formula = y ~ x - 1, model=TRUE, x=TRUE, y=TRUE, qr=TRUE ) 13 | # 14 | # anova(res) 15 | # summary(res) 16 | # print(res) 17 | # 18 | # 19 | # print("resid") 20 | # paste0( resid(res), collapse=", " ) 21 | # # residuals(res) 22 | # # paste0( res['residuals'], collapse=", " ) 23 | # cat("\n") 24 | # 25 | # print("fitted") 26 | # # paste0( fitted(res), collapse=", " ) 27 | # cat("\n") 28 | # 29 | # print("fitted.values") 30 | # paste0( res['fitted.values'], collapse=", " ) 31 | # cat("\n") 32 | # 33 | # print("x") 34 | # # res['x'] 35 | # paste0( res['x'], collapse=", " ) 36 | # cat("\n") 37 | # 38 | # # print("qr") 39 | # # paste0( res['qr'], collapse=", " ) 40 | # 41 | # print( res['weights'] ) 42 | # print( res['coefficients'] ) 43 | # print( res['xlevels'] ) 44 | # print( res['rank'] ) 45 | # print( res['contrasts'] ) 46 | # # print( res['model'] ) 47 | # print( res['df.residual'] ) 48 | 49 | 50 | fit <- glm( formula = y ~ x - 1, family=gaussian() ) 51 | summary(fit) # display results 52 | confint(fit) # 95% CI for the coefficients 53 | exp(coef(fit)) # exponentiated coefficients 54 | exp(confint(fit)) # 95% CI for exponentiated coefficients 55 | predict(fit, type="response") # predicted values 56 | residuals(fit, type="deviance") # residuals 57 | -------------------------------------------------------------------------------- /test/data/utils/csv/logistic_regression.R: -------------------------------------------------------------------------------- 1 | #!/usr/bin/Rscript 2 | 3 | data <- read.csv( file="logistic_regression.csv", sep=",", head=TRUE ) 4 | 5 | x <- data[,'Hours'] 6 | y <- data[,'Pass'] 7 | 8 | # # Normal 9 | # res <- lm(formula = y ~ x, model=TRUE, x=TRUE, y=TRUE, qr=TRUE ) 10 | # 11 | # # No intercept 12 | # # res <- lm(formula = y ~ x - 1, model=TRUE, x=TRUE, y=TRUE, qr=TRUE ) 13 | # 14 | # anova(res) 15 | # summary(res) 16 | # print(res) 17 | # 18 | # 19 | # print("resid") 20 | # paste0( resid(res), collapse=", " ) 21 | # # residuals(res) 22 | # # paste0( res['residuals'], collapse=", " ) 23 | # cat("\n") 24 | # 25 | # print("fitted") 26 | # # paste0( fitted(res), collapse=", " ) 27 | # cat("\n") 28 | # 29 | # print("fitted.values") 30 | # paste0( res['fitted.values'], collapse=", " ) 31 | # cat("\n") 32 | # 33 | # print("x") 34 | # # res['x'] 35 | # paste0( res['x'], collapse=", " ) 36 | # cat("\n") 37 | # 38 | # # print("qr") 39 | # # paste0( res['qr'], collapse=", " ) 40 | # 41 | # print( res['weights'] ) 42 | # print( res['coefficients'] ) 43 | # print( res['xlevels'] ) 44 | # print( res['rank'] ) 45 | # print( res['contrasts'] ) 46 | # # print( res['model'] ) 47 | # print( res['df.residual'] ) 48 | 49 | 50 | fit <- glm( formula = y ~ x, family=binomial(link='logit') ) 51 | summary(fit) # display results 52 | confint(fit) # 95% CI for the coefficients 53 | exp(coef(fit)) # exponentiated coefficients 54 | exp(confint(fit)) # 95% CI for exponentiated coefficients 55 | predict(fit, type="response") # predicted values 56 | residuals(fit, type="deviance") # residuals 57 | -------------------------------------------------------------------------------- /test/data/utils/csv/logistic_regression.csv: -------------------------------------------------------------------------------- 1 | Hours,Pass 2 | 0.5,0 3 | 0.75,0 4 | 1,0 5 | 1.25,0 6 | 1.5,0 7 | 1.75,0 8 | 1.75,1 9 | 2,0 10 | 2.25,1 11 | 2.5,0 12 | 2.75,1 13 | 3,0 14 | 3.25,1 15 | 3.5,0 16 | 4,1 17 | 4.25,1 18 | 4.5,1 19 | 4.75,1 20 | 5,1 21 | 5.5,1 22 | -------------------------------------------------------------------------------- /test/data/utils/csv/mixed.csv: -------------------------------------------------------------------------------- 1 | Name,First,Second,Third,Fourth,Fifth 2 | gamma,1,8,4.7,true,nice 3 | alpha,0,0,4.5,true,bad 4 | kappa,0,0,5,false,nice 5 | theta,1,8,5.3,true,nice 6 | iota,1,1,5.3,true,bad 7 | zeta,1,10,5.3,false,none 8 | delta,1,8,5.3,false,bad 9 | beta,1,8,5,true,none 10 | eta,1,10,5.3,true,bad 11 | epsilon,1,10,5.5,false,bad 12 | -------------------------------------------------------------------------------- /test/data/utils/csv/mixed_nan.csv: -------------------------------------------------------------------------------- 1 | Name,First,Second,Third,Fourth,Fifth 2 | gamma,1,8,4.7,TRUE,nice 3 | alpha,0,0,4.5,TRUE,bad 4 | kappa,0,nan,5,,nice 5 | theta,1,8,,TRUE,nice 6 | iota,,1,5.3,TRUE,bad 7 | zeta,1,10,nan,FALSE,none 8 | delta,1,8,5.3,FALSE,bad 9 | beta,,8,5,TRUE, 10 | eta,1,,5.3,TRUE,bad 11 | epsilon,1,10,5.5,FALSE,bad 12 | -------------------------------------------------------------------------------- /test/data/utils/csv/simple.csv: -------------------------------------------------------------------------------- 1 | 1,Bran,Stark 2 | 2,Petyr,Baelish 3 | 3,Samwell,Tarly 4 | 4,Davos,Seaworth 5 | 5,Margaery,Tyrell 6 | -------------------------------------------------------------------------------- /test/data/utils/csv/tab_esc.csv: -------------------------------------------------------------------------------- 1 | 1 Jon Snow 2 | 2 Tommen "Baratheon\nThe King" 3 | 3 "Jorah with spaces" "Mormont with tabs" 4 | 4, Tyrion, Lannister\ 5 | "continued: The Imp" 6 | 5 "Jaqen 7 | new line" \"H'ghar\" 8 | 6 "Arya \"with quotes\"" Stark 9 | -------------------------------------------------------------------------------- /test/data/utils/csv/table.csv: -------------------------------------------------------------------------------- 1 | Name,First,Second,Third 2 | alpha,0,0,4.5 3 | beta,1,8,5 4 | gamma,1,8,4.7 5 | delta,1,8,5.3 6 | epsilon,1,10,5.5 7 | zeta,1,10,5.3 8 | eta,1,10,5.3 9 | theta,1,8,5.3 10 | iota,1,1,5.3 11 | kappa,0,0,5 12 | -------------------------------------------------------------------------------- /test/data/utils/hash/aaa.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/utils/hash/aaa.txt.gz -------------------------------------------------------------------------------- /test/data/utils/hash/abc.txt: -------------------------------------------------------------------------------- 1 | abc -------------------------------------------------------------------------------- /test/data/utils/hash/empty.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/utils/hash/empty.txt -------------------------------------------------------------------------------- /test/data/utils/json/README.md: -------------------------------------------------------------------------------- 1 | Json Test Files 2 | =============== 3 | 4 | Obtained from [pplacer](http://matsen.fhcrc.org/pplacer/) by Eric Matsen. 5 | Original files published under GPL v3 at https://github.com/matsen/pplacer 6 | 7 | The "fail" files starting with an underscore are currently excluded from our tests, 8 | because we do not figure it necessary to fail in the cases presented there. 9 | This is not strictly in accordance with the JSON standard, so we might change behaviour 10 | later and include those tests as well. 11 | -------------------------------------------------------------------------------- /test/data/utils/json/_fail13.jtest: -------------------------------------------------------------------------------- 1 | {"Numbers cannot have leading zeroes": 013} -------------------------------------------------------------------------------- /test/data/utils/json/_fail15.jtest: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \x15"] -------------------------------------------------------------------------------- /test/data/utils/json/_fail17.jtest: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \017"] -------------------------------------------------------------------------------- /test/data/utils/json/_fail25.jtest: -------------------------------------------------------------------------------- 1 | [" tab character in string "] -------------------------------------------------------------------------------- /test/data/utils/json/_fail26.jtest: -------------------------------------------------------------------------------- 1 | ["tab\ character\ in\ string\ "] -------------------------------------------------------------------------------- /test/data/utils/json/_fail27.jtest: -------------------------------------------------------------------------------- 1 | ["line 2 | break"] -------------------------------------------------------------------------------- /test/data/utils/json/_fail28.jtest: -------------------------------------------------------------------------------- 1 | ["line\ 2 | break"] -------------------------------------------------------------------------------- /test/data/utils/json/fail10.jtest: -------------------------------------------------------------------------------- 1 | {"Extra value after close": true} "misplaced quoted value" -------------------------------------------------------------------------------- /test/data/utils/json/fail11.jtest: -------------------------------------------------------------------------------- 1 | {"Illegal expression": 1 + 2} -------------------------------------------------------------------------------- /test/data/utils/json/fail12.jtest: -------------------------------------------------------------------------------- 1 | {"Illegal invocation": alert()} -------------------------------------------------------------------------------- /test/data/utils/json/fail14.jtest: -------------------------------------------------------------------------------- 1 | {"Numbers cannot be hex": 0x14} -------------------------------------------------------------------------------- /test/data/utils/json/fail16.jtest: -------------------------------------------------------------------------------- 1 | [\naked] -------------------------------------------------------------------------------- /test/data/utils/json/fail19.jtest: -------------------------------------------------------------------------------- 1 | {"Missing colon" null} -------------------------------------------------------------------------------- /test/data/utils/json/fail2.jtest: -------------------------------------------------------------------------------- 1 | ["Unclosed array" -------------------------------------------------------------------------------- /test/data/utils/json/fail20.jtest: -------------------------------------------------------------------------------- 1 | {"Double colon":: null} -------------------------------------------------------------------------------- /test/data/utils/json/fail21.jtest: -------------------------------------------------------------------------------- 1 | {"Comma instead of colon", null} -------------------------------------------------------------------------------- /test/data/utils/json/fail22.jtest: -------------------------------------------------------------------------------- 1 | ["Colon instead of comma": false] -------------------------------------------------------------------------------- /test/data/utils/json/fail23.jtest: -------------------------------------------------------------------------------- 1 | ["Bad value", truth] -------------------------------------------------------------------------------- /test/data/utils/json/fail24.jtest: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /test/data/utils/json/fail29.jtest: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /test/data/utils/json/fail3.jtest: -------------------------------------------------------------------------------- 1 | {unquoted_key: "keys must be quoted"} -------------------------------------------------------------------------------- /test/data/utils/json/fail30.jtest: -------------------------------------------------------------------------------- 1 | [0e+] 2 | -------------------------------------------------------------------------------- /test/data/utils/json/fail31.jtest: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /test/data/utils/json/fail32.jtest: -------------------------------------------------------------------------------- 1 | {"Comma instead if closing brace": true, -------------------------------------------------------------------------------- /test/data/utils/json/fail33.jtest: -------------------------------------------------------------------------------- 1 | ["mismatch"} -------------------------------------------------------------------------------- /test/data/utils/json/fail4.jtest: -------------------------------------------------------------------------------- 1 | ["extra comma",] -------------------------------------------------------------------------------- /test/data/utils/json/fail5.jtest: -------------------------------------------------------------------------------- 1 | ["double extra comma",,] -------------------------------------------------------------------------------- /test/data/utils/json/fail6.jtest: -------------------------------------------------------------------------------- 1 | [ , "<-- missing value"] -------------------------------------------------------------------------------- /test/data/utils/json/fail7.jtest: -------------------------------------------------------------------------------- 1 | ["Comma after the close"], -------------------------------------------------------------------------------- /test/data/utils/json/fail8.jtest: -------------------------------------------------------------------------------- 1 | ["Extra close"]] -------------------------------------------------------------------------------- /test/data/utils/json/fail9.jtest: -------------------------------------------------------------------------------- 1 | {"Extra comma": true,} -------------------------------------------------------------------------------- /test/data/utils/json/pass1.jtest: -------------------------------------------------------------------------------- 1 | [ 2 | "JSON Test Pattern pass1", 3 | {"object with 1 member":["array with 1 element"]}, 4 | {}, 5 | [], 6 | -42, 7 | true, 8 | false, 9 | null, 10 | { 11 | "integer": 1234567890, 12 | "real": -9876.543210, 13 | "e": 0.123456789e-12, 14 | "E": 1.234567890E+34, 15 | "": 23456789012E66, 16 | "zero": 0, 17 | "one": 1, 18 | "space": " ", 19 | "quote": "\"", 20 | "backslash": "\\", 21 | "controls": "\b\f\n\r\t", 22 | "slash": "/ & \/", 23 | "alpha": "abcdefghijklmnopqrstuvwyz", 24 | "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", 25 | "digit": "0123456789", 26 | "0123456789": "digit", 27 | "special": "`1~!@#$%^&*()_+-={':[,]}|;.?", 28 | "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", 29 | "true": true, 30 | "false": false, 31 | "null": null, 32 | "array":[ ], 33 | "object":{ }, 34 | "address": "50 St. James Street", 35 | "url": "http://www.JSON.org/", 36 | "comment": "// /* */": " ", 38 | " s p a c e d " :[1,2 , 3 39 | 40 | , 41 | 42 | 4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], 43 | "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", 44 | "quotes": "" \u0022 %22 0x22 034 "", 45 | "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" 46 | : "A key can be any string" 47 | }, 48 | 0.5 ,98.6 49 | , 50 | 99.44 51 | , 52 | 53 | 1066, 54 | 1e1, 55 | 0.1e1, 56 | 1e-1, 57 | 1e00,2e+00,2e-00 58 | ,"rosebud"] -------------------------------------------------------------------------------- /test/data/utils/json/pass2.jtest: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /test/data/utils/json/pass3.jtest: -------------------------------------------------------------------------------- 1 | { 2 | "JSON Test Pattern pass3": { 3 | "The outermost value": "must be an object or array.", 4 | "In this test": "It is an object." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/data/utils/json/pass4.jtest.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lczech/genesis/b413a402b0b76945b08975bcc03ba6b084e2fca7/test/data/utils/json/pass4.jtest.gz -------------------------------------------------------------------------------- /test/data/utils/matrix/README.md: -------------------------------------------------------------------------------- 1 | Iris Data Set 2 | ============= 3 | 4 | Obtained from https://archive.ics.uci.edu/ml/datasets/Iris 5 | Statistics calculated according to http://sebastianraschka.com/Articles/2015_pca_in_3_steps.html 6 | -------------------------------------------------------------------------------- /test/data/utils/matrix/headers.mat: -------------------------------------------------------------------------------- 1 | Name First Second Third 2 | alpha 0 0 4.5 3 | beta 1 8 5 4 | gamma 1 8 4.7 5 | delta 1 8 5.3 6 | epsilon 1 10 5.5 7 | zeta 1 10 5.3 8 | eta 1 10 5.3 9 | theta 1 8 5.3 10 | iota inf INFINITY nan 11 | kappa -inf -INFINITY -nan 12 | -------------------------------------------------------------------------------- /test/data/utils/matrix/simple.mat: -------------------------------------------------------------------------------- 1 | 0 0 4.5 2 | 1 8 5 3 | 1 8 4.7 4 | 1 8 5.3 5 | 1 10 5.5 6 | 1 10 5.3 7 | 1 10 5.3 8 | 1 8 5.3 9 | inf INFINITY nan 10 | -inf -INFINITY -nan 11 | -------------------------------------------------------------------------------- /test/src/sequence/reference_genome.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2023 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | Department of Plant Biology, Carnegie Institution For Science 21 | 260 Panama Street, Stanford, CA 94305, USA 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup test 29 | */ 30 | 31 | #include "src/common.hpp" 32 | 33 | #include "genesis/sequence/reference_genome.hpp" 34 | #include "genesis/sequence/formats/fasta_reader.hpp" 35 | 36 | #include 37 | 38 | using namespace genesis; 39 | using namespace genesis::sequence; 40 | 41 | TEST( ReferenceGenome, Basics ) 42 | { 43 | // Skip test if no data availabe. 44 | NEEDS_TEST_DATA; 45 | 46 | // Load sequence file. 47 | std::string infile = environment->data_dir + "sequence/dna_10.fasta"; 48 | auto const rg = FastaReader().read_reference_genome( utils::from_file(infile) ); 49 | 50 | EXPECT_EQ( 10, rg.size() ); 51 | EXPECT_TRUE( rg.contains( "Di106BGTue" )); 52 | EXPECT_EQ( "Di106BGTue", rg.begin()->label() ); 53 | EXPECT_EQ( 460, rg.find( "Di106BGTue" )->length() ); 54 | EXPECT_EQ( rg.end(), rg.find( "X" ) ); 55 | } 56 | -------------------------------------------------------------------------------- /test/src/taxonomy/rank.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2017 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 21 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup test 29 | */ 30 | 31 | #include "src/common.hpp" 32 | 33 | #include "genesis/taxonomy/functions/ranks.hpp" 34 | 35 | #include 36 | 37 | using namespace genesis::taxonomy; 38 | 39 | TEST( Taxonomy, Rank ) 40 | { 41 | EXPECT_EQ( "Kingdom", rank_from_abbreviation( 'k' )); 42 | EXPECT_EQ( "", rank_from_abbreviation( 'q' )); 43 | 44 | EXPECT_EQ( "f", rank_to_abbreviation( "familY" )); 45 | EXPECT_EQ( "", rank_to_abbreviation( "hamlet" )); 46 | 47 | auto rra_0 = resolve_rank_abbreviation( "K__Bacteria" ); 48 | EXPECT_EQ( "Kingdom", rra_0.first ); 49 | EXPECT_EQ( "Bacteria", rra_0.second ); 50 | 51 | auto rra_1 = resolve_rank_abbreviation( "q__quartz" ); 52 | EXPECT_EQ( "", rra_1.first ); 53 | EXPECT_EQ( "q__quartz", rra_1.second ); 54 | 55 | auto rra_2 = resolve_rank_abbreviation( "Panthera tigris altaicia" ); 56 | EXPECT_EQ( "", rra_2.first ); 57 | EXPECT_EQ( "Panthera tigris altaicia", rra_2.second ); 58 | } 59 | -------------------------------------------------------------------------------- /test/src/utils/formats/bmp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2023 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | Department of Plant Biology, Carnegie Institution For Science 21 | 260 Panama Street, Stanford, CA 94305, USA 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup test 29 | */ 30 | 31 | #include "src/common.hpp" 32 | 33 | #include "genesis/utils/formats/bmp/writer.hpp" 34 | #include "genesis/utils/containers/matrix.hpp" 35 | #include "genesis/utils/color/color.hpp" 36 | 37 | using namespace genesis::utils; 38 | 39 | // ------------------------------------------------------------------------- 40 | // BMP Writer 41 | // ------------------------------------------------------------------------- 42 | 43 | TEST( Bmp, Writer ) 44 | { 45 | // Some weird sizes to test the padding. 46 | size_t const rows = 185; 47 | size_t const cols = 213; 48 | 49 | auto bunt = Matrix( rows, cols ); 50 | 51 | for( size_t y = 0; y < rows; ++y ) { 52 | for( size_t x = 0; x < cols; ++x ) { 53 | bunt( y, x ) = Color( x / cols, y / rows, 0 ); 54 | } 55 | } 56 | 57 | std::ostringstream ost; 58 | auto writer = BmpWriter(); 59 | // writer.to_file( bunt, "/home/lucas/bunt.bmp" ); 60 | writer.write( bunt, to_stream( ost )); 61 | } 62 | -------------------------------------------------------------------------------- /test/src/utils/tools/char_lookup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Genesis - A toolkit for working with phylogenetic data. 3 | Copyright (C) 2014-2020 Lucas Czech 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | 18 | Contact: 19 | Lucas Czech 20 | Exelixis Lab, Heidelberg Institute for Theoretical Studies 21 | Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 22 | */ 23 | 24 | /** 25 | * @brief 26 | * 27 | * @file 28 | * @ingroup test 29 | */ 30 | 31 | #include "src/common.hpp" 32 | 33 | #include "genesis/utils/tools/char_lookup.hpp" 34 | 35 | using namespace genesis::utils; 36 | 37 | TEST(CharLookup, Simple) 38 | { 39 | auto cl = CharLookup(); 40 | 41 | cl.set_selection( "abc", true ); 42 | EXPECT_TRUE( cl.get('a') ); 43 | EXPECT_FALSE( cl.get('A') ); 44 | 45 | cl.set_range( 'G', 'L', true ); 46 | EXPECT_FALSE( cl.get('F') ); 47 | EXPECT_TRUE( cl.get('I') ); 48 | 49 | cl.set_char( 'I', false ); 50 | EXPECT_FALSE( cl.get('I') ); 51 | } 52 | -------------------------------------------------------------------------------- /tools/deploy/notable_changes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Genesis - A toolkit for working with phylogenetic data. 4 | # Copyright (C) 2014-2016 Lucas Czech 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Contact: 20 | # Lucas Czech 21 | # Exelixis Lab, Heidelberg Institute for Theoretical Studies 22 | # Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 23 | 24 | #################################################################################################### 25 | # This script lists notable changes since the last release. 26 | #################################################################################################### 27 | 28 | # Get current version. 29 | last_tag=`git describe --abbrev=0 --tags` 30 | 31 | # Get all important commits after the last tag and format them for Markdown. 32 | echo -e "\e[34mNotable changes since version ${last_tag}\e[0m\n" 33 | git log ${last_tag}..HEAD --oneline | cut -d " " -f 1 --complement | egrep -iv "^(Minor|Merge|Release)" | sed "s/^/ \* /g" 34 | -------------------------------------------------------------------------------- /tools/deploy/xkcd.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import json 4 | import urllib 5 | 6 | # Get latest xkcd data 7 | url = "http://xkcd.com/info.0.json" 8 | response = urllib.urlopen(url) 9 | data = json.loads(response.read()) 10 | 11 | # Print the title, with proper escaping 12 | print json.dumps(data["safe_title"]).strip('"') 13 | -------------------------------------------------------------------------------- /tools/extract_todos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Genesis - A toolkit for working with phylogenetic data. 4 | # Copyright (C) 2014-2016 Lucas Czech 5 | # 6 | # This program is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program. If not, see . 18 | # 19 | # Contact: 20 | # Lucas Czech 21 | # Exelixis Lab, Heidelberg Institute for Theoretical Studies 22 | # Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany 23 | 24 | #################################################################################################### 25 | # This script scans all C++ files in lib/, python/src/ and test/src/ for comments 26 | # that start with TODO or FIXME and writes them to a file ./TODO for easy access. 27 | #################################################################################################### 28 | 29 | # Change to top level of git repo. 30 | # This ensures that the script can be called from any directory. 31 | cd `git rev-parse --show-toplevel` 32 | 33 | rm -f TODO 34 | 35 | for file in `find lib/ python/src test/src -type f`; do 36 | fgrep -Hn -e "TODO" ${file} | sed "s/[[:space:]]*[\/\*]*[[:space:]]*\(TODO\|FIXME\)[[:space:]]*/\tTODO\t/gI" >> TODO_tmp 37 | fgrep -Hn -e "FIXME" ${file} | sed "s/[[:space:]]*[\/\*]*[[:space:]]*\(TODO\|FIXME\)[[:space:]]*/\tFIXME\t/gI" >> TODO_tmp 38 | done 39 | 40 | cat TODO_tmp | column -t -s $'\t' > TODO 41 | rm TODO_tmp 42 | -------------------------------------------------------------------------------- /tools/py_bindings/.gitignore: -------------------------------------------------------------------------------- 1 | # -------------------------------------------------------------------- 2 | # Generated files 3 | # -------------------------------------------------------------------- 4 | 5 | xml/ 6 | src/ 7 | 8 | # -------------------------------------------------------------------- 9 | # Python Byte-Compiled Files 10 | # -------------------------------------------------------------------- 11 | 12 | __pycache__/ 13 | *.pyc 14 | *.pyo 15 | *.pyd 16 | -------------------------------------------------------------------------------- /tools/py_bindings/py_binder/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | --------------------------------------------------------------------------------