├── LICENSE
├── Makefile
├── README
├── README.md
├── SuperReads_RNA
├── LICENSE.txt
├── PkgConfig.pm
├── README.md
├── create_rna_sr.py
├── dist-bin
│ ├── gmake
│ └── pkg-config
├── global-1
│ ├── LICENSE.txt
│ ├── Makefile.am
│ ├── Makefile.in
│ ├── SuperReadsR
│ │ ├── AUTHORS
│ │ ├── COPYING
│ │ ├── ChangeLog
│ │ ├── INSTALL
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── NEWS
│ │ ├── README
│ │ ├── all_tests
│ │ ├── gtest.mk
│ │ ├── include
│ │ │ ├── binary_search_tree_iterator.hpp
│ │ │ ├── charb.hpp
│ │ │ ├── charbuf.hpp
│ │ │ ├── exp_buffer.hpp
│ │ │ ├── exp_vector.hpp
│ │ │ ├── fork_exec.hpp
│ │ │ ├── gcc_builtins.hpp
│ │ │ ├── gzip_stream.hpp
│ │ │ ├── heap.hpp
│ │ │ ├── jflib
│ │ │ │ ├── multiplexed_io.hpp
│ │ │ │ ├── multiplexed_parser.hpp
│ │ │ │ └── pool.hpp
│ │ │ ├── misc.hpp
│ │ │ ├── multi_thread_skip_list_map.hpp
│ │ │ ├── multi_thread_skip_list_set.hpp
│ │ │ ├── rb_node.hpp
│ │ │ ├── rb_tree.hpp
│ │ │ ├── reallocators.hpp
│ │ │ ├── skip_list_common.hpp
│ │ │ ├── skip_list_map.hpp
│ │ │ ├── skip_list_set.hpp
│ │ │ ├── thread_pool.hpp
│ │ │ ├── timer.h
│ │ │ └── tmpstream.hpp
│ │ ├── lib
│ │ │ └── fork_exec.cpp
│ │ ├── src
│ │ │ ├── MasurcaCommon.pm
│ │ │ ├── MasurcaConf.pm
│ │ │ ├── MasurcaPaths.pm.in
│ │ │ ├── MasurcaSuperReads.pm
│ │ │ ├── MurmurHash3.cpp
│ │ │ ├── MurmurHash3.h
│ │ │ ├── aligned_simple_array.hpp
│ │ │ ├── assign_reads.cpp
│ │ │ ├── bloom_counter2.hpp
│ │ │ ├── bloom_filter.hpp
│ │ │ ├── bloom_hash.hpp
│ │ │ ├── bloom_query.cc
│ │ │ ├── bloom_query_cmdline.hpp
│ │ │ ├── createSuperReads_RNA
│ │ │ ├── create_k_unitigs_common.hpp
│ │ │ ├── create_k_unitigs_large_k.cc
│ │ │ ├── create_k_unitigs_large_k2.cc
│ │ │ ├── create_k_unitigs_large_k2_cmdline.hpp
│ │ │ ├── create_k_unitigs_large_k_cmdline.hpp
│ │ │ ├── diskBasedUnitigger.h
│ │ │ ├── expand_fastq
│ │ │ ├── extract_unjoined_pairs.pl
│ │ │ ├── extractreads.pl
│ │ │ ├── extractreads_not.pl
│ │ │ ├── fibonacci_coding.cc
│ │ │ ├── fibonacci_coding.hpp
│ │ │ ├── gcc_builtins.cc
│ │ │ ├── getNumBasesPerReadInFastaFile.perl
│ │ │ ├── homo_trim.cc
│ │ │ ├── mergeSuperReadsUniquely.pl
│ │ │ ├── read_parser.cc
│ │ │ ├── read_parser.hpp
│ │ │ ├── reduce_sr.cc
│ │ │ ├── reduce_sr_cmdline.hpp
│ │ │ ├── rename_filter_fastq.cc
│ │ │ ├── rename_filter_fastq_cmdline.hpp
│ │ │ ├── reverse_complement.cc
│ │ │ ├── semaphore.cc
│ │ │ ├── semaphore_cmdline.hpp
│ │ │ ├── sorted_merge.cc
│ │ │ ├── sorted_merge_cmdline.hpp
│ │ │ ├── sr_names.hpp
│ │ │ ├── superread_index.cpp
│ │ │ └── superread_index.hpp
│ │ ├── src2
│ │ │ ├── add_missing_mates.pl
│ │ │ ├── createFastaSuperReadSequences.cc
│ │ │ ├── createKUnitigMaxOverlaps.cc
│ │ │ ├── createSuperReadsForDirectory.perl
│ │ │ ├── create_sr_frg.cc
│ │ │ ├── eliminateBadSuperReadsUsingList.cc
│ │ │ ├── findMatchesBetweenKUnitigsAndReads.cc
│ │ │ ├── findMatchesBetweenKUnitigsAndReads_cmdline.hpp
│ │ │ ├── getLengthStatisticsForKUnitigsFile.perl
│ │ │ ├── getSuperReadInsertCountsFromReadPlacementFile.cc
│ │ │ ├── getSuperReadInsertCountsFromReadPlacementFileTwoPasses.cc
│ │ │ ├── getSuperReadInsertCountsFromReadPlacementFileTwoPasses_cmdline.hpp
│ │ │ ├── getSuperReadInsertCountsFromReadPlacementFile_cmdline.hpp
│ │ │ ├── joinKUnitigs_v3.cc
│ │ │ ├── joinKUnitigs_v3_cmdline.hpp
│ │ │ ├── outputAlekseysJellyfishReductionFile.perl
│ │ │ ├── outputRecordsNotOnList.cc
│ │ │ ├── splitFileAtNs.cc
│ │ │ └── translateReduceFile.perl
│ │ └── unittests
│ │ │ ├── gtest
│ │ │ ├── include
│ │ │ │ └── gtest
│ │ │ │ │ ├── gtest-death-test.h
│ │ │ │ │ ├── gtest-message.h
│ │ │ │ │ ├── gtest-param-test.h
│ │ │ │ │ ├── gtest-printers.h
│ │ │ │ │ ├── gtest-spi.h
│ │ │ │ │ ├── gtest-test-part.h
│ │ │ │ │ ├── gtest-typed-test.h
│ │ │ │ │ ├── gtest.h
│ │ │ │ │ ├── gtest_pred_impl.h
│ │ │ │ │ ├── gtest_prod.h
│ │ │ │ │ └── internal
│ │ │ │ │ ├── gtest-death-test-internal.h
│ │ │ │ │ ├── gtest-filepath.h
│ │ │ │ │ ├── gtest-internal.h
│ │ │ │ │ ├── gtest-linked_ptr.h
│ │ │ │ │ ├── gtest-param-util-generated.h
│ │ │ │ │ ├── gtest-param-util.h
│ │ │ │ │ ├── gtest-port.h
│ │ │ │ │ ├── gtest-string.h
│ │ │ │ │ ├── gtest-tuple.h
│ │ │ │ │ └── gtest-type-util.h
│ │ │ └── src
│ │ │ │ ├── gtest-all.cc
│ │ │ │ ├── gtest-death-test.cc
│ │ │ │ ├── gtest-filepath.cc
│ │ │ │ ├── gtest-internal-inl.h
│ │ │ │ ├── gtest-port.cc
│ │ │ │ ├── gtest-printers.cc
│ │ │ │ ├── gtest-test-part.cc
│ │ │ │ ├── gtest-typed-test.cc
│ │ │ │ ├── gtest.cc
│ │ │ │ └── gtest_main.cc
│ │ │ ├── misc.cc
│ │ │ ├── misc.hpp
│ │ │ ├── test_bloom_counter2.cc
│ │ │ ├── test_bloom_filter.cc
│ │ │ ├── test_charb.cc
│ │ │ ├── test_charbuf.cc
│ │ │ ├── test_exp_buffer.cc
│ │ │ ├── test_exp_vector.cc
│ │ │ ├── test_fork_exec.cc
│ │ │ ├── test_hash.cc
│ │ │ ├── test_heap.cc
│ │ │ ├── test_main.cc
│ │ │ ├── test_main_cmdline.hpp
│ │ │ ├── test_multi_thread_skip_list_map.cc
│ │ │ ├── test_multi_thread_skip_list_set.cc
│ │ │ ├── test_rbtree.cc
│ │ │ ├── test_read_parser.cc
│ │ │ ├── test_skip_list_map.cc
│ │ │ ├── test_skip_list_set.cc
│ │ │ ├── test_sr_names.cc
│ │ │ └── test_thread_pool.cc
│ ├── aclocal.m4
│ ├── compile
│ ├── config.guess
│ ├── config.h.in
│ ├── config.log
│ ├── config.sub
│ ├── configure
│ ├── configure.ac
│ ├── depcomp
│ ├── install-sh
│ ├── jellyfish
│ │ ├── LICENSE
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── README
│ │ ├── doc
│ │ │ ├── jellyfish.man
│ │ │ └── jellyfish.pdf
│ │ ├── gtest.mk
│ │ ├── include
│ │ │ └── jellyfish
│ │ │ │ ├── allocators_mmap.hpp
│ │ │ │ ├── atomic_bits_array.hpp
│ │ │ │ ├── atomic_field.hpp
│ │ │ │ ├── atomic_gcc.hpp
│ │ │ │ ├── backtrace.hpp
│ │ │ │ ├── binary_dumper.hpp
│ │ │ │ ├── bloom_common.hpp
│ │ │ │ ├── bloom_counter2.hpp
│ │ │ │ ├── bloom_filter.hpp
│ │ │ │ ├── circular_buffer.hpp
│ │ │ │ ├── compare_and_swap.hpp
│ │ │ │ ├── cooperative_pool.hpp
│ │ │ │ ├── cooperative_pool2.hpp
│ │ │ │ ├── cpp_array.hpp
│ │ │ │ ├── divisor.hpp
│ │ │ │ ├── dumper.hpp
│ │ │ │ ├── err.hpp
│ │ │ │ ├── file_header.hpp
│ │ │ │ ├── generator_manager.hpp
│ │ │ │ ├── generic_file_header.hpp
│ │ │ │ ├── hash_counter.hpp
│ │ │ │ ├── int128.hpp
│ │ │ │ ├── jellyfish.hpp
│ │ │ │ ├── json.h
│ │ │ │ ├── large_hash_array.hpp
│ │ │ │ ├── large_hash_iterator.hpp
│ │ │ │ ├── locks_pthread.hpp
│ │ │ │ ├── mapped_file.hpp
│ │ │ │ ├── mer_dna.hpp
│ │ │ │ ├── mer_dna_bloom_counter.hpp
│ │ │ │ ├── mer_heap.hpp
│ │ │ │ ├── mer_iterator.hpp
│ │ │ │ ├── mer_overlap_sequence_parser.hpp
│ │ │ │ ├── mer_qual_iterator.hpp
│ │ │ │ ├── misc.hpp
│ │ │ │ ├── offsets_key_value.hpp
│ │ │ │ ├── rectangular_binary_matrix.hpp
│ │ │ │ ├── simple_circular_buffer.hpp
│ │ │ │ ├── sorted_dumper.hpp
│ │ │ │ ├── stdio_filebuf.hpp
│ │ │ │ ├── storage.hpp
│ │ │ │ ├── stream_iterator.hpp
│ │ │ │ ├── stream_manager.hpp
│ │ │ │ ├── text_dumper.hpp
│ │ │ │ ├── thread_exec.hpp
│ │ │ │ ├── time.hpp
│ │ │ │ ├── token_ring.hpp
│ │ │ │ └── whole_sequence_parser.hpp
│ │ ├── jellyfish-2.0.pc.in
│ │ ├── jellyfish
│ │ │ ├── backtrace.cc
│ │ │ ├── dbg.cc
│ │ │ ├── dbg.hpp
│ │ │ ├── fstream_default.hpp
│ │ │ ├── generate_sequence.cc
│ │ │ ├── generate_sequence_cmdline.hpp
│ │ │ ├── merge_files.cc
│ │ │ ├── merge_files.hpp
│ │ │ ├── mersenne.cpp
│ │ │ └── randomc.h
│ │ ├── lib
│ │ │ ├── allocators_mmap.cc
│ │ │ ├── generator_manager.cc
│ │ │ ├── int128.cc
│ │ │ ├── jsoncpp.cpp
│ │ │ ├── mer_dna.cc
│ │ │ ├── misc.cc
│ │ │ ├── rectangular_binary_matrix.cc
│ │ │ ├── storage.cc
│ │ │ ├── thread_exec.cc
│ │ │ └── time.cc
│ │ ├── sub_commands
│ │ │ ├── bc_main.cc
│ │ │ ├── bc_main_cmdline.hpp
│ │ │ ├── cite_main.cc
│ │ │ ├── cite_main_cmdline.hpp
│ │ │ ├── count_main.cc
│ │ │ ├── count_main_cmdline.hpp
│ │ │ ├── dump_main.cc
│ │ │ ├── dump_main_cmdline.hpp
│ │ │ ├── histo_main.cc
│ │ │ ├── histo_main_cmdline.hpp
│ │ │ ├── info_main.cc
│ │ │ ├── info_main_cmdline.hpp
│ │ │ ├── jellyfish.cc
│ │ │ ├── mem_main.cc
│ │ │ ├── mem_main_cmdline.hpp
│ │ │ ├── merge_main.cc
│ │ │ ├── merge_main_cmdline.hpp
│ │ │ ├── query_main.cc
│ │ │ ├── query_main_cmdline.hpp
│ │ │ ├── stats_main.cc
│ │ │ └── stats_main_cmdline.hpp
│ │ ├── swig
│ │ │ ├── Makefile.am
│ │ │ ├── hash_counter.i
│ │ │ ├── hash_set.i
│ │ │ ├── jellyfish.i
│ │ │ ├── mer_dna.i
│ │ │ ├── mer_file.i
│ │ │ ├── perl5
│ │ │ │ ├── jellyfish.pm
│ │ │ │ ├── swig_wrap.cpp
│ │ │ │ └── t
│ │ │ │ │ ├── test_hash_counter.t
│ │ │ │ │ ├── test_mer_file.t
│ │ │ │ │ └── test_string_mers.t
│ │ │ ├── python
│ │ │ │ ├── swig_wrap.cpp
│ │ │ │ ├── test_hash_counter.py
│ │ │ │ ├── test_mer_file.py
│ │ │ │ └── test_string_mers.py
│ │ │ ├── ruby
│ │ │ │ ├── swig_wrap.cpp
│ │ │ │ ├── test_hash_counter.rb
│ │ │ │ ├── test_mer_file.rb
│ │ │ │ └── test_string_mers.rb
│ │ │ └── string_mers.i
│ │ ├── tests
│ │ │ ├── big.sh
│ │ │ ├── bloom_counter.sh
│ │ │ ├── bloom_filter.sh
│ │ │ ├── generate_sequence.sh
│ │ │ ├── large_key.sh
│ │ │ ├── merge.sh
│ │ │ ├── multi_file.sh
│ │ │ ├── parallel_hashing.sh
│ │ │ ├── subset_hashing.sh
│ │ │ ├── swig_perl.sh
│ │ │ ├── swig_python.sh
│ │ │ └── swig_ruby.sh
│ │ └── unit_tests
│ │ │ ├── gtest
│ │ │ ├── gtest.h
│ │ │ └── src
│ │ │ │ ├── gtest-all.cc
│ │ │ │ └── gtest_main.cc
│ │ │ ├── test_allocators_mmap.cc
│ │ │ ├── test_atomic_bits_array.cc
│ │ │ ├── test_cooperative_pool2.cc
│ │ │ ├── test_dumpers.cc
│ │ │ ├── test_file_header.cc
│ │ │ ├── test_generator_manager.cc
│ │ │ ├── test_hash_counter.cc
│ │ │ ├── test_int128.cc
│ │ │ ├── test_large_hash_array.cc
│ │ │ ├── test_main.cc
│ │ │ ├── test_main.hpp
│ │ │ ├── test_main_cmdline.hpp
│ │ │ ├── test_mapped_file.cc
│ │ │ ├── test_mer_dna.cc
│ │ │ ├── test_mer_dna_bloom_counter.cc
│ │ │ ├── test_mer_heap.cc
│ │ │ ├── test_mer_iterator.cc
│ │ │ ├── test_mer_overlap_sequence_parser.cc
│ │ │ ├── test_misc.cc
│ │ │ ├── test_offsets_key_value.cc
│ │ │ ├── test_rectangular_binary_matrix.cc
│ │ │ ├── test_simple_circular_buffer.cc
│ │ │ ├── test_stdio_filebuf.cc
│ │ │ ├── test_stream_iterator.cc
│ │ │ ├── test_text_dumper.cc
│ │ │ ├── test_token_ring.cc
│ │ │ ├── test_whole_sequence_parser.cc
│ │ │ └── unit_tests.sh
│ ├── ltmain.sh
│ ├── m4
│ │ ├── ax_openmp.m4
│ │ ├── libtool.m4
│ │ ├── ltoptions.m4
│ │ ├── ltsugar.m4
│ │ ├── ltversion.m4
│ │ ├── lt~obsolete.m4
│ │ ├── m4-ax_perl_ext.m4
│ │ ├── m4-ax_pkg_swig.m4
│ │ └── m4-ax_swig_enable_cxx.m4
│ ├── missing
│ ├── quorum
│ │ ├── AUTHORS
│ │ ├── COPYING
│ │ ├── ChangeLog
│ │ ├── INSTALL
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── NEWS
│ │ ├── README
│ │ ├── data
│ │ │ └── adapter.jf
│ │ ├── gtest.mk
│ │ ├── include
│ │ │ ├── gzip_stream.hpp
│ │ │ ├── jflib
│ │ │ │ ├── locks_pthread.hpp
│ │ │ │ ├── multiplexed_io.hpp
│ │ │ │ └── pool.hpp
│ │ │ └── misc.hpp
│ │ ├── src
│ │ │ ├── create_database.cc
│ │ │ ├── create_database_cmdline.hpp
│ │ │ ├── err_log.cc
│ │ │ ├── err_log.hpp
│ │ │ ├── error_correct_reads.cc
│ │ │ ├── error_correct_reads.hpp
│ │ │ ├── error_correct_reads_cmdline.hpp
│ │ │ ├── histo_mer_database.cc
│ │ │ ├── kmer.hpp
│ │ │ ├── mer_database.hpp
│ │ │ ├── merge_mate_pairs.cc
│ │ │ ├── merge_mate_pairs_cmdline.hpp
│ │ │ ├── query_mer_database.cc
│ │ │ ├── quorum.in
│ │ │ ├── split_mate_pairs.cc
│ │ │ ├── split_mate_pairs_cmdline.hpp
│ │ │ └── verbose_log.hpp
│ │ └── unit_tests
│ │ │ ├── gtest
│ │ │ ├── gtest.h
│ │ │ └── src
│ │ │ │ ├── gtest-all.cc
│ │ │ │ └── gtest_main.cc
│ │ │ ├── test_mer_database.cc
│ │ │ └── test_misc.hpp
│ ├── test-driver
│ └── ufasta
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── common.hpp
│ │ ├── dgrep.cc
│ │ ├── dgrep_cmdline.hpp
│ │ ├── dsort.cc
│ │ ├── dsort_cmdline.hpp
│ │ ├── extract.cc
│ │ ├── extract_cmdline.hpp
│ │ ├── format.cc
│ │ ├── format_cmdline.hpp
│ │ ├── head.cc
│ │ ├── head_cmdline.hpp
│ │ ├── hgrep.cc
│ │ ├── hgrep_cmdline.hpp
│ │ ├── n50.cc
│ │ ├── n50_cmdline.hpp
│ │ ├── one.cc
│ │ ├── one_cmdline.hpp
│ │ ├── rc.cc
│ │ ├── rc_cmdline.hpp
│ │ ├── sizes.cc
│ │ ├── sizes_cmdline.hpp
│ │ ├── sort.cc
│ │ ├── sort_cmdline.hpp
│ │ ├── split.cc
│ │ ├── split_cmdline.hpp
│ │ ├── tail.cc
│ │ ├── tail_cmdline.hpp
│ │ ├── tests
│ │ ├── test1.fasta
│ │ ├── test_dgrep.sh
│ │ ├── test_dsort.sh
│ │ ├── test_extract.sh
│ │ ├── test_format.sh
│ │ ├── test_head.sh
│ │ ├── test_hgrep.sh
│ │ ├── test_n50.sh
│ │ ├── test_one.sh
│ │ ├── test_rc.sh
│ │ ├── test_sizes.sh
│ │ ├── test_sort.sh
│ │ ├── test_split.sh
│ │ ├── test_tail.sh
│ │ └── testsh.in
│ │ └── ufasta.cc
└── install.sh
├── gclib
├── GArgs.cpp
├── GArgs.h
├── GBam.cpp
├── GBam.h
├── GBase.cpp
├── GBase.h
├── GBitVec.h
├── GFaSeqGet.cpp
├── GFaSeqGet.h
├── GFastaIndex.cpp
├── GFastaIndex.h
├── GHash.hh
├── GIntHash.hh
├── GList.hh
├── GStr.cpp
├── GStr.h
├── GThreads.cpp
├── GThreads.h
├── GVec.hh
├── codons.cpp
├── codons.h
├── gdna.cpp
├── gdna.h
├── gff.cpp
├── gff.h
├── proc_mem.cpp
└── proc_mem.h
├── prepDE.py
├── prep_linux.sh
├── prep_mac.sh
├── prep_source.sh
├── rlink.cpp
├── rlink.h
├── samtools-0.1.18
├── AUTHORS
├── COPYING
├── ChangeLog
├── INSTALL
├── Makefile
├── NEWS
├── bam.c
├── bam.h
├── bam2bcf.c
├── bam2bcf.h
├── bam2bcf_indel.c
├── bam2depth.c
├── bam_aux.c
├── bam_cat.c
├── bam_color.c
├── bam_endian.h
├── bam_import.c
├── bam_index.c
├── bam_lpileup.c
├── bam_mate.c
├── bam_md.c
├── bam_pileup.c
├── bam_plcmd.c
├── bam_reheader.c
├── bam_rmdup.c
├── bam_rmdupse.c
├── bam_sort.c
├── bam_stat.c
├── bam_tview.c
├── bamtk.c
├── bedidx.c
├── bgzf.c
├── bgzf.h
├── bgzip.c
├── cut_target.c
├── errmod.c
├── errmod.h
├── faidx.c
├── faidx.h
├── kaln.c
├── kaln.h
├── khash.h
├── klist.h
├── knetfile.c
├── knetfile.h
├── kprobaln.c
├── kprobaln.h
├── kseq.h
├── ksort.h
├── kstring.c
├── kstring.h
├── phase.c
├── razf.c
├── razf.h
├── razip.c
├── sam.c
├── sam.h
├── sam_header.c
├── sam_header.h
├── sam_view.c
├── sample.c
├── sample.h
└── samtools.1
├── stringtie.cpp
├── tablemaker.cpp
├── tablemaker.h
├── tag_git.sh
├── tmerge.cpp
└── tmerge.h
/SuperReads_RNA/dist-bin/gmake:
--------------------------------------------------------------------------------
1 | /usr/bin/make
--------------------------------------------------------------------------------
/SuperReads_RNA/dist-bin/pkg-config:
--------------------------------------------------------------------------------
1 | /home/skovaka/SuperReads_RNA-1.0.1/PkgConfig.pm
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/Makefile.am:
--------------------------------------------------------------------------------
1 | SUBDIRS = jellyfish ufasta quorum SuperReadsR
2 | ACLOCAL_AMFLAGS = -I m4
3 |
4 | EXTRA_DIST = LICENSE.txt
5 |
6 | install-special:
7 | @echo $(SUBDIRS) | tr ' ' '\n' | grep -v '^CA' | while read subdir; do \
8 | echo "Making install in $$subdir pwd `pwd`"; \
9 | $(MAKE) $(AM_MAKEFLAGS) -C $$subdir install; \
10 | done
11 | @echo $(SUBDIRS) | tr ' ' '\n' | grep '^CA' | while read subdir; do \
12 | echo "Making install in $$subdir"; \
13 | $(MAKE) $(AM_MAKEFLAGS) -C $$subdir install bindir=$(dir $(bindir))/$$subdir/$(LOCAL_NAME)/bin; \
14 | done
15 |
16 | # Print the value of a variable
17 | print-%:
18 | @echo -n $($*)
19 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/AUTHORS:
--------------------------------------------------------------------------------
1 | Mike Roberts
2 | Aleksey Zimin
3 | Guillaume Marcais
4 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/ChangeLog:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skovaka/stringtie2/647ab5124e18e99164b45a7fa325240ec7a1b56d/SuperReads_RNA/global-1/SuperReadsR/ChangeLog
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/NEWS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skovaka/stringtie2/647ab5124e18e99164b45a7fa325240ec7a1b56d/SuperReads_RNA/global-1/SuperReadsR/NEWS
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/README:
--------------------------------------------------------------------------------
1 | Installation
2 | ============
3 |
4 | % ./configure
5 | % make
6 | % sudo make install
7 |
8 | See INSTALLATION for more details.
9 |
10 | LEGALESE
11 | ========
12 |
13 | * GNU parallel is licensed under the GPL version 3 license.
14 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/all_tests:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skovaka/stringtie2/647ab5124e18e99164b45a7fa325240ec7a1b56d/SuperReads_RNA/global-1/SuperReadsR/all_tests
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/gtest.mk:
--------------------------------------------------------------------------------
1 | ##############################
2 | # Gtest build.
3 | ##############################
4 | # Build rules for libraries.
5 | # check_LTLIBRARIES = libgtest.la libgtest_main.la
6 |
7 | # libgtest_la_SOURCES = unittests/gtest/src/gtest-all.cc
8 | # libgtest_main_la_SOURCES = unittests/gtest/src/gtest_main.cc
9 | # libgtest_main_la_LIBADD = libgtest.la
10 | # libgtest_la_CXXFLAGS = -I$(srcdir)/unittests/gtest \
11 | # -I$(srcdir)/unittests/gtest/include
12 | # libgtest_main_la_CXXFLAGS = -I$(srcdir)/unittests/gtest \
13 | # -I$(srcdir)/unittests/gtest/include
14 |
15 | check_LIBRARIES = libgtest.a libgtest_main.a
16 |
17 | libgtest_a_SOURCES = unittests/gtest/src/gtest-all.cc
18 | libgtest_main_a_SOURCES = unittests/gtest/src/gtest_main.cc
19 | libgtest_main_a_LIBADD = libgtest.a
20 | libgtest_a_CXXFLAGS = -I$(srcdir)/unittests/gtest \
21 | -I$(srcdir)/unittests/gtest/include
22 | libgtest_main_a_CXXFLAGS = -I$(srcdir)/unittests/gtest \
23 | -I$(srcdir)/unittests/gtest/include
24 |
25 | # gtest source files that we don't compile directly. They are
26 | # #included by gtest-all.cc.
27 | GTEST_SRC = unittests/gtest/src/gtest-death-test.cc \
28 | unittests/gtest/src/gtest-filepath.cc \
29 | unittests/gtest/src/gtest-internal-inl.h \
30 | unittests/gtest/src/gtest-port.cc \
31 | unittests/gtest/src/gtest-printers.cc \
32 | unittests/gtest/src/gtest-test-part.cc \
33 | unittests/gtest/src/gtest-typed-test.cc \
34 | unittests/gtest/src/gtest.cc
35 |
36 | EXTRA_DIST += $(GTEST_SRC)
37 |
38 | # Headers, not installed
39 | GTEST_I = unittests/gtest/include/gtest
40 | noinst_HEADERS += $(GTEST_I)/gtest-death-test.h \
41 | $(GTEST_I)/gtest-message.h \
42 | $(GTEST_I)/gtest-param-test.h \
43 | $(GTEST_I)/gtest-printers.h $(GTEST_I)/gtest-spi.h \
44 | $(GTEST_I)/gtest-test-part.h \
45 | $(GTEST_I)/gtest-typed-test.h $(GTEST_I)/gtest.h \
46 | $(GTEST_I)/gtest_pred_impl.h $(GTEST_I)/gtest_prod.h \
47 | $(GTEST_I)/internal/gtest-death-test-internal.h \
48 | $(GTEST_I)/internal/gtest-filepath.h \
49 | $(GTEST_I)/internal/gtest-internal.h \
50 | $(GTEST_I)/internal/gtest-linked_ptr.h \
51 | $(GTEST_I)/internal/gtest-param-util-generated.h \
52 | $(GTEST_I)/internal/gtest-param-util.h \
53 | $(GTEST_I)/internal/gtest-port.h \
54 | $(GTEST_I)/internal/gtest-string.h \
55 | $(GTEST_I)/internal/gtest-tuple.h \
56 | $(GTEST_I)/internal/gtest-type-util.h
57 |
58 |
59 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/include/fork_exec.hpp:
--------------------------------------------------------------------------------
1 | /** @file fork_exec.hpp
2 | * Defines a family of functions: fork_exec*. They behave like
3 | * calling fork followed by exec. The return value and errno reflect
4 | * the success of both the fork and exec system call (even though
5 | * technically the exec system call was performed by a child
6 | * process). In other word, if fork_exec* returns a valid PID
7 | * (i.e. not -1), then it is guaranteed that the child process is
8 | * executing. The status returned by `wait` or `waitpid` is whatever
9 | * is returned by the program executed.
10 | */
11 |
12 | /**
13 | * Fork and exec, like execvp. Return the pid of the child process in
14 | * case of success or -1 in case of failure (of either fork, execvp or
15 | * some other syscall: close, pipe). Errno is set properly. See the
16 | * man page for `exec`.
17 | *
18 | * @param file Path to executable.
19 | * @param argv Null terminated array of arguments (C strings)
20 | * @return -1 on error. Pid of child process on success.
21 | */
22 | pid_t fork_execvp(const char* file, char *const argv[]);
23 |
24 | /**
25 | * Fork and exec, like execlp.
26 | *
27 | * @param file Path to executable
28 | * @param arg 0th argument (executable name), followed by a 0 terminated list of arguments.
29 | * @return -1 on error. Pid of child process on success.
30 | * @see fork_execvp.
31 | */
32 | pid_t fork_execlp(const char* file, const char* arg, ...);
33 |
34 | /**
35 | * Split command on white spaces, then fork and exec. Warning: this
36 | * command modifies its input argument.
37 | *
38 | * @param cmd Command to execute.
39 | * @return -1 on error. Pid of child process on success.
40 | * @see fork_execvp
41 | */
42 | pid_t fork_exec(char* cmd);
43 |
44 | /**
45 | * Split command on white spaces, then fork and exec. @see fork_execvp.
46 | */
47 | pid_t fork_exec(const char* cmd);
48 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/include/gcc_builtins.hpp:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #ifndef __GCC_BUILTINS_HPP__
20 | #define __GCC_BUILTINS_HPP__
21 |
22 | #ifdef HAVE_CONFIG_H
23 | #include
24 | #endif
25 |
26 | // TODO: check in configure the existence of hardware version
27 | template
28 | int ctz(T x);
29 |
30 | template<>
31 | int ctz(unsigned int x);
32 | template<>
33 | int ctz(unsigned long x);
34 | template<>
35 | int ctz(unsigned long long x);
36 |
37 | #ifdef HAVE_BUILTIN_PREFETCH
38 | inline void prefetch_read_no(const void* addr) { __builtin_prefetch(addr, 0, 0); }
39 | inline void prefetch_read_low(const void* addr) { __builtin_prefetch(addr, 0, 1); }
40 | inline void prefetch_read_med(const void* addr) { __builtin_prefetch(addr, 0, 2); }
41 | inline void prefetch_read_high(const void* addr) { __builtin_prefetch(addr, 0, 3); }
42 | inline void prefetch_write_no(const void* addr) { __builtin_prefetch(addr, 1, 0); }
43 | inline void prefetch_write_low(const void* addr) { __builtin_prefetch(addr, 1, 1); }
44 | inline void prefetch_write_med(const void* addr) { __builtin_prefetch(addr, 1, 2); }
45 | inline void prefetch_write_high(const void* addr) { __builtin_prefetch(addr, 1, 3); }
46 | #else // HAVE_BUILTIN_PREFETCH
47 | inline void prefetch_read_no(const void* addr) { }
48 | inline void prefetch_read_low(const void* addr) { }
49 | inline void prefetch_read_med(const void* addr) { }
50 | inline void prefetch_read_high(const void* addr) { }
51 | inline void prefetch_write_no(const void* addr) { }
52 | inline void prefetch_write_low(const void* addr) { }
53 | inline void prefetch_write_med(const void* addr) { }
54 | inline void prefetch_write_high(const void* addr) { }
55 | #endif // HAVE_BUILTIN_PREFETCH
56 |
57 |
58 | #endif /* __GCC_BUILTINS_HPP__ */
59 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/include/gzip_stream.hpp:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #ifndef __GZIP_STREAM__
20 | #define __GZIP_STREAM__
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | template >
28 | class basic_gzipstream : public std::ostream {
29 | typedef __gnu_cxx::stdio_filebuf<_CharT> stdbuf;
30 | public:
31 | basic_gzipstream(const char *filename) : std::ostream(open_gzip(filename)), closed(false) { }
32 | virtual ~basic_gzipstream() {
33 | close();
34 | delete rdbuf();
35 | }
36 | void close() {
37 | if(!closed) {
38 | flush();
39 | pclose(((stdbuf*)rdbuf())->file());
40 | closed = true;
41 | }
42 | }
43 |
44 | private:
45 | static stdbuf *open_gzip(const char *filename) {
46 | std::string command("gzip -1 > '");
47 | command += filename;
48 | command += "'";
49 | FILE *f = popen(command.c_str(), "w");
50 | if(!f)
51 | throw std::runtime_error("popen failed");
52 | return new stdbuf(f, std::ios::out);
53 | }
54 | bool closed;
55 | };
56 |
57 | typedef basic_gzipstream gzipstream;
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/include/timer.h:
--------------------------------------------------------------------------------
1 | #ifndef TIMER_H
2 | #define TIMER_H
3 |
4 | #include
5 |
6 |
7 | class Timer {
8 | private:
9 | clock_t start;
10 |
11 | public:
12 | inline Timer() {
13 | start = clock();
14 | }
15 |
16 | inline int reset() {
17 | start = clock();
18 | }
19 |
20 | inline float get() {
21 | return float( (long double)(clock() - start) /
22 | (long double)CLOCKS_PER_SEC );
23 | }
24 |
25 | inline float lap() {
26 | float ret = get();
27 | reset();
28 | return ret;
29 | }
30 | };
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/include/tmpstream.hpp:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #ifndef __TMP_FILE_H_
20 | #define __TMP_FILE_H_
21 |
22 | #include
23 | #include
24 | #include
25 |
26 | /** Temporary file stream. Wrapper around FILE* tmpfile(). It seems
27 | * that stdio_filebuf creates a memory leak by not closing fclose on
28 | * the file descriptor. Oh well!
29 | */
30 |
31 | template >
32 | class basic_tmpstream : public std::iostream {
33 | typedef __gnu_cxx::stdio_filebuf<_CharT> stdbuf;
34 | public:
35 | basic_tmpstream() : std::iostream(open_tmp()) { }
36 | virtual ~basic_tmpstream() { close(); delete rdbuf(); }
37 | bool is_open() { return ((stdbuf*)rdbuf())->is_open(); }
38 | void close() {
39 | if(is_open()) {
40 | stdbuf* buf = (stdbuf*)rdbuf();
41 | ::fclose(buf->file());
42 | buf->close();
43 | }
44 | }
45 | private:
46 | static stdbuf * open_tmp() {
47 | FILE *f = tmpfile();
48 | if(!f)
49 | throw std::runtime_error("Failed to create a temporary file.");
50 | return new stdbuf(f, std::ios::in|std::ios::out);
51 | }
52 | };
53 | typedef basic_tmpstream tmpstream;
54 |
55 |
56 | #endif /* __TMP_FILE_H_ */
57 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/MasurcaPaths.pm.in:
--------------------------------------------------------------------------------
1 | package MasurcaPaths;
2 |
3 | use strict;
4 | use warnings;
5 | use File::Spec;
6 |
7 | our (@ISA, @EXPORT, @EXPORT_OK);
8 |
9 | BEGIN {
10 | require Exporter;
11 | @ISA = qw(Exporter);
12 | @EXPORT_OK = qw($BINDIR $LIBDIR $PERL_EXT_LIB);
13 | }
14 |
15 | our ($BINDIR, $LIBDIR, $PERL_EXT_LIB);
16 | $BINDIR = "@bindir@";
17 | $LIBDIR = "@libdir@";
18 | $PERL_EXT_LIB = "@PERL_EXT_DIR@";
19 |
20 | sub rel_ext_bin {
21 | return File::Spec->abs2rel($PERL_EXT_LIB, $BINDIR);
22 | }
23 |
24 | 1;
25 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/bloom_hash.hpp:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #ifndef __BLOOM_HASH_HPP__
20 | #define __BLOOM_HASH_HPP__
21 |
22 | #include
23 |
24 | /* Hash pairs
25 | */
26 | template
27 | class hash_pair { };
28 |
29 | template <>
30 | class hash_pair {
31 | public:
32 | void operator()(const char* const key, uint64_t *hashes) const {
33 | MurmurHash3_x64_128(key, strlen(key), 0, hashes);
34 | }
35 | };
36 |
37 | #endif // __BLOOM_HASH_HPP__
38 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/bloom_query.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | #include
5 | #include
6 |
7 | bloom_query_cmdline args;
8 |
9 | struct mer_dna_hash {
10 | void operator()(const jellyfish::mer_dna& m, uint64_t *hashes) const {
11 | MurmurHash3_T_128(m, (m.k() / 4) + (m.k() % 4 != 0), 0, hashes);
12 | }
13 | };
14 | typedef bloom_counter2 mer_bloom_counter2;
15 |
16 | int main(int argc, char *argv[])
17 | {
18 | args.parse(argc, argv);
19 |
20 | jellyfish::mer_dna::k(args.mer_arg);
21 |
22 | jellyfish::mapped_file dbf(args.input_arg);
23 | uint64_t* base = (uint64_t*)dbf.base();
24 | mer_bloom_counter2 mers(base[0], base[1], (unsigned char*)(base + 2));
25 |
26 | std::string word;
27 | jellyfish::mer_dna m;
28 | jellyfish::mer_dna mq;
29 | while(true) {
30 | std::cin >> word;
31 | if(!std::cin)
32 | break;
33 | m = word;
34 | mq = m;
35 | mq.reverse_complement();
36 | std::cout << word << " " << mers[m < mq ? m : mq] << "\n";
37 | }
38 |
39 | return 0;
40 | }
41 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/expand_fastq:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | FILE="$1"
4 |
5 | check_fastq () {
6 | [ $1 = "@" ] || {
7 | echo >&2 "File '$FILE' is not a fastq file"
8 | exit 1
9 | }
10 | }
11 |
12 | case $(file -L -b -i "$FILE") in
13 | (application/*gzip*)
14 | FIRST=$(gunzip -c "$FILE" | head -c 1)
15 | check_fastq $FIRST
16 | exec gunzip -c "$FILE"
17 | ;;
18 |
19 | (application/*bzip2*)
20 | FIRST=$(bunzip2 -c "$FILE" | head -c 1)
21 | check_fastq $FIRST
22 | exec bunzip2 -c "$FILE"
23 | ;;
24 |
25 | (application/x-xz*)
26 | FIRST=$(unxz -c "$FILE" | head -c 1)
27 | check_fastq $FIRST
28 | exec unxz -c "$FILE"
29 | ;;
30 |
31 | (text/*)
32 | FIRST=$(head -c 1 "$FILE")
33 | check_fastq $FIRST
34 | exec cat "$FILE"
35 | ;;
36 |
37 | (*)
38 | echo >&2 "WARNING!!! Unknown file type for input file '$FILE', assuming type text/"
39 | FIRST=$(head -c 1 "$FILE")
40 | check_fastq $FIRST
41 | exec cat "$FILE"
42 | ;;
43 | esac
44 |
45 |
46 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/extract_unjoined_pairs.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | # SuperRead pipeline
3 | # Copyright (C) 2012 Genome group at University of Maryland.
4 | #
5 | # This program is free software: you can redistribute it and/or
6 | # modify it under the terms of the GNU General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # This program is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | # 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 | my $flag=0;
19 |
20 | while($line=)
21 | {
22 | chomp($line);
23 | @F=split(/\s+/,$line);
24 | if($flag==0)
25 | {
26 | $sr_pair=$F[1];
27 | if(int(substr($F[0],2))%2==0)
28 | {
29 | $insert=$F[0];
30 | }
31 | else
32 | {
33 | $insert=substr($F[0],0,2).int(substr($F[0],2))-1;
34 | }
35 | $flag=1;
36 | }
37 | elsif($flag==1)
38 | {
39 | $srh{"$sr_pair $F[1]"}.="$insert ";
40 | $srh{"$F[1] $sr_pair"}.="$insert ";
41 | push(@pairs,"$sr_pair $F[1]");
42 | $flag=0;
43 | }
44 | }
45 |
46 | foreach $v (@pairs)
47 | {
48 | @f=split(/ /,$v);
49 | if(defined($srh{"$f[0] $f[1]"}) && defined($srh{"$f[1] $f[0]"}))
50 | {
51 | print "$v : ",$srh{"$f[0] $f[1]"},"\n";
52 | }
53 | }
54 |
55 |
56 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/extractreads.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | # SuperRead pipeline
3 | # Copyright (C) 2012 Genome group at University of Maryland.
4 | #
5 | # This program is free software: you can redistribute it and/or
6 | # modify it under the terms of the GNU General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # This program is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | # 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 | $infile1 = $ARGV[0]; #file with read names
19 | $infile2 = $ARGV[1]; #fasta file
20 | $fieldnum = $ARGV[2]-1; #field number
21 |
22 | open (FILE1, $infile1);
23 | open (FILE2, $infile2);
24 | my %readnames;
25 | while ($line = ){
26 | chomp($line);
27 | $readnames{$line}=1;
28 | }
29 | close(FILE1);
30 |
31 | my $sequence="";
32 | my $readname="";
33 | open (OUTFILE, ">$outfile");
34 | while ($line = ){
35 | if ($line =~ /^>/){
36 | if(defined $readnames{$readname}){
37 | print ">$readname\n$sequence\n";
38 | }
39 | chomp($line);
40 | @f=split(/\s+/,substr($line,1));
41 | $readname=$f[$fieldnum];
42 | $sequence="";
43 | }else{
44 | chomp($line);
45 | $sequence.=$line;
46 | }
47 | }
48 | if(defined $readnames{$readname})
49 | {
50 | print ">$readname\n$sequence\n";
51 | }
52 |
53 | close (FILE2);
54 |
55 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/extractreads_not.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | # SuperRead pipeline
3 | # Copyright (C) 2012 Genome group at University of Maryland.
4 | #
5 | # This program is free software: you can redistribute it and/or
6 | # modify it under the terms of the GNU General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # This program is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | # 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 | $infile1 = $ARGV[0]; #file with read names
19 | $infile2 = $ARGV[1]; #fasta file
20 | $fieldnum = $ARGV[2]-1; #field number
21 |
22 | open (FILE1, $infile1);
23 | open (FILE2, $infile2);
24 | my %readnames;
25 | while ($line = ){
26 | chomp($line);
27 | $readnames{$line}=1;
28 | }
29 | close(FILE1);
30 |
31 | my $sequence="";
32 | my $readname="";
33 | open (OUTFILE, ">$outfile");
34 | while ($line = ){
35 | if ($line =~ /^>/){
36 | if(not(defined $readnames{$readname}) && not($readname eq "")){
37 | print ">$readname\n$sequence\n";
38 | }
39 | chomp($line);
40 | @f=split(/\s+/,substr($line,1));
41 | $readname=$f[$fieldnum];
42 | $sequence="";
43 | }else{
44 | chomp($line);
45 | $sequence.=$line;
46 | }
47 | }
48 | if(not(defined $readnames{$readname}) && not($readname eq "")){
49 | print ">$readname\n$sequence\n";
50 | }
51 | close (FILE2);
52 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/fibonacci_coding.hpp:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #ifndef __FIBONACCI_CODING_HPP__
20 | #define __FIBONACCI_CODING_HPP__
21 |
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | struct fibonacci {
28 | static const uint64_t *fibs;
29 |
30 | template
31 | static int encode(T x, T &res) {
32 | const uint64_t * f = fibs + 8 * sizeof(T) - 1;
33 | x++;
34 | if(x <= (T)0 || x >= *f) {
35 | errno = EINVAL; // Number is negative or too large
36 | return -1;
37 | }
38 |
39 | f = std::upper_bound(fibs, f, x) - 1;
40 | int high_bit = f - fibs;
41 | res = (T)1 << high_bit;
42 | x -= *f;
43 | while(x > 0) {
44 | f = std::upper_bound(fibs, f, x) - 1;
45 | res |= (T)1 << (f - fibs);
46 | x -= *f;
47 | }
48 |
49 | return high_bit + 1;
50 | }
51 |
52 | template
53 | static T decode(T x) {
54 | T res = 0;
55 | for(const uint64_t *f = fibs; x; x >>= 1, ++f)
56 | if(x & 0x1)
57 | res += *f;
58 | return res - 1;
59 | }
60 | };
61 |
62 | #endif
63 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/gcc_builtins.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 |
21 | template<>
22 | int ctz(unsigned int x) { return __builtin_ctz(x); }
23 | template<>
24 | int ctz(unsigned long x) { return __builtin_ctzl(x); }
25 | template<>
26 | int ctz(unsigned long long x) { return __builtin_ctzll(x); }
27 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/getNumBasesPerReadInFastaFile.perl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | # Pass the name of a fasta file as an arg and this gives the number of
3 | # bases in each read of the fasta file
4 | # SuperRead pipeline
5 | # Copyright (C) 2012 Genome group at University of Maryland.
6 | #
7 | # This program is free software: you can redistribute it and/or
8 | # modify it under the terms of the GNU General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful, but
13 | # WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | # General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 |
20 | if ($#ARGV != 0) {
21 | open (FILE, $0);
22 | while ($line = ) {
23 | last unless ($line =~ /^\#/);
24 | print $line;
25 | }
26 | close (FILE);
27 | exit;
28 | }
29 | $file = $ARGV[0];
30 | $cmd = "zcat -f $file |";
31 | open (FILE, $cmd);
32 | $isFirstRead = 1;
33 | while ($line = ) {
34 | if ($line =~ /^>/) {
35 | if (! $isFirstRead) { print "$readLen\n"; }
36 | $readLen = 0;
37 | $isFirstRead = 0;
38 | }
39 | else {
40 | $len = length ($line)-1;
41 | $readLen += $len;
42 | }
43 | }
44 | if (! $isFirstRead) { print "$readLen\n"; }
45 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/homo_trim.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 | #include
21 | #include
22 | int main(int argc, char *argv[])
23 | {
24 | ssize_t i,sequence_len;
25 | charb my_string(100),sequence(100);
26 | ssize_t *index_array;
27 | ssize_t max_val=0,max_ind=0;
28 | double num_cg=0;
29 | char last_letter;
30 | index_array = (ssize_t*)malloc(sizeof(ssize_t)*1000000);
31 |
32 | if(argc==1)
33 | {
34 | printf("Need one agrument -- minimum peak height to trim!\n");
35 | return(1);
36 | }
37 |
38 | while(1)
39 | {
40 | if(!fgets(my_string,stdin)){
41 | break;
42 | }
43 | else
44 | {
45 | if(my_string[0]=='>')
46 | {
47 | max_val=0;
48 | max_ind=0;
49 | num_cg=0;
50 | if(!fgets(sequence, stdin))
51 | {
52 | return(1);
53 | }
54 | sequence_len=strlen(sequence);
55 | // printf("sequence_len=%d\n",sequence_len);
56 | last_letter=sequence[sequence_len-2];
57 | // printf("last_letter=%c\n",last_letter);
58 | for(i=sequence_len-3;i>=0;i--)
59 | {
60 | if(sequence[i] != last_letter)
61 | {
62 | num_cg--;
63 | last_letter=sequence[i];
64 | }
65 | else
66 | {
67 | num_cg++;
68 | }
69 | index_array[sequence_len-3-i]=num_cg;
70 | }
71 | for(i=0;imax_val)
74 | {
75 | max_val=index_array[i];
76 | max_ind=i+1;
77 | }
78 | }
79 | // printf("max_val=%d max_ind=%d\n",max_val,max_ind);
80 | if(max_val<(ssize_t)atoi(argv[1]))
81 | max_ind=0;
82 | sequence[sequence_len-max_ind-1]='\0';
83 | printf("%s%s\n",(char*)my_string,(char *)sequence);
84 | }
85 | }
86 | }
87 | return(0);
88 | }
89 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src/reverse_complement.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | int main(int argc, char *argv[])
25 | {
26 | ssize_t bytes_read,i,j;
27 | charb my_string(100000),rev_sequence(100000);
28 |
29 | while(1)
30 | {
31 | if(fgets (my_string, 1, stdin)==NULL)
32 | break;
33 | else
34 | {
35 | if(my_string[0]=='>')
36 | {
37 | printf("%s",(char*)my_string);
38 | }
39 | else
40 | {
41 | bytes_read=strlen(my_string);
42 | j=0;
43 | for(i=bytes_read-2;i>=0;i--)
44 | {
45 | switch (my_string[i])
46 | {
47 | case 'A': rev_sequence[j]='T';break;
48 | case 'C': rev_sequence[j]='G';break;
49 | case 'G': rev_sequence[j]='C';break;
50 | case 'T': rev_sequence[j]='A';break;
51 | case 'a': rev_sequence[j]='t';break;
52 | case 'c': rev_sequence[j]='g';break;
53 | case 'g': rev_sequence[j]='c';break;
54 | case 't': rev_sequence[j]='a';break;
55 | default: rev_sequence[j]='N';
56 | }
57 | j++;
58 | }
59 | rev_sequence[j]='\0';
60 | printf("%s\n",(char*)rev_sequence);
61 | }
62 | }
63 | }
64 | return(0);
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src2/add_missing_mates.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | # SuperRead pipeline
3 | # Copyright (C) 2012 Genome group at University of Maryland.
4 | #
5 | # This program is free software: you can redistribute it and/or
6 | # modify it under the terms of the GNU General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # This program is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | # 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 | #
19 | #This program adds missing mates to the read fasta files "on the fly"
20 |
21 | use strict;
22 | use warnings;
23 |
24 | my $readnumberHold = -1;
25 | my ($editlineHold, $prefixHold, $sequenceHold);
26 | while(my $line=){
27 | chomp($line);
28 | my ($first, $editline) = split(' ', $line, 2);
29 | my $prefix = substr($first, 1, 2);
30 | my $readnumber = int(substr($first, 3));
31 |
32 | if(($readnumber % 2) == 0){#if the read is even we simply remember it
33 | if($readnumberHold!=-1){
34 | print(">", $prefixHold, $readnumberHold, " ", $editlineHold, "\n", $sequenceHold,
35 | "\n>", $prefixHold, $readnumberHold+1, "\nN\n");
36 | }
37 | $prefixHold = $prefix;
38 | $readnumberHold = $readnumber;
39 | $editlineHold = $editline;
40 | $sequenceHold = ;
41 | chomp($sequenceHold);
42 | }
43 | elsif($readnumberHold==-1){#the previous even read is missing
44 | print(">", $prefix, $readnumber-1,"\nN\n", $line, "\n", scalar());
45 | }
46 | elsif($readnumber-1!=$readnumberHold){#previous mate is missing odd and current is missing even
47 | print(">", $prefixHold, $readnumberHold, " ", $editlineHold, "\n", $sequenceHold,
48 | "\n>", $prefixHold, $readnumberHold+1, "\nN\n>", $prefix, $readnumber-1, "\nN\n",
49 | $line, "\n", scalar());
50 | $readnumberHold = -1;
51 | }
52 | else { # if($readnumber-1==$readnumberHold)
53 | print(">", $prefixHold, $readnumberHold, " ", $editlineHold, "\n", $sequenceHold, "\n", $line, "\n", scalar());
54 | $readnumberHold = -1;
55 | }
56 | }
57 |
58 | if($readnumberHold != -1) {
59 | print(">", $prefixHold, $readnumberHold, " ", $editlineHold, "\n", $sequenceHold,
60 | "\n>", $prefixHold, $readnumberHold+1, "\nN\n");
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src2/getLengthStatisticsForKUnitigsFile.perl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | # SuperRead pipeline
3 | # Copyright (C) 2012 Genome group at University of Maryland.
4 | #
5 | # This program is free software: you can redistribute it and/or
6 | # modify it under the terms of the GNU General Public License as
7 | # published by the Free Software Foundation, either version 3 of the
8 | # License, or (at your option) any later version.
9 | #
10 | # This program is distributed in the hope that it will be useful, but
11 | # WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 | # 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 | # Cat the k-unitig fasta file through
19 | $workingDir = ".";
20 | $outputPrefix = "";
21 | for ($i=0; $i<=$#ARGV; $i++) {
22 | $arg = $ARGV[$i];
23 | if ($arg eq "-output-prefix") {
24 | ++$i;
25 | $outputPrefix = $ARGV[$i];
26 | if ($outputPrefix !~ /\.$/) { $outputPrefix .= "."; }
27 | next; }
28 | $workingDir = $arg;
29 | }
30 |
31 | $numKUnitigsFile = $outputPrefix . "numKUnitigs.txt";
32 | $maxKUnitigNumberFile = $outputPrefix . "maxKUnitigNumber.txt";
33 | $totBasesInKUnitigsFile = $outputPrefix . "totBasesInKUnitigs.txt";
34 | $isFirstRead = 1;
35 | while ($line = ) {
36 | if ($line =~ /^>/) {
37 | if (! $isFirstRead) { $kUnitigLengths[$kUnitig] = $kUnitigLength; }
38 | $kUnitigLength = 0;
39 | $isFirstRead = 0;
40 | ($kUnitig) = ($line =~ /^.(\S+)\s/);
41 | }
42 | else {
43 | $len = length ($line)-1;
44 | $kUnitigLength += $len;
45 | }
46 | }
47 | if (! $isFirstRead) { $kUnitigLengths[$kUnitig] = $kUnitigLength; }
48 |
49 | for ($i=0; $i<=$#kUnitigLengths; $i++) {
50 | $length = $kUnitigLengths[$i];
51 | $totBasesInKUnitigs += $length;
52 | if (! $length) {
53 | $length = 0; }
54 | else {
55 | ++$numKUnitigs; }
56 | print "$i $length\n";
57 | }
58 | open (OUTFILE, ">", "$workingDir/$numKUnitigsFile");
59 | print OUTFILE "$numKUnitigs\n";
60 | close (OUTFILE);
61 | open (OUTFILE, ">", "$workingDir/$maxKUnitigNumberFile");
62 | $arraySizeForKUnitigData = $#kUnitigLengths+1;
63 | print OUTFILE "$arraySizeForKUnitigData\n";
64 | close (OUTFILE);
65 | open (OUTFILE, ">", "$workingDir/$totBasesInKUnitigsFile");
66 | print OUTFILE "$totBasesInKUnitigs\n";
67 | close (OUTFILE);
68 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src2/outputAlekseysJellyfishReductionFile.perl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env perl
2 | # Take the input from the first arg
3 | # Takes an optional second arg: The max number of times to output a k-mer
4 | # (default is 2)
5 | $maxTimesToRepeat = 2;
6 | $inputFile = $ARGV[0];
7 | if ($#ARGV >= 1) {
8 | $maxTimesToRepeat = $ARGV[1]; }
9 |
10 | print ">0\n";
11 | $cmd = "jellyfish dump -c $inputFile |";
12 | open (FILE, $cmd);
13 | while ($line = ) {
14 | chomp ($line);
15 | ($kmer, $count) = split (" ", $line);
16 | if ($count> $maxTimesToRepeat) {
17 | $countOut = $maxTimesToRepeat; }
18 | else {
19 | $countOut = $count; }
20 | for ($i=0; $i<$countOut; $i++) {
21 | print $kmer,"N"; }
22 | }
23 | close (FILE);
24 | print "\n";
25 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/src2/translateReduceFile.perl:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env perl
2 | # Pass 2 args: the name of the files containing
3 | # (1) The original super-read names, and
4 | # (2) The name of the input reduce file (e.g. reduce.tmp)
5 | $superReadCount = 0;
6 | open (FILE, $ARGV[0]);
7 | while ($line = ) {
8 | chomp ($line);
9 | $newSuperReadName{$line} = $superReadCount;
10 | ++$superReadCount; }
11 | close (FILE);
12 |
13 | open (FILE, $ARGV[1]);
14 | while ($line = ) {
15 | chomp ($line);
16 | @flds = split (" ", $line);
17 | $flds[0] = $newSuperReadName{$flds[0]};
18 | $flds[1] = $newSuperReadName{$flds[1]};
19 | print "@flds\n";
20 | }
21 | close (FILE);
22 |
23 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/gtest/include/gtest/gtest_prod.h:
--------------------------------------------------------------------------------
1 | // Copyright 2006, Google Inc.
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above
11 | // copyright notice, this list of conditions and the following disclaimer
12 | // in the documentation and/or other materials provided with the
13 | // distribution.
14 | // * Neither the name of Google Inc. nor the names of its
15 | // contributors may be used to endorse or promote products derived from
16 | // this software without specific prior written permission.
17 | //
18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 | //
30 | // Author: wan@google.com (Zhanyong Wan)
31 | //
32 | // Google C++ Testing Framework definitions useful in production code.
33 |
34 | #ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_
35 | #define GTEST_INCLUDE_GTEST_GTEST_PROD_H_
36 |
37 | // When you need to test the private or protected members of a class,
38 | // use the FRIEND_TEST macro to declare your tests as friends of the
39 | // class. For example:
40 | //
41 | // class MyClass {
42 | // private:
43 | // void MyMethod();
44 | // FRIEND_TEST(MyClassTest, MyMethod);
45 | // };
46 | //
47 | // class MyClassTest : public testing::Test {
48 | // // ...
49 | // };
50 | //
51 | // TEST_F(MyClassTest, MyMethod) {
52 | // // Can call MyClass::MyMethod() here.
53 | // }
54 |
55 | #define FRIEND_TEST(test_case_name, test_name)\
56 | friend class test_case_name##_##test_name##_Test
57 |
58 | #endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_
59 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/gtest/src/gtest-all.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2008, Google Inc.
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above
11 | // copyright notice, this list of conditions and the following disclaimer
12 | // in the documentation and/or other materials provided with the
13 | // distribution.
14 | // * Neither the name of Google Inc. nor the names of its
15 | // contributors may be used to endorse or promote products derived from
16 | // this software without specific prior written permission.
17 | //
18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 | //
30 | // Author: mheule@google.com (Markus Heule)
31 | //
32 | // Google C++ Testing Framework (Google Test)
33 | //
34 | // Sometimes it's desirable to build Google Test by compiling a single file.
35 | // This file serves this purpose.
36 |
37 | // This line ensures that gtest.h can be compiled on its own, even
38 | // when it's fused.
39 | #include "gtest/gtest.h"
40 |
41 | // The following lines pull in the real gtest *.cc files.
42 | #include "src/gtest.cc"
43 | #include "src/gtest-death-test.cc"
44 | #include "src/gtest-filepath.cc"
45 | #include "src/gtest-port.cc"
46 | #include "src/gtest-printers.cc"
47 | #include "src/gtest-test-part.cc"
48 | #include "src/gtest-typed-test.cc"
49 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/gtest/src/gtest_main.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2006, Google Inc.
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above
11 | // copyright notice, this list of conditions and the following disclaimer
12 | // in the documentation and/or other materials provided with the
13 | // distribution.
14 | // * Neither the name of Google Inc. nor the names of its
15 | // contributors may be used to endorse or promote products derived from
16 | // this software without specific prior written permission.
17 | //
18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 | #include
31 |
32 | #include "gtest/gtest.h"
33 |
34 | GTEST_API_ int main(int argc, char **argv) {
35 | std::cout << "Running main() from gtest_main.cc\n";
36 |
37 | testing::InitGoogleTest(&argc, argv);
38 | return RUN_ALL_TESTS();
39 | }
40 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/misc.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 |
21 | void pdo(unsigned int n, void* (*f)(void*), void *data) {
22 | pthread_t tids[n];
23 | for(unsigned int i = 0; i < n; ++i) {
24 | int e = pthread_create(&tids[i], 0, f, data);
25 | if(e)
26 | throw std::runtime_error(strerror(e));
27 | }
28 | for(unsigned int i = 0; i < n; ++i) {
29 | int e = pthread_join(tids[i], 0);
30 | if(e)
31 | throw std::runtime_error(strerror(e));
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/misc.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __MISC_HPP__
2 | #define __MISC_HPP__
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | void pdo(unsigned int n, void* (*f)(void*), void *data);
9 |
10 | #endif /* __MISC_HPP__ */
11 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/test_charbuf.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 | #include
21 | #include
22 |
23 | TEST(Charstream, Output) {
24 | charstream s(10);
25 | const char *l1 = "Hello\n";
26 | const char *l2 = "Longer text\n";
27 | const char *l3 = "Sho\n";
28 |
29 | s << l1;
30 | EXPECT_EQ(strlen(l1), s.size());
31 | std::ostringstream os1;
32 | os1 << s;
33 | EXPECT_STREQ(l1, os1.str().c_str());
34 | s.rewind();
35 | EXPECT_EQ((size_t)0, s.size());
36 |
37 | s << l2;
38 | EXPECT_EQ(strlen(l2), s.size());
39 | std::ostringstream os2;
40 | os2 << s;
41 | EXPECT_STREQ(l2, os2.str().c_str());
42 | s.rewind();
43 | EXPECT_EQ((size_t)0, s.size());
44 |
45 | s << l3;
46 | EXPECT_EQ(strlen(l3), s.size());
47 | std::ostringstream os3;
48 | os3 << s;
49 | EXPECT_STREQ(l3, os3.str().c_str());
50 | s.rewind();
51 | EXPECT_EQ((size_t)0, s.size());
52 | }
53 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/test_exp_vector.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 | #include
21 |
22 | TEST(ExpVector, Subscript) {
23 | exp_vector ev;
24 | exp_vector evd(5);
25 |
26 | EXPECT_EQ(int(), ev.default_value());
27 | EXPECT_EQ(5, evd.default_value());
28 |
29 | ev[10] = 5;
30 | evd[10] = 10;
31 | for(int i = 0; i < 10; ++i) {
32 | EXPECT_EQ(int(), ev[i]);
33 | EXPECT_EQ(5, evd[i]);
34 | }
35 | EXPECT_EQ(5, ev[10]);
36 | EXPECT_EQ(10, evd[10]);
37 | }
38 |
39 | TEST(ExpVector, Float) {
40 | exp_vector fv;
41 | exp_vector fvd(0, 5.0);
42 |
43 | fv[10] = 10.0;
44 | fvd[10] = 10.0;
45 |
46 | for(int i = 0; i < 10; ++i) {
47 | EXPECT_FLOAT_EQ(float(), fv[i]);
48 | EXPECT_FLOAT_EQ((float)5.0, fvd[i]);
49 | }
50 |
51 | EXPECT_FLOAT_EQ((float)10.0, fv[10]);
52 | EXPECT_FLOAT_EQ((float)10.0, fvd[10]);
53 | }
54 |
55 | TEST(ExpVector, Initialization) {
56 | static const size_t size = 100;
57 | exp_vector iv(size);
58 |
59 | EXPECT_EQ(size, iv.size());
60 | for(size_t i = 0; i < size; ++i)
61 | EXPECT_EQ(0, iv[i]);
62 | }
63 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/test_fork_exec.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include
6 |
7 | namespace {
8 | TEST(ForkExec,ExecVP) {
9 | pid_t res;
10 |
11 | {
12 | char* cmd[2] = { (char*)"/surely this does not exists in root", (char*)0 };
13 | res = fork_execvp("bad", cmd);
14 | EXPECT_EQ(-1, res);
15 | }
16 |
17 | {
18 | char* cmd[2] = { (char*)"true", 0 };
19 | res = fork_execvp("true", cmd);
20 | EXPECT_LT(0, res);
21 | int status;
22 | pid_t wpid = waitpid(res, &status, 0);
23 | EXPECT_EQ(res, wpid);
24 | ASSERT_EQ(true, WIFEXITED(status));
25 | EXPECT_EQ(EXIT_SUCCESS, WEXITSTATUS(status));
26 | }
27 | }
28 | TEST(ForkExec,ExecLP) {
29 | pid_t res;
30 |
31 | res = fork_execlp("bad", "/this one does not exists either", (char*)0);
32 | EXPECT_EQ(-1, res);
33 |
34 | res = fork_execlp("false", "false", (char*)0);
35 | EXPECT_LT(0, res);
36 | int status;
37 | pid_t wpid = waitpid(res, &status, 0);
38 | EXPECT_EQ(res, wpid);
39 | ASSERT_EQ(true, WIFEXITED(status));
40 | EXPECT_EQ(EXIT_FAILURE, WEXITSTATUS(status));
41 | }
42 | TEST(ForkExec,Exec) {
43 | pid_t res;
44 |
45 | res = fork_exec("/surely_you_are_joking_Mr._Feynam is that right");
46 | EXPECT_EQ(-1, res);
47 |
48 | res = fork_exec("true ignored argument");
49 | EXPECT_LT(0, res);
50 | int status;
51 | pid_t wpid = waitpid(res, &status, 0);
52 | EXPECT_EQ(res, wpid);
53 | ASSERT_EQ(true, WIFEXITED(status));
54 | EXPECT_EQ(EXIT_SUCCESS, WEXITSTATUS(status));
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/test_hash.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 | #include
21 |
22 | class rand_block_string {
23 | std::string str_;
24 |
25 | public:
26 | rand_block_string(int length) : str_(length, '\0') {
27 | for(int i = 0; i != length; ++i)
28 | str_[i] = (char)((random() % 255) + 1);
29 | }
30 |
31 | // Subscript by 64 bit word
32 | uint64_t operator[](unsigned int i) const {
33 | uint64_t* ptr = (uint64_t*)str_.c_str() + i;
34 | return *ptr;
35 | }
36 | const char* raw() const { return str_.c_str(); }
37 | size_t len() const { return str_.size(); }
38 | };
39 |
40 | TEST(MurmurHash3, Generic) {
41 | rand_block_string str(random() % 200);
42 | uint32_t seed = random();
43 | uint64_t original[2];
44 | uint64_t generic[2];
45 |
46 | MurmurHash3_x64_128(str.raw(), str.len(), seed, original);
47 | MurmurHash3_T_128(str, str.len(), seed, generic);
48 | EXPECT_EQ(original[0], generic[0]);
49 | EXPECT_EQ(original[1], generic[1]);
50 | }
51 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/test_main.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | int main(int argc, char *argv[]) {
26 | ::testing::InitGoogleTest(&argc, argv);
27 | cmdline_parse args(argc, argv);
28 |
29 | unsigned int seed;
30 | if(args.seed_given) {
31 | seed = args.seed_arg;
32 | } else {
33 | std::ifstream urandom("/dev/urandom");
34 | urandom.read((char*)&seed, sizeof(seed));
35 | if(!urandom.good()) {
36 | std::cerr << "Failed to read random seed" << std::endl;
37 | return 1;
38 | }
39 | }
40 |
41 | std::cout << "Using random seed " << seed << std::endl;
42 | srandom(seed);
43 |
44 | return RUN_ALL_TESTS();
45 | }
46 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/test_sr_names.cc:
--------------------------------------------------------------------------------
1 | /* SuperRead pipeline
2 | * Copyright (C) 2012 Genome group at University of Maryland.
3 | *
4 | * This program is free software: you can redistribute it and/or
5 | * modify it under the terms of the GNU General Public License as
6 | * published by the Free Software Foundation, either version 3 of the
7 | * License, or (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * 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 |
18 |
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | TEST(SR_name, encode_decode) {
26 | long sr_name_len = random() % 10;
27 | charb sr_original;
28 | charb one_entry;
29 | sprintf(sr_original, "%ld%c", random(), random() % 2 ? 'R' : 'F');
30 | for(long i = 1; i < sr_name_len; ++i) {
31 | sprintf(one_entry, "_%ld_%ld%c", random() % 100, random(), random() %2 ? 'R' : 'F');
32 | strcat(sr_original, one_entry);
33 | }
34 |
35 | sr_name sr(sr_original);
36 | charb res;
37 | sr.to_str(res);
38 | EXPECT_STREQ(sr_original, res);
39 | }
40 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/SuperReadsR/unittests/test_thread_pool.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | namespace {
5 | int square(int x) { return x * x; }
6 |
7 | TEST(ThreadPool, Squares) {
8 | static const int nb_threads = 10;
9 | static const int nb_jobs = 100 * nb_threads;
10 |
11 | int res[nb_jobs];
12 |
13 | thread_pool tp(nb_threads, square);
14 | for(int i = 0; i < nb_jobs; ++i)
15 | tp.submit_job(&i, &res[i]);
16 | tp.release_workers();
17 |
18 | for(int i = 0; i < nb_jobs; ++i)
19 | EXPECT_EQ(i * i, res[i]);
20 |
21 | EXPECT_EQ(nb_jobs, tp.jobs_done());
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/doc/jellyfish.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/skovaka/stringtie2/647ab5124e18e99164b45a7fa325240ec7a1b56d/SuperReads_RNA/global-1/jellyfish/doc/jellyfish.pdf
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/gtest.mk:
--------------------------------------------------------------------------------
1 | ##############################
2 | # Gtest build.
3 | ##############################
4 | # Build rules for libraries.
5 | check_LTLIBRARIES = libgtest.la libgtest_main.la
6 |
7 | libgtest_la_SOURCES = unit_tests/gtest/src/gtest-all.cc
8 | libgtest_main_la_SOURCES = unit_tests/gtest/src/gtest_main.cc
9 | libgtest_main_la_LIBADD = libgtest.la
10 | libgtest_la_CXXFLAGS = -I$(srcdir)/unit_tests
11 | libgtest_main_la_CXXFLAGS = -I$(srcdir)/unit_tests
12 |
13 | GTEST_SRC = unit_tests/gtest/src/gtest-all.cc \
14 | unit_tests/gtest/src/gtest_main.cc \
15 | unit_tests/gtest/gtest.h
16 |
17 | EXTRA_DIST += $(GTEST_SRC)
18 |
19 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/allocators_mmap.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_ALLOCATORS_MMAP_HPP__
18 | #define __JELLYFISH_ALLOCATORS_MMAP_HPP__
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | #include
27 |
28 | namespace allocators {
29 | class mmap {
30 | void *ptr_;
31 | size_t size_;
32 |
33 | public:
34 | mmap() : ptr_(MAP_FAILED), size_(0) {}
35 | explicit mmap(size_t _size) : ptr_(MAP_FAILED), size_(0) {
36 | realloc(_size);
37 | }
38 | mmap(mmap&& rhs) : ptr_(rhs.ptr_), size_(rhs.size_) {
39 | rhs.ptr_ = MAP_FAILED;
40 | rhs.size_ = 0;
41 | }
42 | ~mmap() { free(); }
43 |
44 | mmap& operator=(mmap&& rhs) {
45 | swap(rhs);
46 | return *this;
47 | }
48 |
49 | void swap(mmap& rhs) {
50 | std::swap(ptr_, rhs.ptr_);
51 | std::swap(size_, rhs.size_);
52 | }
53 |
54 | void *get_ptr() const { return ptr_ != MAP_FAILED ? ptr_ : NULL; }
55 | size_t get_size() const { return size_; }
56 | void free();
57 | void *realloc(size_t new_size);
58 | int lock() { return mlock(ptr_, size_); }
59 | int unlock() { return munlock(ptr_, size_); }
60 |
61 | // Return a a number of bytes which is a number of whole pages at
62 | // least as large as size.
63 | static size_t round_to_page(size_t _size);
64 |
65 | private:
66 | static const int nb_threads = 4;
67 | struct tinfo {
68 | pthread_t thid;
69 | char *start, *end;
70 | size_t pgsize;
71 | };
72 | void fast_zero();
73 | static void * _fast_zero(void *_info);
74 | };
75 | inline void swap(mmap& a, mmap& b) { a.swap(b); }
76 | }
77 |
78 | #endif
79 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/atomic_gcc.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_ATOMIC_GCC_HPP__
18 | #define __JELLYFISH_ATOMIC_GCC_HPP__
19 |
20 | namespace atomic
21 | {
22 | class gcc
23 | {
24 | public:
25 | template
26 | static inline T cas(volatile T *ptr, T oval, T nval) {
27 | return __sync_val_compare_and_swap(ptr, oval, nval);
28 | }
29 |
30 | template
31 | static inline T set(T *ptr, T nval) {
32 | return __sync_lock_test_and_set(ptr, nval);
33 | }
34 |
35 | template
36 | static inline T add_fetch(volatile T *ptr, T x) {
37 | T ncount = *ptr, count;
38 | do {
39 | count = ncount;
40 | ncount = cas((T *)ptr, count, count + x);
41 | } while(ncount != count);
42 | return count + x;
43 | }
44 |
45 | template
46 | static inline T fetch_add(volatile T *ptr, T x) {
47 | T ncount = *ptr, count;
48 | do {
49 | count = ncount;
50 | ncount = cas((T *)ptr, count, (T)(count + x));
51 | } while(ncount != count);
52 | return count;
53 | }
54 |
55 | template
56 | static inline T set_to_max(volatile T *ptr, T x) {
57 | T count = *ptr;
58 | while(x > count) {
59 | T ncount = cas(ptr, count, x);
60 | if(ncount == count)
61 | return x;
62 | count = ncount;
63 | }
64 | return count;
65 | }
66 | };
67 | }
68 | #endif
69 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/backtrace.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | void print_backtrace();
18 | void show_backtrace();
19 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/jellyfish.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_JELLYFISH_HPP__
18 | #define __JELLYFISH_JELLYFISH_HPP__
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | typedef jellyfish::cooperative::hash_counter mer_hash;
27 | typedef mer_hash::array mer_array;
28 | typedef jellyfish::text_dumper text_dumper;
29 | typedef jellyfish::text_reader text_reader;
30 | typedef jellyfish::binary_dumper binary_dumper;
31 | typedef jellyfish::binary_reader binary_reader;
32 | typedef jellyfish::binary_query_base binary_query;
33 | typedef jellyfish::binary_writer binary_writer;
34 | typedef jellyfish::text_writer text_writer;
35 |
36 |
37 | #endif /* __JELLYFISH_JELLYFISH_HPP__ */
38 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/mer_dna_bloom_counter.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_MER_DNA_BLOOM_COUNTER_HPP_
18 | #define __JELLYFISH_MER_DNA_BLOOM_COUNTER_HPP_
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 |
26 | namespace jellyfish {
27 | template<>
28 | struct hash_pair {
29 | RectangularBinaryMatrix m1, m2;
30 |
31 | hash_pair() : m1(8 * sizeof(uint64_t), mer_dna::k() * 2), m2(8 * sizeof(uint64_t), mer_dna::k() * 2) {
32 | m1.randomize(random_bits);
33 | m2.randomize(random_bits);
34 | }
35 |
36 | hash_pair(RectangularBinaryMatrix&& m1_, RectangularBinaryMatrix&& m2_) : m1(m1_), m2(m2_) { }
37 |
38 | void operator()(const mer_dna& k, uint64_t* hashes) const {
39 | hashes[0] = m1.times(k);
40 | hashes[1] = m2.times(k);
41 | }
42 | };
43 |
44 | typedef bloom_counter2 mer_dna_bloom_counter;
45 | typedef bloom_counter2_file mer_dna_bloom_counter_file;
46 | typedef bloom_filter mer_dna_bloom_filter;
47 | typedef bloom_filter_file mer_dna_bloom_filter_file;
48 | }
49 |
50 | #endif /* __JELLYFISH_MER_DNA_BLOOM_COUNTER_HPP_ */
51 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/storage.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_STORAGE_HPP__
18 | #define __JELLYFISH_STORAGE_HPP__
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | namespace jellyfish {
25 |
26 | class storage_t {
27 | public:
28 | storage_t() {}
29 | virtual ~storage_t() {}
30 | };
31 |
32 | // Entry 0 is used only when switching to a large field
33 | extern const size_t *quadratic_reprobes;
34 |
35 | }
36 |
37 | #endif // __STORAGE_HPP__
38 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/thread_exec.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_THREAD_EXEC_HPP__
18 | #define __JELLYFISH_THREAD_EXEC_HPP__
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 |
29 | namespace jellyfish {
30 | class thread_exec {
31 | struct thread_info {
32 | int id;
33 | pthread_t thid;
34 | thread_exec *self;
35 | };
36 | static void *start_routine(void *);
37 | std::vector infos;
38 |
39 | public:
40 | define_error_class(Error);
41 | thread_exec() {}
42 | virtual ~thread_exec() {}
43 | virtual void start(int id) = 0;
44 | void exec(int nb_threads);
45 | void join();
46 | void exec_join(int nb_threads) {
47 | exec(nb_threads);
48 | join();
49 | }
50 | };
51 | } // namespace jellyfish {
52 |
53 | #endif // __THREAD_EXEC_HPP__
54 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/time.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_TIME_HPP__
18 | #define __JELLYFISH_TIME_HPP__
19 |
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | class Time {
26 | static const suseconds_t max_useconds = 1000000UL;
27 | struct timeval tv;
28 |
29 | public:
30 | static const Time zero;
31 | explicit Time(bool init = true) {
32 | if(init)
33 | now();
34 | }
35 | Time(time_t sec, suseconds_t usec) {
36 | tv.tv_sec = sec;
37 | tv.tv_usec = usec;
38 | }
39 | Time &operator=(const Time &o) {
40 | if(&o != this) {
41 | tv.tv_sec = o.tv.tv_sec;
42 | tv.tv_usec = o.tv.tv_usec;
43 | }
44 | return *this;
45 | }
46 |
47 | Time & operator-=(const Time &o) {
48 | tv.tv_sec -= o.tv.tv_sec;
49 | if(o.tv.tv_usec > tv.tv_usec) {
50 | tv.tv_usec = (max_useconds + tv.tv_usec) - o.tv.tv_usec;
51 | --tv.tv_sec;
52 | } else {
53 | tv.tv_usec -= o.tv.tv_usec;
54 | }
55 | return *this;
56 | }
57 | const Time operator-(const Time &o) const {
58 | return Time(*this) -= o;
59 | }
60 |
61 | Time & operator+=(const Time &o) {
62 | tv.tv_sec += o.tv.tv_sec;
63 | tv.tv_usec += o.tv.tv_usec;
64 | if(tv.tv_usec >= max_useconds) {
65 | ++tv.tv_sec;
66 | tv.tv_usec -= max_useconds;
67 | }
68 | return *this;
69 | }
70 | const Time operator+(const Time &o) const {
71 | return Time(*this) += o;
72 | }
73 |
74 | bool operator<(const Time& o) const {
75 | return tv.tv_sec < o.tv.tv_sec || (tv.tv_sec == o.tv.tv_sec && tv.tv_usec < o.tv.tv_usec);
76 | }
77 |
78 | void now() { gettimeofday(&tv, NULL); }
79 | Time elapsed() const {
80 | return Time() - *this;
81 | }
82 |
83 |
84 | std::string str() const {
85 | std::ostringstream res;
86 | res << tv.tv_sec << "."
87 | << std::setfill('0') << std::setw(6) << std::right << tv.tv_usec;
88 | return res.str();
89 | }
90 | };
91 |
92 | #endif // __TIME_HPP__
93 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/include/jellyfish/token_ring.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_TOKEN_RING_HPP__
18 | #define __JELLYFISH_TOKEN_RING_HPP__
19 |
20 | #include
21 | #include
22 |
23 | namespace jellyfish {
24 | template
25 | class token_ring {
26 | public:
27 | class token {
28 | bool val;
29 | cond_t cond;
30 | token* next;
31 | friend class token_ring;
32 |
33 | public:
34 | void wait() {
35 | cond.lock();
36 | while(!val) { cond.wait(); }
37 | cond.unlock();
38 | }
39 |
40 | void pass() {
41 | next->cond.lock();
42 | val = false;
43 | next->val = true;
44 | next->cond.signal();
45 | next->cond.unlock();
46 | }
47 | };
48 |
49 | protected:
50 | typedef std::vector token_list;
51 | typedef typename token_list::iterator token_iterator;
52 | token_list tokens;
53 |
54 | void initialize() {
55 | if(tokens.size() == 0)
56 | return;
57 |
58 | tokens.front().val = true;
59 | tokens.back().next = &tokens.front();
60 |
61 | for(size_t i = 1; i < tokens.size(); ++i) {
62 | tokens[i].val = false;
63 | tokens[i-1].next = &tokens[i];
64 | }
65 | }
66 |
67 | public:
68 | token_ring(int nb_tokens) :
69 | tokens(nb_tokens)
70 | { initialize(); }
71 |
72 | ~token_ring() { }
73 |
74 | token& operator[](int i) { return tokens[i]; }
75 |
76 | void reset() {
77 | if(tokens.size() == 0)
78 | return;
79 |
80 | token_iterator it = tokens.begin();
81 | it->val = true;
82 | for(++it; it != tokens.end(); ++it)
83 | it->val = false;
84 | }
85 | };
86 | } // namespace jellyfish {
87 | #endif
88 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/jellyfish-2.0.pc.in:
--------------------------------------------------------------------------------
1 | prefix=@prefix@
2 | exec_prefix=@exec_prefix@
3 | libdir=@libdir@
4 | includedir=@includedir@
5 |
6 | Name: Jellyfish
7 | Description: A multi-threaded hash based k-mer counter.
8 | Version: @PACKAGE_VERSION@
9 | Libs: -L${libdir} -ljellyfish-2.0 -lpthread
10 | Cflags: -I${includedir}/jellyfish-@PACKAGE_VERSION@
11 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/jellyfish/backtrace.cc:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #ifndef HAVE_EXECINFO_H
4 |
5 | void show_backtrace() {}
6 |
7 | #else
8 |
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | void print_backtrace() {
17 | void *trace_elems[20];
18 | int trace_elem_count(backtrace(trace_elems, 20));
19 | backtrace_symbols_fd(trace_elems, trace_elem_count, 2);
20 | }
21 |
22 | static void handler() {
23 | // Display message of last thrown exception if any
24 | try { throw; }
25 | catch(const std::exception& e) {
26 | int status;
27 | size_t n = 0;
28 | char *name = abi::__cxa_demangle(typeid(e).name(), 0, &n, &status);
29 | std::cerr << "terminate called after throwing an instance of '"
30 | << (status < 0 ? "UNKNOWN" : name)
31 | << "'\n what(): " << e.what() << "\n";
32 | if(n)
33 | free(name);
34 | }
35 | catch(...) {}
36 |
37 | print_backtrace();
38 | abort();
39 | }
40 |
41 | void show_backtrace() {
42 | std::set_terminate(handler);
43 | }
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/jellyfish/dbg.cc:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #include
18 | #include
19 | #include
20 |
21 | namespace dbg {
22 | pthread_mutex_t print_t::_lock = PTHREAD_MUTEX_INITIALIZER;
23 | volatile pid_t print_t::_print_tid = 0;
24 |
25 | #ifdef DEBUG
26 | Time _tic_time;
27 | #endif
28 |
29 | void tic() {
30 | #ifdef DEBUG
31 | _tic_time.now();
32 | #endif
33 | }
34 | Time toc() {
35 | #ifdef DEBUG
36 | Time t;
37 | return t - _tic_time;
38 | #else
39 | return Time::zero;
40 | #endif
41 | }
42 |
43 | #ifdef SYS_gettid
44 | pid_t gettid() { return (pid_t)syscall(SYS_gettid); }
45 | #else
46 | pid_t gettid() { return getpid(); }
47 | #endif
48 |
49 | int print_t::set_signal(int signum) {
50 | struct sigaction act;
51 | memset(&act, '\0', sizeof(act));
52 | act.sa_sigaction = signal_handler;
53 | act.sa_flags = SA_SIGINFO;
54 | return sigaction(signum, &act, 0);
55 | }
56 |
57 | void print_t::signal_handler(int signum, siginfo_t *info, void *context) {
58 | #ifdef HAVE_SI_INT
59 | if(info->si_code != SI_QUEUE)
60 | return;
61 | _print_tid = info->si_int;
62 | #endif
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/jellyfish/merge_files.hpp:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #ifndef __JELLYFISH_MERGE_FILES_HPP__
18 | #define __JELLYFISH_MERGE_FILES_HPP__
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | define_error_class(MergeError);
25 |
26 | /// Merge files. Throw a MergeError in case of error.
27 | void merge_files(std::vector input_files, const char* out_file,
28 | jellyfish::file_header& h, uint64_t min, uint64_t max);
29 |
30 | #endif /* __JELLYFISH_MERGE_FILES_HPP__ */
31 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/lib/mer_dna.cc:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 |
18 | #include
19 |
20 | namespace jellyfish { namespace mer_dna_ns {
21 | const char* const error_different_k = "Length of k-mers are different";
22 | const char* const error_short_string = "Input string is to short";
23 | } } // namespace jellyfish { namespace mer_dna_ns
24 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/lib/thread_exec.cc:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #include
18 |
19 | void jellyfish::thread_exec::exec(int nb_threads) {
20 | struct thread_info empty = {0, 0, 0};
21 | infos.resize(nb_threads, empty);
22 |
23 | for(int i = 0; i < nb_threads; i++) {
24 | infos[i].id = i;
25 | infos[i].self = this;
26 | int err = pthread_create(&infos[i].thid, NULL, start_routine, &infos[i]);
27 | if(err)
28 | throw Error(err::msg() << "Can't create thread: " << err::no);
29 | }
30 | }
31 |
32 | void jellyfish::thread_exec::join() {
33 | for(unsigned int i = 0; i < infos.size(); i++) {
34 | int err = pthread_join(infos[i].thid, NULL);
35 | if(err)
36 | throw Error(err::msg() << "Can't join thread '" << infos[i].thid << "': " << err::no);
37 | }
38 | }
39 |
40 | void *jellyfish::thread_exec::start_routine(void *_info) {
41 | struct thread_info *info = (struct thread_info *)_info;
42 | info->self->start(info->id);
43 | return 0;
44 | }
45 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/lib/time.cc:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #include
18 |
19 | const Time Time::zero = Time(0, 0);
20 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/sub_commands/info_main.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include
6 | #include
7 | #include
8 | #include
9 |
10 | namespace err = jellyfish::err;
11 |
12 | static info_main_cmdline args;
13 |
14 | std::string get_command(const jellyfish::generic_file_header& h) {
15 | std::string cmd(h["exe_path"]);
16 | std::vector cmdline = h.cmdline();
17 | for(auto it = cmdline.cbegin(); it != cmdline.cend(); ++it)
18 | (cmd += " ") += jellyfish::quote_arg(*it);
19 |
20 | return cmd;
21 | }
22 |
23 | std::string get_where(const jellyfish::generic_file_header& h) {
24 | std::string res(jellyfish::quote_arg(h["hostname"]));
25 | if(!res.empty())
26 | res += ":";
27 | res += jellyfish::quote_arg(h["pwd"]);
28 | return res;
29 | }
30 |
31 | int info_main(int argc, char *argv[]) {
32 | args.parse(argc, argv);
33 |
34 | std::ifstream file(args.file_arg);
35 | if(!file.good())
36 | err::die(err::msg() << "Can't open '" << args.file_arg << "'");
37 |
38 | jellyfish::file_header header;
39 | header.read(file);
40 |
41 | if(args.skip_flag)
42 | std::cout << file.rdbuf();
43 | else if(args.json_flag)
44 | std::cout << header;
45 | else if(args.cmd_flag)
46 | std::cout << get_command(header) << "\n";
47 | else
48 | std::cout << "command: " << get_command(header) << "\n"
49 | << "where: " << get_where(header) << "\n"
50 | << "when: " << header["time"] << "\n"
51 | << "canonical: " << (header.canonical() ? "yes" : "no") << "\n";
52 |
53 | return 0;
54 | }
55 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/sub_commands/mem_main.cc:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include
21 | #include
22 | #include
23 |
24 | static const char* suffixes = "kMGTPE";
25 |
26 | template
27 | std::string add_suffix(uint64_t x) {
28 | const int max_i = strlen(suffixes);
29 | int i = 0;
30 | while(x >= U && i <= max_i) {
31 | x /= U;
32 | ++i;
33 | }
34 | std::ostringstream res;
35 | res << x;
36 | if(i > 0)
37 | res << suffixes[i - 1];
38 | return res.str();
39 | }
40 |
41 | int mem_main(int argc, char *argv[]) {
42 | mem_main_cmdline args(argc, argv);
43 | jellyfish::large_hash::array::usage_info usage(args.mer_len_arg * 2, args.counter_len_arg, args.reprobes_arg);
44 |
45 | if(args.size_given) {
46 | uint64_t val = usage.mem(args.size_arg);
47 | std::cout << val << " (" << add_suffix<1024>(val) << ")\n";
48 | } else {
49 | uint64_t val = usage.size(args.mem_arg);
50 | std::cout << val << " (" << add_suffix<1000>(val) << ")\n";
51 | }
52 |
53 | return 0;
54 | }
55 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/sub_commands/merge_main.cc:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #include
18 | #include
19 |
20 | #include
21 |
22 | namespace err = jellyfish::err;
23 |
24 | int merge_main(int argc, char *argv[])
25 | {
26 | jellyfish::file_header out_header;
27 | out_header.fill_standard();
28 | out_header.set_cmdline(argc, argv);
29 |
30 | merge_main_cmdline args(argc, argv);
31 | uint64_t min = args.lower_count_given ? args.lower_count_arg : 0;
32 | uint64_t max = args.upper_count_given ? args.upper_count_arg : std::numeric_limits::max();
33 |
34 | try {
35 | merge_files(args.input_arg, args.output_arg, out_header, min, max);
36 | } catch(MergeError e) {
37 | err::die(err::msg() << e.what());
38 | }
39 |
40 | return 0;
41 | }
42 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/Makefile.am:
--------------------------------------------------------------------------------
1 | # SWIG
2 | SWIG_SRC = swig/jellyfish.i swig/hash_counter.i swig/hash_set.i \
3 | swig/mer_dna.i swig/mer_file.i swig/string_mers.i
4 |
5 | if HAVE_SWIG
6 | SWIG_V_GEN = $(swig_v_GEN_$(V))
7 | swig_v_GEN_ = $(swig_v_GEN_$(AM_DEFAULT_VERBOSITY))
8 | swig_v_GEN_0 = @echo " SWIG " $@;
9 | %/swig_wrap.cpp: $(SWIG_SRC)
10 | $(SWIG_V_GEN)$(SWIG) -$(notdir $*) -I$(srcdir)/../include -o $@ $<
11 | else
12 | %/swig_wrap.cpp:
13 | @echo >&2 SWIG >= 3.x.x not found. Make sure it is install and rerun configure
14 | @false
15 | endif
16 |
17 | # Python support
18 | if PYTHON_BINDING
19 | PYTHON_BUILT = swig/python/swig_wrap.cpp swig/python/jellyfish.py
20 | BUILT_SOURCES += $(PYTHON_BUILT)
21 |
22 | pythonextdir = $(PYTHON_SITE_PKG)/jellyfish
23 | pythonext_SCRIPTS = swig/python/__init__.pyc
24 | pythonext_LTLIBRARIES = swig/python/_jellyfish.la
25 | swig_python__jellyfish_la_SOURCES = swig/python/swig_wrap.cpp $(SWIG_SRC)
26 | swig_python__jellyfish_la_CPPFLAGS = $(PYTHON_CPPFLAGS) -I$(srcdir)/include
27 | swig_python__jellyfish_la_LDFLAGS = -module
28 | swig_python__jellyfish_la_LIBADD = libjellyfish-2.0.la
29 | CLEANFILES += $(PYTHON_BUILT) $(pythonext_SCRIPTS)
30 | PYTHONC_V_GEN = $(pythonc_v_GEN_$(V))
31 | pythonc_v_GEN_ = $(pythonc_v_GEN_$(AM_DEFAULT_VERBOSITY))
32 | pythonc_v_GEN_0 = @echo " PYTHONC " $@;
33 | %/__init__.pyc: %/jellyfish.py
34 | $(PYTHONC_V_GEN)$(PYTHON) -c 'import py_compile, sys; py_compile.compile(sys.argv[1], sys.argv[2])' $< $@
35 | swig/python/jellyfish.py: swig/python/swig_wrap.cpp
36 | EXTRA_DIST += $(PYTHON_BUILT)
37 | endif
38 |
39 | # Ruby support
40 | if RUBY_BINDING
41 | RUBY_BUILT = swig/ruby/swig_wrap.cpp
42 | BUILT_SOURCES += $(RUBY_BUILT)
43 | rubyextdir = $(RUBY_EXT_LIB)
44 | rubyext_LTLIBRARIES = swig/ruby/jellyfish.la
45 | swig_ruby_jellyfish_la_SOURCES = swig/ruby/swig_wrap.cpp $(SWIG_SRC)
46 | swig_ruby_jellyfish_la_CPPFLAGS = $(RUBY_EXT_CFLAGS) -I$(srcdir)/include
47 | swig_ruby_jellyfish_la_LDFLAGS = -module
48 | swig_ruby_jellyfish_la_LIBADD = libjellyfish-2.0.la
49 | CLEANFILES += $(RUBY_BUILT)
50 | endif
51 |
52 | # Perl5 support
53 | if PERL_BINDING
54 | PERL_BUILT = swig/perl5/swig_wrap.cpp swig/perl5/jellyfish.pm
55 | BUILT_SOURCES += $(PERL_BUILT)
56 | perlextdir = $(PERL_EXT_LIB)
57 | perlext_SCRIPTS = swig/perl5/jellyfish.pm
58 | perlext_LTLIBRARIES = swig/perl5/jellyfish.la
59 | swig_perl5_jellyfish_la_SOURCES = swig/perl5/swig_wrap.cpp $(SWIG_SRC)
60 | swig_perl5_jellyfish_la_CPPFLAGS = $(PERL_EXT_CPPFLAGS) -I$(PERL_EXT_INC) -I$(srcdir)/include
61 | swig_perl5_jellyfish_la_LDFLAGS = -module
62 | swig_perl5_jellyfish_la_LIBADD = libjellyfish-2.0.la
63 | CLEANFILES += $(PERL_BUILT)
64 | swig/perl5/jellyfish.pm: swig/perl5/swig_wrap.cpp
65 | EXTRA_DIST += $(PERL_BUILT)
66 | endif
67 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/hash_counter.i:
--------------------------------------------------------------------------------
1 | /*********************************************************************/
2 | /* Proxy class for hash counter: auto size doubling hash on mer_dna. */
3 | /*********************************************************************/
4 | %{
5 | class HashCounter : public jellyfish::cooperative::hash_counter {
6 | typedef jellyfish::cooperative::hash_counter super;
7 | public:
8 | HashCounter(size_t size, unsigned int val_len, unsigned int nb_threads = 1) : \
9 | super(size, jellyfish::mer_dna::k() * 2, val_len, nb_threads)
10 | { }
11 |
12 | bool add(const MerDNA& m, const int& x) {
13 | bool res;
14 | size_t id;
15 | super::add(m, x, &res, &id);
16 | return res;
17 | }
18 |
19 | };
20 | %}
21 |
22 | // Typemaps to return nil/undef/None if the mer asked for is not in
23 | // the hash
24 | %typemap(in, numinputs=0) std::pair* COUNT (std::pair tmp) {
25 | $1 = &tmp;
26 | }
27 | %typemap(argout) std::pair* COUNT {
28 | if(($1)->first) {
29 | SWIG_Object o = SWIG_From(unsigned long)(($1)->second);
30 | %append_output(o);
31 | } else {
32 | %append_output(VOID_Object);
33 | }
34 | }
35 |
36 | class HashCounter {
37 | public:
38 | HashCounter(size_t size, unsigned int val_len, unsigned int nb_threads = 1);
39 | size_t size() const;
40 | unsigned int val_len() const;
41 | // unsigned int nb_threads() const;
42 |
43 | bool add(const MerDNA& m, const int& x);
44 | bool update_add(const MerDNA&, const int&);
45 |
46 | %extend {
47 | void get(const MerDNA& m, std::pair* COUNT) const {
48 | COUNT->first = $self->ary()->get_val_for_key(m, &COUNT->second);
49 | }
50 | #ifndef SWIGPERL
51 | void __getitem__(const MerDNA& m, std::pair* COUNT) const {
52 | COUNT->first = $self->ary()->get_val_for_key(m, &COUNT->second);
53 | }
54 | #endif
55 | }
56 | };
57 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/hash_set.i:
--------------------------------------------------------------------------------
1 | /*********************************************************************/
2 | /* Proxy class for hash counter: auto size doubling hash on mer_dna. */
3 | /*********************************************************************/
4 | %{
5 | class HashSet : public jellyfish::cooperative::hash_counter {
6 | typedef jellyfish::cooperative::hash_counter super;
7 | public:
8 | HashSet(size_t size, unsigned int nb_threads = 1) : \
9 | super(size, jellyfish::mer_dna::k() * 2, 0, nb_threads)
10 | { }
11 |
12 | bool add(const MerDNA& m) {
13 | bool res;
14 | size_t id;
15 | super::set(m, &res, &id);
16 | return res;
17 | }
18 | };
19 | %}
20 |
21 | class HashSet {
22 | public:
23 | HashSet(size_t size, unsigned int nb_threads = 1);
24 | size_t size() const;
25 | // unsigned int nb_threads() const;
26 |
27 | bool add(const MerDNA& m);
28 |
29 | %extend {
30 | bool get(const MerDNA& m) const { return $self->ary()->has_key(m); }
31 | #ifndef SWIGPERL
32 | bool __getitem__(const MerDNA& m) const { return $self->ary()->has_key(m); }
33 | #endif
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/jellyfish.i:
--------------------------------------------------------------------------------
1 | %module(docstring="Jellyfish binding") jellyfish
2 | %naturalvar; // Use const reference instead of pointers
3 | %include "std_string.i"
4 | %include "exception.i"
5 | %include "std_except.i"
6 | %include "typemaps.i"
7 | %feature("autodoc", "2");
8 |
9 | %{
10 | #ifdef SWIGPYTHON
11 | #define SWIG_FILE_WITH_INIT
12 | #endif
13 |
14 | #ifdef SWIGPERL
15 | #undef seed
16 | #undef random
17 | #endif
18 |
19 | #include
20 | #include
21 | #undef die
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #undef die
28 | %}
29 |
30 | %include "mer_dna.i"
31 | %include "mer_file.i"
32 | %include "hash_counter.i"
33 | %include "hash_set.i"
34 | %include "string_mers.i"
35 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/perl5/t/test_hash_counter.t:
--------------------------------------------------------------------------------
1 | use strict;
2 | use warnings;
3 | use Test::More;
4 | use jellyfish;
5 |
6 | require_ok('jellyfish');
7 | my $data = shift(@ARGV);
8 |
9 | jellyfish::MerDNA::k(100);
10 | my $hash = jellyfish::HashCounter->new(1024, 5);
11 |
12 | # Check info
13 | ok(100 == jellyfish::MerDNA::k, "mer_dna k");
14 | ok(1024 == $hash->size, "Hash size");
15 | ok(5 == $hash->val_len, "Hash value length");
16 |
17 | # Test adding mers
18 | {
19 | my $mer = jellyfish::MerDNA->new;
20 | my $good = 1;
21 | for(my $i = 0; $i < 1000; $i++) {
22 | $mer->randomize();
23 | my $val = int(rand(1000));
24 | $good &&= $hash->add($mer, $val) or
25 | (ok($good, "Adding to new mer") || last);
26 | if($i % 3 > 0) {
27 | my $nval = int(rand(1000));
28 | $val += $nval;
29 | if($i % 3 == 1) {
30 | $good &&= !$hash->add($mer, $nval) or
31 | (ok($good, "Adding to existing mer") || last);
32 | } else {
33 | $good &&= $hash->update_add($mer, $nval) or
34 | (ok($good, "Updating existing mer") || last);
35 | }
36 | }
37 | $good &&= $val == $hash->get($mer) or
38 | (ok($good, "Value in hash") || last);
39 |
40 | }
41 | ok($good, "Adding mer to hash");
42 | }
43 |
44 | done_testing;
45 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/perl5/t/test_mer_file.t:
--------------------------------------------------------------------------------
1 | use strict;
2 | use warnings;
3 | use Test::More;
4 |
5 | require_ok('jellyfish');
6 | my $data = shift(@ARGV);
7 |
8 | # Compare histo
9 | {
10 | my $rf = jellyfish::ReadMerFile->new($data . "/swig_perl.jf");
11 | my @histo;
12 | $histo[$rf->count]++ while($rf->next_mer);
13 |
14 | open(my $io, "<", $data . "/swig_perl.histo");
15 | my @jf_histo;
16 | while(<$io>) {
17 | my ($freq, $count) = split;
18 | $jf_histo[$freq] = $count;
19 | }
20 |
21 | is_deeply(\@histo, \@jf_histo, "Histogram");
22 | }
23 |
24 | # Compare dump
25 | {
26 | my $rf = jellyfish::ReadMerFile->new($data . "/swig_perl.jf");
27 | my $equal = open(my $io, "<", $data . "/swig_perl.dump");
28 | while(<$io>) {
29 | my ($mer, $count) = split;
30 | $equal &&= $rf->next_mer;
31 | $equal &&= ($mer eq $rf->mer);
32 | $equal &&= ($count == $rf->count);
33 | last unless $equal;
34 | }
35 | $equal &&= !$rf->next_mer;
36 | ok($equal, "Dump");
37 | }
38 |
39 | # Query
40 | {
41 | my $rf = jellyfish::ReadMerFile->new($data . "/swig_perl.jf");
42 | my $qf = jellyfish::QueryMerFile->new($data . "/swig_perl.jf");
43 | my $good = 1;
44 | while(my ($mer, $count) = $rf->each) {
45 | $good &&= $count == $qf->get($mer) or
46 | (ok($good, "Query mer") || last);
47 | }
48 | ok($good, "Query identical to read");
49 | }
50 |
51 | done_testing;
52 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/perl5/t/test_string_mers.t:
--------------------------------------------------------------------------------
1 | use strict;
2 | use warnings;
3 | use Test::More;
4 |
5 | require_ok('jellyfish');
6 | jellyfish::MerDNA::k(int(rand(100)) + 10);
7 |
8 | my @bases = ("A", "C", "G", "T", "a", "c", "g", "t");
9 | my $str;
10 | for(my $i = 0; $i < 1000; $i++) {
11 | $str .= $bases[int(rand(8))];
12 | }
13 |
14 | my $count = 0;
15 | my $m2 = jellyfish::MerDNA->new;
16 | my $mers = jellyfish::string_mers($str);
17 | my $good_mers = 1;
18 | my $good_strs = 1;
19 | while($mers->next_mer) {
20 | my $mstr = uc(substr($str, $count, jellyfish::MerDNA::k()));
21 | $m2->set($mstr);
22 | $good_strs &&= $mers->mer == $m2;
23 | $good_mers &&= $mers->mer eq $mstr;
24 | $count++;
25 | }
26 | ok($good_mers, "Mers equal");
27 | ok($good_strs, "Strs equal");
28 | ok($count == length($str) - jellyfish::MerDNA::k() + 1, "Number of mers");
29 |
30 | done_testing;
31 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/python/test_hash_counter.py:
--------------------------------------------------------------------------------
1 | import unittest
2 | import sys
3 | import random
4 | import jellyfish
5 |
6 | class TestHashCounter(unittest.TestCase):
7 | def setUp(self):
8 | jellyfish.MerDNA.k(100)
9 | self.hash = jellyfish.HashCounter(1024, 5)
10 |
11 | def test_info(self):
12 | self.assertEqual(100, jellyfish.MerDNA.k())
13 | self.assertEqual(1024, self.hash.size())
14 | self.assertEqual(5, self.hash.val_len())
15 |
16 | def test_add(self):
17 | mer = jellyfish.MerDNA()
18 | good = True
19 | for i in range(1000):
20 | mer.randomize()
21 | val = random.randrange(1000)
22 | good = good and self.hash.add(mer, val)
23 | if not good: break
24 | if i % 3 > 0:
25 | nval = random.randrange(1000)
26 | val = val + nval
27 | if i % 3 == 1:
28 | good = good and (not self.hash.add(mer, nval))
29 | else:
30 | good = good and self.hash.update_add(mer, nval)
31 | if not good: break
32 | good = good and (val == self.hash.get(mer)) and (val == self.hash[mer])
33 | if not good: break
34 | self.assertTrue(good)
35 |
36 |
37 | if __name__ == '__main__':
38 | data = sys.argv.pop(1)
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/python/test_mer_file.py:
--------------------------------------------------------------------------------
1 | import jellyfish
2 | import unittest
3 | import sys
4 | import os
5 | from collections import Counter
6 |
7 | class TestMerFile(unittest.TestCase):
8 | def setUp(self):
9 | self.mf = jellyfish.ReadMerFile(os.path.join(data, "swig_python.jf"))
10 |
11 | def test_histo(self):
12 | histo = Counter()
13 | while self.mf.next_mer():
14 | histo[self.mf.count()] += 1
15 |
16 | jf_histo = Counter()
17 | with open(os.path.join(data, "swig_python.histo")) as f:
18 | for line in f:
19 | num, count = [int(n) for n in line.split()]
20 | self.assertEqual(count, histo[num])
21 |
22 | def test_dump(self):
23 | good = True
24 | with open(os.path.join(data, "swig_python.dump")) as f:
25 | for line in f:
26 | good = good and self.mf.next_mer()
27 | if not good: break
28 | a = line.split()
29 | good = good and a[0] == str(self.mf.mer()) and int(a[1]) == self.mf.count()
30 | if not good: break
31 | self.assertTrue(good)
32 |
33 | def test_iter(self):
34 | good = True
35 | with open(os.path.join(data, "swig_python.dump")) as f:
36 | for mer, count in self.mf:
37 | line = f.readline()
38 | good = good and line
39 | if not good: break
40 | fmer, fcount = line.split()
41 | good = good and fmer == str(mer) and int(fcount) == count
42 | if not good: break
43 | self.assertTrue(good)
44 | line = f.readline()
45 | self.assertTrue(not line)
46 |
47 | def test_query(self):
48 | good = True
49 | qf = jellyfish.QueryMerFile(os.path.join(data, "swig_python.jf"))
50 | for mer, count in self.mf:
51 | good = good and count == qf[mer]
52 | if not good: break
53 | self.assertTrue(good)
54 |
55 | if __name__ == '__main__':
56 | data = sys.argv.pop(1)
57 | unittest.main()
58 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/python/test_string_mers.py:
--------------------------------------------------------------------------------
1 | import unittest
2 | import sys
3 | import random
4 | import jellyfish
5 |
6 | class TestStringMers(unittest.TestCase):
7 | def setUp(self):
8 | bases = "ACGTacgt"
9 | self.str = ''.join(random.choice(bases) for _ in range(1000))
10 | self.k = random.randint(10, 110)
11 | jellyfish.MerDNA.k(self.k)
12 |
13 | def test_all_mers(self):
14 | count = 0
15 | good = True
16 | mers = jellyfish.string_mers(self.str)
17 | for m in mers:
18 | m2 = jellyfish.MerDNA(self.str[count:count+self.k])
19 | good = good and m == m2
20 | count += 1
21 | self.assertTrue(good)
22 | self.assertEqual(len(self.str) - self.k + 1, count)
23 |
24 | def test_canonical_mers(self):
25 | good = True
26 | mers = jellyfish.string_canonicals(self.str)
27 | for count, m in enumerate(mers):
28 | m2 = jellyfish.MerDNA(self.str[count:count+self.k])
29 | rm2 = m2.get_reverse_complement()
30 | good = good and (m == m2 or m == rm2)
31 | good = good and (not (m > m2)) and (not (m > rm2))
32 | # count += 1
33 | self.assertTrue(good)
34 | self.assertEqual(len(self.str) - self.k + 0, count)
35 |
36 |
37 | if __name__ == '__main__':
38 | data = sys.argv.pop(1)
39 | unittest.main()
40 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/ruby/test_hash_counter.rb:
--------------------------------------------------------------------------------
1 | require 'minitest/autorun'
2 | require 'jellyfish'
3 |
4 | class TestHashCounter < MiniTest::Unit::TestCase
5 | def setup
6 | Jellyfish::MerDNA::k(100)
7 | @hash = Jellyfish::HashCounter.new(1024, 5)
8 | end
9 |
10 | def test_info
11 | assert_equal(100, Jellyfish::MerDNA::k)
12 | assert_equal(1024, @hash.size)
13 | assert_equal(5, @hash.val_len)
14 | # assert_equal(1, @hash.nb_threads)
15 | end
16 |
17 | def test_add
18 | mer = Jellyfish::MerDNA.new
19 |
20 | 1000.times { |i|
21 | mer.randomize!
22 | val = rand(1000)
23 | assert(@hash.add(mer, val))
24 | if i % 3 > 0
25 | nval = rand(1000)
26 | val += nval
27 | if i % 3 == 1
28 | assert(!@hash.add(mer, nval))
29 | else
30 | assert(@hash.update_add(mer, nval))
31 | end
32 | end
33 | assert_equal(val, @hash.get(mer))
34 | assert_equal(val, @hash[mer])
35 | }
36 |
37 | mer.randomize!
38 | assert_nil(@hash.get(mer))
39 | assert_nil(@hash[mer])
40 | assert(!@hash.update_add(mer, 1))
41 | end
42 | end
43 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/ruby/test_mer_file.rb:
--------------------------------------------------------------------------------
1 | require 'minitest/autorun'
2 | require 'jellyfish'
3 |
4 | $data = ARGV.shift
5 |
6 | class TestMerFile < MiniTest::Unit::TestCase
7 | def setup
8 | @mf = Jellyfish::ReadMerFile.new(File.join($data, "swig_ruby.jf"))
9 | end
10 |
11 | def test_histo
12 | histo = []
13 | histo[@mf.count] = (histo[@mf.count] || 0) + 1 while @mf.next_mer
14 |
15 | jf_histo = []
16 | open(File.join($data, "swig_ruby.histo")) { |f|
17 | f.each_line.each { |l|
18 | freq, count = l.split.map {|x| x.to_i }
19 | jf_histo[freq] = count
20 | }
21 | }
22 |
23 | assert_equal jf_histo, histo
24 | end
25 |
26 | def test_each
27 | open(File.join($data, "swig_ruby.dump")) { |f|
28 | @mf.each { |m, c|
29 | l = f.readline
30 | assert l
31 | fm, fc = l.split
32 | assert_equal fm, m.to_s
33 | assert_equal fc.to_i, c
34 | }
35 | assert_raises(EOFError) { f.readline }
36 | }
37 | end
38 |
39 | def test_dump
40 | open(File.join($data, "swig_ruby.dump")) { |f|
41 | f.each_line.each { |l|
42 | mer, count = l.split
43 | assert @mf.next_mer
44 | assert_equal(mer, @mf.mer.to_s)
45 | assert_equal(count.to_i, @mf.count)
46 | }
47 | }
48 | assert !@mf.next_mer
49 | end
50 |
51 | def test_query
52 | query = Jellyfish::QueryMerFile.new(File.join($data, "swig_ruby.jf"))
53 | @mf.each { |m, c|
54 | assert_equal c, query[m]
55 | }
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/swig/ruby/test_string_mers.rb:
--------------------------------------------------------------------------------
1 | require 'minitest/autorun'
2 | require 'jellyfish'
3 |
4 | class TestStringMers < MiniTest::Unit::TestCase
5 | def setup
6 | bases = "ACGTacgt"
7 | @str = (0..1000).map { bases[rand(bases.size())] }.join("")
8 | Jellyfish::MerDNA::k(rand(100) + 10)
9 | end
10 |
11 | def test_all_mers
12 | count = 0
13 | m2 = Jellyfish::MerDNA.new
14 |
15 | @str.mers.each_with_index { |m, i|
16 | assert_equal m.to_s, @str[i, Jellyfish::MerDNA::k()].upcase
17 | m2.set @str[i, Jellyfish::MerDNA::k()]
18 | assert_equal m2, m
19 | count += 1
20 | }
21 | assert_equal @str.size - Jellyfish::MerDNA::k() + 1, count
22 | end
23 |
24 | def test_canonical_mers
25 | count = 0
26 | m2 = Jellyfish::MerDNA.new
27 | @str.canonicals { |m|
28 | m2.set @str[count, Jellyfish::MerDNA::k()]
29 | cm2 = m2.get_reverse_complement
30 | assert(m2 == m || m == cm2)
31 | assert(!(m > m2) && !(m > cm2));
32 | count += 1
33 | }
34 | assert_equal @str.size - Jellyfish::MerDNA::k() + 1, count
35 | end
36 | end
37 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/big.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 |
6 | if [ -z "$BIG" ]; then
7 | echo "Skip big test"
8 | exit 77
9 | fi
10 |
11 | sort -k2,2 > ${pref}.md5sum < ${pref}_31.histo && \
18 |
19 | echo "Count k-mers on big data set" && \
20 | ([ -f seq30g.fa ] || ${DIR}/generate_sequence -v -o seq30g -r 1000 -s 1602176487 30000000000) &&
21 | $JF count -m 16 -s 4000000000 -o ${pref}_16.jf -c 4 -p 253 -C --out-counter-len 2 \
22 | -t $nCPUs $JFPARAM seq30g.fa && \
23 | $JF histo ${pref}_16.jf > ${pref}_16.histo && \
24 | check ${pref}.md5sum
25 | RET=$?
26 |
27 | # echo "16-mer timing"; cat ${pref}_16.timing
28 |
29 | exit $RET
30 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/bloom_counter.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 |
6 | sort -k2,2 > ${pref}.md5sum < ${pref}_commands < ${pref}_none.histo
24 |
25 | $JF histo ${pref}.jf > ${pref}.histo
26 | $JF histo ${pref}_filtered.jf > ${pref}_filtered.histo
27 |
28 | TOTAL=$(cut -d\ -f2 ${pref}.histo)
29 | COLLISION=$(cut -d\ -f2 ${pref}_none.histo)
30 | # FPR is 1 in 1000. Should not get more than 1/500 collisions.
31 | [ $((TOTAL / 500 > COLLISION)) = 1 ] || {
32 | echo >&2 "Too many collisions"
33 | false
34 | }
35 |
36 | QUERY_TOT=$($JF query -s seq1m_0.fa ${pref}.bc | grep -c ' 2$')
37 | [ $QUERY_TOT = $TOTAL ] || {
38 | echo >&2 "Queried count 2 mers should be all mers"
39 | false
40 | }
41 | QUERY_COL=$($JF query -s seq1m_0.fa ${pref}_none.bc | grep -c ' 2$')
42 | [ $QUERY_COL = $COLLISION ] || {
43 | echo >&2 "Queried count 2 mers should equal collisions"
44 | false
45 | }
46 |
47 | check ${pref}.md5sum
48 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/bloom_filter.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 |
6 | # sort -k2,2 > ${pref}.md5sum < ${pref}_10m.histo
11 | COLLISIONS=$(cut -d\ -f2 ${pref}_10m.histo | paste -sd+ - | bc)
12 | [ $((COLLISIONS > 10000)) = 0 ] || {
13 | echo >& "Too many collisions"
14 | false
15 | }
16 |
17 | $JF count --bf-size 3M --bf-fp 0.001 -t $nCPUs -o ${pref}_3m.jf -s 1M -m 40 seq1m_0.fa seq1m_1.fa seq1m_0.fa seq1m_2.fa
18 | $JF histo ${pref}_3m.jf > ${pref}_3m.histo
19 | COLLISIONS=$(cut -d\ -f2 ${pref}_3m.histo | paste -sd+ - | bc)
20 | [ $((COLLISIONS - 1000000 > 20000)) = 0 ] || {
21 | echo >& "Too many collisions"
22 | false
23 | }
24 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/generate_sequence.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 |
6 | ${DIR}/generate_sequence -v -o seq10m -m 10 -m 22 -s 3141592653 10000000
7 | ${DIR}/generate_sequence -v -o seq1m -s 1040104553 1000000 1000000 1000000 1000000 1000000
8 |
9 | for i in 0 1 2 3 4; do
10 | gzip -c seq1m_$i.fa > seq1m_$i.fa.gz
11 | done
12 |
13 | ${DIR}/generate_sequence -v -q -o seq10m -s 1473540700 10000000
14 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/large_key.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 |
6 | sort -k2,2 > ${pref}.md5sum < ${pref}_m100_2M_ordered
14 | head -n 10001 seq1m_0.fa | time $JF count -t $nCPUs -o ${pref}_m100_2k.jf -s 2k -m 100 /dev/fd/0
15 | $JF dump -c ${pref}_m100_2k.jf | cut -d\ -f 1 | sort > ${pref}_m100_2k_ordered
16 | head -n 10001 seq1m_0.fa | time $JF count -t $nCPUs -o ${pref}_m100_2k_disk.jf -s 2k --disk -m 100 /dev/fd/0
17 | $JF dump -c ${pref}_m100_2k_disk.jf | cut -d\ -f 1 | sort > ${pref}_m100_2k_disk_ordered
18 | check ${pref}.md5sum
19 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/merge.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 |
6 | sort -k2,2 > ${pref}.md5sum < ${pref}_m40_s16m.histo
16 |
17 | ls | grep "^${pref}_m40_s1m[0-9].*" | xargs rm -f
18 | echo $FILES | xargs $JF count -t $nCPUs -o ${pref}_m40_s1m -s 1M --disk --no-merge -C -m 40
19 | $JF merge -o ${pref}_m40_s1m_merged.jf ${pref}_m40_s1m[0-9]*
20 | ls | grep "^${pref}_m40_s1m[0-9].*" | xargs rm -f
21 |
22 | echo $FILES | xargs $JF count -t $nCPUs -o ${pref}_automerge_m40_s1m.jf -s 1M --disk -C -m 40
23 |
24 | echo $FILES | xargs $JF count -t $nCPUs -o ${pref}_m40_s1m_text.jf -s 1M --text --disk -C -m 40
25 |
26 | $JF histo ${pref}_automerge_m40_s1m.jf > ${pref}_automerge_m40_s1m.histo
27 | $JF histo ${pref}_m40_s1m_merged.jf > ${pref}_m40_s1m_merged.histo
28 | $JF histo ${pref}_m40_s1m_text.jf > ${pref}_m40_s1m_text.histo
29 |
30 | check ${pref}.md5sum
31 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/multi_file.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 |
6 | sort -k2,2 > ${pref}.md5sum < ${pref}_m15_s2M.histo
14 |
15 | cat > ${pref}_gunzip_cmds <> ${pref}_gunzip_cmds
22 | $JF count -t $nCPUs -g ${pref}_gunzip_cmds -G 2 -C -m 15 -s 2M -o ${pref}_m15_s2M_zip.jf seq10m.fa
23 | $JF histo ${pref}_m15_s2M_zip.jf > ${pref}_m15_s2M_zip.histo
24 |
25 | # Test failure of generator
26 | echo false > ${pref}_fail_cmds
27 | STATUS=
28 | $JF count -t $nCPUs -g ${pref}_fail_cmds -G 2 -C -m 15 -s 2M -o ${pref}_fail.jf || STATUS=$?
29 | if [ -z "$STATUS" ]; then
30 | echo >&2 "Jellyfish did not report failure in generator command"
31 | false
32 | fi
33 |
34 | # Test failure to open file
35 | STATUS=
36 | $JF count -t $nCPUs -C -m 15 -s 2M -o ${pref}_fail.jf non_existent_sequence.fa || STATUS=$?
37 | if [ -z "$STATUS" ]; then
38 | echo >&2 "Jellyfish did not report failure in opening a file"
39 | false
40 | fi
41 |
42 | check ${pref}.md5sum
43 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/subset_hashing.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests/
4 | . ./compat.sh
5 |
6 | sort -k2,2 > ${pref}.md5sum < ${pref}_m35_s2M_if.histo
14 |
15 | # Idem with 10-mers
16 | $JF count -t $nCPUs -o ${pref}_m10_s2M_if.jf -s 6M -C -m 10 --if seq1m_0.fa --if seq1m_2.fa seq1m_1.fa seq1m_0.fa seq1m_3.fa seq1m_2.fa
17 | $JF histo ${pref}_m10_s2M_if.jf > ${pref}_m10_s2M_if.histo
18 |
19 | check ${pref}.md5sum
20 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/swig_perl.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 | [ -z "$ENABLE_PERL_BINDING" ] && exit 77
6 |
7 | LOADPATH="$BUILDDIR/swig/perl5"
8 | K=$($PERL -e 'print(int(rand(16)) + 6)')
9 | I=$($PERL -e 'print(int(rand(5)))')
10 | $JF count -m $K -s 10M -t $nCPUs -C -o ${pref}.jf seq1m_$I.fa
11 | $JF dump -c ${pref}.jf > ${pref}.dump
12 | $JF histo ${pref}.jf > ${pref}.histo
13 |
14 | for i in test_mer_file.t test_hash_counter.t test_string_mers.t; do
15 | echo Test $i
16 | $PERL "-I$LOADPATH/.libs" "-I$LOADPATH" "-I$SRCDIR/swig/perl5" "$SRCDIR/swig/perl5/t/$i" .
17 | done
18 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/swig_python.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 | [ -z "$ENABLE_PYTHON_BINDING" ] && exit 77
6 |
7 | export PYTHONPATH="$BUILDDIR/swig/python/.libs:$BUILDDIR/swig/python${PYTHONPATH+:$PYTHONPATH}"
8 | K=$($PYTHON -c 'import random; print(random.randint(6, 20))')
9 | I=$($PYTHON -c 'import random; print(random.randint(0, 4))')
10 | $JF count -m $K -s 10M -t $nCPUs -C -o ${pref}.jf seq1m_$I.fa
11 | $JF dump -c ${pref}.jf > ${pref}.dump
12 | $JF histo ${pref}.jf > ${pref}.histo
13 |
14 | for i in test_mer_file.py test_hash_counter.py test_string_mers.py; do
15 | echo Test $i
16 | $PYTHON "$SRCDIR/swig/python/$i" .
17 | done
18 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/tests/swig_ruby.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | cd tests
4 | . ./compat.sh
5 | [ -z "$ENABLE_RUBY_BINDING" ] && exit 77
6 |
7 | LOADPATH="$BUILDDIR/swig/ruby/.libs"
8 | K=$($RUBY -e 'print(rand(15) + 6)')
9 | I=$($RUBY -e 'print(rand(5))')
10 | $JF count -m $K -s 10M -t $nCPUs -C -o ${pref}.jf seq1m_$I.fa
11 | $JF dump -c ${pref}.jf > ${pref}.dump
12 | $JF histo ${pref}.jf > ${pref}.histo
13 |
14 |
15 |
16 | for i in test_mer_file.rb test_hash_counter.rb test_string_mers.rb; do
17 | echo Test $i
18 | $RUBY "-I$LOADPATH" "$SRCDIR/swig/ruby/$i" .
19 | done
20 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/gtest/src/gtest_main.cc:
--------------------------------------------------------------------------------
1 | // Copyright 2006, Google Inc.
2 | // All rights reserved.
3 | //
4 | // Redistribution and use in source and binary forms, with or without
5 | // modification, are permitted provided that the following conditions are
6 | // met:
7 | //
8 | // * Redistributions of source code must retain the above copyright
9 | // notice, this list of conditions and the following disclaimer.
10 | // * Redistributions in binary form must reproduce the above
11 | // copyright notice, this list of conditions and the following disclaimer
12 | // in the documentation and/or other materials provided with the
13 | // distribution.
14 | // * Neither the name of Google Inc. nor the names of its
15 | // contributors may be used to endorse or promote products derived from
16 | // this software without specific prior written permission.
17 | //
18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 | #include
31 |
32 | #include "gtest/gtest.h"
33 |
34 | GTEST_API_ int main(int argc, char **argv) {
35 | printf("Running main() from gtest_main.cc\n");
36 | testing::InitGoogleTest(&argc, argv);
37 | return RUN_ALL_TESTS();
38 | }
39 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_allocators_mmap.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | namespace {
5 | TEST(AllocMmap, Simple) {
6 | static const size_t size = 4096;
7 | allocators::mmap mem(size);
8 |
9 | EXPECT_EQ(size, mem.get_size());
10 | EXPECT_NE((void*)0, mem.get_ptr());
11 | char* ptr = (char*)mem.get_ptr();
12 | // char c = ptr[size];
13 | // EXPECT_EQ((char)0, c);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_atomic_bits_array.cc:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | namespace {
8 | TEST(AtomicBitsArray, Fill) {
9 | static const size_t size = 2066;
10 | static const int bits = 3;
11 | jellyfish::atomic_bits_array ary(bits, size);
12 | std::unique_ptr data(new unsigned char[size]);
13 |
14 | for(size_t i = 0; i < size; ++i) {
15 | data[i] = random_bits(bits);
16 | auto e = ary[i];
17 | e.get();
18 | EXPECT_TRUE(e.set(data[i]));
19 | }
20 |
21 | auto it = ary.begin();
22 | auto it_end = ary.end();
23 | for(size_t i = 0; i < size; ++i, ++it) {
24 | auto e = ary[i];
25 | EXPECT_EQ(data[i], e.get());
26 | EXPECT_EQ(data[i], (unsigned char)e);
27 | ASSERT_NE(it_end, it);
28 | EXPECT_EQ(data[i], *it);
29 | }
30 | EXPECT_EQ(it_end, it);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_cooperative_pool2.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | namespace {
6 | // Generate all numbers in [0, producers * max)
7 | class sequence : public jellyfish::cooperative_pool2 {
8 | typedef jellyfish::cooperative_pool2 super;
9 |
10 | const uint32_t max_;
11 | std::vector cur_;
12 | const uint32_t producers_;
13 |
14 | public:
15 | std::vector check_;
16 | sequence(uint32_t producers, uint32_t threads, uint32_t max) :
17 | super(producers, 3 * threads),
18 | max_(max),
19 | cur_(producers, 0),
20 | producers_(producers),
21 | check_(max * producers, 0)
22 | { }
23 |
24 | bool produce(uint32_t i, int& e) {
25 | assert(i < producers_);
26 | int& cur = cur_[i];
27 | if(cur < max_) {
28 | e = i * max_ + cur++;
29 | __sync_add_and_fetch(&check_[e], 1);
30 | return false;
31 | }
32 | return true;
33 | }
34 | };
35 |
36 | class list_ints : public jellyfish::thread_exec {
37 | sequence seq_;
38 | std::vector check_;
39 | public:
40 | list_ints(uint32_t producers, uint32_t threads, uint32_t max) : seq_(producers, threads, max), check_(producers * max, 0) { }
41 | virtual void start(int i) {
42 | while(true) {
43 | sequence::job j(seq_);
44 | if(j.is_empty())
45 | break;
46 | ++check_[*j];
47 | }
48 | }
49 |
50 | bool check() const {
51 | for(auto it = check_.cbegin(); it != check_.cend(); ++it)
52 | if(*it != 1)
53 | return false;
54 | return true;
55 | }
56 |
57 | bool check_print() const {
58 | if(check())
59 | return true;
60 |
61 | for(auto it = check_.cbegin(); it != check_.cend(); ++it)
62 | printf("%d", *it);
63 | printf("\n----------\n");
64 | for(auto it = seq_.check_.cbegin(); it != seq_.check_.cend(); ++it)
65 | printf("%d", *it);
66 | printf("\n");
67 | return false;
68 | }
69 | };
70 |
71 | class CooperativePoolTest : public ::testing::TestWithParam {
72 | public:
73 | static const uint32_t nb_threads = 10;
74 | CooperativePoolTest() : workers(GetParam(), nb_threads, 1000) { }
75 |
76 | protected:
77 | list_ints workers;
78 | };
79 |
80 | TEST_P(CooperativePoolTest, Ints) {
81 | workers.exec_join(nb_threads);
82 | EXPECT_TRUE(workers.check_print());
83 | }
84 |
85 | INSTANTIATE_TEST_CASE_P(CooperativePool,
86 | CooperativePoolTest,
87 | ::testing::Range((uint32_t)1, CooperativePoolTest::nb_threads + 1));
88 |
89 | } // namespace {
90 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_file_header.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 |
9 | namespace {
10 | using jellyfish::file_header;
11 | using jellyfish::RectangularBinaryMatrix;
12 | using std::ostringstream;
13 | using std::istringstream;
14 | using std::string;
15 |
16 | TEST(FileHeader, Standard) {
17 | file_header h;
18 |
19 | EXPECT_EQ("", h["hostname"]);
20 | EXPECT_EQ("", h["pwd"]);
21 | EXPECT_EQ("", h["time"]);
22 | EXPECT_EQ("", h["exe_path"]);
23 |
24 | h.fill_standard();
25 |
26 | EXPECT_NE("", h["hostname"]);
27 | EXPECT_NE("", h["pwd"]);
28 | EXPECT_NE("", h["time"]);
29 | EXPECT_NE("", h["exe_path"]);
30 | }
31 |
32 | TEST(FileHeader, WriteRead) {
33 | file_header hw;
34 | ostringstream os;
35 | os.fill('A');
36 | os.width(20);
37 | os << std::hex;
38 | std::ios::fmtflags flags = os.flags();
39 | const size_t random_size = random_bits(35);
40 | const unsigned int val_len = random_bits(4);
41 | const unsigned int max_reprobe = random_bits(7);
42 | const double fpr = (double)random_bits(10) / 1024.0;
43 | RectangularBinaryMatrix m(random_bits(6) + 1, random_bits(8) + 1);
44 | m.randomize(random_bits);
45 |
46 | EXPECT_EQ(8, hw.alignment());
47 | hw.fill_standard();
48 | hw.size(random_size);
49 | hw.matrix(m);
50 | hw.key_len(m.r());
51 | hw.val_len(val_len);
52 | hw.max_reprobe(max_reprobe);
53 | hw.set_reprobes(jellyfish::quadratic_reprobes);
54 | hw.fpr(fpr);
55 | hw.write(os);
56 | EXPECT_EQ(0, os.tellp() % 8);
57 | EXPECT_EQ('A', os.fill());
58 | EXPECT_EQ(20, os.width());
59 | EXPECT_EQ(flags, os.flags());
60 | os.width(0);
61 | const string ah("After header");
62 | os << ah;
63 |
64 | // std::cerr << os.str() << "\n";
65 | istringstream is(os.str());
66 |
67 | file_header hr;
68 | EXPECT_TRUE(hr.read(is));
69 | EXPECT_EQ(is.tellg(), hr.offset());
70 | EXPECT_EQ(0, is.tellg() % 8);
71 | EXPECT_EQ(8, hr.alignment());
72 | EXPECT_EQ(random_size, hr.size());
73 | EXPECT_EQ(m, hr.matrix());
74 | EXPECT_EQ(m.r(), hr.key_len());
75 | EXPECT_EQ(val_len, hr.val_len());
76 | EXPECT_EQ(fpr, hr.fpr());
77 |
78 | size_t reprobes[max_reprobe + 1];
79 | hr.get_reprobes(reprobes);
80 | for(unsigned int i = 0; i <= max_reprobe; ++i)
81 | EXPECT_EQ(jellyfish::quadratic_reprobes[i], reprobes[i]);
82 |
83 | // Not sure why the following fails. But all the fields come out
84 | // equal so ignore for now
85 | // EXPECT_EQ(hw, hr);
86 | string line;
87 | getline(is, line);
88 | EXPECT_EQ(ah, line);
89 | }
90 | } // namespace {
91 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_int128.cc:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #ifdef HAVE_INT128
5 | #include
6 | #include
7 |
8 | namespace {
9 | TEST(Int128, Specialized) {
10 | // This is supposed to be true, whether it is specialized by gcc or
11 | // in int128.hpp above.
12 | EXPECT_TRUE(std::numeric_limits<__int128>::is_specialized);
13 | EXPECT_TRUE(std::numeric_limits::is_specialized);
14 | }
15 |
16 | TEST(Int128, Max) {
17 | static const __int128 sone = 1;
18 | static const unsigned __int128 uone = 1;
19 | __int128 sm = std::numeric_limits<__int128>::max();
20 | unsigned __int128 um = std::numeric_limits::max();
21 |
22 | for(int i = 0; i < 127; ++i, sm >>= 1, um >>= 1) {
23 | EXPECT_EQ(1, (int)(sm & sone));
24 | EXPECT_EQ(1, (int)(um & uone));
25 | EXPECT_EQ(1, (int)((std::numeric_limits<__int128>::max() >> i) & sone));
26 | EXPECT_EQ(1, (int)((std::numeric_limits::max() >> i) & uone));
27 | }
28 |
29 | EXPECT_EQ(0, (int)sm);
30 | EXPECT_EQ(1, (int)um);
31 | }
32 | } // namespace
33 |
34 | #endif // HAVE_INT128
35 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_main.cc:
--------------------------------------------------------------------------------
1 | /* This file is part of Jellyfish.
2 |
3 | Jellyfish is free software: you can redistribute it and/or modify
4 | it under the terms of the GNU General Public License as published by
5 | the Free Software Foundation, either version 3 of the License, or
6 | (at your option) any later version.
7 |
8 | Jellyfish is distributed in the hope that it will be useful,
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 | GNU General Public License for more details.
12 |
13 | You should have received a copy of the GNU General Public License
14 | along with Jellyfish. If not, see .
15 | */
16 |
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 |
25 | template
26 | struct floorLog2 {
27 | static const int val = floorLog2::val + 1;
28 | };
29 | template<>
30 | struct floorLog2<1> {
31 | static const int val = 0;
32 | };
33 |
34 | // Return length random bits. 1 <= length <= 64
35 | uint64_t random_bits(int length) {
36 | uint64_t res = 0;
37 | for(int i = 0; i < length; i += floorLog2::val)
38 | res ^= (uint64_t)random() << i;
39 | return res & ((uint64_t)-1 >> (64 - length));
40 | }
41 |
42 |
43 | int main(int argc, char *argv[]) {
44 | ::testing::InitGoogleTest(&argc, argv);
45 | cmdline_parse args(argc, argv);
46 |
47 | unsigned int seed;
48 | if(args.seed_given) {
49 | seed = args.seed_arg;
50 | } else {
51 | std::ifstream urandom("/dev/urandom");
52 | urandom.read((char*)&seed, sizeof(seed));
53 | if(!urandom.good()) {
54 | std::cerr << "Failed to read random seed" << std::endl;
55 | return 1;
56 | }
57 | }
58 | if(args.backtrace_flag) {
59 | show_backtrace();
60 | setenv("GTEST_CATCH_EXCEPTIONS", "0", 1);
61 | }
62 |
63 | std::cout << "Using random seed " << seed << std::endl;
64 | srandom(seed);
65 |
66 | return RUN_ALL_TESTS();
67 | }
68 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_main.hpp:
--------------------------------------------------------------------------------
1 | #ifndef __TEST_MAIN_HPP__
2 | #define __TEST_MAIN_HPP__
3 |
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | uint64_t random_bits(int length);
11 | inline uint64_t random_bits() { return random_bits(64); }
12 |
13 | struct file_unlink {
14 | std::string path;
15 | bool do_unlink;
16 | explicit file_unlink(const char* s, bool d = true) : path(s), do_unlink(d) { }
17 | explicit file_unlink(const std::string& s, bool d = true) : path(s), do_unlink(d) { }
18 |
19 | ~file_unlink() {
20 | if(do_unlink)
21 | unlink(path.c_str());
22 | }
23 | };
24 |
25 | #endif /* __TEST_MAIN_HPP__ */
26 |
27 |
--------------------------------------------------------------------------------
/SuperReads_RNA/global-1/jellyfish/unit_tests/test_mapped_file.cc:
--------------------------------------------------------------------------------
1 | #include