finishm 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.gitmodules +3 -0
- data/.rspec +1 -0
- data/Gemfile +31 -0
- data/LICENSE.txt +20 -0
- data/README.md +59 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/bin/assembly_visualiser +106 -0
- data/bin/check_primer_combinations.rb +73 -0
- data/bin/contig_joiner.rb +244 -0
- data/bin/contigs_against_assembly.rb +153 -0
- data/bin/finishm +143 -0
- data/bin/finishm_assembler +55 -0
- data/bin/finishm_gap_closer.rb +241 -0
- data/bin/kmer_abundance_file_tool.rb +49 -0
- data/bin/kmer_pattern_to_assembly.rb +377 -0
- data/bin/kmer_profile_finder.rb +92 -0
- data/bin/kmers_count_parse.d +52 -0
- data/bin/kmers_count_tabulate.d +123 -0
- data/bin/kmers_count_tabulate.rb +84 -0
- data/bin/pcr_result_parser.rb +108 -0
- data/bin/primer_finder.rb +119 -0
- data/bin/read_selection_by_kmer.d +174 -0
- data/bin/scaffold_by_pattern.rb +119 -0
- data/bin/scaffold_connection_possibilities_to_knowns.rb +193 -0
- data/bin/scaffold_end_coverages.rb +69 -0
- data/bin/trail_validator.rb +84 -0
- data/ext/mkrf_conf.rb +56 -0
- data/ext/src/Makefile +140 -0
- data/ext/src/src/allocArray.c +305 -0
- data/ext/src/src/allocArray.h +86 -0
- data/ext/src/src/autoOpen.c +107 -0
- data/ext/src/src/autoOpen.h +18 -0
- data/ext/src/src/binarySequences.c +813 -0
- data/ext/src/src/binarySequences.h +125 -0
- data/ext/src/src/concatenatedGraph.c +233 -0
- data/ext/src/src/concatenatedGraph.h +30 -0
- data/ext/src/src/concatenatedPreGraph.c +262 -0
- data/ext/src/src/concatenatedPreGraph.h +29 -0
- data/ext/src/src/correctedGraph.c +2643 -0
- data/ext/src/src/correctedGraph.h +32 -0
- data/ext/src/src/dfib.c +509 -0
- data/ext/src/src/dfib.h +69 -0
- data/ext/src/src/dfibHeap.c +89 -0
- data/ext/src/src/dfibHeap.h +39 -0
- data/ext/src/src/dfibpriv.h +105 -0
- data/ext/src/src/fib.c +628 -0
- data/ext/src/src/fib.h +78 -0
- data/ext/src/src/fibHeap.c +79 -0
- data/ext/src/src/fibHeap.h +41 -0
- data/ext/src/src/fibpriv.h +110 -0
- data/ext/src/src/globals.h +154 -0
- data/ext/src/src/graph.c +3932 -0
- data/ext/src/src/graph.h +233 -0
- data/ext/src/src/graphReConstruction.c +1472 -0
- data/ext/src/src/graphReConstruction.h +30 -0
- data/ext/src/src/graphStats.c +2167 -0
- data/ext/src/src/graphStats.h +72 -0
- data/ext/src/src/graphStructures.h +52 -0
- data/ext/src/src/kmer.c +652 -0
- data/ext/src/src/kmer.h +73 -0
- data/ext/src/src/kmerOccurenceTable.c +236 -0
- data/ext/src/src/kmerOccurenceTable.h +44 -0
- data/ext/src/src/kseq.h +223 -0
- data/ext/src/src/locallyCorrectedGraph.c +557 -0
- data/ext/src/src/locallyCorrectedGraph.h +40 -0
- data/ext/src/src/passageMarker.c +677 -0
- data/ext/src/src/passageMarker.h +137 -0
- data/ext/src/src/preGraph.c +1717 -0
- data/ext/src/src/preGraph.h +106 -0
- data/ext/src/src/preGraphConstruction.c +990 -0
- data/ext/src/src/preGraphConstruction.h +26 -0
- data/ext/src/src/probe_node_finder.c +84 -0
- data/ext/src/src/probe_node_finder.h +6 -0
- data/ext/src/src/readCoherentGraph.c +557 -0
- data/ext/src/src/readCoherentGraph.h +30 -0
- data/ext/src/src/readSet.c +1734 -0
- data/ext/src/src/readSet.h +67 -0
- data/ext/src/src/readToNode.c +218 -0
- data/ext/src/src/readToNode.h +35 -0
- data/ext/src/src/recycleBin.c +199 -0
- data/ext/src/src/recycleBin.h +58 -0
- data/ext/src/src/roadMap.c +342 -0
- data/ext/src/src/roadMap.h +65 -0
- data/ext/src/src/run.c +318 -0
- data/ext/src/src/run.h +52 -0
- data/ext/src/src/run2.c +744 -0
- data/ext/src/src/runReadToNode.c +29 -0
- data/ext/src/src/scaffold.c +1876 -0
- data/ext/src/src/scaffold.h +64 -0
- data/ext/src/src/shortReadPairs.c +1243 -0
- data/ext/src/src/shortReadPairs.h +32 -0
- data/ext/src/src/splay.c +259 -0
- data/ext/src/src/splay.h +43 -0
- data/ext/src/src/splayTable.c +1315 -0
- data/ext/src/src/splayTable.h +31 -0
- data/ext/src/src/tightString.c +362 -0
- data/ext/src/src/tightString.h +82 -0
- data/ext/src/src/utility.c +199 -0
- data/ext/src/src/utility.h +98 -0
- data/ext/src/third-party/zlib-1.2.3/ChangeLog +855 -0
- data/ext/src/third-party/zlib-1.2.3/FAQ +339 -0
- data/ext/src/third-party/zlib-1.2.3/INDEX +51 -0
- data/ext/src/third-party/zlib-1.2.3/Makefile +154 -0
- data/ext/src/third-party/zlib-1.2.3/Makefile.in +154 -0
- data/ext/src/third-party/zlib-1.2.3/README +125 -0
- data/ext/src/third-party/zlib-1.2.3/adler32.c +149 -0
- data/ext/src/third-party/zlib-1.2.3/adler32.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/algorithm.txt +209 -0
- data/ext/src/third-party/zlib-1.2.3/amiga/Makefile.pup +66 -0
- data/ext/src/third-party/zlib-1.2.3/amiga/Makefile.sas +65 -0
- data/ext/src/third-party/zlib-1.2.3/as400/bndsrc +132 -0
- data/ext/src/third-party/zlib-1.2.3/as400/compile.clp +123 -0
- data/ext/src/third-party/zlib-1.2.3/as400/readme.txt +111 -0
- data/ext/src/third-party/zlib-1.2.3/as400/zlib.inc +331 -0
- data/ext/src/third-party/zlib-1.2.3/compress.c +79 -0
- data/ext/src/third-party/zlib-1.2.3/compress.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/configure +459 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/README.contrib +71 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/buffer_demo.adb +106 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/mtest.adb +156 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/read.adb +156 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/readme.txt +65 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/test.adb +463 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-streams.adb +225 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-streams.ads +114 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-thin.adb +141 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib-thin.ads +450 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib.adb +701 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib.ads +328 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/ada/zlib.gpr +20 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm586/README.586 +43 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm586/match.S +364 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm686/README.686 +34 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/asm686/match.S +329 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/Makefile +8 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/README +4 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/blast.c +444 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/blast.h +71 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/test.pk +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/blast/test.txt +1 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/ZLib.pas +557 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/ZLibConst.pas +11 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/readme.txt +76 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/delphi/zlibd32.mak +93 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib.build +33 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib.chm +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib.sln +21 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/dotzlib/readme.txt +58 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/README +1 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/infback9.c +608 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/infback9.h +37 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inffix9.h +107 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inflate9.h +47 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inftree9.c +323 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/infback9/inftree9.h +55 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/inflate86/inffas86.c +1157 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/inflate86/inffast.S +1368 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream/test.cpp +24 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream/zfstream.cpp +329 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream/zfstream.h +128 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream2/zstream.h +307 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream2/zstream_test.cpp +25 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/README +35 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/TODO +17 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/test.cc +50 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/zfstream.cc +479 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/iostream3/zfstream.h +466 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masm686/match.asm +413 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/bld_ml64.bat +2 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/gvmat64.asm +513 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/gvmat64.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/inffas8664.c +186 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/inffasx64.asm +392 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/inffasx64.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx64/readme.txt +28 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/bld_ml32.bat +2 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/gvmat32.asm +972 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/gvmat32.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/gvmat32c.c +62 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/inffas32.asm +1083 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/inffas32.obj +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/mkasm.bat +3 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/masmx86/readme.txt +21 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/ChangeLogUnzip +67 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/Makefile +25 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/crypt.h +132 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/ioapi.c +177 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/ioapi.h +75 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/iowin32.c +270 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/iowin32.h +21 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/miniunz.c +585 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/minizip.c +420 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/mztools.c +281 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/mztools.h +31 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/unzip.c +1598 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/unzip.h +354 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/zip.c +1219 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/minizip/zip.h +235 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/example.pas +599 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/readme.txt +76 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/zlibd32.mak +93 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/pascal/zlibpas.pas +236 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/Makefile +8 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/README +63 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/puff.c +837 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/puff.h +31 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/puff/zeros.raw +0 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/testzlib/testzlib.c +275 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/testzlib/testzlib.txt +10 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/untgz/Makefile +14 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/untgz/Makefile.msc +17 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/untgz/untgz.c +674 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/readme.txt +73 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/miniunz.vcproj +126 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/minizip.vcproj +126 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/testzlib.vcproj +126 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlib.rc +32 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibstat.vcproj +246 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibvc.def +92 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibvc.sln +78 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc7/zlibvc.vcproj +445 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/miniunz.vcproj +566 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/minizip.vcproj +563 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/testzlib.vcproj +948 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/testzlibdll.vcproj +567 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlib.rc +32 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibstat.vcproj +870 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibvc.def +92 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibvc.sln +144 -0
- data/ext/src/third-party/zlib-1.2.3/contrib/vstudio/vc8/zlibvc.vcproj +1219 -0
- data/ext/src/third-party/zlib-1.2.3/crc32.c +423 -0
- data/ext/src/third-party/zlib-1.2.3/crc32.h +441 -0
- data/ext/src/third-party/zlib-1.2.3/crc32.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/deflate.c +1736 -0
- data/ext/src/third-party/zlib-1.2.3/deflate.h +331 -0
- data/ext/src/third-party/zlib-1.2.3/deflate.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/example +0 -0
- data/ext/src/third-party/zlib-1.2.3/example.c +565 -0
- data/ext/src/third-party/zlib-1.2.3/examples/README.examples +42 -0
- data/ext/src/third-party/zlib-1.2.3/examples/fitblk.c +233 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gun.c +693 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzappend.c +500 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzjoin.c +448 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzlog.c +413 -0
- data/ext/src/third-party/zlib-1.2.3/examples/gzlog.h +58 -0
- data/ext/src/third-party/zlib-1.2.3/examples/zlib_how.html +523 -0
- data/ext/src/third-party/zlib-1.2.3/examples/zpipe.c +191 -0
- data/ext/src/third-party/zlib-1.2.3/examples/zran.c +404 -0
- data/ext/src/third-party/zlib-1.2.3/gzio.c +1026 -0
- data/ext/src/third-party/zlib-1.2.3/gzio.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/infback.c +623 -0
- data/ext/src/third-party/zlib-1.2.3/infback.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/inffast.c +318 -0
- data/ext/src/third-party/zlib-1.2.3/inffast.h +11 -0
- data/ext/src/third-party/zlib-1.2.3/inffast.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/inffixed.h +94 -0
- data/ext/src/third-party/zlib-1.2.3/inflate.c +1368 -0
- data/ext/src/third-party/zlib-1.2.3/inflate.h +115 -0
- data/ext/src/third-party/zlib-1.2.3/inflate.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/inftrees.c +329 -0
- data/ext/src/third-party/zlib-1.2.3/inftrees.h +55 -0
- data/ext/src/third-party/zlib-1.2.3/inftrees.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/libz.a +0 -0
- data/ext/src/third-party/zlib-1.2.3/make_vms.com +461 -0
- data/ext/src/third-party/zlib-1.2.3/minigzip +0 -0
- data/ext/src/third-party/zlib-1.2.3/minigzip.c +322 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.bor +109 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.dj2 +104 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.emx +69 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.msc +106 -0
- data/ext/src/third-party/zlib-1.2.3/msdos/Makefile.tc +94 -0
- data/ext/src/third-party/zlib-1.2.3/old/Makefile.riscos +151 -0
- data/ext/src/third-party/zlib-1.2.3/old/README +3 -0
- data/ext/src/third-party/zlib-1.2.3/old/descrip.mms +48 -0
- data/ext/src/third-party/zlib-1.2.3/old/os2/Makefile.os2 +136 -0
- data/ext/src/third-party/zlib-1.2.3/old/os2/zlib.def +51 -0
- data/ext/src/third-party/zlib-1.2.3/old/visual-basic.txt +160 -0
- data/ext/src/third-party/zlib-1.2.3/old/zlib.html +971 -0
- data/ext/src/third-party/zlib-1.2.3/projects/README.projects +41 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/README.txt +73 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/example.dsp +278 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/minigzip.dsp +278 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/zlib.dsp +609 -0
- data/ext/src/third-party/zlib-1.2.3/projects/visualc6/zlib.dsw +59 -0
- data/ext/src/third-party/zlib-1.2.3/qnx/package.qpg +141 -0
- data/ext/src/third-party/zlib-1.2.3/trees.c +1219 -0
- data/ext/src/third-party/zlib-1.2.3/trees.h +128 -0
- data/ext/src/third-party/zlib-1.2.3/trees.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/uncompr.c +61 -0
- data/ext/src/third-party/zlib-1.2.3/uncompr.o +0 -0
- data/ext/src/third-party/zlib-1.2.3/win32/DLL_FAQ.txt +397 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.bor +107 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.emx +69 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.gcc +141 -0
- data/ext/src/third-party/zlib-1.2.3/win32/Makefile.msc +126 -0
- data/ext/src/third-party/zlib-1.2.3/win32/VisualC.txt +3 -0
- data/ext/src/third-party/zlib-1.2.3/win32/zlib.def +60 -0
- data/ext/src/third-party/zlib-1.2.3/win32/zlib1.rc +39 -0
- data/ext/src/third-party/zlib-1.2.3/zconf.h +332 -0
- data/ext/src/third-party/zlib-1.2.3/zconf.in.h +332 -0
- data/ext/src/third-party/zlib-1.2.3/zlib.3 +159 -0
- data/ext/src/third-party/zlib-1.2.3/zlib.h +1357 -0
- data/ext/src/third-party/zlib-1.2.3/zutil.c +318 -0
- data/ext/src/third-party/zlib-1.2.3/zutil.h +269 -0
- data/ext/src/third-party/zlib-1.2.3/zutil.o +0 -0
- data/lib/assembly/a_b_visualiser.rb +169 -0
- data/lib/assembly/acyclic_connection_finder.rb +81 -0
- data/lib/assembly/all_orfs.rb +615 -0
- data/lib/assembly/bad_format_writer.rb +46 -0
- data/lib/assembly/bam_probe_read_selector.rb +48 -0
- data/lib/assembly/bubbly_assembler.rb +842 -0
- data/lib/assembly/c_probe_node_finder.rb +38 -0
- data/lib/assembly/connection_interpreter.rb +350 -0
- data/lib/assembly/contig_printer.rb +400 -0
- data/lib/assembly/coverage_based_graph_filter.rb +68 -0
- data/lib/assembly/depth_first_search.rb +63 -0
- data/lib/assembly/dijkstra.rb +216 -0
- data/lib/assembly/fluffer.rb +253 -0
- data/lib/assembly/graph_explorer.rb +85 -0
- data/lib/assembly/graph_generator.rb +315 -0
- data/lib/assembly/height_finder.rb +355 -0
- data/lib/assembly/hybrid_velvet_graph.rb +70 -0
- data/lib/assembly/input_genome.rb +182 -0
- data/lib/assembly/kmer_coverage_based_path_filter.rb +65 -0
- data/lib/assembly/node_finder.rb +171 -0
- data/lib/assembly/oriented_node_trail.rb +507 -0
- data/lib/assembly/paired_end_assembler.rb +53 -0
- data/lib/assembly/paired_end_neighbour_finder.rb +176 -0
- data/lib/assembly/probed_graph.rb +105 -0
- data/lib/assembly/read_input.rb +79 -0
- data/lib/assembly/read_to_node.rb +37 -0
- data/lib/assembly/scaffold_breaker.rb +126 -0
- data/lib/assembly/sequence_hasher.rb +71 -0
- data/lib/assembly/single_coherent_paths_between_nodes.rb +533 -0
- data/lib/assembly/single_coherent_wanderer.rb +261 -0
- data/lib/assembly/single_ended_assembler.rb +441 -0
- data/lib/assembly/velvet_c_binding.rb +54 -0
- data/lib/assembly/velvet_graph_sequence_extractor.rb +123 -0
- data/lib/external/VERSION +1 -0
- data/lib/finishm/assemble.rb +224 -0
- data/lib/finishm/explore.rb +217 -0
- data/lib/finishm/finisher.rb +303 -0
- data/lib/finishm/fluff.rb +122 -0
- data/lib/finishm/gapfiller.rb +325 -0
- data/lib/finishm/orfs_finder.rb +88 -0
- data/lib/finishm/path_counter.rb +90 -0
- data/lib/finishm/primers.rb +425 -0
- data/lib/finishm/primers_check.rb +176 -0
- data/lib/finishm/roundup.rb +344 -0
- data/lib/finishm/sequence.rb +142 -0
- data/lib/finishm/visualise.rb +430 -0
- data/lib/finishm/wander.rb +270 -0
- data/lib/kmer_abundance_pattern.rb +79 -0
- data/lib/kmer_multi_abundance_file.rb +48 -0
- data/lib/oligo_designer.rb +88 -0
- data/lib/priner.rb +66 -0
- data/spec/acyclic_connection_finder_spec.rb +551 -0
- data/spec/all_orfs_spec.rb +443 -0
- data/spec/assemble_spec.rb +186 -0
- data/spec/bubbly_assembler_spec.rb +707 -0
- data/spec/c_node_finder_spec.rb +58 -0
- data/spec/connection_interpreter_spec.rb +284 -0
- data/spec/contig_printer_spec.rb +291 -0
- data/spec/coverage_based_graph_filter_spec.rb +102 -0
- data/spec/data/6_3e4e5e6e.1vANME.bam +0 -0
- data/spec/data/6_3e4e5e6e.1vANME.bam.bai +0 -0
- data/spec/data/acyclic_connection_finder/1/probes.fa +5 -0
- data/spec/data/acyclic_connection_finder/1/random1.fa +2 -0
- data/spec/data/acyclic_connection_finder/1/random1.sammy.fa.gz +0 -0
- data/spec/data/acyclic_connection_finder/1/random2.fa +2 -0
- data/spec/data/acyclic_connection_finder/1/random2.sammy.fa.gz +0 -0
- data/spec/data/assembly/1_simple_bubble_uneven_coverage/random3000.fa +39 -0
- data/spec/data/assembly/1_simple_bubble_uneven_coverage/random3000.slightly_changed.fa +39 -0
- data/spec/data/assembly/1_simple_bubble_uneven_coverage/reads_combined.fa.gz +0 -0
- data/spec/data/assembly_visualiser/Contig_6_1_to_250.fa.kmers31 +220 -0
- data/spec/data/assembly_visualiser/Contig_7_1_to_250.fa.kmers31 +220 -0
- data/spec/data/assembly_visualiser/Graph +46 -0
- data/spec/data/assembly_visualiser/start_kmers1 +2 -0
- data/spec/data/bands.csv +1 -0
- data/spec/data/c_probe_node_finder/1/CnyUnifiedSeq +0 -0
- data/spec/data/c_probe_node_finder/1/CnyUnifiedSeq.names +544 -0
- data/spec/data/c_probe_node_finder/1/Graph2 +668 -0
- data/spec/data/c_probe_node_finder/1/LastGraph +668 -0
- data/spec/data/c_probe_node_finder/1/Log +756 -0
- data/spec/data/c_probe_node_finder/1/PreGraph +11 -0
- data/spec/data/c_probe_node_finder/1/Roadmaps +2009 -0
- data/spec/data/c_probe_node_finder/1/contigs.fa +29 -0
- data/spec/data/c_probe_node_finder/1/stats.txt +6 -0
- data/spec/data/contig_printer/1/HOWTO_RECREATE +17 -0
- data/spec/data/contig_printer/1/contigs.fa +4 -0
- data/spec/data/contig_printer/1/seq.fa +2408 -0
- data/spec/data/contig_printer/1/seq.fa.svg +153 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/Graph2 +2953 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/LastGraph +2953 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/Log +21 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/PreGraph +27 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/Roadmaps +5182 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/Sequences +3612 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/contigs.fa +36 -0
- data/spec/data/contig_printer/1/seq.fa.velvet/stats.txt +14 -0
- data/spec/data/contig_printer/1/seq.faVseq2_1to550.fa.bam +0 -0
- data/spec/data/contig_printer/1/seq.faVseq2_1to550.fa.bam.bai +0 -0
- data/spec/data/contig_printer/1/seq.node12.fa +4 -0
- data/spec/data/contig_printer/1/seq1_1to550.fa +2 -0
- data/spec/data/contig_printer/1/seq2_1to550.fa +2 -0
- data/spec/data/contig_printer/1/seq2_1to550.fa.fai +1 -0
- data/spec/data/explore/1/2seqs.sammy.fa +12004 -0
- data/spec/data/explore/1/HOWTO_RECREATE.txt +6 -0
- data/spec/data/explore/1/a.fa +2 -0
- data/spec/data/explore/1/seq1_and_a.fa +3 -0
- data/spec/data/explore/1/seq2.fa +2 -0
- data/spec/data/fluff/1/2seqs.sammy.fa +12004 -0
- data/spec/data/fluff/1/HOWTO_RECREATE.txt +5 -0
- data/spec/data/fluff/1/seq1.fa +2 -0
- data/spec/data/fluff/1/seq2.fa +2 -0
- data/spec/data/gapfilling/1/reads.fa +171 -0
- data/spec/data/gapfilling/1/trail_with_Ns.fa +5 -0
- data/spec/data/gapfilling/1/velvetAssembly/Graph2 +130 -0
- data/spec/data/gapfilling/1/velvetAssembly/LastGraph +130 -0
- data/spec/data/gapfilling/1/velvetAssembly/Log +199 -0
- data/spec/data/gapfilling/1/velvetAssembly/PreGraph +7 -0
- data/spec/data/gapfilling/1/velvetAssembly/Roadmaps +239 -0
- data/spec/data/gapfilling/1/velvetAssembly/Sequences +281 -0
- data/spec/data/gapfilling/1/velvetAssembly/contigs.fa +12 -0
- data/spec/data/gapfilling/1/velvetAssembly/stats.txt +4 -0
- data/spec/data/gapfilling/2/HOWTO_recreate +17 -0
- data/spec/data/gapfilling/2/reference.fa +2 -0
- data/spec/data/gapfilling/2/reference_part1.fa +4 -0
- data/spec/data/gapfilling/2/reference_part2.fa +4 -0
- data/spec/data/gapfilling/2/sammy_reads.fa.gz +0 -0
- data/spec/data/gapfilling/2/with_gaps.fa +4 -0
- data/spec/data/gapfilling/3/HOWTO_recreate +4 -0
- data/spec/data/gapfilling/3/reads.fa.gz +0 -0
- data/spec/data/gapfilling/3/reference_part1.fa +4 -0
- data/spec/data/gapfilling/3/reference_part2.fa +4 -0
- data/spec/data/gapfilling/3/with_gaps.fa +4 -0
- data/spec/data/gapfilling/4/HOWTO_recreate +1 -0
- data/spec/data/gapfilling/4/reads.fa.gz +0 -0
- data/spec/data/gapfilling/5/HOWTO_RECREATE +7 -0
- data/spec/data/gapfilling/5/answer.fna +2 -0
- data/spec/data/gapfilling/5/gappy.fna +2 -0
- data/spec/data/gapfilling/5/reads.fa +17961 -0
- data/spec/data/gapfilling/5/velvet51_3.5/LastGraph +8337 -0
- data/spec/data/gapfilling/5/velvet51_3.5/Sequences +20921 -0
- data/spec/data/gapfilling/6/random1.fa +28 -0
- data/spec/data/gapfilling/6/random2.fa +28 -0
- data/spec/data/gapfilling/6/random_sequence_length_2000 +0 -0
- data/spec/data/gapfilling/6/reads.random1.fa.gz +0 -0
- data/spec/data/gapfilling/6/reads.random2.fa.gz +0 -0
- data/spec/data/gapfilling/6/to_gapfill.fa +22 -0
- data/spec/data/kmer_profile_to_assembly/multiple_abundance_file1.csv +2 -0
- data/spec/data/kmers_count1.csv +2 -0
- data/spec/data/kmers_count2.csv +3 -0
- data/spec/data/out +3 -0
- data/spec/data/positive_latching_pair.fa +2 -0
- data/spec/data/primers.csv +4 -0
- data/spec/data/read_selection_by_kmer/blacklist1.txt +1 -0
- data/spec/data/read_selection_by_kmer/input.fasta +6 -0
- data/spec/data/read_selection_by_kmer/whitelist1.txt +1 -0
- data/spec/data/read_selection_by_kmer/whitelist2.txt +2 -0
- data/spec/data/read_to_node/1_a_graph/HOWTO_RECREATE.txt +2 -0
- data/spec/data/read_to_node/1_a_graph/LastGraph +6695 -0
- data/spec/data/read_to_node/1_a_graph/ReadToNode.bin +0 -0
- data/spec/data/read_to_node/2_no_read256_or_259/HOWTO_RECREATE.txt +3 -0
- data/spec/data/read_to_node/2_no_read256_or_259/LastGraph +6693 -0
- data/spec/data/read_to_node/2_no_read256_or_259/ReadToNode.bin +0 -0
- data/spec/data/read_to_node/3_no_last_read/LastGraph +6694 -0
- data/spec/data/read_to_node/3_no_last_read/ReadToNode.bin +0 -0
- data/spec/data/t/details.txt +5 -0
- data/spec/data/t/details.txt.srt +5 -0
- data/spec/data/t/location.txt +3 -0
- data/spec/data/t/location.txt.srt +3 -0
- data/spec/data/tweak/1_gap_then_unscaffolded/answer.fa +2 -0
- data/spec/data/tweak/1_gap_then_unscaffolded/reads.fa.gz +0 -0
- data/spec/data/tweak/1_gap_then_unscaffolded/scaffolds.fa +6 -0
- data/spec/data/tweak/2_second_genome/answer2.fa +2 -0
- data/spec/data/tweak/2_second_genome/reads.fa.gz +0 -0
- data/spec/data/tweak/3_variant/answer.fa +2 -0
- data/spec/data/tweak/3_variant/lesser_answer.fa +2 -0
- data/spec/data/tweak/3_variant/reads.fa.gz +0 -0
- data/spec/data/tweak/3_variant/with_gaps.fa +2 -0
- data/spec/data/velvet_test_trails/Assem/Graph +17 -0
- data/spec/data/velvet_test_trails/Assem/Graph2 +40 -0
- data/spec/data/velvet_test_trails/Assem/LastGraph +40 -0
- data/spec/data/velvet_test_trails/Assem/Log +35 -0
- data/spec/data/velvet_test_trails/Assem/PreGraph +9 -0
- data/spec/data/velvet_test_trails/Assem/Roadmaps +89 -0
- data/spec/data/velvet_test_trails/Assem/Sequences +50 -0
- data/spec/data/velvet_test_trails/Assem/a.svg +53 -0
- data/spec/data/velvet_test_trails/Assem/contigs.fa +15 -0
- data/spec/data/velvet_test_trails/Assem/stats.txt +5 -0
- data/spec/data/velvet_test_trails/node_fwds.fa +8 -0
- data/spec/data/velvet_test_trails/node_seqs.fa +9 -0
- data/spec/data/velvet_test_trails/nodes_fwd_rev.fa +16 -0
- data/spec/data/velvet_test_trails/read1.fa +2 -0
- data/spec/data/velvet_test_trails/reads.fa +50 -0
- data/spec/data/velvet_test_trails_reverse/Assem/LastGraph +17 -0
- data/spec/data/velvet_test_trails_reverse/Assem/a.svg +53 -0
- data/spec/data/velvet_test_trails_reverse/reads_reversed.fa +10 -0
- data/spec/data/visualise/1/LastGraph +6695 -0
- data/spec/data/visualise/2_paired_end/HOWTO_RECREATE.txt +10 -0
- data/spec/data/visualise/2_paired_end/rand1.fa +2 -0
- data/spec/data/visualise/2_paired_end/rand2.fa +2 -0
- data/spec/data/visualise/2_paired_end/with_gaps.fa +8 -0
- data/spec/data/visualise/2_paired_end/with_gaps.read_pairs.fa.gz +0 -0
- data/spec/data/wander/1/random1.fa +2 -0
- data/spec/data/wander/1/random1.sammy.fa +804 -0
- data/spec/depth_first_search_spec.rb +190 -0
- data/spec/dijkstra_spec.rb +143 -0
- data/spec/explore_spec.rb +29 -0
- data/spec/fluffer_spec.rb +155 -0
- data/spec/gapfiller_spec.rb +107 -0
- data/spec/graph_explorer_spec.rb +475 -0
- data/spec/graph_generator_spec.rb +99 -0
- data/spec/height_finder_spec.rb +306 -0
- data/spec/kmer_abundance_pattern_spec.rb +56 -0
- data/spec/kmer_coverage_based_path_filter_spec.rb +73 -0
- data/spec/kmer_profile_finder_spec.rb +38 -0
- data/spec/kmers_count_tabulate_spec.rb +120 -0
- data/spec/oriented_node_trail_spec.rb +221 -0
- data/spec/paired_end_neighbours_spec.rb +126 -0
- data/spec/paths_between_nodes_spec.rb +349 -0
- data/spec/priner_spec.rb +7 -0
- data/spec/read_input_spec.rb +23 -0
- data/spec/read_selection_by_kmer_spec.rb +166 -0
- data/spec/read_to_node_spec.rb +35 -0
- data/spec/roundup_spec.rb +366 -0
- data/spec/scaffold_breaker_spec.rb +144 -0
- data/spec/sequence_spec.rb +43 -0
- data/spec/single_coherent_paths_between_nodes_spec.rb +492 -0
- data/spec/single_coherent_wanderer_spec.rb +120 -0
- data/spec/single_ended_assembler_spec.rb +398 -0
- data/spec/spec_helper.rb +310 -0
- data/spec/velvet_graph_sequence_extractor_spec.rb +80 -0
- data/spec/visualise_spec.rb +105 -0
- data/spec/wander_spec.rb +119 -0
- data/spec/watch_for_changes.sh +16 -0
- data/validation/fasta_compare.rb +72 -0
- data/validation/gapfill_simulate_perfect.rb +108 -0
- metadata +899 -0
@@ -0,0 +1,174 @@
|
|
1
|
+
#!/usr/bin/env rdmd
|
2
|
+
|
3
|
+
import std.stdio;
|
4
|
+
import std.string;
|
5
|
+
import std.conv;
|
6
|
+
import std.getopt;
|
7
|
+
import std.file;
|
8
|
+
import std.array;
|
9
|
+
import bio.core.fasta;
|
10
|
+
import bio.core.sequence;
|
11
|
+
import std.algorithm;
|
12
|
+
import std.container;
|
13
|
+
import std.c.stdlib;
|
14
|
+
|
15
|
+
void main(string[] args){
|
16
|
+
string whitelistFile, blacklistFile, fastaFile = null;
|
17
|
+
bool help, verbose, quiet, debugging = false;
|
18
|
+
int targetPerKmer = 1;
|
19
|
+
int minLeftoverLength;
|
20
|
+
getopt(args,
|
21
|
+
"whitelist", &whitelistFile,
|
22
|
+
"blacklist", &blacklistFile,
|
23
|
+
"reads", &fastaFile,
|
24
|
+
"kmer-coverage-target", &targetPerKmer,
|
25
|
+
"min-leftover-length", &minLeftoverLength,
|
26
|
+
"verbose", &verbose,
|
27
|
+
"debug", &debugging,
|
28
|
+
"quiet", &quiet,
|
29
|
+
"help|h", &help,
|
30
|
+
);
|
31
|
+
if(help){
|
32
|
+
writeln("my helpa");
|
33
|
+
}
|
34
|
+
else if(whitelistFile is null){stderr.writeln("Error: Need to specify a newline-separeted list of whitelisted kmers as --whitelist <file>");}
|
35
|
+
else if(fastaFile is null){stderr.writeln("Error: Need to specify a fasta file of reads to work with as --reads <fasta_file>");}
|
36
|
+
else {
|
37
|
+
if(debugging) verbose = true;
|
38
|
+
if(verbose) quiet=false;
|
39
|
+
|
40
|
+
|
41
|
+
//read in a text file of kmers that we wish to find, the whitelist
|
42
|
+
auto whites = split(cast(string) read(whitelistFile));
|
43
|
+
if (verbose)
|
44
|
+
stderr.writeln("Read in ",whites.length," kmers as a whitelist, e.g. ",whites.front);
|
45
|
+
|
46
|
+
|
47
|
+
// Find the minimum length of kmer being searched for
|
48
|
+
auto whitelistMinLength = map!"a.length"(whites).reduce!"a<b ? a : b";
|
49
|
+
auto whitelistMaxLength = map!"a.length"(whites).reduce!"a<b ? b : a";
|
50
|
+
if (whitelistMinLength != whitelistMaxLength){
|
51
|
+
stderr.writeln("Kmers must be of uniform length, but these ones weren't..");
|
52
|
+
exit(1);
|
53
|
+
}
|
54
|
+
if (verbose)
|
55
|
+
stderr.writeln("Minimum length of kmer in whitelist is ",whitelistMinLength);
|
56
|
+
|
57
|
+
//if blacklistFile is specified, read in a list of kmers that are blacklisted, otherwise make an empty array
|
58
|
+
bool[string] blacks;
|
59
|
+
if(blacklistFile != null){
|
60
|
+
foreach(kmer; split(cast(string) read(blacklistFile))){
|
61
|
+
if (kmer.length != whitelistMinLength){
|
62
|
+
stderr.writeln("Kmers (currently) must be of uniform length, but some blacklisted ones weren't..");
|
63
|
+
exit(1);
|
64
|
+
}
|
65
|
+
blacks[kmer] = true;
|
66
|
+
if(verbose)
|
67
|
+
stderr.writeln("Read in ",blacks.length," blacklisted kmers e.g. ",blacks.keys.front);
|
68
|
+
}
|
69
|
+
} else {
|
70
|
+
if(verbose)
|
71
|
+
stderr.writeln("No blacklisted kmers specified");
|
72
|
+
}
|
73
|
+
|
74
|
+
int[string] whitelistCounts;
|
75
|
+
foreach(white; whites){
|
76
|
+
whitelistCounts[white] = 0;
|
77
|
+
}
|
78
|
+
int num_reads_whitelisted = 0;
|
79
|
+
int num_reads_blacklisted = 0;
|
80
|
+
|
81
|
+
//Iterate through the fastq reads given.
|
82
|
+
auto fastas = fastaRecords(fastaFile);
|
83
|
+
bool all_accounted_for = false;
|
84
|
+
ptrdiff_t range_end;
|
85
|
+
string[] kmers;
|
86
|
+
if (minLeftoverLength)
|
87
|
+
kmers = new string[4];
|
88
|
+
else
|
89
|
+
kmers = new string[2];
|
90
|
+
foreach(seq; fastas){
|
91
|
+
if (verbose)
|
92
|
+
stderr.writeln("Inspecting ", seq);
|
93
|
+
//If they contain one of the blacklist kmers, then skip
|
94
|
+
string fwd = seq.sequence;
|
95
|
+
string rev = to!string(nucleotideSequence(fwd, true));
|
96
|
+
|
97
|
+
range_end = fwd.length - whitelistMinLength + 1;
|
98
|
+
if (minLeftoverLength)
|
99
|
+
range_end -= minLeftoverLength;
|
100
|
+
if (range_end < 0) continue; //If the read is too short, then don't even bother comparing it
|
101
|
+
if (debugging) stderr.writeln("Range end was ",range_end);
|
102
|
+
|
103
|
+
//How many of each whitelist kmers are found (including in the reverse complement)?
|
104
|
+
bool whitelisted = false;
|
105
|
+
foreach(i; 0 .. range_end){
|
106
|
+
kmers[0] = fwd[i .. (i+whitelistMinLength)];
|
107
|
+
kmers[1] = rev[i .. (i+whitelistMinLength)];
|
108
|
+
// if min leftover length is specified then search the reverse complement of the fwd as well
|
109
|
+
if (minLeftoverLength){
|
110
|
+
kmers[2] = to!string(nucleotideSequence(kmers[0], true));
|
111
|
+
kmers[3] = to!string(nucleotideSequence(kmers[1], true));
|
112
|
+
}
|
113
|
+
foreach(kmer; kmers){
|
114
|
+
if (debugging)
|
115
|
+
stderr.writeln("Whitelist inspecting kmer ",kmer," at position ",i);
|
116
|
+
if (kmer in whitelistCounts && whitelistCounts[kmer] < targetPerKmer){
|
117
|
+
whitelisted = true;
|
118
|
+
whitelistCounts[kmer] += 1;
|
119
|
+
if (whitelistCounts[kmer] >= targetPerKmer){
|
120
|
+
if(verbose)
|
121
|
+
stderr.writeln("kmer index ",i," now accounted for");
|
122
|
+
if (count!((x){return x<targetPerKmer;})(whitelistCounts.values) == 0){
|
123
|
+
if(verbose)
|
124
|
+
stderr.writeln("All whitelisted kmers now accounted for");
|
125
|
+
all_accounted_for = true; //all done, no more fasta entries required
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
}
|
131
|
+
if(!whitelisted) continue;
|
132
|
+
else if (verbose) stderr.writeln("Read contains a valid whitelisted kmer");
|
133
|
+
|
134
|
+
//I'm sure there is a faster way to search for an array of strings within a particular string, but eh for now.
|
135
|
+
bool blacklisted = false;
|
136
|
+
if (blacklistFile != null){
|
137
|
+
foreach(i; 0 .. fwd.length - whitelistMinLength+1){
|
138
|
+
auto kmer = fwd[i .. (i+whitelistMinLength)];
|
139
|
+
if (kmer in blacks){
|
140
|
+
//blacklisted kmer found
|
141
|
+
blacklisted = true;
|
142
|
+
break;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
if(blacklisted){
|
148
|
+
num_reads_blacklisted += 1;
|
149
|
+
if(verbose)
|
150
|
+
stderr.writeln(fwd," contains a blacklisted kmer, not including this one");
|
151
|
+
continue;
|
152
|
+
} else {
|
153
|
+
if(verbose)
|
154
|
+
stderr.writeln(fwd," not blacklisted");
|
155
|
+
}
|
156
|
+
|
157
|
+
//print this sequence, as it is whitelisted and not blacklisted
|
158
|
+
num_reads_whitelisted += 1;
|
159
|
+
writeln(">", seq.header);
|
160
|
+
writeln(fwd);
|
161
|
+
|
162
|
+
if(all_accounted_for) break;
|
163
|
+
}
|
164
|
+
|
165
|
+
//output the number of kmers that were sufficiently covered
|
166
|
+
|
167
|
+
ulong num_counted = count!("a >= b")(whitelistCounts.values, targetPerKmer);
|
168
|
+
ulong num_not_counted = whitelistCounts.length - num_counted;
|
169
|
+
if(!quiet){
|
170
|
+
stderr.writeln("Found ",num_counted," from the whitelist as expected and ",num_not_counted," not enough times");
|
171
|
+
stderr.writeln("There were ",num_reads_whitelisted," reads output, and ",num_reads_blacklisted," reads blacklisted");
|
172
|
+
}
|
173
|
+
}
|
174
|
+
}
|
@@ -0,0 +1,119 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'bio-logger'
|
5
|
+
require 'csv'
|
6
|
+
require 'bio'
|
7
|
+
require 'tempfile'
|
8
|
+
require 'systemu'
|
9
|
+
|
10
|
+
SCRIPT_NAME = File.basename(__FILE__); LOG_NAME = SCRIPT_NAME.gsub('.rb','')
|
11
|
+
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
12
|
+
require 'kmer_abundance_pattern'
|
13
|
+
|
14
|
+
# Parse command line options into the options hash
|
15
|
+
options = {
|
16
|
+
:logger => 'stderr',
|
17
|
+
:log_level => 'info',
|
18
|
+
:number_of_kmers => 100,
|
19
|
+
}
|
20
|
+
o = OptionParser.new do |opts|
|
21
|
+
opts.banner = "
|
22
|
+
Usage: #{SCRIPT_NAME} -f <scaffolds_fasta> -k <kmer_abundance_file>
|
23
|
+
|
24
|
+
Take a fasta file of contigs, and a multiple kmer count file. Output the patterns each contig end shows up.n\n"
|
25
|
+
|
26
|
+
|
27
|
+
opts.on("-f FASTA_FILE", "Fasta file containing multiple sequences that we are attempting to scaffold together [required]") do |arg|
|
28
|
+
options[:fasta_file] = arg
|
29
|
+
end
|
30
|
+
opts.on("-k KMER_FILE", "kmer frequencies [required]") do |arg|
|
31
|
+
options[:kmer_file] = arg
|
32
|
+
end
|
33
|
+
opts.on("--kmer KMER_SIZE", "kmer length [required]") do |arg|
|
34
|
+
options[:kmer_size] = arg.to_i
|
35
|
+
end
|
36
|
+
opts.on("--upper-threshold ARG", "kmer frequency cutoff to saying 'present' [required]") do |arg|
|
37
|
+
options[:upper_threshold] = arg.to_i
|
38
|
+
end
|
39
|
+
opts.on("--lower-threshold ARG", "kmer frequency cutoff to saying 'not present' [required]") do |arg|
|
40
|
+
options[:lower_threshold] = arg.to_i
|
41
|
+
end
|
42
|
+
|
43
|
+
# logger options
|
44
|
+
opts.separator "\nVerbosity:\n\n"
|
45
|
+
opts.on("-q", "--quiet", "Run quietly, set logging to ERROR level [default INFO]") {options[:log_level] = 'error'}
|
46
|
+
opts.on("--logger filename",String,"Log to file [default #{options[:logger]}]") { |name| options[:logger] = name}
|
47
|
+
opts.on("--trace options",String,"Set log level [default INFO]. e.g. '--trace debug' to set logging level to DEBUG"){|s| options[:log_level] = s}
|
48
|
+
end; o.parse!
|
49
|
+
if ARGV.length != 0 or options[:fasta_file].nil? or options[:kmer_file].nil? or options[:upper_threshold].nil? or options[:lower_threshold].nil? or options[:kmer_size].nil?
|
50
|
+
$stderr.puts o
|
51
|
+
exit 1
|
52
|
+
end
|
53
|
+
# Setup logging
|
54
|
+
Bio::Log::CLI.logger(options[:logger]); Bio::Log::CLI.trace(options[:log_level]); log = Bio::Log::LoggerPlus.new(LOG_NAME); Bio::Log::CLI.configure(LOG_NAME)
|
55
|
+
|
56
|
+
get_kmer_abundances_from_kmers = lambda do |kmers|
|
57
|
+
# fgrep the kmer abundance file for these particular ones
|
58
|
+
patterns = {}
|
59
|
+
Tempfile.open('kemrs') do |tempfile|
|
60
|
+
tempfile.puts kmers.join "\n"
|
61
|
+
tempfile.close
|
62
|
+
|
63
|
+
# for each of the kmers that come back, output their pattern in the kmer abundance file
|
64
|
+
grep_cmd = "fgrep -f #{tempfile.path} #{options[:kmer_file].inspect}"
|
65
|
+
log.debug "Running cmd with #{kmers.length} kmers: #{grep_cmd}"
|
66
|
+
status, stdout, stderr = systemu grep_cmd
|
67
|
+
raise stderr if stderr != ''
|
68
|
+
raise unless status.exitstatus == 0
|
69
|
+
num_kmers = stdout.split("\n").length
|
70
|
+
log.debug "Finished grepping for kmers, found #{num_kmers} kmers"
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
stdout.each_line do |line|
|
75
|
+
CSV.parse(line, :col_sep => ' ') do |row|
|
76
|
+
pattern = KmerAbundancePattern.new
|
77
|
+
pattern.parse_from_kmer_abundance row[1...row.length].collect{|a| a.to_f}, options[:lower_threshold], options[:upper_threshold]
|
78
|
+
rep = pattern.binary_string
|
79
|
+
patterns[rep] ||= 0
|
80
|
+
patterns[rep] += 1
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
patterns.sort{|a,b| b[1]<=>a[1]}.collect{|a| a.join(',')}.join("\t")
|
85
|
+
end
|
86
|
+
|
87
|
+
# For each of the sequences in the fasta file
|
88
|
+
Bio::FlatFile.foreach(Bio::FastaFormat, options[:fasta_file]) do |seq|
|
89
|
+
# Extract the first 100 kmers
|
90
|
+
kmers = []
|
91
|
+
i = 0
|
92
|
+
seq.to_biosequence.window_search(options[:kmer_size]) do |s|
|
93
|
+
kmers.push s.seq
|
94
|
+
i += 1
|
95
|
+
break if i>options[:number_of_kmers]
|
96
|
+
end
|
97
|
+
# output to a tempfile
|
98
|
+
patterns = get_kmer_abundances_from_kmers.call kmers
|
99
|
+
puts [
|
100
|
+
seq.definition,
|
101
|
+
'start',
|
102
|
+
patterns
|
103
|
+
].join("\t")
|
104
|
+
|
105
|
+
# repeat for the end of the contig
|
106
|
+
kmers = []
|
107
|
+
i = 0
|
108
|
+
seq.naseq.reverse_complement.window_search(options[:kmer_size]) do |s|
|
109
|
+
kmers.push s.seq.upcase
|
110
|
+
i += 1
|
111
|
+
break if i>options[:number_of_kmers]
|
112
|
+
end
|
113
|
+
patterns = get_kmer_abundances_from_kmers.call kmers
|
114
|
+
puts [
|
115
|
+
seq.definition,
|
116
|
+
'end',
|
117
|
+
patterns
|
118
|
+
].join("\t")
|
119
|
+
end
|
@@ -0,0 +1,193 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'bio-logger'
|
5
|
+
require 'csv'
|
6
|
+
require 'pp'
|
7
|
+
require 'bio'
|
8
|
+
require 'pry'
|
9
|
+
|
10
|
+
SCRIPT_NAME = File.basename(__FILE__); LOG_NAME = SCRIPT_NAME.gsub('.rb','')
|
11
|
+
|
12
|
+
$:.unshift File.join(ENV['HOME'],'git/yargraph/lib')
|
13
|
+
require 'yargraph'
|
14
|
+
|
15
|
+
# Parse command line options into the options hash
|
16
|
+
options = {
|
17
|
+
:logger => 'stderr',
|
18
|
+
:log_level => 'info',
|
19
|
+
}
|
20
|
+
o = OptionParser.new do |opts|
|
21
|
+
opts.banner = "
|
22
|
+
Usage: #{SCRIPT_NAME} <arguments>
|
23
|
+
|
24
|
+
Description of what this program does...\n\n"
|
25
|
+
|
26
|
+
opts.on("-c", "--connnections FILE", "connections file [required]") do |arg|
|
27
|
+
options[:connections_file] = arg
|
28
|
+
end
|
29
|
+
opts.on("-f", "--fasta FILE", "Fasta file of all contigs [required]") do |arg|
|
30
|
+
options[:fasta_file] = arg
|
31
|
+
end
|
32
|
+
|
33
|
+
# logger options
|
34
|
+
opts.separator "\nVerbosity:\n\n"
|
35
|
+
opts.on("-q", "--quiet", "Run quietly, set logging to ERROR level [default INFO]") {options[:log_level] = 'error'}
|
36
|
+
opts.on("--logger filename",String,"Log to file [default #{options[:logger]}]") { |name| options[:logger] = name}
|
37
|
+
opts.on("--trace options",String,"Set log level [default INFO]. e.g. '--trace debug' to set logging level to DEBUG"){|s| options[:log_level] = s}
|
38
|
+
end; o.parse!
|
39
|
+
if ARGV.length != 0 or options[:connections_file].nil?
|
40
|
+
$stderr.puts o
|
41
|
+
exit 1
|
42
|
+
end
|
43
|
+
# Setup logging
|
44
|
+
Bio::Log::CLI.logger(options[:logger]); Bio::Log::CLI.trace(options[:log_level]); log = Bio::Log::LoggerPlus.new(LOG_NAME); Bio::Log::CLI.configure(LOG_NAME)
|
45
|
+
|
46
|
+
class Probe
|
47
|
+
attr_accessor :contig_name, :side
|
48
|
+
|
49
|
+
def to_setable
|
50
|
+
[@contig_name, @side]
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class ProbeSet
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
graph = Yargraph::UndirectedGraph.new
|
59
|
+
|
60
|
+
num_probes_circular = 0
|
61
|
+
CSV.foreach(options[:connections_file], :col_sep => "\t") do |row|
|
62
|
+
if row.length == 3
|
63
|
+
# e.g. 110811_E_1_D_nesoni_single_contig_1011407.start 110811_E_1_D_nesoni_single_contig_1030181.start 225
|
64
|
+
splits1 = nil
|
65
|
+
splits2 = nil
|
66
|
+
splits1 = row[0].match(/^(.+)\.(.+)$/)
|
67
|
+
splits2 = row[1].match(/^(.+)\.(.+)$/)
|
68
|
+
raise if splits1.nil? or splits2.nil?
|
69
|
+
distance = row[2]
|
70
|
+
row = [
|
71
|
+
splits1[1], splits1[2], splits2[1], splits2[2], distance
|
72
|
+
].flatten
|
73
|
+
end
|
74
|
+
|
75
|
+
raise unless row.length == 5
|
76
|
+
# e.g. seq1 end seq23 start 6878
|
77
|
+
|
78
|
+
probe1 = Probe.new
|
79
|
+
probe1.contig_name = row[0]
|
80
|
+
probe1.side = row[1]
|
81
|
+
|
82
|
+
probe2 = Probe.new
|
83
|
+
probe2.contig_name = row[2]
|
84
|
+
probe2.side = row[3]
|
85
|
+
|
86
|
+
if probe1.contig_name == probe2.contig_name and probe1.side == probe2.side
|
87
|
+
num_probes_circular += 1
|
88
|
+
else
|
89
|
+
graph.add_edge probe1.to_setable, probe2.to_setable
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
probes = graph.vertices.to_a
|
94
|
+
|
95
|
+
# Connect all starts to the ends
|
96
|
+
probes.each do |array|
|
97
|
+
contig_name = array[0]
|
98
|
+
|
99
|
+
start_probe = Probe.new
|
100
|
+
start_probe.contig_name = contig_name
|
101
|
+
start_probe.side = 'start'
|
102
|
+
end_probe = Probe.new
|
103
|
+
end_probe.contig_name = contig_name
|
104
|
+
end_probe.side = 'end'
|
105
|
+
|
106
|
+
graph.add_edge start_probe.to_setable, end_probe.to_setable
|
107
|
+
end
|
108
|
+
log.info "Removed #{num_probes_circular} connections that join a contig end to itself"
|
109
|
+
|
110
|
+
# First try the not computationally intensive way - can we find any?
|
111
|
+
edge_result = graph.some_edges_in_all_hamiltonian_cycles
|
112
|
+
|
113
|
+
cross_contig_connections = []
|
114
|
+
edge_result.edges_in_all.each do |v1, v2|
|
115
|
+
if v1[0] != v2[0]
|
116
|
+
cross_contig_connections.push [v1,v2]
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
if !cross_contig_connections.empty?
|
121
|
+
length = cross_contig_connections.length
|
122
|
+
|
123
|
+
log.info "Good news. Found #{length} connections that are in all Hamiltonian paths (and thus can probably be scaffolded together):"
|
124
|
+
cross_contig_connections.each do |connection|
|
125
|
+
log.info connection[0].to_s + "\t" + connection[1].to_s
|
126
|
+
end
|
127
|
+
if length == probes.length and edge_result.contains_hamcycle != false
|
128
|
+
log.info "Extra good news. You just scaffolded your genome into a single scaffold"
|
129
|
+
end
|
130
|
+
end
|
131
|
+
if edge_result.contains_hamcycle == false
|
132
|
+
log.warn "Bad news. The connectivity graph contains no Hamiltonian cycles, and so the contigs cannot be scaffolded into one circular genome"
|
133
|
+
end
|
134
|
+
|
135
|
+
# Determine if there are any ends that don't connect to anything
|
136
|
+
contig_names = []
|
137
|
+
Bio::FlatFile.foreach(options[:fasta_file]) do |seq|
|
138
|
+
contig_name = seq.definition.split(/\s+/)[0]
|
139
|
+
contig_names.push contig_name
|
140
|
+
%w(start end).each do |side|
|
141
|
+
probe = Probe.new
|
142
|
+
probe.contig_name = contig_name
|
143
|
+
probe.side = side
|
144
|
+
if graph.edges[probe.to_setable].empty?
|
145
|
+
log.info "Unable to find any connections from #{probe.to_setable}"
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# Determine if there is any possible plasmids
|
151
|
+
num_plasmids_found = 0
|
152
|
+
contig_names.each do |contig_name|
|
153
|
+
probe = Probe.new
|
154
|
+
probe.contig_name = contig_name
|
155
|
+
probe.side = 'start'
|
156
|
+
rev_probe = Probe.new
|
157
|
+
rev_probe.contig_name = contig_name
|
158
|
+
rev_probe.side = 'end'
|
159
|
+
|
160
|
+
# Both the start and the end must only connect to each other
|
161
|
+
if graph.edges[probe.to_setable].length == 1 and
|
162
|
+
graph.edges[rev_probe.to_setable].length == 1 and
|
163
|
+
graph.edges[probe.to_setable].include?(rev_probe.to_setable)
|
164
|
+
|
165
|
+
num_plasmids_found += 1
|
166
|
+
log.info "Contig #{contig_name} appears to be circular and not connect to other contigs, suggesting it may be a plasmid"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
log.info "Found #{num_plasmids_found} contigs that appear to be plasmids based on connectivity"
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
log.info "Attempting a better but more computationally intensive method of determining edges that are in all hamiltonian paths.."
|
174
|
+
# First try to see if there is any hamiltonian paths?
|
175
|
+
paths = []
|
176
|
+
max_path_count = 4
|
177
|
+
operation_limit = 50000
|
178
|
+
graph.hamiltonian_cycles(operation_limit) do |path|
|
179
|
+
if paths.length <= max_path_count
|
180
|
+
paths.push path
|
181
|
+
else
|
182
|
+
break
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
if paths.length < max_path_count
|
187
|
+
log.info "Found exactly #{paths.length} Hamiltonian cycles"
|
188
|
+
else
|
189
|
+
log.info "Gave up searching for Hamiltonian cycles as there are at least #{max_path_count} cycles"
|
190
|
+
end
|
191
|
+
|
192
|
+
# OK so
|
193
|
+
#edges_in_all = graph.edges_in_all_hamiltonian_cycles
|