├── src ├── kurtz │ ├── streesrc │ │ ├── streeproto.h │ │ ├── dfs.o │ │ ├── access.o │ │ ├── depthtab.o │ │ ├── ex2leav.o │ │ ├── iterator.o │ │ ├── libstree.a │ │ ├── linkloc.o │ │ ├── overmax.o │ │ ├── oversucc.o │ │ ├── scanpref.o │ │ ├── construct.o │ │ ├── addleafcount.o │ │ ├── streedef.h │ │ ├── symboldef.h │ │ ├── Macronames │ │ ├── Mkstreeproto.sh │ │ ├── loc.c │ │ ├── ex2leav.c │ │ ├── oversucc.c │ │ ├── depthtab.c │ │ ├── stree.c │ │ ├── dfs.gen │ │ ├── overmax.c │ │ ├── streemac.h │ │ ├── dfs.c │ │ ├── Makefile │ │ ├── streehuge.h │ │ ├── streesmall.h │ │ ├── construct.gen │ │ ├── Filegoals.mf │ │ ├── addleafcount.c │ │ └── linkloc.c │ ├── mm3src │ │ ├── maxmat3.o │ │ ├── findmaxmat.o │ │ ├── maxmatinp.o │ │ ├── maxmatopt.o │ │ ├── procmaxmat.o │ │ ├── findmumcand.o │ │ ├── .findmumcand.c.swp │ │ ├── README │ │ ├── Makefile │ │ ├── Filegoals.mf │ │ ├── maxmatdef.h │ │ ├── maxmat3.c │ │ └── Dependencies.mf │ ├── libbasedir │ │ ├── clock.o │ │ ├── space.o │ │ ├── libbase.a │ │ ├── mapfile.o │ │ ├── multiseq.o │ │ ├── procopt.o │ │ ├── safescpy.o │ │ ├── seterror.o │ │ ├── cleanMUMcand.o │ │ ├── Cuthere.awk │ │ ├── Excludemulti │ │ ├── Importfiles │ │ ├── Mksrc.sh │ │ ├── Mkprotodef.sh │ │ ├── README │ │ ├── megabytes.h │ │ ├── Filelists.mf │ │ ├── minmax.h │ │ ├── Makefile │ │ ├── chardef.h │ │ ├── fopen.h │ │ ├── mumcand.h │ │ ├── safescpy.c │ │ ├── clock.c │ │ ├── Dependencies.mf │ │ ├── args.h │ │ ├── seterror.c │ │ ├── visible.h │ │ ├── Filegoals.mf │ │ ├── spacedef.h │ │ ├── protodef.h │ │ ├── intbits.h │ │ ├── cleanMUMcand.c │ │ ├── errordef.h │ │ ├── debug.c │ │ ├── optdesc.h │ │ ├── multidef.h │ │ └── arraydef.h │ ├── Makedef │ ├── Makefile │ ├── Splintoptions │ └── README └── tigr │ ├── delta.o │ ├── sw_align.o │ ├── tigrinc.o │ ├── translate.o │ ├── tigrinc.hh │ ├── Makefile │ ├── translate.cc │ └── prenuc.cc ├── gaps ├── mgaps ├── mummer ├── annotate ├── show-diff ├── show-snps ├── combineMUMs ├── delta-filter ├── repeat-match ├── show-aligns ├── show-coords ├── show-tiling ├── aux_bin ├── prenuc ├── prepro ├── postnuc └── postpro ├── docs ├── web │ ├── logo.gif │ ├── MUMmer.pdf │ ├── XFiles.pdf │ ├── MUMmer2.pdf │ ├── MUMmer3.pdf │ ├── manual │ │ ├── gaps.gif │ │ ├── osi.gif │ │ ├── covplot.gif │ │ ├── dotplot.gif │ │ ├── mapplot.gif │ │ ├── mgaps.gif │ │ ├── nucex.gif │ │ ├── nuc_proex.gif │ │ ├── pro_proex.gif │ │ ├── manual_logo.gif │ │ ├── multiplota.gif │ │ ├── multiplotb.gif │ │ ├── AlignmentTypes.odg │ │ └── AlignmentTypes.pdf │ ├── mummer-help.gif │ ├── mummer-users.gif │ └── examples │ │ ├── dotplot.gif │ │ ├── mapplot.gif │ │ ├── mummer_ps.jpg │ │ ├── mapview_fig.jpg │ │ ├── data │ │ ├── mapview_0.pdf │ │ ├── README │ │ ├── mummer.gp │ │ ├── nucmer.tiling │ │ ├── D_melanogaster_2Rslice.cds │ │ ├── D_melanogaster_2Rslice.utr │ │ ├── promer.aligns │ │ ├── nucmer.delta │ │ └── nucmer.coords │ │ └── examples_logo.gif ├── maxmat3src.pdf ├── Makefile ├── skaff.sty ├── optionman.sty ├── README ├── differences.README ├── run-mummer3.README └── run-mummer1.README ├── COPYRIGHT ├── ACKNOWLEDGEMENTS ├── scripts ├── exact-tandems.csh ├── run-mummer1.csh ├── tandem-repeat.awk ├── run-mummer3.csh └── Makefile ├── exact-tandems ├── run-mummer1 ├── run-mummer3 ├── ChangeLog ├── Makefile ├── INSTALL └── LICENSE /src/kurtz/streesrc/streeproto.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gaps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/gaps -------------------------------------------------------------------------------- /mgaps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/mgaps -------------------------------------------------------------------------------- /mummer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/mummer -------------------------------------------------------------------------------- /annotate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/annotate -------------------------------------------------------------------------------- /show-diff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/show-diff -------------------------------------------------------------------------------- /show-snps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/show-snps -------------------------------------------------------------------------------- /combineMUMs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/combineMUMs -------------------------------------------------------------------------------- /delta-filter: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/delta-filter -------------------------------------------------------------------------------- /repeat-match: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/repeat-match -------------------------------------------------------------------------------- /show-aligns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/show-aligns -------------------------------------------------------------------------------- /show-coords: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/show-coords -------------------------------------------------------------------------------- /show-tiling: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/show-tiling -------------------------------------------------------------------------------- /aux_bin/prenuc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/aux_bin/prenuc -------------------------------------------------------------------------------- /aux_bin/prepro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/aux_bin/prepro -------------------------------------------------------------------------------- /aux_bin/postnuc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/aux_bin/postnuc -------------------------------------------------------------------------------- /aux_bin/postpro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/aux_bin/postpro -------------------------------------------------------------------------------- /docs/web/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/logo.gif -------------------------------------------------------------------------------- /src/tigr/delta.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/tigr/delta.o -------------------------------------------------------------------------------- /docs/maxmat3src.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/maxmat3src.pdf -------------------------------------------------------------------------------- /docs/web/MUMmer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/MUMmer.pdf -------------------------------------------------------------------------------- /docs/web/XFiles.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/XFiles.pdf -------------------------------------------------------------------------------- /src/tigr/sw_align.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/tigr/sw_align.o -------------------------------------------------------------------------------- /src/tigr/tigrinc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/tigr/tigrinc.o -------------------------------------------------------------------------------- /docs/web/MUMmer2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/MUMmer2.pdf -------------------------------------------------------------------------------- /docs/web/MUMmer3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/MUMmer3.pdf -------------------------------------------------------------------------------- /src/tigr/translate.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/tigr/translate.o -------------------------------------------------------------------------------- /docs/web/manual/gaps.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/gaps.gif -------------------------------------------------------------------------------- /docs/web/manual/osi.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/osi.gif -------------------------------------------------------------------------------- /docs/web/mummer-help.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/mummer-help.gif -------------------------------------------------------------------------------- /src/kurtz/streesrc/dfs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/dfs.o -------------------------------------------------------------------------------- /docs/web/manual/covplot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/covplot.gif -------------------------------------------------------------------------------- /docs/web/manual/dotplot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/dotplot.gif -------------------------------------------------------------------------------- /docs/web/manual/mapplot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/mapplot.gif -------------------------------------------------------------------------------- /docs/web/manual/mgaps.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/mgaps.gif -------------------------------------------------------------------------------- /docs/web/manual/nucex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/nucex.gif -------------------------------------------------------------------------------- /docs/web/mummer-users.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/mummer-users.gif -------------------------------------------------------------------------------- /src/kurtz/mm3src/maxmat3.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/mm3src/maxmat3.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/access.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/access.o -------------------------------------------------------------------------------- /docs/web/examples/dotplot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/examples/dotplot.gif -------------------------------------------------------------------------------- /docs/web/examples/mapplot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/examples/mapplot.gif -------------------------------------------------------------------------------- /docs/web/manual/nuc_proex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/nuc_proex.gif -------------------------------------------------------------------------------- /docs/web/manual/pro_proex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/pro_proex.gif -------------------------------------------------------------------------------- /src/kurtz/libbasedir/clock.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/clock.o -------------------------------------------------------------------------------- /src/kurtz/libbasedir/space.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/space.o -------------------------------------------------------------------------------- /src/kurtz/mm3src/findmaxmat.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/mm3src/findmaxmat.o -------------------------------------------------------------------------------- /src/kurtz/mm3src/maxmatinp.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/mm3src/maxmatinp.o -------------------------------------------------------------------------------- /src/kurtz/mm3src/maxmatopt.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/mm3src/maxmatopt.o -------------------------------------------------------------------------------- /src/kurtz/mm3src/procmaxmat.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/mm3src/procmaxmat.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/depthtab.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/depthtab.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/ex2leav.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/ex2leav.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/iterator.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/iterator.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/libstree.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/libstree.a -------------------------------------------------------------------------------- /src/kurtz/streesrc/linkloc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/linkloc.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/overmax.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/overmax.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/oversucc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/oversucc.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/scanpref.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/scanpref.o -------------------------------------------------------------------------------- /docs/web/examples/mummer_ps.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/examples/mummer_ps.jpg -------------------------------------------------------------------------------- /docs/web/manual/manual_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/manual_logo.gif -------------------------------------------------------------------------------- /docs/web/manual/multiplota.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/multiplota.gif -------------------------------------------------------------------------------- /docs/web/manual/multiplotb.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/multiplotb.gif -------------------------------------------------------------------------------- /src/kurtz/libbasedir/libbase.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/libbase.a -------------------------------------------------------------------------------- /src/kurtz/libbasedir/mapfile.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/mapfile.o -------------------------------------------------------------------------------- /src/kurtz/libbasedir/multiseq.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/multiseq.o -------------------------------------------------------------------------------- /src/kurtz/libbasedir/procopt.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/procopt.o -------------------------------------------------------------------------------- /src/kurtz/libbasedir/safescpy.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/safescpy.o -------------------------------------------------------------------------------- /src/kurtz/libbasedir/seterror.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/seterror.o -------------------------------------------------------------------------------- /src/kurtz/mm3src/findmumcand.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/mm3src/findmumcand.o -------------------------------------------------------------------------------- /src/kurtz/streesrc/construct.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/construct.o -------------------------------------------------------------------------------- /docs/web/examples/mapview_fig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/examples/mapview_fig.jpg -------------------------------------------------------------------------------- /docs/web/manual/AlignmentTypes.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/AlignmentTypes.odg -------------------------------------------------------------------------------- /docs/web/manual/AlignmentTypes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/manual/AlignmentTypes.pdf -------------------------------------------------------------------------------- /src/kurtz/streesrc/addleafcount.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/streesrc/addleafcount.o -------------------------------------------------------------------------------- /docs/web/examples/data/mapview_0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/examples/data/mapview_0.pdf -------------------------------------------------------------------------------- /docs/web/examples/examples_logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/docs/web/examples/examples_logo.gif -------------------------------------------------------------------------------- /src/kurtz/libbasedir/cleanMUMcand.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/libbasedir/cleanMUMcand.o -------------------------------------------------------------------------------- /src/kurtz/mm3src/.findmumcand.c.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/garviz/MUMmer/HEAD/src/kurtz/mm3src/.findmumcand.c.swp -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Cuthere.awk: -------------------------------------------------------------------------------- 1 | BEGIN{echoline=1;} 2 | /\/\*CUT HERE\*\// {echoline=0;} 3 | /.*/ {if(echoline) print $0;} 4 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | LATEX=pdflatex 2 | 3 | maxmat3man.dvi:maxmat3man.tex 4 | ${LATEX} maxmat3man 5 | ${LATEX} maxmat3man 6 | 7 | clean: 8 | rm -f *.dvi *.aux *.log *.out *~ maxmat3man.pdf 9 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Excludemulti: -------------------------------------------------------------------------------- 1 | alphadef\.h 2 | maxfiles\.h 3 | freemultiseqfileinfo 4 | initmultiseqfileinfo 5 | allfiles 6 | filesep 7 | searchregexp 8 | numofdbfiles 9 | numofqueryfiles 10 | -------------------------------------------------------------------------------- /docs/web/examples/data/README: -------------------------------------------------------------------------------- 1 | The files in this directory are meant to be used in conjunction with 2 | the MUMmer Examples website. The site can be found here: 3 | 4 | http://mummer.sourceforge.net/examples/ 5 | 6 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | -=- MUMmer3.xx COPYRIGHT NOTICE -=- 2 | 3 | This software is OSI Certified Open Source Software. OSI Certified is a 4 | certification mark of the Open Source Initiative. Please refer to the 5 | 'LICENSE' file for more information and the 'ACKNOWLEDGEMENTS' file for 6 | names of contributors to the code base. 7 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Importfiles: -------------------------------------------------------------------------------- 1 | visible.h 2 | args.h 3 | intbits.h 4 | arraydef.h 5 | chardef.h 6 | cleanMUMcand.c 7 | debug.c 8 | safescpy.c 9 | clock.c 10 | debugdef.h 11 | errordef.h 12 | mapfile.c 13 | megabytes.h 14 | minmax.h 15 | fopen.h 16 | mumcand.h 17 | optdesc.h 18 | procopt.c 19 | seterror.c 20 | space.c 21 | spacedef.h 22 | types.h 23 | -------------------------------------------------------------------------------- /docs/skaff.sty: -------------------------------------------------------------------------------- 1 | \newcommand{\SKaffiliation}{% 2 | Zentrum f{\"u}r Bioinformatik,~% 3 | Universit{\"a}t Hamburg,~% 4 | Bundesstrasse 43, 20146 Hamburg, Germany,~% 5 | E-mail: kurtz@zbh.uni-hamburg.de} 6 | 7 | \newcommand{\SKaffiliationEnglish}{% 8 | Center for Bioinformatics,~% 9 | University of Hamburg,~% 10 | Bundesstrasse 43, 20146 Hamburg, Germany,~% 11 | E-mail: kurtz@zbh.uni-hamburg.de} 12 | -------------------------------------------------------------------------------- /ACKNOWLEDGEMENTS: -------------------------------------------------------------------------------- 1 | -- MUMmer 3.x ACKNOWLEDGEMENTS -- 2 | 3 | DEVELOPERS 4 | Art Delcher 5 | Stefan Kurtz 6 | Adam Phillippy 7 | Steven Salzberg 8 | 9 | The Institute for Genomic Research 10 | Center for Bioinformatics, University of Hamburg 11 | Center for Bioinformatics and Computational Biology, University of Maryland 12 | 13 | CONTRIBUTORS 14 | Michael Schatz 15 | Corina Antonescu 16 | -------------------------------------------------------------------------------- /src/kurtz/Makedef: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2003 by Stefan Kurtz and The Institute for 2 | # Genomic Research. This is OSI Certified Open Source Software. 3 | # Please see the file LICENSE for licensing information and 4 | # the file ACKNOWLEDGEMENTS for names of contributors to the 5 | # code base. 6 | 7 | # This files contains some basic definitions to be included in the 8 | # makefiles. 9 | 10 | CC=gcc 11 | DEFINECFLAGS=-Wall -Werror -O3 12 | DEFINELDFLAGS= 13 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Mksrc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | VSTREESRC=${DIRVSTREE}/src/vstree/src 3 | vcopy.sh `cat Importfiles` 4 | grep -v -f Excludemulti ${VSTREESRC}/include/multidef.h > multidef.h 5 | gawk -f Cuthere.awk ${VSTREESRC}/kurtz/multiseq.c | grep -v -f Excludemulti > multiseq.c 6 | Mkprotodef.sh `ls *.c` > protodef.h 7 | for filename in `ls *.[ch]` 8 | do 9 | cat ../Copyright > tmp 10 | Skipfirstcom.pl ${filename} >> tmp 11 | mv tmp ${filename} 12 | done 13 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/streedef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #ifndef STREEDEF_H 10 | #define STREEDEF_H 11 | #include "types.h" 12 | #include "streemac.h" 13 | #include "streetyp.h" 14 | #include "streeproto.h" 15 | #endif 16 | -------------------------------------------------------------------------------- /src/kurtz/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | cd libbasedir; $(MAKE) all 3 | cd streesrc; $(MAKE) all 4 | cd mm3src; $(MAKE) all 5 | 6 | clean: 7 | rm -f *~ 8 | cd libbasedir; $(MAKE) clean 9 | cd streesrc; $(MAKE) clean 10 | cd mm3src; $(MAKE) clean 11 | 12 | mummer: 13 | cd libbasedir; $(MAKE) libbase.a 14 | cd streesrc; $(MAKE) libstree.a 15 | cd mm3src; $(MAKE) mummer 16 | 17 | splintall: 18 | cd libbasedir; ${MAKE} splintall 19 | cd streesrc; ${MAKE} splintall 20 | cd mm3src; ${MAKE} splintall 21 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Mkprotodef.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if test $# -lt 1 3 | then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | cat << ENDOFINCLUDE 8 | /* 9 | This file is generated. Do not edit. 10 | */ 11 | 12 | #ifndef PROTODEF_H 13 | #define PROTODEF_H 14 | 15 | #include 16 | #include 17 | #include 18 | #include "types.h" 19 | #include "optdesc.h" 20 | #include "multidef.h" 21 | #include "mumcand.h" 22 | ENDOFINCLUDE 23 | skproto.x $* 24 | echo "#endif" 25 | -------------------------------------------------------------------------------- /src/kurtz/mm3src/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains the sources of the 'mummer' (maxmat3.x) program: 3 | 4 | maxmatdef.h: some basic definitions 5 | findmumcand.c: computing MUM-candidate by traversing a suffix tree 6 | findmaxmat.c: computing maximal matches by traversing a suffix tree 7 | maxmaxinp.c: reading the input sequences 8 | maxmat3.c: the main program 9 | maxmatopt.c: parsing options 10 | procmaxmat.c: processing and output of MUM-candidates 11 | 12 | *.mf: some files to be included into Makefile 13 | -------------------------------------------------------------------------------- /docs/optionman.sty: -------------------------------------------------------------------------------- 1 | 2 | \newcommand{\Showoption}[1]{\mbox{\footnotesize \texttt{-#1}}} 3 | \newcommand{\Option}[3]{\index{Option!\texttt{-#1}}\item[\Showoption{#1}~#2] 4 | \mbox{}\\% 5 | #3} 6 | 7 | \newenvironment{Showprogramwithoptions}[2]{ 8 | The program is called as follows: 9 | \par 10 | \noindent#1 [\emph{options}] \emph{indexname} 11 | \par 12 | #2 13 | \par 14 | And here is a description of the options: 15 | \par 16 | \begin{list}{}{} 17 | }{\end{list}} 18 | 19 | \newcommand{\MKV}{\texttt{mkvtree}\xspace} 20 | 21 | \parskip5pt 22 | \parindent0pt 23 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains basic functions which are useful for other 3 | software. That is why I have put it in a seperate directory. 4 | 5 | cleanMUMcand.c: cleaning tables of MUM candidates 6 | clock.c: timing the program 7 | debug.c: throwing debugging messages 8 | distri.c: incrementally computing distributions of integers 9 | mapfile.c: memory mapping files 10 | multiseq.c: handling multiple sequences 11 | procopt.c: parsing options 12 | safescpy.c: a safe string copy 13 | seterror.c: handling error messages 14 | space.c: space allocation and keeping track of it 15 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/megabytes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef MEGABYTES_H 12 | #define MEGABYTES_H 13 | #include "types.h" 14 | 15 | //} 16 | 17 | /* 18 | The following macro transforms bytes into megabytes. 19 | */ 20 | 21 | #define MEGABYTES(V) ((double) (V)/((UintConst(1) << 20) - 1)) 22 | 23 | //\Ignore{ 24 | 25 | #endif 26 | 27 | //} 28 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Filelists.mf: -------------------------------------------------------------------------------- 1 | LIBOBJECTS=\ 2 | cleanMUMcand.o\ 3 | clock.o\ 4 | mapfile.o\ 5 | multiseq.o\ 6 | procopt.o\ 7 | safescpy.o\ 8 | seterror.o\ 9 | space.o 10 | 11 | LIBDEBUGOBJECTS=\ 12 | cleanMUMcand.dbg.o\ 13 | clock.dbg.o\ 14 | debug.dbg.o\ 15 | mapfile.dbg.o\ 16 | multiseq.dbg.o\ 17 | procopt.dbg.o\ 18 | safescpy.dbg.o\ 19 | seterror.dbg.o\ 20 | space.dbg.o 21 | 22 | SPLINTALL=\ 23 | cleanMUMcand.splint\ 24 | clock.splint\ 25 | debug.splint\ 26 | mapfile.splint\ 27 | multiseq.splint\ 28 | procopt.splint\ 29 | safescpy.splint\ 30 | seterror.splint\ 31 | space.splint 32 | 33 | -------------------------------------------------------------------------------- /docs/README: -------------------------------------------------------------------------------- 1 | Files in this directory... 2 | 3 | differences.README - differences between MUMmer2 and MUMmer3 4 | maxmat3man.pdf - PDF documenation for 'mummer' (maxmat3) 5 | maxmat3man.tex - LaTeX documentation for 'mummer' (maxmat3) 6 | maxmat3src.pdf - PDF documentation for the maxmat3 source 7 | nucmer.README - documentation for the NUCmer alignment utility 8 | optionman.sty - LaTeX source for maxmat3man.tex 9 | promer.README - documentation for the PROmer alignment utility 10 | run-mummer1.README - documentation for the run-mummer1 script 11 | run-mummer3.README - documentation for the run-mummer3 script 12 | skaff.sty - LaTeX source for maxmat3man.tex 13 | -------------------------------------------------------------------------------- /docs/web/examples/data/mummer.gp: -------------------------------------------------------------------------------- 1 | set terminal postscript color solid "Courier" 8 2 | set output "mummer.ps" 3 | set size 1,1 4 | set grid 5 | unset key 6 | set border 0 7 | set ticscale 0 0 8 | set xlabel "REF" 9 | set ylabel "H_pyloriJ99_Eslice" 10 | set format "%.0f" 11 | set mouse format "%.0f" 12 | set mouse mouseformat "[%.0f, %.0f]" 13 | set mouse clipboardformat "[%.0f, %.0f]" 14 | set xrange [0:275287] 15 | set yrange [0:265111] 16 | set style line 1 lt 1 lw 2 pt 6 ps 0.5 17 | set style line 2 lt 3 lw 2 pt 6 ps 0.5 18 | set style line 3 lt 2 lw 2 pt 6 ps 0.5 19 | plot \ 20 | "mummer.fplot" title "FWD" w lp ls 1, \ 21 | "mummer.rplot" title "REV" w lp ls 2 22 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/symboldef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #ifndef SYMBOLDEF_H 10 | #define SYMBOLDEF_H 11 | 12 | #ifndef SYMBOLBYTES 13 | #define SYMBOLBYTES 1 14 | #endif 15 | 16 | #if SYMBOLBYTES == 1 17 | typedef Uchar SYMBOL; 18 | #else 19 | #if SYMBOLBYTES == 2 20 | typedef Ushort SYMBOL; 21 | #else 22 | #if SYMBOLBYTES == 4 23 | typedef Uint SYMBOL; 24 | #endif 25 | #endif 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /scripts/exact-tandems.csh: -------------------------------------------------------------------------------- 1 | #!__CSH_PATH -f 2 | # 3 | # Find exact tandem repeats in specified file involving an 4 | # exact duplicate of at least the specified length 5 | 6 | set filename = $1 7 | set matchlen = $2 8 | 9 | set bindir = __BIN_DIR 10 | set scriptdir = __SCRIPT_DIR 11 | 12 | if ($filename == '' || $matchlen == '') then 13 | echo "USAGE: $0 " 14 | exit -1 15 | endif 16 | 17 | echo "Finding matches" 18 | $bindir/repeat-match -t -n $matchlen $filename | tail +3 > $$.tmp.matches 19 | if ($status != 0) exit -1 20 | 21 | echo "Tandem repeats" 22 | sort -k1n -k2n $$.tmp.matches | awk -f $scriptdir/tandem-repeat.awk 23 | rm -f $$.tmp.matches 24 | -------------------------------------------------------------------------------- /exact-tandems: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | # 3 | # Find exact tandem repeats in specified file involving an 4 | # exact duplicate of at least the specified length 5 | 6 | set filename = $1 7 | set matchlen = $2 8 | 9 | set bindir = /Users/garviz/Downloads/MUMmer3.23 10 | set scriptdir = /Users/garviz/Downloads/MUMmer3.23/scripts 11 | 12 | if ($filename == '' || $matchlen == '') then 13 | echo "USAGE: $0 " 14 | exit -1 15 | endif 16 | 17 | echo "Finding matches" 18 | $bindir/repeat-match -t -n $matchlen $filename | tail +3 > $$.tmp.matches 19 | if ($status != 0) exit -1 20 | 21 | echo "Tandem repeats" 22 | sort -k1n -k2n $$.tmp.matches | awk -f $scriptdir/tandem-repeat.awk 23 | rm -f $$.tmp.matches 24 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/minmax.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef MINMAX_H 12 | #define MINMAX_H 13 | 14 | //} 15 | 16 | /* 17 | This file defines macros for maximum and minimum computation, 18 | if they are not already defined. 19 | */ 20 | 21 | #ifndef MAX 22 | #define MAX(X,Y) (((X) > (Y)) ? (X) : (Y)) 23 | #endif 24 | 25 | #ifndef MIN 26 | #define MIN(X,Y) (((X) < (Y)) ? (X) : (Y)) 27 | #endif 28 | 29 | //\Ignore{ 30 | 31 | #endif 32 | 33 | //} 34 | -------------------------------------------------------------------------------- /src/kurtz/Splintoptions: -------------------------------------------------------------------------------- 1 | -checks 2 | +enumindex 3 | -onlyunqglobaltrans 4 | -looploopbreak 5 | -readonlytrans 6 | -retalias 7 | -infloopsuncon 8 | -declundef 9 | -redecl 10 | -namechecks 11 | -exportheader 12 | -exportlocal 13 | +charint 14 | -warnposix 15 | -mustfreefresh 16 | -boolops 17 | -usereleased 18 | -mustfreeonly 19 | -compmempass 20 | -compdef 21 | -kepttrans 22 | -predboolint 23 | -unrecog 24 | -usedef 25 | -compdestroy 26 | -statictrans 27 | -branchstate 28 | -temptrans 29 | -globstate 30 | -dependenttrans 31 | -noeffect 32 | -nullstate 33 | -realcompare 34 | -initallelements 35 | -mayaliasunique 36 | -nullassign 37 | -nullpass 38 | -unqualifiedtrans 39 | -maintype 40 | -observertrans 41 | -immediatetrans 42 | -castfcnptr 43 | -onlytrans 44 | -------------------------------------------------------------------------------- /scripts/run-mummer1.csh: -------------------------------------------------------------------------------- 1 | #!__CSH_PATH -f 2 | # 3 | # **SEVERELY** antiquated script for running the mummer 1 suite 4 | # -r option reverse complements the query sequence, coordinates of the reverse 5 | # matches will be relative to the reversed sequence 6 | # 7 | 8 | set ref = $1 9 | set qry = $2 10 | set pfx = $3 11 | set rev = $4 12 | 13 | set bindir = __BIN_DIR 14 | 15 | if($ref == '' || $qry == '' || $pfx == '') then 16 | echo "USAGE: $0 [-r]" 17 | exit(-1) 18 | endif 19 | 20 | echo "Find MUMs" 21 | $bindir/mummer -mum -l 20 $rev $ref $qry | tail +2 > $pfx.out 22 | echo "Determine gaps" 23 | $bindir/gaps $ref $rev < $pfx.out > $pfx.gaps 24 | echo "Align gaps" 25 | $bindir/annotate $pfx.gaps $qry > $pfx.align 26 | mv witherrors.gaps $pfx.errorsgaps 27 | -------------------------------------------------------------------------------- /run-mummer1: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | # 3 | # **SEVERELY** antiquated script for running the mummer 1 suite 4 | # -r option reverse complements the query sequence, coordinates of the reverse 5 | # matches will be relative to the reversed sequence 6 | # 7 | 8 | set ref = $1 9 | set qry = $2 10 | set pfx = $3 11 | set rev = $4 12 | 13 | set bindir = /Users/garviz/Downloads/MUMmer3.23 14 | 15 | if($ref == '' || $qry == '' || $pfx == '') then 16 | echo "USAGE: $0 [-r]" 17 | exit(-1) 18 | endif 19 | 20 | echo "Find MUMs" 21 | $bindir/mummer -mum -l 20 $rev $ref $qry | tail +2 > $pfx.out 22 | echo "Determine gaps" 23 | $bindir/gaps $ref $rev < $pfx.out > $pfx.gaps 24 | echo "Align gaps" 25 | $bindir/annotate $pfx.gaps $qry > $pfx.align 26 | mv witherrors.gaps $pfx.errorsgaps 27 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Makefile: -------------------------------------------------------------------------------- 1 | #-- Imported variables from top level makefile 2 | # BIN_DIR AUX_BIN_DIR CXX CC CFLAGS CXXFLAGS LDFLAGS 3 | 4 | ##include ../Makedef 5 | 6 | SPLINTFLAGS=-f ../Splintoptions -DDEBUG 7 | 8 | LD=$(CC) 9 | 10 | ##CFLAGS=${DEFINECFLAGS} 11 | 12 | LIBBASE=libbase.a 13 | LIBBASEDBG=libbase.dbg.a 14 | 15 | .SUFFIXES: .dbg.o .c .o .inc 16 | 17 | include Filelists.mf 18 | 19 | all: $(LIBBASE) $(LIBBASEDBG) 20 | 21 | 22 | protodef.h: 23 | Mkprotodef.sh `ls *.c` > protodef.h 24 | 25 | 26 | $(LIBBASE): $(LIBOBJECTS) 27 | ar sruv $@ $(LIBOBJECTS) 28 | 29 | 30 | include Filegoals.mf 31 | 32 | 33 | $(LIBBASEDBG): $(LIBDEBUGOBJECTS) 34 | ar sruv $@ $(LIBDEBUGOBJECTS) 35 | 36 | 37 | .PHONY:clean 38 | clean:splintclean 39 | rm -f *.[oa] *.dbg.o *.inc *.aux *.dvi *.log *~ 40 | 41 | 42 | include Dependencies.mf 43 | -------------------------------------------------------------------------------- /scripts/tandem-repeat.awk: -------------------------------------------------------------------------------- 1 | # Usage: awk -f tandem-repeat.awk 2 | # Outputs tandem repeat regions based on repeat matches found 3 | # by repeat-match program. That program should be run with 4 | # the -t option (for tandem repeats) or at least the -f 5 | # option (fo forward strand only), and the output 6 | # sorted by first and then second column (with the first two 7 | # header lines removed). 8 | 9 | BEGIN { 10 | printf "%8s %8s %8s %10s\n", "Start", "Extent", "UnitLen", "Copies"; 11 | } 12 | 13 | { 14 | if ($1 + $3 < $2) 15 | next; 16 | if ($1 == prev) 17 | next; 18 | start = $1; 19 | extent = $2 + $3 - $1; 20 | unitlen = $2 - $1; 21 | printf "%8d %8d %8d %10.1f\n", start, extent, unitlen, extent / unitlen; 22 | prev = $1; 23 | } 24 | -------------------------------------------------------------------------------- /scripts/run-mummer3.csh: -------------------------------------------------------------------------------- 1 | #!__CSH_PATH -f 2 | # 3 | # for running the basic mummer 3 suite, should use nucmer instead when possible 4 | # to avoid the confusing reverse coordinate system of the raw programs. 5 | # 6 | # NOTE: be warned that all reverse matches will then 7 | # be relative to the reverse complement of the query sequence. 8 | # 9 | # Edit this script as necessary to alter the matching and clustering values 10 | # 11 | 12 | set ref = $1 13 | set qry = $2 14 | set pfx = $3 15 | 16 | set bindir = __BIN_DIR 17 | 18 | if($ref == '' || $qry == '' || $pfx == '') then 19 | echo "USAGE: $0 " 20 | exit(-1) 21 | endif 22 | 23 | echo "Find MUMs" 24 | $bindir/mummer -mumreference -b -l 20 $ref $qry > $pfx.out 25 | echo "Determine gaps" 26 | $bindir/mgaps -l 100 -f .12 -s 600 < $pfx.out > $pfx.gaps 27 | echo "Align gaps" 28 | $bindir/combineMUMs -x -e .10 -W $pfx.errorsgaps $ref $qry $pfx.gaps > $pfx.align 29 | -------------------------------------------------------------------------------- /run-mummer3: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | # 3 | # for running the basic mummer 3 suite, should use nucmer instead when possible 4 | # to avoid the confusing reverse coordinate system of the raw programs. 5 | # 6 | # NOTE: be warned that all reverse matches will then 7 | # be relative to the reverse complement of the query sequence. 8 | # 9 | # Edit this script as necessary to alter the matching and clustering values 10 | # 11 | 12 | set ref = $1 13 | set qry = $2 14 | set pfx = $3 15 | 16 | set bindir = /Users/garviz/Downloads/MUMmer3.23 17 | 18 | if($ref == '' || $qry == '' || $pfx == '') then 19 | echo "USAGE: $0 " 20 | exit(-1) 21 | endif 22 | 23 | echo "Find MUMs" 24 | $bindir/mummer -mumreference -b -l 20 $ref $qry > $pfx.out 25 | echo "Determine gaps" 26 | $bindir/mgaps -l 100 -f .12 -s 600 < $pfx.out > $pfx.gaps 27 | echo "Align gaps" 28 | $bindir/combineMUMs -x -e .10 -W $pfx.errorsgaps $ref $qry $pfx.gaps > $pfx.align 29 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/chardef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef CHARDEF_H 12 | #define CHARDEF_H 13 | #include 14 | 15 | //} 16 | 17 | /* 18 | This file defines some character values used when storing 19 | multiple sequences. 20 | */ 21 | 22 | #define SEPARATOR UCHAR_MAX // separator symbol in multiple seq 23 | #define WILDCARD (SEPARATOR-1) // wildcard symbol in multiple seq 24 | #define UNDEFCHAR (SEPARATOR-2) // undefined character in multiple seq 25 | #define ISSPECIAL(C) ((C) >= WILDCARD) // either WILDCARD or SEPARATOR 26 | #define ISNOTSPECIAL(C) ((C) < WILDCARD) // neither WILDCARD nor SEPARATOR 27 | 28 | //\Ignore{ 29 | 30 | #endif 31 | 32 | //} 33 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/Macronames: -------------------------------------------------------------------------------- 1 | SMALLINTS 2 | LARGEINTS 3 | SMALLINTS 4 | LARGEINTS 5 | MULTBYSMALLINTS 6 | DIVBYSMALLINTS 7 | DISTBITS 8 | DISTSHIFT 9 | MAXDISTANCE 10 | DISTPATT 11 | INDEXBITS 12 | LEAFBIT 13 | NILBIT 14 | MAXINDEX 15 | EXTRAPATT 16 | TLENBITS 17 | UNUSEDINLEAF 18 | SMALLDEPTHMARK 19 | SMALLDEPTHBITS 20 | SHIFTMIDDLE 21 | LOWERLINKBITS 22 | SMALLDEPTH 23 | ISSMALLDEPTH 24 | MAXTLEN 25 | HIGHERSIZE 26 | SHIFTHIGHER 27 | LOWERLINKSIZE 28 | LOWERLINKPATT 29 | MIDDLELINKPATT 30 | ISLEAF 31 | ISLARGE 32 | MAKELEAF 33 | MAKELARGE 34 | MAKELARGELEAF 35 | GETLEAFINDEX 36 | GETBRANCHINDEX 37 | NILPTR 38 | UNDEFINED 39 | MAXTEXTLEN 40 | GETCHILD 41 | GETDISTANCE 42 | GETBROTHER 43 | GETDEPTH 44 | GETHEADPOS 45 | GETSUFFIXLINK 46 | SETCHILD 47 | SETBROTHER 48 | SETDISTANCE 49 | SETDEPTHHEADPOS 50 | SETNEWCHILD 51 | SETNEWCHILDBROTHER 52 | LEAFBROTHERVAL 53 | SETLEAFBROTHER 54 | GETCHAINEND 55 | MAKEBRANCHADDR 56 | SETBRANCHNODEOFFSET 57 | CHILDREFERSTOLEAF 58 | LARGESTCHARINDEX 59 | LARGESTCHARINDEX 60 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/Mkstreeproto.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if test $# -lt 1 3 | then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | cat << ENDOFINCLUDE 8 | /* 9 | This file is generated. Do not edit. 10 | 11 | A Library for the Efficient Construction and Application of Suffix Trees 12 | 13 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 14 | Genomic Research. This is OSI Certified Open Source Software. 15 | Please see the file LICENSE for licensing information and 16 | the file ACKNOWLEDGEMENTS for names of contributors to the 17 | code base. 18 | */ 19 | 20 | #ifndef STREEPROTO_H 21 | #define STREEPROTO_H 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | ENDOFINCLUDE 28 | 29 | grep -h '^#define CONSTRUCT' construct.c |\ 30 | sed -e 's/^#define CONSTRUCT \(.*\)/\1;/' 31 | 32 | cat << ENDOFINCLUDE 33 | 34 | void freestree(Suffixtree *stree); 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | ENDOFINCLUDE 40 | skproto.x $* 41 | echo "#endif" 42 | -------------------------------------------------------------------------------- /src/tigr/tigrinc.hh: -------------------------------------------------------------------------------- 1 | #ifndef __TIGRINC_HH 2 | #define __TIGRINC_HH 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | 18 | #define TRUE 1 19 | #define FALSE 0 20 | #ifndef EXIT_FAILURE 21 | #define EXIT_FAILURE -1 22 | #endif 23 | #ifndef EXIT_SUCCESS 24 | #define EXIT_SUCCESS 0 25 | #endif 26 | 27 | #define INCR_SIZE 10000 28 | #define SMALL_INIT_SIZE 100 29 | #define INIT_SIZE 10000 30 | #define MAX_LINE 1024 31 | 32 | 33 | FILE * File_Open (const char *, const char *); 34 | void * Safe_calloc (size_t, size_t); 35 | void * Safe_malloc (size_t); 36 | void * Safe_realloc (void *, size_t); 37 | char Complement (char); 38 | bool CompareIUPAC (char, char); 39 | int Read_String (FILE *, char * &, long int &, char [], int); 40 | void Reverse_Complement (char S [], long int Lo, long int Hi); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/loc.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include "debugdef.h" 13 | #include "args.h" 14 | #include "types.h" 15 | #include "streedef.h" 16 | #include "protodef.h" 17 | #include "streeacc.h" 18 | #include "errordef.h" 19 | #include "spacedef.h" 20 | 21 | MAINFUNCTION 22 | { 23 | Uchar *text; 24 | Uint textlen; 25 | Suffixtree stree; 26 | 27 | DEBUGLEVELSET; 28 | 29 | CHECKARGNUM(2,"filename"); 30 | text = (Uchar *) CREATEMEMORYMAP(argv[1],False,&textlen); 31 | if(text == NULL) 32 | { 33 | STANDARDMESSAGE; 34 | } 35 | CONSTRUCTSTREE(&stree,text,textlen,return EXIT_FAILURE); 36 | #ifdef DEBUG 37 | enumlocations(&stree,checklocation); 38 | #endif 39 | freestree(&stree); 40 | if(DELETEMEMORYMAP(text) != 0) 41 | { 42 | STANDARDMESSAGE; 43 | } 44 | return EXIT_SUCCESS; 45 | } 46 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/fopen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef FOPEN_H 12 | #define FOPEN_H 13 | #include 14 | #include 15 | 16 | //} 17 | 18 | /* 19 | This file defines macros for opening and writing files via 20 | file pointers. 21 | */ 22 | 23 | #define FILEOPEN(FP,FILENAME,MODE)\ 24 | if ((FP = fopen(FILENAME,MODE)) == NULL)\ 25 | {\ 26 | fprintf(stderr,"(%s,%lu): Cannot open file \"%s\"\n",\ 27 | __FILE__,(Showuint) __LINE__,FILENAME);\ 28 | exit(EXIT_FAILURE);\ 29 | } 30 | 31 | #define FPBINWRITE(FP,BUF,SIZE)\ 32 | if(fwrite(BUF,SIZE,1,FP) != 1)\ 33 | {\ 34 | fprintf(stderr,"(%s,%lu): fwrite failed\n",__FILE__,\ 35 | (Showuint) __LINE__);\ 36 | exit(EXIT_FAILURE);\ 37 | } 38 | 39 | //\Ignore{ 40 | 41 | #endif 42 | 43 | //} 44 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/mumcand.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef MUMCAND_H 12 | #define MUMCAND_H 13 | #include "types.h" 14 | #include "arraydef.h" 15 | 16 | //} 17 | 18 | /* 19 | The following structure stores MUM candidates. That is, maximal matches 20 | which are unique in the subject-sequence but not necessarily in the 21 | query sequence. 22 | */ 23 | 24 | typedef struct 25 | { 26 | Uint mumlength, // length of the mum 27 | dbstart, // start position in the subject-sequence 28 | queryseq, // number of the query sequence 29 | querystart; // start position in the query sequence 30 | } MUMcandidate; // \Typedef{MUMcandidate} 31 | 32 | /* 33 | We store MUM-candidates in a table and hence declare a corresponding 34 | array. 35 | */ 36 | 37 | DECLAREARRAYSTRUCT(MUMcandidate); 38 | 39 | //\Ignore{ 40 | 41 | #endif 42 | 43 | //} 44 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/safescpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #include 12 | #include "debugdef.h" 13 | #include "errordef.h" 14 | #include "protodef.h" 15 | 16 | //} 17 | 18 | /*EE 19 | The following function copies the 0-terminated string pointed to by 20 | \texttt{source} to the memory area pointed to by \texttt{dest}, provided 21 | \texttt{source} is shorter than \texttt{maxlen}. If this is not 22 | true, then the function returns a negative error code. Otherwise 23 | the return value is 0. 24 | */ 25 | 26 | Sint safestringcopy(char *dest,char *source,Sint maxlen) 27 | { 28 | Sint slen; 29 | 30 | slen = (Sint) strlen(source); 31 | if(slen >= maxlen) 32 | { 33 | ERROR2("string \"%s\" is too long, cannot copy, maximum length is %ld", 34 | source,(Showsint) maxlen); 35 | return -1; 36 | } 37 | strcpy(dest,source); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /docs/web/examples/data/nucmer.tiling: -------------------------------------------------------------------------------- 1 | >B_anthracis_Mslice 312600 bases 2 | 5224 12167 88 6944 100.00 99.80 - 138389 3 | 12256 19902 56 7647 100.00 99.88 - 138310 4 | 19959 52830 -15 32872 100.00 99.98 - 138291 5 | 52816 75315 185 22500 100.00 100.00 - 138388 6 | 75501 76281 304 781 100.00 97.59 - 138123 7 | 76586 80244 -26 3659 99.92 100.00 - 138262 8 | 80219 92612 430 12394 99.99 99.97 - 138239 9 | 93043 100464 11 7422 100.00 100.00 - 138261 10 | 100476 109289 101 8814 99.97 99.99 - 138186 11 | 109391 113980 -29 4590 100.00 99.93 - 138238 12 | 113952 157110 -315 43159 99.93 99.99 - 138237 13 | 156796 187944 507 31149 99.99 99.99 - 138387 14 | 188452 189424 222 973 100.00 99.79 - 138043 15 | 189647 190339 167 693 100.00 99.57 - 138127 16 | 190507 191708 266 1202 100.00 100.00 - 138059 17 | 191975 200488 -6 8514 100.00 99.98 - 138233 18 | 200483 203490 -6 3008 100.00 100.00 - 138232 19 | 203485 204496 -146 1012 100.00 100.00 + 138088 20 | 204351 205764 60 1414 100.00 98.87 + 137999 21 | 205825 223920 72 18096 99.98 99.98 - 138259 22 | 223993 230700 -118 6708 99.97 99.99 - 138236 23 | 230583 235156 113 4574 100.00 100.00 + 138021 24 | 235270 270455 201 35186 100.00 99.99 + 138378 25 | 270657 271776 386 1120 100.00 100.00 + 138045 26 | 272163 282981 -68 10819 100.00 99.96 + 138330 27 | 282914 285791 95 2878 100.00 99.65 + 138207 28 | 285887 311494 1106 25608 99.98 99.98 + 138208 29 | -------------------------------------------------------------------------------- /src/kurtz/README: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | This directory contains the complete sources for 'mummer' (maxmat3.x) in three 10 | subdirectories: 11 | 12 | - libbasedir contains some basic functions which are used for other programs 13 | as well. To simplify reusing them I have put them in an extra library. 14 | 15 | - streesrc contains the source for the suffix tree library. 16 | 17 | - mm3src contains the application specific source code for the 18 | program maxmat3.x 19 | 20 | You can compile it using make. Since we use include statements 21 | in Makefile's your make has to support this feature. This e.g. 22 | holds for gnu make. 23 | 24 | The code was tested for the following platforms: 25 | 26 | - linux on Intel PIII 27 | - solaris2 on SUN-Sparc 28 | - tru64 on Compaq-Alpha 29 | - hp-machine with HP-UX 30 | 31 | 32 | #-- FOR DEVELOPERS --# 33 | If you would prefer to build the suffix tree source from this directory rather 34 | than the top level MUMmer directory, please uncomment the lines that begin with 35 | '##' in the Makefiles for each subdirectory to assure they use the appropriate 36 | values for compilation. 37 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/clock.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #include 12 | #include 13 | #include "types.h" 14 | 15 | //} 16 | 17 | /* 18 | This module implements function to measures the running time 19 | of programs or program parts. 20 | */ 21 | 22 | /* 23 | The following values store the the clockticks at start time 24 | and stop time of the clock. 25 | */ 26 | 27 | static clock_t startclock, 28 | stopclock; 29 | 30 | /*EE 31 | The following function initializes the clock. 32 | */ 33 | 34 | void initclock(void) 35 | { 36 | startclock = clock(); 37 | } 38 | 39 | /*EE 40 | The following function delivers the time since the 41 | clock was initialized. The time is reported in seconds 42 | as a floating point value. 43 | */ 44 | 45 | double getruntime(void) 46 | { 47 | stopclock = clock(); 48 | return (stopclock-startclock) / (double) CLOCKS_PER_SEC; 49 | } 50 | 51 | /*EE 52 | The following function delivers the clock ticks betwenn 53 | \texttt{startclock} to \texttt{stopclock}. 54 | */ 55 | 56 | Uint getclockticks(void) 57 | { 58 | stopclock = clock(); 59 | return (Uint) (stopclock-startclock); 60 | } 61 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Dependencies.mf: -------------------------------------------------------------------------------- 1 | cleanMUMcand.o: cleanMUMcand.c types.h mumcand.h arraydef.h 2 | clock.o: clock.c types.h 3 | debug.o: debug.c types.h fopen.h debugdef.h errordef.h megabytes.h 4 | mapfile.o: mapfile.c types.h errordef.h megabytes.h debugdef.h 5 | multiseq.o: multiseq.c types.h debugdef.h spacedef.h errordef.h \ 6 | minmax.h protodef.h optdesc.h multidef.h arraydef.h mumcand.h \ 7 | chardef.h 8 | procopt.o: procopt.c optdesc.h types.h errordef.h debugdef.h \ 9 | protodef.h multidef.h arraydef.h mumcand.h spacedef.h 10 | safescpy.o: safescpy.c debugdef.h types.h errordef.h protodef.h \ 11 | optdesc.h multidef.h arraydef.h mumcand.h 12 | seterror.o: seterror.c types.h 13 | space.o: space.c types.h errordef.h megabytes.h debugdef.h 14 | cleanMUMcand.dbg.o: cleanMUMcand.c types.h mumcand.h arraydef.h 15 | clock.dbg.o: clock.c types.h 16 | debug.dbg.o: debug.c types.h fopen.h debugdef.h errordef.h megabytes.h 17 | mapfile.dbg.o: mapfile.c types.h errordef.h megabytes.h debugdef.h 18 | multiseq.dbg.o: multiseq.c types.h debugdef.h spacedef.h errordef.h \ 19 | minmax.h protodef.h optdesc.h multidef.h arraydef.h mumcand.h \ 20 | chardef.h 21 | procopt.dbg.o: procopt.c optdesc.h types.h errordef.h debugdef.h \ 22 | protodef.h multidef.h arraydef.h mumcand.h spacedef.h 23 | safescpy.dbg.o: safescpy.c debugdef.h types.h errordef.h protodef.h \ 24 | optdesc.h multidef.h arraydef.h mumcand.h 25 | seterror.dbg.o: seterror.c types.h 26 | space.dbg.o: space.c types.h errordef.h megabytes.h debugdef.h 27 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/ex2leav.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include "debugdef.h" 10 | #include "streedef.h" 11 | #include "streeacc.h" 12 | 13 | BOOL exactlytwoleavesstree(Suffixtree *stree,PairUint *twoleaves,Bref start) 14 | { 15 | BOOL firstleaffound = False; 16 | Uint tmpval, node; 17 | 18 | node = GETCHILD(start); 19 | while(True) 20 | { 21 | if(ISLEAF(node)) 22 | { 23 | if(firstleaffound) 24 | { 25 | twoleaves->uint1 = GETLEAFINDEX(node); 26 | if(twoleaves->uint0 > twoleaves->uint1) 27 | { 28 | tmpval = twoleaves->uint1; 29 | twoleaves->uint1 = twoleaves->uint0; 30 | twoleaves->uint0 = tmpval; 31 | } 32 | DEBUG2(3,"has two leafs: %lu %lu\n",(Showuint) twoleaves->uint0, 33 | (Showuint) twoleaves->uint1); 34 | if(NILPTR(LEAFBROTHERVAL(stree->leaftab[GETLEAFINDEX(node)]))) 35 | { 36 | return True; 37 | } 38 | return False; 39 | } 40 | twoleaves->uint0 = GETLEAFINDEX(node); 41 | DEBUG1(3,"first successor is leaf %lu\n",(Showuint) twoleaves->uint0); 42 | firstleaffound = True; 43 | node = LEAFBROTHERVAL(stree->leaftab[GETLEAFINDEX(node)]); 44 | } else 45 | { 46 | DEBUG0(3,"has branch successor\n"); 47 | return False; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /docs/differences.README: -------------------------------------------------------------------------------- 1 | -- RUNTIME COMPARISON -- 2 | Compute mum candidates of length >= 100. 3 | Result is identical for both programs. 4 | 5 | mummer3: mummer2: 6 | 7 | Ecoli K12/ 8 | Ecoli 0157: 14 sec/66 MB 17 sec/133 MB 9 | 10 | Ecoli 0157/ 11 | Ecoli K12: 14 sec/77 MB 17 sec/155 MB 12 | 13 | S cerevisae/ 14 | S pombe 42 sec/172 MB 50 sec/348 MB 15 | 16 | S pombe/ 17 | S cerevisae 41 sec/176 MB 52 sec/358 MB 18 | 19 | 20 | 21 | -- CORRECTNESS COMPARISON -- 22 | Consider the two files 23 | 24 | > N25 25 | NNNNNNNNNNNNNNNNNNNNNNNNN 26 | 27 | and nn.query 28 | 29 | > n18 30 | nnnnnnnnnnnnnnnnnn 31 | 32 | ------------------ First example:--------------- 33 | mummer3 -l 5 Data/nn.query Data/nn.subject 34 | > N25 35 | 1 1 18 36 | 1 2 18 37 | 1 3 18 38 | 1 4 18 39 | 1 5 18 40 | 1 6 18 41 | 1 7 18 42 | 1 8 18 43 | 44 | mummer2 -l 5 Data/nn.query Data/nn.subject 45 | > N25 46 | 1 1 18 47 | 48 | I think the result of mummer3 is correct, since the 49 | string n18 occurs exactly once in n18. It occurs 8 50 | times in N25. hence 8 MUM-candidates are reported. 51 | 52 | ---- second example ----- 53 | 54 | mummer3.x -l 5 Data/nn.subject Data/nn.query 55 | > n18 56 | 57 | Bigmum.sh -l 5 Data/nn.subject Data/nn.query 58 | > n18 59 | New string is suffix of reference string 60 | 8 1 18 61 | 62 | Here n18 occurs several times in the N25, hence it is 63 | not a MUM-candidates and so nothing is to be reported. 64 | Thus the result of mummer3 is correct. 65 | -------------------------------------------------------------------------------- /docs/web/examples/data/D_melanogaster_2Rslice.cds: -------------------------------------------------------------------------------- 1 | D_melanogaster_2Rslice Dpseudo initial-exon 4473 4605 . - . 2R_CG14748.1 2 | D_melanogaster_2Rslice Dpseudo internal-exon 2533 3735 . - . 2R_CG14748.1 3 | D_melanogaster_2Rslice Dpseudo internal-exon 1823 2164 . - . 2R_CG14748.1 4 | D_melanogaster_2Rslice Dpseudo internal-exon 1416 1733 . - . 2R_CG14748.1 5 | D_melanogaster_2Rslice Dpseudo internal-exon 1205 1352 . - . 2R_CG14748.1 6 | D_melanogaster_2Rslice Dpseudo internal-exon 937 1142 . - . 2R_CG14748.1 7 | D_melanogaster_2Rslice Dpseudo internal-exon 425 608 . - . 2R_CG14748.1 8 | D_melanogaster_2Rslice Dpseudo last-exon 23 347 . - . 2R_CG14748.1 9 | D_melanogaster_2Rslice Dpseudo initial-exon 8532 8638 . - . 2R_CG14747.1 10 | D_melanogaster_2Rslice Dpseudo internal-exon 7371 8434 . - . 2R_CG14747.1 11 | D_melanogaster_2Rslice Dpseudo last-exon 7176 7258 . - . 2R_CG14747.1 12 | D_melanogaster_2Rslice Dpseudo initial-exon 16918 16938 . + . 2R_CG14752.1 13 | D_melanogaster_2Rslice Dpseudo internal-exon 17371 17432 . + . 2R_CG14752.1 14 | D_melanogaster_2Rslice Dpseudo last-exon 17913 18168 . + . 2R_CG14752.1 15 | D_melanogaster_2Rslice Dpseudo initial-exon 21197 21364 . - . 2R_CG8736.1 16 | D_melanogaster_2Rslice Dpseudo last-exon 20513 20989 . - . 2R_CG8736.1 17 | D_melanogaster_2Rslice Dpseudo initial-exon 26159 26185 . - . 2R_CG8735.1 18 | D_melanogaster_2Rslice Dpseudo internal-exon 25820 26049 . - . 2R_CG8735.1 19 | D_melanogaster_2Rslice Dpseudo internal-exon 25619 25751 . - . 2R_CG8735.1 20 | D_melanogaster_2Rslice Dpseudo internal-exon 24920 25355 . - . 2R_CG8735.1 21 | D_melanogaster_2Rslice Dpseudo internal-exon 24461 24637 . - . 2R_CG8735.1 22 | D_melanogaster_2Rslice Dpseudo last-exon 24035 24195 . - . 2R_CG8735.1 23 | -------------------------------------------------------------------------------- /docs/web/examples/data/D_melanogaster_2Rslice.utr: -------------------------------------------------------------------------------- 1 | D_melanogaster_2Rslice Dpseudo initial-exon 4473 4834 . - . 2R_CG14748.1 2 | D_melanogaster_2Rslice Dpseudo internal-exon 2533 3735 . - . 2R_CG14748.1 3 | D_melanogaster_2Rslice Dpseudo internal-exon 1823 2164 . - . 2R_CG14748.1 4 | D_melanogaster_2Rslice Dpseudo internal-exon 1416 1733 . - . 2R_CG14748.1 5 | D_melanogaster_2Rslice Dpseudo internal-exon 1205 1352 . - . 2R_CG14748.1 6 | D_melanogaster_2Rslice Dpseudo internal-exon 937 1142 . - . 2R_CG14748.1 7 | D_melanogaster_2Rslice Dpseudo internal-exon 425 608 . - . 2R_CG14748.1 8 | D_melanogaster_2Rslice Dpseudo last-exon 1 347 . - . 2R_CG14748.1 9 | D_melanogaster_2Rslice Dpseudo initial-exon 8532 8638 . - . 2R_CG14747.1 10 | D_melanogaster_2Rslice Dpseudo internal-exon 7371 8434 . - . 2R_CG14747.1 11 | D_melanogaster_2Rslice Dpseudo last-exon 7176 7258 . - . 2R_CG14747.1 12 | D_melanogaster_2Rslice Dpseudo initial-exon 16918 16938 . + . 2R_CG14752.1 13 | D_melanogaster_2Rslice Dpseudo internal-exon 17371 17432 . + . 2R_CG14752.1 14 | D_melanogaster_2Rslice Dpseudo last-exon 17913 18168 . + . 2R_CG14752.1 15 | D_melanogaster_2Rslice Dpseudo initial-exon 21197 21364 . - . 2R_CG8736.1 16 | D_melanogaster_2Rslice Dpseudo last-exon 20376 20989 . - . 2R_CG8736.1 17 | D_melanogaster_2Rslice Dpseudo initial-exon 26159 26279 . - . 2R_CG8735.1 18 | D_melanogaster_2Rslice Dpseudo internal-exon 25820 26049 . - . 2R_CG8735.1 19 | D_melanogaster_2Rslice Dpseudo internal-exon 25619 25751 . - . 2R_CG8735.1 20 | D_melanogaster_2Rslice Dpseudo internal-exon 24920 25355 . - . 2R_CG8735.1 21 | D_melanogaster_2Rslice Dpseudo internal-exon 24461 24637 . - . 2R_CG8735.1 22 | D_melanogaster_2Rslice Dpseudo last-exon 23876 24195 . - . 2R_CG8735.1 23 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/oversucc.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include "streedef.h" 10 | #include "streeacc.h" 11 | 12 | #define P3(F,A,B,C) F(A,B,C) 13 | #define PNO(F,A,B,C) /* Nothing */ 14 | 15 | #define PROCESS(PL,PB)\ 16 | while(!NILPTR(node))\ 17 | {\ 18 | if(ISLEAF(node))\ 19 | {\ 20 | leafindex = GETLEAFINDEX(node);\ 21 | PL(processleaf,stree,leafindex,info);\ 22 | node = LEAFBROTHERVAL(stree->leaftab[leafindex]);\ 23 | } else\ 24 | {\ 25 | btptr = stree->branchtab + GETBRANCHINDEX(node);\ 26 | PB(processbranch,stree,btptr,info);\ 27 | node = GETBROTHER(btptr);\ 28 | }\ 29 | } 30 | 31 | void oversuccsstree(Suffixtree *stree,Bref bnode, 32 | void(*processleaf)(Suffixtree *,Uint,void *), 33 | void(*processbranch)(Suffixtree *,Bref,void *), 34 | void *info) 35 | { 36 | Uint leafindex, node, *btptr; 37 | 38 | node = GETCHILD(bnode); 39 | if(processleaf != NULL) 40 | { 41 | if(processbranch != NULL) 42 | { 43 | PROCESS(P3,P3); 44 | } else 45 | { 46 | PROCESS(P3,PNO); 47 | } 48 | } else 49 | { 50 | if(processbranch != NULL) 51 | { 52 | PROCESS(PNO,P3); 53 | } else 54 | { 55 | fprintf(stderr,"processleaf and processbranch are both undefined\n"); 56 | exit(EXIT_FAILURE); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/args.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef ARGS_H 12 | #define ARGS_H 13 | #include 14 | #include 15 | 16 | //} 17 | 18 | /* 19 | This header file implements three macros for checking argument numbers 20 | and to parse integers and floats from strings. 21 | */ 22 | 23 | /* 24 | The following macro checks if the number of argument is exactly 25 | \texttt{N}. Otherwise, an error message is thrown. 26 | */ 27 | 28 | #define CHECKARGNUM(N,S)\ 29 | if (argc != N)\ 30 | {\ 31 | fprintf(stderr,"Usage: %s %s\n",argv[0],S);\ 32 | exit(EXIT_FAILURE);\ 33 | } 34 | 35 | /* 36 | The following scans an integer \texttt{readint} from a string. 37 | */ 38 | 39 | #define PARSEINTARG(S)\ 40 | if(sscanf(S,"%ld",&readint) != 1 || readint < 0)\ 41 | {\ 42 | fprintf(stderr,"invalid argument \"%s\": " \ 43 | "non-negative number expected\n",S);\ 44 | exit(EXIT_FAILURE);\ 45 | } 46 | 47 | /* 48 | The following scans a floating point value \texttt{readfloat} from a 49 | string. 50 | */ 51 | 52 | #define PARSEFLOATARG(S)\ 53 | if(sscanf(S,"%f",&readfloat) != 1)\ 54 | {\ 55 | fprintf(stderr,"invalid argument \"%s\":"\ 56 | " floating point number expected\n",S);\ 57 | exit(EXIT_FAILURE);\ 58 | } 59 | 60 | //\IgnoreLatex{ 61 | 62 | #endif 63 | 64 | //} 65 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/seterror.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #include 12 | #include "types.h" 13 | 14 | //} 15 | 16 | /*EE 17 | This module implements a simple mechanism to write error messages 18 | into a global buffer, and to output this buffer when required. 19 | We also maintain a global error code. 20 | */ 21 | 22 | /* 23 | The buffer to write the error message is of the following size. 24 | */ 25 | 26 | #define MAXERRORMSG 1024 27 | 28 | static Sint errorcode = 0; 29 | static char errormessage[MAXERRORMSG+1]; 30 | 31 | /*EE 32 | The following function returns the size of the buffer, and thus 33 | the maximal length of an error message. 34 | */ 35 | 36 | Sint maxerrormsg(void) 37 | { 38 | return (Sint) MAXERRORMSG; 39 | } 40 | 41 | /*EE 42 | The following function returns a reference to the buffer for storing 43 | or retrieving the error message. 44 | */ 45 | 46 | char *messagespace(void) 47 | { 48 | return errormessage; // write message with sprintf into this array 49 | } 50 | 51 | /*EE 52 | The following function sets the error code. It should be 53 | called in the innermost function in which the error occurs. 54 | */ 55 | 56 | void seterror(Sint code) 57 | { 58 | errorcode = code; 59 | } 60 | 61 | /*EE 62 | The following function returns the error code. 63 | */ 64 | 65 | Sint geterror(void) 66 | { 67 | return errorcode; 68 | } 69 | 70 | /*EE 71 | The following function resets the error code to 0. 72 | */ 73 | 74 | void reseterror(void) 75 | { 76 | errorcode = 0; 77 | } 78 | -------------------------------------------------------------------------------- /src/kurtz/mm3src/Makefile: -------------------------------------------------------------------------------- 1 | #-- Imported variables from top level makefile 2 | # BIN_DIR AUX_BIN_DIR CXX CC CFLAGS CXXFLAGS LDFLAGS 3 | 4 | ##include ../Makedef 5 | 6 | ifndef BIN_DIR 7 | BIN_DIR := $(CURDIR) 8 | endif 9 | 10 | VPATH := $(BIN_DIR) 11 | 12 | ALL := maxmat3.x maxmat3.dbg.x 13 | 14 | LIBBASEDIR=../libbasedir 15 | LIBSTREEDIR=../streesrc 16 | INCLUDEDIR=-I${LIBBASEDIR} -I${LIBSTREEDIR} 17 | 18 | override CFLAGS+=$(INCLUDEDIR) 19 | ##CFLAGS=${DEFINECFLAGS} $(INCLUDEDIR) 20 | ##LDFLAGS=${DEFINELDFLAGS} 21 | SPLINTFLAGS=${INCLUDEDIR} -f ../Splintoptions -DDEBUG 22 | LD=$(CC) 23 | 24 | LIBBASE=$(LIBBASEDIR)/libbase.a 25 | LIBBASEDBG=$(LIBBASEDIR)/libbase.dbg.a 26 | LIBSTREE=$(LIBSTREEDIR)/libstree.a 27 | LIBSTREEDBG=$(LIBSTREEDIR)/libstree.dbg.a 28 | 29 | MUM3OBJECTS=maxmat3.o maxmatopt.o maxmatinp.o\ 30 | findmumcand.o findmaxmat.o procmaxmat.o 31 | 32 | MUM3DBGOBJECTS=maxmat3.dbg.o maxmatopt.dbg.o maxmatinp.dbg.o\ 33 | findmumcand.dbg.o findmaxmat.dbg.o procmaxmat.dbg.o 34 | 35 | SPLINTALL=maxmat3.splint maxmatopt.splint maxmatinp.splint\ 36 | findmumcand.splint findmaxmat.splint procmaxmat.splint 37 | 38 | .SUFFIXES: .dbg.o 39 | 40 | all: $(ALL) 41 | 42 | mummer: $(MUM3OBJECTS) $(LIBSTREE) 43 | $(LD) $(CFLAGS) $(MUM3OBJECTS) $(LIBSTREE) $(LIBBASE) \ 44 | -o $(BIN_DIR)/$@ $(LDFLAGS); chmod 755 $(BIN_DIR)/$@ 45 | 46 | maxmat3.x: $(MUM3OBJECTS) $(LIBSTREE) 47 | $(LD) $(CFLAGS) $(LDFLAGS) $(MUM3OBJECTS) $(LIBSTREE) $(LIBBASE) \ 48 | -o $(BIN_DIR)/$@ $(LDFLAGS); chmod 755 $(BIN_DIR)/$@ 49 | 50 | maxmat3.dbg.x: ${MUM3DBGOBJECTS} $(LIBSTREEDBG) 51 | $(LD) $(LDFLAGS) $(MUM3DBGOBJECTS) $(LIBSTREEDBG) $(LIBBASEDBG) \ 52 | -lm -o $(BIN_DIR)/$@; chmod 755 $(BIN_DIR)/$@ 53 | 54 | include Filegoals.mf 55 | 56 | .PHONY:clean 57 | clean:splintclean 58 | rm -f *.[ox] shit[123] *~ 59 | cd $(BIN_DIR); rm -f $(ALL) mummer 60 | 61 | include Dependencies.mf 62 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/visible.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\IgnoreLatex{ 10 | 11 | 12 | #ifndef VISIBLE_H 13 | #define VISIBLE_H 14 | #include "types.h" 15 | 16 | //} 17 | 18 | /* 19 | This header file defines some constants and macros 20 | to test for visibility of a character (ASCII code is between 21 | 33 and 126) and to show this character. 22 | */ 23 | 24 | /* 25 | The smallest visible character is the blank with code 33. 26 | */ 27 | 28 | #define LOWESTVISIBLE 33 29 | 30 | /* 31 | The largest visible character is the tilde with code 126. 32 | */ 33 | 34 | #define HIGHESTVISIBLE 126 35 | 36 | /* 37 | Check if character is invisible according to the definition from above. 38 | */ 39 | 40 | #define INVISIBLE(C) ((C) < (Uchar) LOWESTVISIBLE ||\ 41 | (C) > (Uchar) HIGHESTVISIBLE) 42 | 43 | /* 44 | Rescale characters denoted by numbers starting at 0 to 45 | the visible ASCII characters. 46 | */ 47 | 48 | #define VISIBLECHAR(I) ((char)((I)+LOWESTVISIBLE)) 49 | 50 | /* 51 | Reverse the previous operation. 52 | */ 53 | 54 | #define INVISIBLECHAR(C) ((Sint)((C)-LOWESTVISIBLE)) 55 | 56 | /* 57 | The following macro prints a character to a file pointer. 58 | If the character is not visible, then it is shown as the 59 | corresponding ASCII-number with a prepended backslash. 60 | */ 61 | 62 | #define SHOWCHARFP(FP,C)\ 63 | if(INVISIBLE(C))\ 64 | {\ 65 | fprintf(FP,"\\%lu",(Showuint) (C));\ 66 | } else\ 67 | {\ 68 | (void) putc((Fputcfirstargtype) (C),FP);\ 69 | } 70 | 71 | /* 72 | The following macro is a variation of the previous macro, 73 | always showing the output to standard out. 74 | */ 75 | 76 | #define SHOWCHAR(C) SHOWCHARFP(stdout,C) 77 | 78 | //\IgnoreLatex{ 79 | 80 | #endif 81 | 82 | //} 83 | -------------------------------------------------------------------------------- /src/kurtz/mm3src/Filegoals.mf: -------------------------------------------------------------------------------- 1 | findmaxmat.dbg.o:findmaxmat.c 2 | $(CC) $(CFLAGS) -DDEBUG -c findmaxmat.c -o $@ 3 | 4 | findmumcand.dbg.o:findmumcand.c 5 | $(CC) $(CFLAGS) -DDEBUG -c findmumcand.c -o $@ 6 | 7 | maxmat3.dbg.o:maxmat3.c 8 | $(CC) $(CFLAGS) -DDEBUG -c maxmat3.c -o $@ 9 | 10 | maxmatinp.dbg.o:maxmatinp.c 11 | $(CC) $(CFLAGS) -DDEBUG -c maxmatinp.c -o $@ 12 | 13 | maxmatopt.dbg.o:maxmatopt.c 14 | $(CC) $(CFLAGS) -DDEBUG -c maxmatopt.c -o $@ 15 | 16 | procmaxmat.dbg.o:procmaxmat.c 17 | $(CC) $(CFLAGS) -DDEBUG -c procmaxmat.c -o $@ 18 | 19 | findmaxmat.prepro:findmaxmat.c 20 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c findmaxmat.c -o $@ 21 | 22 | findmumcand.prepro:findmumcand.c 23 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c findmumcand.c -o $@ 24 | 25 | maxmat3.prepro:maxmat3.c 26 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c maxmat3.c -o $@ 27 | 28 | maxmatinp.prepro:maxmatinp.c 29 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c maxmatinp.c -o $@ 30 | 31 | maxmatopt.prepro:maxmatopt.c 32 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c maxmatopt.c -o $@ 33 | 34 | procmaxmat.prepro:procmaxmat.c 35 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c procmaxmat.c -o $@ 36 | 37 | findmaxmat.pr:findmaxmat.c 38 | skproto.x findmaxmat.c > $@ 39 | 40 | findmumcand.pr:findmumcand.c 41 | skproto.x findmumcand.c > $@ 42 | 43 | maxmat3.pr:maxmat3.c 44 | skproto.x maxmat3.c > $@ 45 | 46 | maxmatinp.pr:maxmatinp.c 47 | skproto.x maxmatinp.c > $@ 48 | 49 | maxmatopt.pr:maxmatopt.c 50 | skproto.x maxmatopt.c > $@ 51 | 52 | procmaxmat.pr:procmaxmat.c 53 | skproto.x procmaxmat.c > $@ 54 | 55 | findmaxmat.splint:findmaxmat.c 56 | splint ${SPLINTFLAGS} findmaxmat.c 57 | touch findmaxmat.splint 58 | 59 | findmumcand.splint:findmumcand.c 60 | splint ${SPLINTFLAGS} findmumcand.c 61 | touch findmumcand.splint 62 | 63 | maxmat3.splint:maxmat3.c 64 | splint ${SPLINTFLAGS} maxmat3.c 65 | touch maxmat3.splint 66 | 67 | maxmatinp.splint:maxmatinp.c 68 | splint ${SPLINTFLAGS} maxmatinp.c 69 | touch maxmatinp.splint 70 | 71 | maxmatopt.splint:maxmatopt.c 72 | splint ${SPLINTFLAGS} maxmatopt.c 73 | touch maxmatopt.splint 74 | 75 | procmaxmat.splint:procmaxmat.c 76 | splint ${SPLINTFLAGS} procmaxmat.c 77 | touch procmaxmat.splint 78 | 79 | splintall:${SPLINTALL} 80 | 81 | splintclean: 82 | rm -f *.splint 83 | 84 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/depthtab.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include 10 | #include 11 | #include "debugdef.h" 12 | #include "types.h" 13 | #include "streedef.h" 14 | #include "streeacc.h" 15 | #include "spacedef.h" 16 | #include "protodef.h" 17 | 18 | #define ADDAMOUNT 128 19 | 20 | void showdepthtab(ArrayUint *dt) 21 | { 22 | Uint i; 23 | 24 | for(i=0; inextfreeUint; i++) 25 | { 26 | if(dt->spaceUint[i] > 0) 27 | { 28 | printf("Depth %lu %lu\n",(Showuint) i,(Showuint) dt->spaceUint[i]); 29 | } 30 | } 31 | } 32 | 33 | static void setdepthtab(ArrayUint *depthtab,Uint depth) 34 | { 35 | Uint i; 36 | 37 | if(depth >= depthtab->allocatedUint) 38 | { 39 | depthtab->spaceUint 40 | = ALLOCSPACE(depthtab->spaceUint,Uint,depth+ADDAMOUNT); 41 | for(i= depthtab->allocatedUint; ispaceUint[i] = 0; 44 | } 45 | depthtab->allocatedUint = depth+ADDAMOUNT; 46 | } 47 | if(depth + 1 > depthtab->nextfreeUint) 48 | { 49 | depthtab->nextfreeUint = depth+1; 50 | } 51 | depthtab->spaceUint[depth]++; 52 | } 53 | 54 | void makedepthtabstree(ArrayUint *depthtab,Suffixtree *stree) 55 | { 56 | Uint depth, headposition, *btptr, *largeptr, distance; 57 | 58 | btptr = stree->branchtab; 59 | while(btptr < stree->nextfreebranch) 60 | { 61 | if(ISLARGE(*btptr)) 62 | { 63 | depth = GETDEPTH(btptr); 64 | headposition = GETHEADPOS(btptr); 65 | setdepthtab(depthtab,depth); 66 | btptr += LARGEINTS; 67 | } else 68 | { 69 | distance = GETDISTANCE(btptr); 70 | GETCHAINEND(largeptr,btptr,distance); 71 | depth = GETDEPTH(largeptr); 72 | headposition = GETHEADPOS(largeptr); 73 | while(distance > 0) 74 | { 75 | setdepthtab(depthtab,depth + distance); 76 | distance--; 77 | btptr += SMALLINTS; 78 | } 79 | setdepthtab(depthtab,depth); 80 | btptr += LARGEINTS; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/tigr/Makefile: -------------------------------------------------------------------------------- 1 | #-- Imported variables from top level makefile 2 | # BIN_DIR AUX_BIN_DIR CXX CC CFLAGS CXXFLAGS LDFLAGS 3 | 4 | ifndef BIN_DIR 5 | BIN_DIR := $(CURDIR) 6 | endif 7 | ifndef AUX_BIN_DIR 8 | AUX_BIN_DIR := $(CURDIR) 9 | endif 10 | 11 | OBJ_RULE = $(CXX) $(CXXFLAGS) $< -c -o $@ 12 | BIN_RULE = $(CXX) $(CXXFLAGS) $^ -o $(BIN_DIR)/$@; \ 13 | chmod 755 $(BIN_DIR)/$@ 14 | AUX_BIN_RULE = $(CXX) $(CXXFLAGS) $^ -o $(AUX_BIN_DIR)/$@; \ 15 | chmod 755 $(AUX_BIN_DIR)/$@ 16 | VPATH := $(AUX_BIN_DIR):$(BIN_DIR) 17 | 18 | ALL := annotate combineMUMs delta-filter gaps mgaps \ 19 | postnuc postpro prenuc prepro repeat-match \ 20 | show-aligns show-coords show-tiling show-snps \ 21 | show-diff 22 | 23 | 24 | #-- PHONY rules --# 25 | .PHONY: all clean 26 | 27 | 28 | all: $(ALL) 29 | 30 | 31 | clean: 32 | rm -f *.o *~ 33 | cd $(BIN_DIR); rm -f $(ALL) 34 | cd $(AUX_BIN_DIR); rm -f $(ALL) 35 | 36 | 37 | 38 | 39 | #-- not so PHONY rules --# 40 | delta.o: delta.cc delta.hh 41 | $(OBJ_RULE) 42 | 43 | tigrinc.o: tigrinc.cc tigrinc.hh 44 | $(OBJ_RULE) 45 | 46 | sw_align.o: sw_align.cc sw_align.hh tigrinc.hh 47 | $(OBJ_RULE) 48 | 49 | translate.o: translate.cc translate.hh 50 | $(OBJ_RULE) 51 | 52 | 53 | annotate: annotate.cc tigrinc.o 54 | $(BIN_RULE) 55 | 56 | combineMUMs: combineMUMs.cc tigrinc.o 57 | $(BIN_RULE) 58 | 59 | delta-filter: delta-filter.cc tigrinc.o delta.o 60 | $(BIN_RULE) 61 | 62 | gaps: gaps.cc tigrinc.o 63 | $(BIN_RULE) 64 | 65 | mgaps: mgaps.cc tigrinc.o 66 | $(BIN_RULE) 67 | 68 | postnuc: postnuc.cc tigrinc.o sw_align.o 69 | $(AUX_BIN_RULE) 70 | 71 | postpro: postpro.cc tigrinc.o sw_align.o translate.o 72 | $(AUX_BIN_RULE) 73 | 74 | prenuc: prenuc.cc tigrinc.o 75 | $(AUX_BIN_RULE) 76 | 77 | prepro: prepro.cc tigrinc.o translate.o 78 | $(AUX_BIN_RULE) 79 | 80 | repeat-match: repeat-match.cc tigrinc.o 81 | $(BIN_RULE) 82 | 83 | show-aligns: show-aligns.cc tigrinc.o translate.o delta.o 84 | $(BIN_RULE) 85 | 86 | show-coords: show-coords.cc tigrinc.o delta.o 87 | $(BIN_RULE) 88 | 89 | show-tiling: show-tiling.cc tigrinc.o delta.o 90 | $(BIN_RULE) 91 | 92 | show-snps: show-snps.cc tigrinc.o translate.o delta.o 93 | $(BIN_RULE) 94 | 95 | show-diff: show-diff.cc tigrinc.o delta.o 96 | $(BIN_RULE) 97 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/stree.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include "debugdef.h" 13 | #include "args.h" 14 | #include "protodef.h" 15 | #include "errordef.h" 16 | #include "streedef.h" 17 | #include "spacedef.h" 18 | #include "megabytes.h" 19 | 20 | /*@unused@*/ static void progresswithdot(/*@unused@*/ Uint nextstep, 21 | /*@unused@*/ void *info) 22 | { 23 | (void) putc('.',stderr); 24 | (void) fflush(stderr); 25 | } 26 | 27 | /*@unused@*/ static void finalprogress(/*@unused@*/ void *info) 28 | { 29 | (void) putc('\n',stderr); 30 | } 31 | 32 | /*EE 33 | The following function constructs the suffix tree. 34 | */ 35 | 36 | MAINFUNCTION 37 | { 38 | Uchar *text; 39 | Uint textlen; 40 | Suffixtree stree; 41 | char *filename; 42 | 43 | DEBUGLEVELSET; 44 | 45 | CHECKARGNUM(2,"filename"); 46 | initclock(); 47 | filename = argv[1]; 48 | text = (Uchar *) CREATEMEMORYMAP(filename,False,&textlen); 49 | if(text == NULL) 50 | { 51 | fprintf(stderr,"%s: cannot open file \"%s\" ",argv[0],filename); 52 | fprintf(stderr,"or file \"%s\" is empty\n",filename); 53 | return EXIT_FAILURE; 54 | } 55 | if(textlen == 0) 56 | { 57 | fprintf(stderr,"%s: file \"%s\" is empty\n",argv[0],filename); 58 | return EXIT_FAILURE; 59 | } 60 | fprintf(stderr,"# construct suffix tree for sequence of length %lu\n", 61 | (Showuint) textlen); 62 | fprintf(stderr,"# (maximal input length is %lu)\n", 63 | (Showuint) getmaxtextlenstree()); 64 | if(constructprogressstree(&stree,text,textlen,NULL,NULL,NULL) != 0) 65 | { 66 | fprintf(stderr,"%s %s: %s\n",argv[0],filename,messagespace()); 67 | return EXIT_FAILURE; 68 | } 69 | /* 70 | addleafcountsstree(&stree); 71 | */ 72 | if(DELETEMEMORYMAP(text) != 0) 73 | { 74 | STANDARDMESSAGE; 75 | } 76 | freestree(&stree); 77 | fprintf(stderr,"# TIME %s %s %.2f\n",argv[0],filename,getruntime()); 78 | fprintf(stderr,"# SPACE %s %s %.1f\n",argv[0],filename, 79 | (double) MEGABYTES(getspacepeak())); 80 | fprintf(stderr,"# MMSPACE %s %s %.1f\n",argv[0],filename, 81 | (double) MEGABYTES(mmgetspacepeak())); 82 | return EXIT_SUCCESS; 83 | } 84 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/Filegoals.mf: -------------------------------------------------------------------------------- 1 | cleanMUMcand.dbg.o:cleanMUMcand.c 2 | $(CC) $(CFLAGS) -DDEBUG -c cleanMUMcand.c -o $@ 3 | 4 | clock.dbg.o:clock.c 5 | $(CC) $(CFLAGS) -DDEBUG -c clock.c -o $@ 6 | 7 | debug.dbg.o:debug.c 8 | $(CC) $(CFLAGS) -DDEBUG -c debug.c -o $@ 9 | 10 | mapfile.dbg.o:mapfile.c 11 | $(CC) $(CFLAGS) -DDEBUG -c mapfile.c -o $@ 12 | 13 | multiseq.dbg.o:multiseq.c 14 | $(CC) $(CFLAGS) -DDEBUG -c multiseq.c -o $@ 15 | 16 | procopt.dbg.o:procopt.c 17 | $(CC) $(CFLAGS) -DDEBUG -c procopt.c -o $@ 18 | 19 | safescpy.dbg.o:safescpy.c 20 | $(CC) $(CFLAGS) -DDEBUG -c safescpy.c -o $@ 21 | 22 | seterror.dbg.o:seterror.c 23 | $(CC) $(CFLAGS) -DDEBUG -c seterror.c -o $@ 24 | 25 | space.dbg.o:space.c 26 | $(CC) $(CFLAGS) -DDEBUG -c space.c -o $@ 27 | 28 | cleanMUMcand.prepro:cleanMUMcand.c 29 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c cleanMUMcand.c -o $@ 30 | 31 | clock.prepro:clock.c 32 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c clock.c -o $@ 33 | 34 | debug.prepro:debug.c 35 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c debug.c -o $@ 36 | 37 | mapfile.prepro:mapfile.c 38 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c mapfile.c -o $@ 39 | 40 | multiseq.prepro:multiseq.c 41 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c multiseq.c -o $@ 42 | 43 | procopt.prepro:procopt.c 44 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c procopt.c -o $@ 45 | 46 | safescpy.prepro:safescpy.c 47 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c safescpy.c -o $@ 48 | 49 | seterror.prepro:seterror.c 50 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c seterror.c -o $@ 51 | 52 | space.prepro:space.c 53 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c space.c -o $@ 54 | 55 | cleanMUMcand.splint:cleanMUMcand.c 56 | splint ${SPLINTFLAGS} cleanMUMcand.c 57 | touch cleanMUMcand.splint 58 | 59 | clock.splint:clock.c 60 | splint ${SPLINTFLAGS} clock.c 61 | touch clock.splint 62 | 63 | debug.splint:debug.c 64 | splint ${SPLINTFLAGS} debug.c 65 | touch debug.splint 66 | 67 | mapfile.splint:mapfile.c 68 | splint ${SPLINTFLAGS} mapfile.c 69 | touch mapfile.splint 70 | 71 | multiseq.splint:multiseq.c 72 | splint ${SPLINTFLAGS} multiseq.c 73 | touch multiseq.splint 74 | 75 | procopt.splint:procopt.c 76 | splint ${SPLINTFLAGS} procopt.c 77 | touch procopt.splint 78 | 79 | safescpy.splint:safescpy.c 80 | splint ${SPLINTFLAGS} safescpy.c 81 | touch safescpy.splint 82 | 83 | seterror.splint:seterror.c 84 | splint ${SPLINTFLAGS} seterror.c 85 | touch seterror.splint 86 | 87 | space.splint:space.c 88 | splint ${SPLINTFLAGS} space.c 89 | touch space.splint 90 | 91 | splintall:${SPLINTALL} 92 | 93 | splintclean: 94 | rm -f *.splint 95 | 96 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/dfs.gen: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | while(True) 10 | { 11 | if(stoptraversal != NULL && stoptraversal(stopinfo)) 12 | { 13 | return 0; 14 | } 15 | if(currentnode.toleaf) 16 | { 17 | DEBUG1(3,"visit leaf %lu ", 18 | (Showuint) LEAFADDR2NUM(stree,currentnode.address)); 19 | DEBUG1(3,"below %lu\n",(Showuint) BRADDR2NUM(stree,startnode->address)); 20 | if(processleaf(LEAFADDR2NUM(stree,currentnode.address),lcpnode,info) != 0) 21 | { 22 | return -1; 23 | } 24 | brotherval = LEAFBROTHERVAL(*(currentnode.address)); 25 | if(NILPTR(brotherval)) 26 | { 27 | readyforpop = True; 28 | currentnode.toleaf = False; 29 | } else 30 | { 31 | SETCURRENT(brotherval); // current comes from brother 32 | lcpnode = stack.spaceBref[stack.nextfreeBref-1]; 33 | } 34 | } else 35 | { 36 | if(readyforpop) 37 | { 38 | if(stack.nextfreeBref == UintConst(1)) 39 | { 40 | break; 41 | } 42 | (stack.nextfreeBref)--; 43 | DEBUG1(3,"#pop[%lu]=",(Showuint) stack.nextfreeBref); 44 | DEBUG1(3,"%lu\n", 45 | (Showuint) BRADDR2NUM(stree,stack.spaceBref[stack.nextfreeBref])); 46 | PROCESSBRANCH2(stack.spaceBref[stack.nextfreeBref],info); 47 | brotherval = GETBROTHER(stack.spaceBref[stack.nextfreeBref]); 48 | if(!NILPTR(brotherval)) 49 | { 50 | SETCURRENT(brotherval); // current comes from brother 51 | lcpnode = stack.spaceBref[stack.nextfreeBref-1]; 52 | readyforpop = False; 53 | } 54 | } else 55 | { 56 | DEBUG1(3,"#process1 %lu\n", 57 | (Showuint) BRADDR2NUM(stree,currentnode.address)); 58 | PROCESSBRANCH1(currentnode.address,info); 59 | if(godown) 60 | { 61 | STOREINARRAY(&stack,Bref,128,currentnode.address); 62 | DEBUG1(3,"#push[%lu]=",(Showuint) (stack.nextfreeBref-1)); 63 | DEBUG1(3,"%lu\n",(Showuint) BRADDR2NUM(stree,currentnode.address)); 64 | child = GETCHILD(currentnode.address); 65 | SETCURRENT(child); // current comes from child 66 | } else 67 | { 68 | brotherval = GETBROTHER(currentnode.address); 69 | if(NILPTR(brotherval)) 70 | { 71 | readyforpop = True; 72 | } else 73 | { 74 | SETCURRENT(brotherval); // current comes brother 75 | } 76 | } 77 | } 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/kurtz/mm3src/maxmatdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\IgnoreLatex{ 10 | 11 | #ifndef MAXMATDEF_H 12 | #define MAXMATDEF_H 13 | #include 14 | #include "chardef.h" 15 | #include "multidef.h" 16 | 17 | //} 18 | 19 | /* 20 | This file defines some constants and types for computing maximal 21 | matches using suffix trees. 22 | */ 23 | 24 | /* 25 | The following two characters replace wildcard 26 | characters in a DNA sequences whenever the option \texttt{-n} 27 | (for match only nucleotides) is used. One is for the 28 | subject string and the other for the query string 29 | */ 30 | 31 | #define MMREPLACEMENTCHARSUBJECT (WILDCARD-2) 32 | #define MMREPLACEMENTCHARQUERY (WILDCARD-3) 33 | 34 | /* 35 | The maximal number of query files. 36 | */ 37 | 38 | #define MAXNUMOFQUERYFILES 32 39 | 40 | /* 41 | The following type contains all information 42 | derived from parsing the arguments of the program 43 | */ 44 | 45 | typedef struct 46 | { 47 | BOOL showstring, // show the matching string 48 | reversecomplement, // compute matches on reverse strand 49 | forward, // compute matches on forward strand 50 | fourcolumn, // always use 4 column format 51 | showreversepositions, // give reverse pos. rel. to orig. string 52 | showsequencelengths, // show length of sequences on header line 53 | matchnucleotidesonly, // match ONLY acgt's 54 | cmaxmatch, // compute all maximal matches 55 | cmumcand, // compute reference-unique maximal matches 56 | cmum; // compute real matches unique in both sequences 57 | Uint minmatchlength, // minimal length of a match to be reported 58 | chunks, // number of chunks to split query sequence 59 | numofqueryfiles; // number of query files 60 | char program[PATH_MAX+1], // the path of the program 61 | subjectfile[PATH_MAX+1], // filename of the subject-sequence 62 | queryfilelist[MAXNUMOFQUERYFILES][PATH_MAX+1]; 63 | // filenames of the query-sequences 64 | } MMcallinfo; // \Typedef{MMcallinfo} 65 | 66 | /* 67 | Functions processing a maximal match are of the following type. 68 | */ 69 | 70 | typedef Sint (*Processmatchfunction) 71 | (void *,Uint,Uint,Uint,Uint); // \Typedef{Processmatchfunction} 72 | 73 | //\IgnoreLatex{ 74 | 75 | #endif 76 | 77 | //} 78 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/overmax.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include "intbits.h" 10 | #include "debugdef.h" 11 | #include "streedef.h" 12 | #include "streeacc.h" 13 | 14 | void overallstree(Suffixtree *stree,BOOL skiproot, 15 | void(*processnode)(Suffixtree *,Bref,Uint,Uint,void *), 16 | void *info) 17 | { 18 | Uint depth, headposition, *btptr, *largeptr, distance; 19 | 20 | if(skiproot) 21 | { 22 | btptr = stree->branchtab + LARGEINTS; 23 | } else 24 | { 25 | btptr = stree->branchtab; 26 | } 27 | while(btptr < stree->nextfreebranch) 28 | { 29 | if(ISLARGE(*btptr)) 30 | { 31 | depth = GETDEPTH(btptr); 32 | headposition = GETHEADPOS(btptr); 33 | processnode(stree,btptr,depth,headposition,info); 34 | btptr += LARGEINTS; 35 | } else 36 | { 37 | distance = GETDISTANCE(btptr); 38 | GETCHAINEND(largeptr,btptr,distance); 39 | depth = GETDEPTH(largeptr); 40 | headposition = GETHEADPOS(largeptr); 41 | while(distance > 0) 42 | { 43 | processnode(stree,btptr,depth + distance,headposition - distance,info); 44 | distance--; 45 | btptr += SMALLINTS; 46 | } 47 | processnode(stree,btptr,depth,headposition,info); 48 | btptr += LARGEINTS; 49 | } 50 | } 51 | } 52 | 53 | void overmaximalstree(Suffixtree *stree, 54 | void(*processnode)(Suffixtree *,Bref,Uint,Uint,void *), 55 | void *info) 56 | { 57 | Uint *btptr, *nextptr, *largeptr, depth, headposition, distance; 58 | 59 | btptr = stree->branchtab + LARGEINTS; // skip the root 60 | if(stree->nonmaximal == NULL) 61 | { 62 | fprintf(stderr,"stree->nonmaximal is NULL\n"); 63 | exit(EXIT_FAILURE); 64 | } 65 | while(btptr < stree->nextfreebranch) 66 | { 67 | if(ISLARGE(*btptr)) 68 | { 69 | depth = GETDEPTH(btptr); 70 | headposition = GETHEADPOS(btptr); 71 | nextptr = btptr + LARGEINTS; 72 | } else 73 | { 74 | distance = GETDISTANCE(btptr); 75 | GETCHAINEND(largeptr,btptr,distance); 76 | depth = GETDEPTH(largeptr) + distance; 77 | headposition = GETHEADPOS(largeptr) - distance; 78 | nextptr = largeptr + LARGEINTS; 79 | } 80 | if(!ISIBITSET(stree->nonmaximal,headposition)) 81 | { 82 | DEBUG2(3,"processnode(%lu,%lu):",(Showuint) depth, 83 | (Showuint) headposition); 84 | processnode(stree,btptr,depth,headposition,info); 85 | } 86 | btptr = nextptr; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /docs/web/examples/data/promer.aligns: -------------------------------------------------------------------------------- 1 | /home/aphillip/web/mummer/examples/data/D_melanogaster_2Rslice.fasta /home/aphillip/web/mummer/examples/data/D_pseudoobscura_contigs.fasta 2 | 3 | ============================================================ 4 | -- Alignments between D_melanogaster_2Rslice and 3214968 5 | 6 | -- BEGIN alignment [ -3 26049 - 25810 | +3 84 - 323 ] 7 | 8 | 9 | 26049 KEKSTEAVLEGLQTQIQALEKYMINTEERKRRFVTNFVGFTIGAYIVGF 10 | KEKSTE VLE LQ QI+ LEKYMINT+ERKR FVTNF+G TIGAYIVGF 11 | 84 KEKSTEEVLEALQVQIKDLEKYMINTQERKRSFVTNFLGITIGAYIVGF 12 | 13 | 25902 GLWWYFYFPPTMQECFMYLVPLLLFPIV*VL 14 | GLW FYFPPT +E +YLVPLLLFP++ V 15 | 231 GLWCCFYFPPTWKERIVYLVPLLLFPVIIVF 16 | 17 | 18 | -- END alignment [ -3 26049 - 25810 | +3 84 - 323 ] 19 | -- BEGIN alignment [ -2 25750 - 25604 | +3 315 - 461 ] 20 | 21 | 22 | 25750 IIFLRRLFTWYFQRKLNKNGDKLTRLKEDKRKILEQVMDKETYKVGSQL 23 | I+F+R++FTWYFQRKLNKNGDKL +LKE K+KILEQVMDKETYKV L 24 | 315 IVFMRQMFTWYFQRKLNKNGDKLAQLKEKKKKILEQVMDKETYKVAVNL 25 | 26 | 27 | -- END alignment [ -2 25750 - 25604 | +3 315 - 461 ] 28 | -- BEGIN alignment [ -1 25358 - 24888 | +3 444 - 845 ] 29 | 30 | 31 | 25358 QVAVNLLERFGDKKQLRISGLPTGSTPNRPQVERSPLTVAAVARTSSAG 32 | +VAVNLLERFGD+K ++ + S +PQ R+P A + 33 | 444 KVAVNLLERFGDRK...LNQSFSRSPAMQPQ..RTPQPAARLP...... 34 | 35 | 25211 GQQQQQRSLAPYTSVYRNNNNNQNTSLNSSVISTHSLGQMTSASPQLRA 36 | G QQR L PY SVYRN NNN +LNSS S MTSASP + A 37 | 558 GASTQQRLLTPYRSVYRNVNNN...NLNSSTQS......MTSASPNVGA 38 | 39 | 25064 VQELRRRSPFPIVD.DRSRSAIDRIVDFIVGDSPKDRFGMICKACHAHN 40 | VQELRRR+PFP+VD +RSRSA+DRIVDFIVGD+P R+GMICK C HN 41 | 678 VQELRRRTPFPVVDQNRSRSAVDRIVDFIVGDTP.IRYGMICKECDGHN 42 | 43 | 24920 GGL*LLKENFY 44 | G +L E+ Y 45 | 822 G...MLPEDEY 46 | 47 | 48 | -- END alignment [ -1 25358 - 24888 | +3 444 - 845 ] 49 | -- BEGIN alignment [ -1 24617 - 24462 | +3 843 - 1001 ] 50 | 51 | 52 | 24617 YEYTTFRCAFCNVLNPARKKRPVAPRLSLEAPSDTANKRNDSSESESSD 53 | Y +T+FRCAFCN LNPARKKRPVAPRLSL + +N R DSS S+SSD 54 | 843 YVFTSFRCAFCNALNPARKKRPVAPRLSLNQQTPPSNNRIDSSGSDSSD 55 | 56 | 24470 D.DS 57 | D DS 58 | 990 DYDS 59 | 60 | 61 | -- END alignment [ -1 24617 - 24462 | +3 843 - 1001 ] 62 | -- BEGIN alignment [ +3 25617 - 25787 | -2 448 - 278 ] 63 | 64 | 65 | 25617 TL*VSLSMTCSNILRLSSFRRVSLSPFLLSLRWKYHVNSRRRKMMLEPG 66 | TL*VSLSMTCSNI SF SLSPFLLSLR KYHVN R K M+ 67 | 448 TL*VSLSMTCSNIFFFFSFSWASLSPFLLSLR*KYHVNICRMKTMITGN 68 | 69 | 25764 REKGGSGT 70 | R G T 71 | 301 RSSGTKYT 72 | 73 | 74 | -- END alignment [ +3 25617 - 25787 | -2 448 - 278 ] 75 | 76 | ============================================================ 77 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/streemac.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #ifndef STREEMAC_H 10 | #define STREEMAC_H 11 | 12 | #include "types.h" 13 | #include "symboldef.h" 14 | #include "errordef.h" 15 | 16 | /* 17 | For each branching node we store five integers, see \cite{KUR:1999}. 18 | An or-combination of the following bits allow to access any subset of 19 | these five integers via the function \texttt{getbranchinfostree}. 20 | */ 21 | 22 | #define ACCESSDEPTH UintConst(1) 23 | #define ACCESSHEADPOS (UintConst(1) << 1) 24 | #define ACCESSSUFFIXLINK (UintConst(1) << 2) 25 | #define ACCESSFIRSTCHILD (UintConst(1) << 3) 26 | #define ACCESSBRANCHBROTHER (UintConst(1) << 4) 27 | 28 | /* 29 | The following macro simplifies calling the function for constructing 30 | suffix trees. 31 | */ 32 | 33 | #define CONSTRUCTSTREE(ST,TEXT,TEXTLEN,ACTION)\ 34 | if(constructstree(ST,TEXT,TEXTLEN) != 0)\ 35 | {\ 36 | fprintf(stderr,"%s",messagespace());\ 37 | ACTION;\ 38 | } 39 | 40 | /* 41 | The root of the suffix tree is stored in the first elements of the 42 | table \texttt{branchtab}. 43 | */ 44 | 45 | #define ROOT(ST) ((ST)->branchtab) 46 | 47 | /* 48 | The following macro returns \texttt{True}, if and only if the given 49 | location refers to the root. 50 | */ 51 | 52 | #define ROOTLOCATION(LOC)\ 53 | (((LOC)->locstring.length == 0) ? True : False) 54 | 55 | /* 56 | The following macros compute the index of a branch node and a leaf, 57 | relative to the first address and the first leaf, respectively. 58 | */ 59 | 60 | #define BRADDR2NUM(ST,A) ((Uint) ((A) - ROOT(ST))) 61 | #define LEAFADDR2NUM(ST,A) ((Uint) ((A) - (ST)->leaftab)) 62 | 63 | //\Ignore{ 64 | 65 | #ifdef DEBUG 66 | #define CHECKADDR(ST,A)\ 67 | if((A).toleaf)\ 68 | {\ 69 | if(LEAFADDR2NUM(ST,(A).address) > (ST)->textlen)\ 70 | {\ 71 | printf("%s,%lu:",__FILE__,(Showuint) __LINE__);\ 72 | printf("leafaddr = %lu invalid\n",\ 73 | (Showuint) LEAFADDR2NUM(ST,(A).address));\ 74 | exit(EXIT_FAILURE);\ 75 | }\ 76 | } else\ 77 | {\ 78 | if(BRADDR2NUM(ST,(A).address) >= (ST)->nextfreebranchnum)\ 79 | {\ 80 | printf("%s,%lu:",__FILE__,(Showuint) __LINE__);\ 81 | printf("branchaddr = %lu invalid\n",\ 82 | (Showuint) BRADDR2NUM(ST,(A).address));\ 83 | exit(EXIT_FAILURE);\ 84 | }\ 85 | } 86 | #else 87 | #define CHECKADDR(ST,A) /* Nothing */ 88 | #endif 89 | 90 | //} 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/dfs.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include "arraydef.h" 10 | #include "spacedef.h" 11 | #include "debugdef.h" 12 | #include "streedef.h" 13 | #include "streeacc.h" 14 | #include "protodef.h" 15 | 16 | #define SETCURRENT(V)\ 17 | if(ISLEAF(V))\ 18 | {\ 19 | currentnode.address = stree->leaftab + GETLEAFINDEX(V);\ 20 | currentnode.toleaf = True;\ 21 | } else\ 22 | {\ 23 | currentnode.address = stree->branchtab + GETBRANCHINDEX(V);\ 24 | currentnode.toleaf = False;\ 25 | } 26 | 27 | Sint depthfirststree(Suffixtree *stree,Reference *startnode, 28 | Sint (*processleaf)(Uint,Bref,void *), 29 | BOOL (*processbranch1)(Bref,void *), 30 | Sint (*processbranch2)(Bref,void *), 31 | BOOL (*stoptraversal)(void *),void *stopinfo,void *info) 32 | { 33 | BOOL godown = True, readyforpop = False; 34 | Uint child, brotherval; 35 | Bref lcpnode = NULL; 36 | Reference currentnode; 37 | ArrayBref stack; 38 | 39 | if(startnode->toleaf) 40 | { 41 | if(processleaf((Uint) (startnode->address - stree->leaftab),NULL,info) != 0) 42 | { 43 | return -1; 44 | } 45 | return 0; 46 | } 47 | if(stoptraversal != NULL && stoptraversal(stopinfo)) 48 | { 49 | return 0; 50 | } 51 | 52 | currentnode.toleaf = False; 53 | currentnode.address = startnode->address; 54 | INITARRAY(&stack,Bref); 55 | STOREINARRAY(&stack,Bref,128,currentnode.address); 56 | SETCURRENT(GETCHILD(currentnode.address)); 57 | 58 | if(processbranch1 == NULL) 59 | { 60 | #define PROCESSBRANCH1(A,B) /* Nothing */ 61 | #define PROCESSBRANCH2(A,B) godown = True 62 | #include "dfs.gen" 63 | } else 64 | { 65 | #undef PROCESSBRANCH1 66 | #undef PROCESSBRANCH2 67 | #define PROCESSBRANCH1(A,B) godown = processbranch1(A,B) 68 | #define PROCESSBRANCH2(A,B) if(processbranch2(A,B) != 0)\ 69 | {\ 70 | return -2;\ 71 | } 72 | #include "dfs.gen" 73 | } 74 | FREEARRAY(&stack,Bref); 75 | return 0; 76 | } 77 | 78 | static Sint insertinleaflist(Uint leafindex,/*@unused@*/ Bref lcpnode, 79 | void *info) 80 | { 81 | ArrayUint *leaflist = (ArrayUint *) info; 82 | 83 | DEBUG1(3,"insertinleaflist %lu\n",(Showuint) leafindex); 84 | CHECKARRAYSPACE(leaflist,Uint,256); 85 | leaflist->spaceUint[leaflist->nextfreeUint++] = leafindex; 86 | return 0; 87 | } 88 | 89 | Sint makeleaflist(Suffixtree *stree,ArrayUint *leaflist,Reference *start) 90 | { 91 | if(depthfirststree(stree,start,insertinleaflist,NULL,NULL, 92 | NULL,NULL,(void *) leaflist) != 0) 93 | { 94 | return -1; 95 | } 96 | return 0; 97 | } 98 | -------------------------------------------------------------------------------- /src/tigr/translate.cc: -------------------------------------------------------------------------------- 1 | #include "translate.hh" 2 | 3 | 4 | long int Translate_DNA 5 | (char * A, char * tA, int Frame) 6 | 7 | // function to translate dna sequence to aminoacid sequence 8 | // uses esttrans' headers and algo 9 | // A as read in from gene.h Read_String 10 | // tA should be an empty string malloced to atleast (Len A / 3) 11 | // frame is 1,2,3,4,5,6 12 | // returns new (strlen(tA+1)) or -1 on error 13 | 14 | { 15 | int dna_int; 16 | int dnaseq_len, aaseq_len; 17 | int aa_index; 18 | char *dna_seq, *dna_ptr, *dna_end, *aa_ptr; 19 | 20 | dnaseq_len = strlen ( A + 1 ); 21 | aa_ptr = tA + 1; 22 | dna_seq = A + 1; 23 | dna_end = A + dnaseq_len; 24 | 25 | if ( Frame >= 1 && Frame <= 3 ) 26 | { 27 | dna_end -= 2; 28 | dna_ptr = dna_seq + Frame - 1; 29 | for (; dna_ptr <= dna_end;) 30 | { 31 | dna_int = transdna [ int(*dna_ptr++) ]; 32 | if ( dna_int == BAD_PEP_CHAR ) { 33 | fprintf(stderr,"WARNING: Forcing unrecognized DNA char to N\n"); 34 | dna_int = DNA_XN; 35 | } 36 | aa_index = dna_int; 37 | aa_index <<= 4; 38 | 39 | dna_int = transdna [ int(*dna_ptr++) ]; 40 | if ( dna_int == BAD_PEP_CHAR ) { 41 | fprintf(stderr,"WARNING: Forcing unrecognized DNA char to N\n"); 42 | dna_int = DNA_XN; 43 | } 44 | aa_index += dna_int; 45 | aa_index <<= 4; 46 | 47 | dna_int = transdna [ int(*dna_ptr++) ]; 48 | if ( dna_int == BAD_PEP_CHAR ) { 49 | fprintf(stderr,"WARNING: Forcing unrecognized DNA char to N\n"); 50 | dna_int = DNA_XN; 51 | } 52 | aa_index += dna_int; 53 | 54 | *(aa_ptr++) = universal[aa_index]; 55 | } 56 | 57 | *aa_ptr = '\0'; 58 | aaseq_len = strlen ( tA + 1 ); 59 | } 60 | else if ( Frame >= 4 && Frame <= 6 ) 61 | { 62 | Frame -= 3; 63 | 64 | dna_seq += 2; 65 | dna_ptr = dna_end - Frame + 1; 66 | for (; dna_ptr >= dna_seq;) 67 | { 68 | dna_int = compdna [ transdna [ int(*dna_ptr--)] ]; 69 | if ( dna_int == BAD_PEP_CHAR ) { 70 | fprintf(stderr,"WARNING: Forcing unrecognized DNA char to N\n"); 71 | dna_int = DNA_XN; 72 | } 73 | aa_index = dna_int; 74 | aa_index <<= 4; 75 | 76 | dna_int = compdna [ transdna [ int(*dna_ptr--)] ]; 77 | if ( dna_int == BAD_PEP_CHAR ) { 78 | fprintf(stderr,"WARNING: Forcing unrecognized DNA char to N\n"); 79 | dna_int = DNA_XN; 80 | } 81 | aa_index += dna_int; 82 | aa_index <<= 4; 83 | 84 | dna_int = compdna [ transdna [ int(*dna_ptr--)] ]; 85 | if ( dna_int == BAD_PEP_CHAR ) { 86 | fprintf(stderr,"WARNING: Forcing unrecognized DNA char to N\n"); 87 | dna_int = DNA_XN; 88 | } 89 | aa_index += dna_int; 90 | 91 | *(aa_ptr++) = universal[aa_index]; 92 | } 93 | 94 | *aa_ptr = '\0'; 95 | aaseq_len = strlen ( tA + 1 ); 96 | } 97 | else 98 | aaseq_len = -1; 99 | 100 | 101 | return aaseq_len; 102 | } 103 | 104 | -------------------------------------------------------------------------------- /scripts/Makefile: -------------------------------------------------------------------------------- 1 | #-- Imported variables from top level makefile 2 | # BIN_DIR AUX_BIN_DIR CXX CC CFLAGS CXXFLAGS LDFLAGS 3 | 4 | ifndef BIN_DIR 5 | BIN_DIR := $(CURDIR) 6 | endif 7 | ifndef AUX_BIN_DIR 8 | AUX_BIN_DIR := $(CURDIR) 9 | endif 10 | ifndef SCRIPT_DIR 11 | SCRIPT_DIR := $(CURDIR) 12 | endif 13 | 14 | SCRIPT_DIR := $(CURDIR) 15 | SED := $(filter /%,$(shell /bin/sh -c 'type sed')) 16 | CSH := $(filter /%,$(shell /bin/sh -c 'type csh')) 17 | PERL := $(filter /%,$(shell /bin/sh -c 'type perl')) 18 | VPATH := $(BIN_DIR) 19 | 20 | ALL := exact-tandems mapview mummerplot nucmer promer \ 21 | run-mummer1 run-mummer3 nucmer2xfig dnadiff 22 | 23 | #-- PHONY rules --# 24 | .PHONY: all clean 25 | 26 | 27 | all: $(ALL) 28 | 29 | 30 | clean: 31 | rm -f *~ 32 | cd $(BIN_DIR); rm -f $(ALL) 33 | 34 | 35 | 36 | 37 | #-- not so PHONY rules --# 38 | exact-tandems: exact-tandems.csh 39 | $(SED) -e 's?__CSH_PATH?$(CSH)?g' \ 40 | -e 's?__BIN_DIR?$(BIN_DIR)?g' \ 41 | -e 's?__SCRIPT_DIR?$(SCRIPT_DIR)?g' \ 42 | exact-tandems.csh > $(BIN_DIR)/exact-tandems 43 | chmod 755 $(BIN_DIR)/exact-tandems 44 | 45 | mapview: mapview.pl 46 | $(SED) -e 's?__PERL_PATH?$(PERL)?g' \ 47 | -e 's?__SCRIPT_DIR?$(SCRIPT_DIR)?g' \ 48 | mapview.pl > $(BIN_DIR)/mapview 49 | chmod 755 $(BIN_DIR)/mapview 50 | 51 | mummerplot: mummerplot.pl Foundation.pm 52 | $(SED) -e 's?__PERL_PATH?$(PERL)?g' \ 53 | -e 's?__SCRIPT_DIR?$(SCRIPT_DIR)?g' \ 54 | -e 's?__BIN_DIR?$(BIN_DIR)?g' \ 55 | mummerplot.pl > $(BIN_DIR)/mummerplot 56 | chmod 755 $(BIN_DIR)/mummerplot 57 | 58 | dnadiff: dnadiff.pl Foundation.pm 59 | $(SED) -e 's?__PERL_PATH?$(PERL)?g' \ 60 | -e 's?__SCRIPT_DIR?$(SCRIPT_DIR)?g' \ 61 | -e 's?__BIN_DIR?$(BIN_DIR)?g' \ 62 | dnadiff.pl > $(BIN_DIR)/dnadiff 63 | chmod 755 $(BIN_DIR)/dnadiff 64 | 65 | nucmer: nucmer.pl Foundation.pm 66 | $(SED) -e 's?__PERL_PATH?$(PERL)?g' \ 67 | -e 's?__SCRIPT_DIR?$(SCRIPT_DIR)?g' \ 68 | -e 's?__AUX_BIN_DIR?$(AUX_BIN_DIR)?g' \ 69 | -e 's?__BIN_DIR?$(BIN_DIR)?g' \ 70 | nucmer.pl > $(BIN_DIR)/nucmer 71 | chmod 755 $(BIN_DIR)/nucmer 72 | 73 | promer: promer.pl Foundation.pm 74 | $(SED) -e 's?__PERL_PATH?$(PERL)?g' \ 75 | -e 's?__SCRIPT_DIR?$(SCRIPT_DIR)?g' \ 76 | -e 's?__AUX_BIN_DIR?$(AUX_BIN_DIR)?g' \ 77 | -e 's?__BIN_DIR?$(BIN_DIR)?g' \ 78 | promer.pl > $(BIN_DIR)/promer 79 | chmod 755 $(BIN_DIR)/promer 80 | 81 | run-mummer1: run-mummer1.csh 82 | $(SED) -e 's?__CSH_PATH?$(CSH)?g' \ 83 | -e 's?__BIN_DIR?$(BIN_DIR)?g' \ 84 | run-mummer1.csh > $(BIN_DIR)/run-mummer1 85 | chmod 755 $(BIN_DIR)/run-mummer1 86 | 87 | run-mummer3: run-mummer3.csh 88 | $(SED) -e 's?__CSH_PATH?$(CSH)?g' \ 89 | -e 's?__BIN_DIR?$(BIN_DIR)?g' \ 90 | run-mummer3.csh > $(BIN_DIR)/run-mummer3 91 | chmod 755 $(BIN_DIR)/run-mummer3 92 | 93 | nucmer2xfig: nucmer2xfig.pl 94 | $(SED) -e 's?__PERL_PATH?$(PERL)?g' \ 95 | nucmer2xfig.pl > $(BIN_DIR)/nucmer2xfig 96 | chmod 755 $(BIN_DIR)/nucmer2xfig 97 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | -- Version history -- 2 | 3 | 3.23 - Added -D and --banded option to nucmer. These options can be used to 4 | specify the largest indel that will be included in an alignment 5 | segment without breaking it in two pieces. 6 | 3.22 - Significant 'dnadiff' bug fixes. Breakpoints, unaligned seqs, and 7 | SNP counts now reported accurately. Unaligned contig output format 8 | switched to match show-diff format. Dynamic memory allocation for 9 | run-mummer1. Turned off output of the near useless .cluster files 10 | from nucmer and promer (let us know if you still want them). 11 | 3.21 - gcc compatability fix. 12 | 3.20 - Added 'dnadiff' comparative analysis script, 'show-diff' nucmer 13 | utility, and fixed a number of build issues. 14 | 3.19 - Fixed gcc4 build problem . 15 | 3.18 - Fixed bugs in delta-filter, began migrating to delta library. 16 | 3.17 - Many changes, major upgrade. Added/improved delta-filter, show-snps, 17 | mummerplot, and mgaps. Multiplot capability added to mummerplot. 18 | 3.16 - Added 'delta-filter' utility. 19 | 3.15 - Fixed --nooptimize in nuc/promer. 20 | 3.14 - Fixed gcc3 compilation bug. 21 | 3.13 - Added -d, -g, -G and -o options to show-coords and updated 22 | documentation. Fixed bug in show-tiling -R. 23 | 3.12 - Added the --nosimplify option to nucmer for repeat searching. Fixed 24 | a bug in nucmer and promer. Fixed rounding issue in show-coords. 25 | Updated citations. 26 | 3.11 - Fixed bug show-tiling -R option. Added some mapview changes. Fixed 27 | the issue with mummerplot being to faint. 28 | 3.10 - Now Mac OSX compatible. Added -R option to show-tiling. 29 | 3.08 - Added MUMmer examples web docs which gives brief walkthroughs. 30 | 3.07 - Added the 'mapview' plotting utility and appropriate documentation. 31 | Fixed origin wrap shadowing bug in show-tiling when using the -c option. 32 | NUCmer and PROmer now convert to absolute paths to avoid ambiguity. 33 | 3.06 - Added -F and -h option to mummer. Changed -mumcand option to 34 | -mumreference, but left deprecated -mumcand option available. Added 35 | -maxmatch option to mummer, and changed default behavior of all 36 | applicable programs to -mumreference (nucmer, promer and mummer). 37 | Added -w (screen width) option to show-aligns. Updated documentation 38 | with all of these changes. 39 | 3.05 - Added -k option to show-coords to only display the best frame for 40 | overlapping PROmer alignments. Added --[no]optimize option to nucmer 41 | and promer to allow alignment score optimization to be turned off, i.e 42 | allow alignments to extend to the ends of sequences rather than 43 | backtracking to optimize the alignment score. Updated docs. 44 | 3.04 - Fixed combineMUMs bug and added new option, added some developer 45 | support in the src/kurtz subdirectory, and added extra INSTALL 46 | information in the docs. 47 | 3.03 - Added HTML user manual in the /docs/htmlmanual/ subdir. 48 | 3.02 - Fixed small bug in show-coords. Added additional options 49 | to show-coords. Added extra help text to show-tiling. Changed 50 | contact email address. Consistent padding added to combineMUMs. 51 | 3.01 - Fixed off-by-one error in multi-reference 'mummer' usage. 52 | 3.00 - Initial open source release! 53 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/spacedef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef SPACEDEF_H 12 | #define SPACEDEF_H 13 | #include "types.h" 14 | #include "errordef.h" 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /*@notnull@*/ void *allocandusespaceviaptr(char *file,Uint line, 21 | /*@null@*/ void *ptr, 22 | Uint size,Uint number); 23 | /*@notnull@*/ char *dynamicstrdup(char *file,Uint line,char *source); 24 | void freespaceviaptr(char *file,Uint line,void *ptr); 25 | /*@null@*/ void *creatememorymapforfiledesc(char *file,Uint line,Sint fd, 26 | BOOL writemap,Uint numofbytes); 27 | /*@null@*/ void *creatememorymap(char *file,Uint line,char *filename, 28 | BOOL writemap,Uint *numofbytes); 29 | Sint deletememorymap(char *file,Uint line,void *mappedfile); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | //} 36 | 37 | /* 38 | This file defines macros to simplify the calls to the 39 | functions 40 | \begin{itemize} 41 | \item 42 | \texttt{allocandusespaceviaptr}, 43 | \item 44 | \texttt{freespaceviaptr}, 45 | \item 46 | \texttt{dynamicstrdup}, 47 | \item 48 | \texttt{creatememorymapforfiledesc}, 49 | \item 50 | \texttt{creatememorymap}, 51 | \item 52 | \texttt{delete\-memorymap}. 53 | \end{itemize} 54 | 55 | \begin{enumerate} 56 | \item 57 | The first parameter to \texttt{ALLOCSPACE} is \texttt{NULL} 58 | or a pointer to a previously 59 | allocated space block. 60 | \item 61 | The second argument of the macro is the type of the space block 62 | to be allocated. 63 | \item 64 | The third argument is the number of elements of that type to be 65 | allocated space for. 66 | \end{enumerate} 67 | */ 68 | 69 | #define ALLOCSPACE(S,T,N)\ 70 | (T *) allocandusespaceviaptr(__FILE__,(Uint) __LINE__,\ 71 | S,(Uint) sizeof(T),N) 72 | 73 | /* 74 | The macro \texttt{FREESPACE} frees the space pointed to by \texttt{P}, 75 | if this is not \texttt{NULL}. It also sets the 76 | pointer to \texttt{NULL}. 77 | */ 78 | 79 | #define FREESPACE(P)\ 80 | if((P) != NULL)\ 81 | {\ 82 | freespaceviaptr(__FILE__,(Uint) __LINE__,P);\ 83 | P = NULL;\ 84 | } 85 | 86 | /* 87 | The remaining macros call the corresponding function with 88 | the filename and the line number where the function call 89 | appears. 90 | */ 91 | 92 | #define DYNAMICSTRDUP(S)\ 93 | dynamicstrdup(__FILE__,(Uint) __LINE__,S) 94 | 95 | #define CREATEMEMORYMAP(F,WM,NB)\ 96 | creatememorymap(__FILE__,(Uint) __LINE__,F,WM,NB) 97 | 98 | #define CREATEMEMORYMAPFORFILEDESC(FD,WM,NB)\ 99 | creatememorymapforfiledesc(__FILE__,(Uint) __LINE__,FD,WM,NB) 100 | 101 | #define DELETEMEMORYMAP(MF)\ 102 | deletememorymap(__FILE__,(Uint) __LINE__,(void *) MF) 103 | 104 | //\Ignore{ 105 | 106 | #endif 107 | 108 | //} 109 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/Makefile: -------------------------------------------------------------------------------- 1 | #-- Imported variables from top level makefile 2 | # BIN_DIR AUX_BIN_DIR CXX CC CFLAGS CXXFLAGS LDFLAGS 3 | 4 | ##include ../Makedef 5 | 6 | LIBBASEDIR=../libbasedir 7 | INCLUDEDIR=../libbasedir 8 | 9 | # the following flags determines the maximal allowed input size of 10 | # the suffix tree construction 11 | # STREESMALL means that the maximal sequence length is 2 MB 12 | # STREELARGE means that the maximal sequence length is 134 MB 13 | # STREEHUGE means that the maximal sequence length is 500 MB 14 | 15 | #SIZEFLAG=-DSTREESMALL 16 | #SIZEFLAG=-DSTREELARGE 17 | SIZEFLAG=-DSTREEHUGE 18 | 19 | override CFLAGS+=-I$(INCLUDEDIR) $(SIZEFLAG) 20 | ##CFLAGS=${DEFINECFLAGS} -I$(INCLUDEDIR) $(SIZEFLAG) 21 | ##LDFLAGS=${DEFINELDFLAGS} 22 | SPLINTFLAGS=${SIZEFLAG} -I${INCLUDEDIR} -f ../Splintoptions -DDEBUG 23 | 24 | #-DSTARTFACTOR=0.5 25 | 26 | LD=${CC} 27 | 28 | LIBBASE=${LIBBASEDIR}/libbase.a 29 | LIBBASEDBG=${LIBBASEDIR}/libbase.dbg.a 30 | 31 | PROTOFILES=access.c scanpref.c linkloc.c depthtab.c\ 32 | ex2leav.c dfs.c overmax.c oversucc.c\ 33 | addleafcount.c iterator.c streedbg.c 34 | 35 | OBJECTS4=construct.4.o access.4.o scanpref.4.o linkloc.4.o depthtab.4.o\ 36 | ex2leav.4.o dfs.4.o overmax.4.o oversucc.4.o\ 37 | addleafcount.4.o iterator.4.o 38 | 39 | OBJECTS=construct.o access.o scanpref.o linkloc.o depthtab.o\ 40 | ex2leav.o dfs.o overmax.o oversucc.o\ 41 | addleafcount.o iterator.o 42 | 43 | DBGOBJECTS4=construct.dbg.4.o access.dbg.4.o streedbg.dbg.4.o\ 44 | depthtab.dbg.4.o scanpref.dbg.4.o linkloc.dbg.4.o\ 45 | ex2leav.dbg.4.o dfs.dbg.4.o overmax.dbg.4.o oversucc.dbg.4.o\ 46 | addleafcount.dbg.4.o iterator.dbg.4.o 47 | 48 | DBGOBJECTS=construct.dbg.o access.dbg.o streedbg.dbg.o depthtab.dbg.o\ 49 | scanpref.dbg.o linkloc.dbg.o ex2leav.dbg.o dfs.dbg.o\ 50 | overmax.dbg.o oversucc.dbg.o addleafcount.dbg.o iterator.dbg.o 51 | 52 | SPLINTALL=access.splint scanpref.splint linkloc.splint depthtab.splint\ 53 | ex2leav.splint dfs.splint overmax.splint oversucc.splint\ 54 | addleafcount.splint iterator.splint streedbg.splint\ 55 | loc.splint stree.splint 56 | 57 | .SUFFIXES: .o .4.o .dbg.o .dbg.4.o .a .dbg.a .4.a .dbg.4.a .x .dbg.x 58 | 59 | all: libs progs 60 | 61 | libs: libstree.a libstree.dbg.a 62 | 63 | progs: stree.x stree.dbg.x loc.x loc.dbg.x 64 | 65 | include Filegoals.mf 66 | 67 | libstree.4.a: $(OBJECTS4) 68 | ar sruv $@ $(OBJECTS4) 69 | 70 | libstree.a: $(OBJECTS) 71 | ar sruv $@ $(OBJECTS) 72 | 73 | libstree.dbg.4.a: $(DBGOBJECTS4) 74 | ar sruv $@ $(DBGOBJECTS4) 75 | 76 | libstree.dbg.a: $(DBGOBJECTS) 77 | ar sruv $@ $(DBGOBJECTS) 78 | 79 | 80 | stree.x: stree.o libstree.a 81 | $(LD) $(LDFLAGS) stree.o libstree.a $(LIBBASE) -o $@ 82 | 83 | loc.x: loc.o libstree.a 84 | $(LD) $(LDFLAGS) loc.o libstree.a $(LIBBASE) -o $@ 85 | 86 | stree.dbg.x: stree.dbg.o libstree.dbg.a 87 | $(LD) $(LDFLAGS) stree.dbg.o libstree.dbg.a $(LIBBASEDBG) -o $@ 88 | 89 | loc.dbg.x: loc.dbg.o libstree.dbg.a 90 | $(LD) $(LDFLAGS) loc.dbg.o libstree.dbg.a $(LIBBASEDBG) -o $@ 91 | 92 | streeproto.h: $(PROTOFILES) Mkstreeproto.sh 93 | @echo "make $@" 94 | @Mkstreeproto.sh ${PROTOFILES} > $@ 95 | 96 | .PHONY:clean 97 | clean:splintclean 98 | rm -f *.[aox] *~ 99 | 100 | stree.dbg.o: streedbg.o construct.dbg.o 101 | 102 | construct.dbg.o: construct.gen 103 | 104 | include Dependencies.mf 105 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------- 2 | # Top level makefile for MUMmer 3.0 3 | # 4 | # Dependencies: '/bin/sh', 'g++', 'gcc', 'csh', 'perl', 'sed' 5 | # 6 | # 'make all' builds all MUMmer code and scripts in the base directory 7 | # 8 | # 'make check' checks for the existance of the MUMmer dependencies 9 | # 10 | # 'make clean' removes *.o *~ core* and executable files 11 | # 12 | # 'make dist' creates a gzipped tarfile of the MUMmer directories 13 | # 14 | # 'make install' alias for 'make all' (for compatibility) 15 | # 16 | # 'make kurtz' builds Stefan's mummer program in the base directory 17 | # 18 | # 'make scripts' builds the MUMmer scripts in the base directory 19 | # 20 | # 'make tigr' builds TIGR's code in the base directory 21 | # 22 | # 'make uninstall' alias for 'make clean' (for compatibility) 23 | # 24 | #------------------------------------------------------------------------------- 25 | SHELL = /bin/sh 26 | VERSION := 3.23 27 | 28 | 29 | TOP_DIR := $(CURDIR) 30 | BIN_DIR := $(TOP_DIR) 31 | AUX_BIN_DIR := $(TOP_DIR)/aux_bin 32 | 33 | DOC_DIR := $(TOP_DIR)/docs 34 | SCRIPT_DIR := $(TOP_DIR)/scripts 35 | TIGR_SRC_DIR := $(TOP_DIR)/src/tigr 36 | KURTZ_SRC_DIR := $(TOP_DIR)/src/kurtz 37 | 38 | CC := $(filter /%,$(shell /bin/sh -c 'type gcc')) 39 | CXX := $(filter /%,$(shell /bin/sh -c 'type g++')) 40 | SED := $(filter /%,$(shell /bin/sh -c 'type sed')) 41 | CSH := $(filter /%,$(shell /bin/sh -c 'type csh')) 42 | PERL := $(filter /%,$(shell /bin/sh -c 'type perl')) 43 | AR := $(filter /%,$(shell /bin/sh -c 'type ar')) 44 | 45 | CXXFLAGS = -Wno-write-strings -Wno-strings-format -fopenmp -O3 46 | CFLAGS = -fopenmp -O3 47 | LDFLAGS = -llikwid -lm 48 | 49 | FLATS = ACKNOWLEDGEMENTS COPYRIGHT INSTALL LICENSE Makefile README ChangeLog 50 | 51 | 52 | 53 | #-- EXPORT THESE VARIABLES TO OTHER MAKEFILES 54 | export BIN_DIR AUX_BIN_DIR CXX CC CFLAGS CXXFLAGS LDFLAGS 55 | 56 | 57 | 58 | 59 | #-- PHONY rules --# 60 | .PHONY: all check clean dist scripts uninstall 61 | 62 | 63 | all: kurtz tigr scripts 64 | 65 | 66 | check: 67 | ifndef TOP_DIR 68 | @echo "ERROR: could not find working directory" 69 | endif 70 | ifndef CC 71 | @echo "ERROR: 'gcc' GNU C compiler not found" 72 | endif 73 | ifndef CXX 74 | @echo "ERROR: 'g++' GNU C++ compiler not found" 75 | endif 76 | ifndef SED 77 | @echo "ERROR: 'sed' StreamEDitor not found" 78 | endif 79 | ifndef CSH 80 | @echo "ERROR: 'csh' C-shell not found" 81 | endif 82 | ifndef PERL 83 | @echo "ERROR: 'perl' PERL not found" 84 | endif 85 | ifndef AR 86 | @echo "ERROR: 'ar' GNU archiver not found" 87 | endif 88 | @echo "check complete" 89 | 90 | 91 | clean: 92 | rm -f *~ core* 93 | cd $(KURTZ_SRC_DIR); $(MAKE) clean 94 | cd $(TIGR_SRC_DIR); $(MAKE) clean 95 | cd $(SCRIPT_DIR); $(MAKE) clean 96 | cd $(DOC_DIR); $(MAKE) clean 97 | 98 | 99 | dist: DISTDIR = MUMmer$(VERSION) 100 | dist: 101 | mkdir $(DISTDIR) 102 | cp -r aux_bin $(DISTDIR) 103 | cp -r docs $(DISTDIR) 104 | cp -r scripts $(DISTDIR) 105 | cp -r src $(DISTDIR) 106 | cp $(FLATS) $(DISTDIR) 107 | rm -rf `find $(DISTDIR) -name CVS` 108 | tar -cvf $(DISTDIR).tar $(DISTDIR) 109 | gzip $(DISTDIR).tar 110 | rm -rf $(DISTDIR) 111 | 112 | 113 | install: all 114 | 115 | 116 | kurtz: 117 | cd $(KURTZ_SRC_DIR); $(MAKE) mummer 118 | 119 | 120 | scripts: 121 | cd $(SCRIPT_DIR); $(MAKE) all 122 | 123 | 124 | tigr: 125 | cd $(TIGR_SRC_DIR); $(MAKE) all 126 | 127 | 128 | uninstall: clean 129 | 130 | 131 | #-- END OF MAKEFILE --# 132 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/protodef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #ifndef PROTODEF_H 10 | #define PROTODEF_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include "types.h" 16 | #include "optdesc.h" 17 | #include "multidef.h" 18 | #include "mumcand.h" 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | Sint mumuniqueinquery(void *processinfo, 23 | Sint (*processmum)(void *,Uint,Uint,Uint,Uint), 24 | ArrayMUMcandidate *mumcand); 25 | void initclock(void); 26 | double getruntime(void); 27 | Uint getclockticks(void); 28 | Sint getdebuglevel(void); 29 | BOOL getdebugwhere(void); 30 | void setdebuglevel(void); 31 | void setdebuglevelfilename(char *filename); 32 | FILE *getdbgfp(void); 33 | void debugclosefile(void); 34 | Sint simplefileOpen(char *filename,Uint *numofbytes); 35 | /*@null@*/ void *creatememorymapforfiledesc(char *file,Uint line,Sint fd, 36 | BOOL writemap,Uint numofbytes); 37 | /*@null@*/ void *creatememorymap(char *file,Uint line,char *filename, 38 | BOOL writemap,Uint *numofbytes); 39 | Sint deletememorymap(char *file,Uint line,void *mappedfile); 40 | void mmcheckspaceleak(void); 41 | Sint mmwrapspace(void); 42 | void mmshowspace(void); 43 | Uint mmgetspacepeak(void); 44 | void initmultiseq(Multiseq *multiseq); 45 | void freemultiseq(Multiseq *multiseq); 46 | Sint overallsequences(BOOL rcmode,Multiseq *multiseq,void *applyinfo, 47 | Sint(*apply)(void *,Uint,Uchar *,Uint)); 48 | Sint getrecordnum(Uint *recordseps,Uint numofrecords,Uint totalwidth, 49 | Uint position); 50 | Sint getseqnum(Multiseq *multiseq,Uint position); 51 | Sint pos2pospair(Multiseq *multiseq,PairUint *pos,Uint position); 52 | void initoptions(OptionDescription *options,Uint numofoptions); 53 | Sint addoption(OptionDescription *options,Uint numofoptions, 54 | Uint optnum,char *optname,char *optdesc); 55 | Sint procoption(OptionDescription *opt,Uint numofopt,char *optstring); 56 | void showoptions(FILE *outfp,char *program,OptionDescription *opt, 57 | Uint numofopt); 58 | void showoptionswithoutexclude(FILE *outfp,char *program, 59 | OptionDescription *opt, 60 | Sint *excludetab,Uint numofopt); 61 | Sint checkdoubleexclude(Uint numofopts,OptionDescription *opt, 62 | Sint *excludetab,Uint len); 63 | Sint checkexclude(OptionDescription *opt,Sint *excludetab,Uint len); 64 | void showexclude(OptionDescription *opt,Sint *excludetab,Uint len); 65 | Sint safestringcopy(char *dest,char *source,Sint maxlen); 66 | Sint maxerrormsg(void); 67 | char *messagespace(void); 68 | void seterror(Sint code); 69 | Sint geterror(void); 70 | void reseterror(void); 71 | /*@notnull@*/ void *allocandusespaceviaptr(char *file,Uint line, 72 | /*@null@*/ void *ptr, 73 | Uint size,Uint number); 74 | /*@notnull@*/ char *dynamicstrdup(char *file,Uint line,char *source); 75 | void freespaceviaptr(char *file,Uint line,void *ptr); 76 | void wrapspace(void); 77 | void activeblocks(void); 78 | void checkspaceleak(void); 79 | void showspace(void); 80 | Uint getspacepeak(void); 81 | void showmemsize(void); 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | #endif 86 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/intbits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef INTBITS_H 12 | #define INTBITS_H 13 | #include 14 | #include "types.h" 15 | #include "errordef.h" 16 | #include "spacedef.h" 17 | 18 | //} 19 | 20 | /* 21 | This file contains some definitions manipulating bitvectors represented 22 | by a \texttt{Uint}. In the comment lines we use $w$ for the word size 23 | and \texttt{\symbol{94}} for exponentiation of the previous character. 24 | */ 25 | 26 | #define INTWORDSIZE\ 27 | (UintConst(1) << LOGWORDSIZE) // # of bits in Uint = w 28 | #define FIRSTBIT\ 29 | (UintConst(1) << (INTWORDSIZE-1)) // \(10^{w-1}\) 30 | #define ISBITSET(S,I)\ 31 | (((S) << (I)) & FIRSTBIT) // is \(i\)th bit set? 32 | #define ITHBIT(I)\ 33 | (FIRSTBIT >> (I)) // \(0^{i}10^{w-i-1}\) 34 | #define SECONDBIT\ 35 | (FIRSTBIT >> 1) // \(010^{w-2}\) 36 | #define THIRDBIT\ 37 | (FIRSTBIT >> 2) // \(0010^{w-3}\) 38 | #define FIRSTTWOBITS\ 39 | (UintConst(3) << (INTWORDSIZE-2)) // \(11^{w-2}\) 40 | #define EXCEPTFIRSTBIT\ 41 | (~FIRSTBIT) // \(01^{w-1}\) 42 | #define EXCEPTFIRSTTWOBITS\ 43 | (EXCEPTFIRSTBIT >> 1) // \(001^{w-2}\) 44 | #define EXCEPTFIRSTTHREEBITS\ 45 | (EXCEPTFIRSTBIT >> 2) // \(0001^{w-3}\) 46 | #define DIVWORDSIZE(I)\ 47 | ((I) >> LOGWORDSIZE) // \((I) div w\) 48 | #define MODWORDSIZE(I)\ 49 | ((I) & (INTWORDSIZE-1)) // \((I) mod w\) 50 | #define MULWORDSIZE(I)\ 51 | ((I) << LOGWORDSIZE) // \((I) * w\) 52 | 53 | /* 54 | The following macro allocates a bitarray of \texttt{N} bits. All bits 55 | are off. 56 | */ 57 | 58 | #define INITBITTAB(TAB,N)\ 59 | {\ 60 | Uint *tabptr, tabsize = 1 + DIVWORDSIZE(N);\ 61 | TAB = ALLOCSPACE(NULL,Uint,tabsize);\ 62 | for(tabptr = TAB; tabptr < (TAB) + tabsize; tabptr++)\ 63 | {\ 64 | *tabptr = 0;\ 65 | }\ 66 | } 67 | 68 | /* 69 | The following macro inititalizes a bitarray such tha all bits 70 | are off. 71 | */ 72 | 73 | #define CLEARBITTAB(TAB,N)\ 74 | {\ 75 | Uint *tabptr, tabsize = 1 + DIVWORDSIZE(N);\ 76 | for(tabptr = TAB; tabptr < TAB + tabsize; tabptr++)\ 77 | {\ 78 | *tabptr = 0;\ 79 | }\ 80 | } 81 | 82 | 83 | /* 84 | \texttt{SETIBIT(TAB,I)} sets the \texttt{I}-th bit in bitarray 85 | \texttt{TAB} to 1. 86 | */ 87 | 88 | #define SETIBIT(TAB,I) (TAB)[DIVWORDSIZE(I)] |= ITHBIT(MODWORDSIZE(I)) 89 | 90 | /* 91 | \texttt{UNSSETIBIT(TAB,I)} sets the \texttt{I}-th bit in bitarray 92 | \texttt{TAB} to 0. 93 | */ 94 | 95 | #define UNSETIBIT(TAB,I) (TAB)[DIVWORDSIZE(I)] &= ~(ITHBIT(MODWORDSIZE(I))) 96 | 97 | /* 98 | \texttt{ISIBITSET(TAB,I)} checks if the \texttt{I}-th bit in bitarray 99 | \texttt{TAB} is 1. 100 | */ 101 | 102 | #define ISIBITSET(TAB,I) ((TAB)[DIVWORDSIZE(I)] & ITHBIT(MODWORDSIZE(I))) 103 | 104 | //\Ignore{ 105 | 106 | #ifdef __cplusplus 107 | extern "C" { 108 | #endif 109 | 110 | char *intbits2string(Uint bs); 111 | 112 | #ifdef __cplusplus 113 | } 114 | #endif 115 | 116 | #endif 117 | 118 | //} 119 | -------------------------------------------------------------------------------- /src/tigr/prenuc.cc: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // Programmer: Adam M Phillippy, The Institute for Genomic Research 3 | // File: prenuc.cc 4 | // Date: 07 / 15 / 2002 5 | // 6 | // Input: Input is a single multi-fasta sequence file 7 | // 8 | // Output: Output is to stdout, and it consists of each sequence in the 9 | // FASTA file appended together with all the headers removed. A 10 | // new generic header is inserted at the beginning of the file to 11 | // adhere to FASTA standards. 12 | // 13 | // NOTICE: An `x' is placed at the end of all sequences so that no MUMs 14 | // will span across two different sequences. This extra character 15 | // is not included in the sequence lengths. 16 | // 17 | // Usage: prenuc 18 | // 19 | //------------------------------------------------------------------------------ 20 | 21 | #include "tigrinc.hh" 22 | 23 | //-- Output this many sequence characters per line 24 | #define CHARS_PER_LINE 60 25 | 26 | void printHelp 27 | (const char *); 28 | 29 | void printUsage 30 | (const char *); 31 | 32 | int main 33 | (int argc, char * argv[]) 34 | { 35 | long int InitSize, SizeA, ct, i; 36 | char * A, Id[MAX_LINE]; 37 | FILE * RefFile; 38 | 39 | //-- Parse the command line arguments 40 | { 41 | optarg = NULL; 42 | int ch, errflg = 0; 43 | while ( !errflg && ((ch = getopt (argc, argv, "hT:qrclw")) != EOF) ) 44 | switch (ch) 45 | { 46 | case 'h' : 47 | printHelp (argv[0]); 48 | exit (EXIT_SUCCESS); 49 | break; 50 | 51 | default : 52 | errflg ++; 53 | } 54 | 55 | if ( errflg > 0 || argc - optind != 1 ) 56 | { 57 | printUsage (argv[0]); 58 | exit (EXIT_FAILURE); 59 | } 60 | } 61 | 62 | RefFile = File_Open(argv[1],"r"); 63 | 64 | InitSize = INIT_SIZE; 65 | A = (char *) Safe_malloc (sizeof(char) * INIT_SIZE); 66 | 67 | ct = 0; 68 | 69 | printf(">allcontigs %s\n", argv[1]); 70 | while ( Read_String (RefFile, A, InitSize, Id, FALSE) ) 71 | { 72 | SizeA = strlen(A + 1); 73 | 74 | //-- Output the concatenated sequence 75 | for ( i = 1; i <= SizeA; i ++ ) 76 | { 77 | fputc (A[i], stdout); 78 | if ( ++ ct == CHARS_PER_LINE ) 79 | { 80 | ct = 0; 81 | fputc ('\n', stdout); 82 | } 83 | } 84 | 85 | fputc ('x', stdout); 86 | if ( ++ ct == CHARS_PER_LINE ) 87 | { 88 | ct = 0; 89 | fputc ('\n', stdout); 90 | } 91 | } 92 | if ( ct != 0 ) 93 | fputc ('\n', stdout); 94 | 95 | fclose(RefFile); 96 | 97 | free(A); 98 | 99 | return EXIT_SUCCESS; 100 | } 101 | 102 | 103 | 104 | void printHelp 105 | (const char * s) 106 | { 107 | fprintf(stderr, 108 | "\nUSAGE: %s [options] \n\n", s); 109 | fprintf(stderr,"-h display help information\n\n"); 110 | fprintf(stderr, 111 | " Input is one multi-fasta sequence file.\n" 112 | " Output is to stdout, and it consists of each sequence in the\n" 113 | "FASTA file appended together with all the headers removed. A\n" 114 | "new generic header is inserted at the beginning of the file to\n" 115 | "adhere to FASTA standards. An `x' is placed at the end of all\n" 116 | "sequences so that no MUMs will span two different sequences.\n\n"); 117 | return; 118 | } 119 | 120 | 121 | 122 | void printUsage 123 | (const char * s) 124 | { 125 | fprintf(stderr, 126 | "\nUSAGE: %s [options] \n\n", s); 127 | fprintf (stderr, "Try '%s -h' for more information.\n", s); 128 | return; 129 | } 130 | -------------------------------------------------------------------------------- /docs/web/examples/data/nucmer.delta: -------------------------------------------------------------------------------- 1 | /home/aphillip/web/mummer/examples/data/B_anthracis_Mslice.fasta /home/aphillip/web/mummer/examples/data/B_anthracis_contigs.fasta 2 | NUCMER 3 | >B_anthracis_Mslice 137795 312600 863 4 | 131175 132041 863 1 11 11 0 5 | 5 6 | 43 7 | 8 8 | -5 9 | 29 10 | 66 11 | 0 12 | >B_anthracis_Mslice 137797 312600 985 13 | 133048 134036 3 985 16 16 0 14 | 846 15 | 11 16 | 12 17 | 9 18 | 24 19 | -17 20 | 15 21 | 20 22 | 0 23 | >B_anthracis_Mslice 137827 312600 851 24 | 29078 29933 1 851 9 9 0 25 | 725 26 | 69 27 | 12 28 | 22 29 | 21 30 | 0 31 | >B_anthracis_Mslice 137829 312600 879 32 | 23368 24230 858 1 9 9 0 33 | 7 34 | 7 35 | 12 36 | 6 37 | 10 38 | 32 39 | -768 40 | 0 41 | >B_anthracis_Mslice 137892 312600 701 42 | 40129 40827 1 701 8 8 0 43 | -572 44 | -1 45 | -35 46 | 79 47 | 0 48 | >B_anthracis_Mslice 137957 312600 822 49 | 294295 295119 1 822 14 14 0 50 | 763 51 | 11 52 | 30 53 | 0 54 | >B_anthracis_Mslice 137999 312600 1414 55 | 204351 205767 1 1414 16 16 0 56 | -11 57 | 41 58 | 20 59 | 21 60 | 14 61 | -1236 62 | 11 63 | -41 64 | 4 65 | 0 66 | >B_anthracis_Mslice 138021 312600 4574 67 | 230583 235156 1 4574 0 0 0 68 | 0 69 | >B_anthracis_Mslice 138043 312600 973 70 | 188452 189423 973 1 2 2 0 71 | -206 72 | 0 73 | >B_anthracis_Mslice 138045 312600 1120 74 | 270657 271776 1 1120 0 0 0 75 | 0 76 | >B_anthracis_Mslice 138059 312600 1202 77 | 190507 191708 1202 1 0 0 0 78 | 0 79 | >B_anthracis_Mslice 138088 312600 1012 80 | 203485 204496 1 1012 0 0 0 81 | 0 82 | >B_anthracis_Mslice 138123 312600 781 83 | 75501 76288 781 1 19 19 0 84 | 6 85 | 5 86 | 9 87 | 19 88 | 4 89 | 30 90 | -8 91 | 17 92 | 11 93 | 42 94 | -5 95 | 0 96 | >B_anthracis_Mslice 138127 312600 693 97 | 189647 190336 693 1 3 3 0 98 | -7 99 | -7 100 | -16 101 | 0 102 | >B_anthracis_Mslice 138186 312600 8814 103 | 100476 109286 8814 4 1 1 0 104 | 0 105 | >B_anthracis_Mslice 138207 312600 2878 106 | 282914 285798 1 2878 10 10 0 107 | 7 108 | 11 109 | 6 110 | 6 111 | 4 112 | 26 113 | 9 114 | 0 115 | >B_anthracis_Mslice 138208 312600 25608 116 | 285887 311490 1 25604 4 4 0 117 | 27 118 | -134 119 | 6 120 | -9165 121 | 0 122 | >B_anthracis_Mslice 138232 312600 3008 123 | 200483 203490 3008 1 0 0 0 124 | 0 125 | >B_anthracis_Mslice 138233 312600 8514 126 | 191975 200488 8514 1 2 2 0 127 | 0 128 | >B_anthracis_Mslice 138236 312600 6708 129 | 223993 230697 6708 3 1 1 0 130 | -6686 131 | 0 132 | >B_anthracis_Mslice 138237 312600 43159 133 | 113952 157080 43159 33 3 3 0 134 | 48 135 | 43046 136 | 0 137 | >B_anthracis_Mslice 138238 312600 4590 138 | 109391 113981 4590 1 3 3 0 139 | 786 140 | 0 141 | >B_anthracis_Mslice 138239 312600 12394 142 | 80219 92609 12394 2 4 4 0 143 | -9161 144 | -1 145 | -3159 146 | 60 147 | 0 148 | >B_anthracis_Mslice 138259 312600 18096 149 | 205825 223920 18096 4 4 4 0 150 | 5 151 | 18071 152 | 6 153 | 0 154 | >B_anthracis_Mslice 138261 312600 7422 155 | 93043 100464 7422 1 0 0 0 156 | 0 157 | >B_anthracis_Mslice 138262 312600 3659 158 | 76589 80244 3656 1 0 0 0 159 | 0 160 | >B_anthracis_Mslice 138291 312600 32872 161 | 19959 52829 32872 1 7 7 0 162 | -15152 163 | 0 164 | >B_anthracis_Mslice 138310 312600 7647 165 | 12256 19905 7647 1 9 9 0 166 | 15 167 | 26 168 | 26 169 | 0 170 | >B_anthracis_Mslice 138330 312600 10819 171 | 272163 282983 1 10819 4 4 0 172 | 10806 173 | 5 174 | 0 175 | >B_anthracis_Mslice 138378 312600 35186 176 | 235270 270455 1 35186 4 4 0 177 | -10413 178 | 13459 179 | 0 180 | >B_anthracis_Mslice 138387 312600 31149 181 | 156798 187944 31147 1 2 2 0 182 | 0 183 | >B_anthracis_Mslice 138388 312600 22500 184 | 52816 75314 22500 1 1 1 0 185 | -14357 186 | 0 187 | >B_anthracis_Mslice 138389 312600 6944 188 | 5224 12174 6944 1 14 14 0 189 | 3395 190 | -53 191 | -1 192 | 5 193 | 6 194 | 20 195 | 6 196 | 28 197 | 5 198 | 21 199 | 67 200 | 0 201 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/cleanMUMcand.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #include "types.h" 12 | #include "mumcand.h" 13 | 14 | //} 15 | 16 | /*EE 17 | This module contains functions to extract from a table of 18 | MUM-candidates those which are also unique in the query 19 | sequence. 20 | */ 21 | 22 | /* 23 | The following function compares two MUM-candidates. The MUM-candidate 24 | with smaller \texttt{dbstart}-value comes first. 25 | If both MUMs have the same \texttt{dbstart}-value, then the MUM-candidate 26 | with the larger length comes first. 27 | */ 28 | 29 | static Sint compareMUMcandidates(MUMcandidate *p,MUMcandidate *q) 30 | { 31 | if(p->dbstart == q->dbstart) 32 | { 33 | return (p->mumlength < q->mumlength) ? 1 : -1; 34 | } 35 | return (p->dbstart > q->dbstart) ? 1 : -1; 36 | } 37 | 38 | /* 39 | Sort all MUM-candidates according by increasing \texttt{dbstart}-value 40 | and decreasing length. 41 | */ 42 | 43 | static void sortMUMcandidates(ArrayMUMcandidate *mumcand) 44 | { 45 | qsort(mumcand->spaceMUMcandidate, 46 | (size_t) mumcand->nextfreeMUMcandidate, 47 | sizeof(MUMcandidate), 48 | (Qsortcomparefunction) compareMUMcandidates); 49 | } 50 | 51 | /*EE 52 | Output all MUM candidates that are unique in the query sequence. 53 | These are the MUMs. The MUM-candidates are stored in table 54 | \texttt{mumcand}. The MUM is processed further by the function 55 | \texttt{processmum} which takes the \texttt{processinfo} 56 | as an argument. 57 | */ 58 | 59 | Sint mumuniqueinquery(void *processinfo, 60 | Sint (*processmum)(void *,Uint,Uint,Uint,Uint), 61 | ArrayMUMcandidate *mumcand) 62 | { 63 | if(mumcand->nextfreeMUMcandidate > 0) 64 | { 65 | Uint currentright, dbright = 0; 66 | MUMcandidate *mumcandptr; 67 | BOOL ignorecurrent, ignoreprevious = False; 68 | 69 | sortMUMcandidates(mumcand); 70 | for(mumcandptr = mumcand->spaceMUMcandidate; 71 | mumcandptr < mumcand->spaceMUMcandidate + 72 | mumcand->nextfreeMUMcandidate; 73 | mumcandptr++) 74 | { 75 | ignorecurrent = False; 76 | currentright = mumcandptr->dbstart + mumcandptr->mumlength - 1; 77 | if(dbright > currentright) 78 | { 79 | ignorecurrent = True; 80 | } else 81 | { 82 | if(dbright == currentright) 83 | { 84 | ignorecurrent = True; 85 | if(!ignoreprevious && (mumcandptr-1)->dbstart == mumcandptr->dbstart) 86 | { 87 | ignoreprevious = True; 88 | } 89 | } else 90 | { 91 | dbright = currentright; 92 | } 93 | } 94 | if(mumcandptr > mumcand->spaceMUMcandidate && !ignoreprevious) 95 | { 96 | if(processmum(processinfo, 97 | (mumcandptr-1)->mumlength, 98 | (mumcandptr-1)->dbstart, 99 | (mumcandptr-1)->queryseq, 100 | (mumcandptr-1)->querystart) != 0) 101 | { 102 | return -1; 103 | } 104 | } 105 | ignoreprevious = ignorecurrent; 106 | } 107 | if(!ignoreprevious) 108 | { 109 | mumcandptr = mumcand->spaceMUMcandidate + 110 | mumcand->nextfreeMUMcandidate - 1; 111 | if(processmum(processinfo, 112 | mumcandptr->mumlength, 113 | mumcandptr->dbstart, 114 | mumcandptr->queryseq, 115 | mumcandptr->querystart) != 0) 116 | { 117 | return -1; 118 | } 119 | } 120 | } 121 | return 0; 122 | } 123 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/errordef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef ERRORDEF_H 12 | #define ERRORDEF_H 13 | #include 14 | #include 15 | #include "types.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | char *messagespace(void); 22 | Sint maxerrormsg(void); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | //} 29 | 30 | /* 31 | This file contains some macros to write error messages into a 32 | buffer returned by the function \texttt{messagespace}. 33 | */ 34 | 35 | /* 36 | There is a generic macro \texttt{GENERROR} (definition 37 | not given) that checks if the 38 | result of the computation \texttt{C} exceed the value returned 39 | by the function \texttt{maxerrormessage}. If so, then a 40 | corresponding error message is written to stderr. 41 | */ 42 | 43 | //\IgnoreLatex{ 44 | 45 | #ifdef DEBUG 46 | #define THROWERRORLINE\ 47 | DEBUG2(1,"# throw error message in %s line %lu\n",__FILE__,\ 48 | (Showuint) __LINE__) 49 | #else 50 | #define THROWERRORLINE /* Nothing */ 51 | #endif 52 | 53 | #define GENERROR(C);\ 54 | THROWERRORLINE;\ 55 | if((C) >= maxerrormsg())\ 56 | {\ 57 | fprintf(stderr,"file %s, line %lu: "\ 58 | "space for errormessage too small\n",\ 59 | __FILE__,(Showuint) __LINE__);\ 60 | exit(EXIT_FAILURE);\ 61 | } 62 | 63 | /* 64 | The different error macros call \texttt{sprintf} with the corresponding 65 | number of arguments. 66 | */ 67 | 68 | 69 | #define ERROR0(F)\ 70 | GENERROR(sprintf(messagespace(),F)) 71 | 72 | #define ERROR1(F,A1)\ 73 | GENERROR(sprintf(messagespace(),F,A1)) 74 | 75 | #define ERROR2(F,A1,A2)\ 76 | GENERROR(sprintf(messagespace(),F,A1,A2)) 77 | 78 | #define ERROR3(F,A1,A2,A3)\ 79 | GENERROR(sprintf(messagespace(),F,A1,A2,A3)) 80 | 81 | #define ERROR4(F,A1,A2,A3,A4)\ 82 | GENERROR(sprintf(messagespace(),F,A1,A2,A3,A4)) 83 | 84 | #define ERROR5(F,A1,A2,A3,A4,A5)\ 85 | GENERROR(sprintf(messagespace(),F,A1,A2,A3,A4,A5)) 86 | 87 | //} 88 | 89 | 90 | /* 91 | The following is a macro to show the usage line for all programs 92 | which have options and an indexname as the last argument. 93 | */ 94 | 95 | #define USAGEOUT\ 96 | ERROR2("Usage: %s options indexname\n"\ 97 | "%s -help shows possible options",\ 98 | argv[0],argv[0]); 99 | 100 | /* 101 | The following is the standard message in the main function. It shows the 102 | program name and the error message as returned by the function 103 | \texttt{messagespace}. 104 | */ 105 | 106 | #define STANDARDMESSAGE\ 107 | fprintf(stderr,"%s: %s\n",argv[0],messagespace());\ 108 | return EXIT_FAILURE 109 | 110 | #define SIMPLESTANDARDMESSAGE\ 111 | fprintf(stderr,"%s\n",messagespace());\ 112 | return EXIT_FAILURE 113 | 114 | /* 115 | The following is a generell error message which leads to a termination 116 | of the program. 117 | */ 118 | 119 | #define NOTSUPPOSED\ 120 | fprintf(stderr,"%s: line %lu: This case is not supposed to occur\n",\ 121 | __FILE__,(Showuint) __LINE__);\ 122 | exit(EXIT_FAILURE) 123 | 124 | /* 125 | The following macro checks a ptr. If it is \texttt{NULL}, then the 126 | program terminates with an error. 127 | */ 128 | 129 | #ifdef DEBUG 130 | #define NOTSUPPOSEDTOBENULL(PTR)\ 131 | if((PTR) == NULL)\ 132 | {\ 133 | NOTSUPPOSED;\ 134 | } 135 | #else 136 | #define NOTSUPPOSEDTOBENULL(PTR) /* Nothing */ 137 | #endif 138 | 139 | //\Ignore{ 140 | 141 | #endif 142 | 143 | //} 144 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | -=- MUMmer3.x INSTALLATION README -=- 2 | 3 | -- TO INSTALL -- 4 | Extract the tarfile by typing: 5 | 6 | "tar -xvzf MUMmer3.x" 7 | 8 | After extracting the tarfile into the desired installation directory, 9 | change to the "MUMmer3.x" directory. Once in this directory, type: 10 | 11 | "make check" 12 | 13 | This command will check for the necessary utilities that the MUMmer package 14 | depends on. If you see no error messages, the check was successful. Next, type: 15 | 16 | "make install" 17 | 18 | This command will build the appropriate scripts and binaries in the current 19 | directory. Refer to the "README" file in this directory for further assistance, 20 | or the "docs" directory for detailed information on the various utilities. 21 | To make all of the scripts and executables accessible from different 22 | directories, simply add the full MUMmer directory path to your system PATH, or 23 | link the desired MUMmer programs to your favorite bin directory. Please note 24 | that the 'make' command dynamically generates the MUMmer scripts with the 25 | appropriate paths, therefore if the MUMmer directory is moved after the 'make' 26 | command is issued, the scripts will fail to run. If the MUMmer executables 27 | are needed in a directory other than the install directory, it is recommended 28 | that the install directory be left untouched and its files linked to the 29 | desired destination. An alternative would be to move the install directory and 30 | reissue the 'make' command at the new location. 31 | 32 | 33 | 34 | -- SYSTEM REQUIREMENTS -- 35 | MUMmer3.10 has been tested successfully on: 36 | 37 | - Redhat Linux 6.2, 7.3 (Pentium 4) 38 | - Compaq Tru64 UNIX 5.1 (alpha) 39 | - SunOS UNIX 5.8 (sparc) 40 | - Mac OS X 10.2.8 (PowerPC G4) 41 | 42 | Sufficient memory and disk space are necessary, but required sizes vary 43 | with input size. Be aware of your disk and memory usage, because insufficient 44 | capacities will result in incorrect or missing output. Required resources 45 | differ depending on the input size, but in general 512 MB of RAM and 1 GB of 46 | disk space is sufficient for most applications. 47 | It is possible to port the code to any system with a C++ compiler but 48 | this has not been tested and will not be supported. In addition, you may need 49 | to alter the Makefile to direct 'make' to your native compiler and other 50 | system resources. 51 | For Mac OSX, the Mac development kit must be downloaded and installed. This 52 | kit will include 'gcc', 'ar', and 'make' which are necessary for building 53 | MUMmer. MUMmer is not supported for any Mac operating system other than OSX. 54 | 55 | 56 | 57 | -- SOFTWARE REQUIREMENTS -- 58 | The MUMmer3.x package requires the following to run successfully. In the 59 | absence of one or more of these utilities, certain MUMmer programs may fail 60 | to run correctly. Listed in parenthesis are the versions used to test the 61 | MUMmer package. These versions, or subsequent versions should assure the proper 62 | execution of the various MUMmer programs. These utilities must be accessible 63 | via the system path: 64 | 65 | - make (GNU make 3.79.1) 66 | - perl (PERL 5.6.0) 67 | - sh (GNU sh 1.14.7) 68 | - csh (tcsh 6.10.00) 69 | - g++ (GNU gcc 2.95.3) 70 | - sed (GNU sed 3.02) 71 | - awk (GNU awk 3.0.4) 72 | - ar (GNU ar 2.9.5) 73 | 74 | 75 | -- OPTIONAL UTILITIES -- 76 | To use the visualization tools included with MUMmer, it may be necessary 77 | to download and install the following utilities: 78 | 79 | - fig2dev (fig2dev 3.2.3) 80 | - gnuplot (gnuplot 4.0) 81 | - xfig (xfig 3.2) 82 | 83 | 84 | 85 | -- UN-INSTALLATION -- 86 | In the "MUMmer3.x" base directory type: 87 | 88 | "make uninstall" 89 | 90 | This will remove all binary executables and runnable scripts from the 91 | base and aux_bin directories. The original source files will remain unchanged, 92 | thus reverting the package to its post-untar, pre-install state. 93 | 94 | Please address questions and bug reports to: 95 | 96 | Last update: May 12, 2005 97 | -------------------------------------------------------------------------------- /src/kurtz/mm3src/maxmat3.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\IgnoreLatex{ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include "types.h" 17 | #include "debugdef.h" 18 | #include "errordef.h" 19 | #include "protodef.h" 20 | #include "spacedef.h" 21 | #include "megabytes.h" 22 | #include "maxmatdef.h" 23 | 24 | #ifdef DEBUG 25 | 26 | #define SHOWBOOLEANVALUE(CC)\ 27 | fprintf(stderr,"# %s=%s\n",#CC,SHOWBOOL(mmcallinfo->CC)); 28 | 29 | static void showmaxmatflags (char *program, 30 | MMcallinfo *mmcallinfo) 31 | { 32 | Uint i; 33 | 34 | fprintf (stderr,"# %s called with the following flags\n", program); 35 | SHOWBOOLEANVALUE (showstring); 36 | SHOWBOOLEANVALUE (reversecomplement); 37 | SHOWBOOLEANVALUE (forward); 38 | SHOWBOOLEANVALUE (showreversepositions); 39 | SHOWBOOLEANVALUE (showsequencelengths); 40 | SHOWBOOLEANVALUE (matchnucleotidesonly); 41 | SHOWBOOLEANVALUE (cmumcand); 42 | SHOWBOOLEANVALUE (cmum); 43 | fprintf (stderr,"# minmatchlength=%lu\n", 44 | (Showuint) mmcallinfo->minmatchlength); 45 | fprintf (stderr,"# subject-file=\"%s\"\n", &mmcallinfo->subjectfile[0]); 46 | for(i=0; i< mmcallinfo->numofqueryfiles; i++) 47 | { 48 | fprintf (stderr,"# query-file=\"%s\"\n", &mmcallinfo->queryfilelist[i][0]); 49 | } 50 | } 51 | #endif 52 | 53 | //} 54 | 55 | /*EE 56 | This module contains the main function of maxmatch3. It calls 57 | the following three functions in an appropriate order and with 58 | proper arguments. 59 | */ 60 | 61 | /*EE 62 | The following function is imported form \texttt{maxmatopt.c}. 63 | */ 64 | 65 | Sint parsemaxmatoptions (MMcallinfo *maxmatcallinfo, 66 | Argctype argc, 67 | char **argv); 68 | 69 | /*EE 70 | The following function is imported form \texttt{maxmatinp.c}. 71 | */ 72 | 73 | Sint getmaxmatinput (Multiseq *subjectmultiseq, 74 | BOOL matchnucleotidesonly, 75 | char *subjectfile); 76 | 77 | /*EE 78 | The following function is imported form \texttt{procmaxmat.c}. 79 | */ 80 | 81 | Sint procmaxmatches(MMcallinfo *mmcallinfo, 82 | Multiseq *subjectmultiseq); 83 | 84 | //\IgnoreLatex{ 85 | 86 | /* 87 | This is the main function. 88 | */ 89 | 90 | MAINFUNCTION 91 | { 92 | likwid_markerInit(); 93 | Sint retcode; 94 | MMcallinfo mmcallinfo; 95 | Multiseq subjectmultiseq; 96 | double start, end; 97 | start = omp_get_wtime(); 98 | DEBUGLEVELSET; 99 | initclock(); 100 | retcode = parsemaxmatoptions (&mmcallinfo, argc, argv); 101 | if (retcode < 0) 102 | { 103 | STANDARDMESSAGE; // return error code and show message 104 | } 105 | if (retcode == 1) // program was called with option -help 106 | { 107 | checkspaceleak (); 108 | mmcheckspaceleak (); 109 | return EXIT_SUCCESS; 110 | } 111 | DEBUGCODE(1,showmaxmatflags (argv[0], &mmcallinfo)); 112 | if (getmaxmatinput (&subjectmultiseq, 113 | mmcallinfo.matchnucleotidesonly, 114 | &mmcallinfo.subjectfile[0]) != 0) 115 | { 116 | STANDARDMESSAGE; 117 | } 118 | if(procmaxmatches(&mmcallinfo,&subjectmultiseq) != 0) 119 | { 120 | STANDARDMESSAGE; 121 | } 122 | freemultiseq (&subjectmultiseq); 123 | checkspaceleak (); 124 | mmcheckspaceleak (); 125 | /*fprintf(stderr,"# COMPLETETIME %s %s %.2f\n", 126 | argv[0],&mmcallinfo.subjectfile[0], 127 | getruntime()); 128 | fprintf(stderr,"# SPACE %s %s %.2f\n",argv[0], 129 | &mmcallinfo.subjectfile[0], 130 | MEGABYTES(getspacepeak()+mmgetspacepeak()));*/ 131 | end = omp_get_wtime(); 132 | fprintf(stdout,"Total=%f\n", (double) (end-start)); 133 | likwid_markerClose(); 134 | return EXIT_SUCCESS; 135 | } 136 | 137 | //} 138 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/streehuge.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //} 10 | 11 | //\FILEINFO{streehuge.h}{Stefan Kurtz}{March 2003} 12 | 13 | //\Ignore{ 14 | 15 | #ifndef STREEHUGE_H 16 | #define STREEHUGE_H 17 | #include 18 | #include 19 | #include 20 | #include "intbits.h" 21 | 22 | /* 23 | This header file defines the constants and macros for 24 | a linked list implementation technique for suffix trees as described 25 | in \cite{KUR:1999}. The implementation technique requires 26 | one integer for each leaf, three integers for each small node and 27 | five integers for each large node. For more details, see \cite{KUR:1999}. 28 | */ 29 | 30 | #define SMALLINTS 3 // # of integers for small node 31 | #define LARGEINTS 5 // # of integers for large node 32 | #define MULTBYSMALLINTS(V) ((V) * SMALLINTS) // multiply by SMALLINTS 33 | #define DIVBYSMALLINTS(V) ((V) / SMALLINTS) // div by SMALLINTS 34 | 35 | #define LEAFBIT SECONDBIT // mark leaf address 36 | #define SMALLBIT FIRSTBIT // mark small node 37 | #define NILBIT FIRSTBIT // mark nil reference in brother 38 | #define MAXINDEX (NILBIT-1) // all except for first bit 39 | #define MAXDISTANCE MAXINDEX // maximal distance value 40 | 41 | /* 42 | We use the least significant bit to discriminate references to leafs 43 | and branching nodes. Since base addresses are even, the unset least 44 | significant bit of a reference identifies a base address. For a leaf 45 | reference we shift the leaf number one to the right and 46 | set the least significant bit. 47 | */ 48 | 49 | #define ISLEAF(V) ((V) & LEAFBIT) 50 | #define ISLARGE(V) (!((V) & SMALLBIT)) 51 | #define MAKELEAF(V) ((V) | LEAFBIT) 52 | #define MAKELARGE(V) (V) 53 | #define MAKELARGELEAF(V) MAKELEAF(V) 54 | 55 | #define GETLEAFINDEX(V) ((V) & ~(LEAFBIT | SMALLBIT)) 56 | #define GETBRANCHINDEX(V) GETLEAFINDEX(V) 57 | 58 | #define NILPTR(P) ((P) & NILBIT) 59 | #define UNDEFINEDREFERENCE (~((Uint) 0)) 60 | #define MAXTEXTLEN ((MAXINDEX/((LARGEINTS+SMALLINTS)/2)) - 3) 61 | 62 | #define GETCHILD(B) ((*(B)) & MAXINDEX) 63 | #define GETBROTHER(B) (*((B)+1)) 64 | #define GETDISTANCE(B) (*((B)+2)) 65 | #define GETDEPTH(B) (*((B)+2)) 66 | #define GETHEADPOS(B) (*((B)+3)) 67 | #define GETSUFFIXLINK(B) getlargelinkconstruction(stree) 68 | #define SETCHILD(B,VAL) SETVAL(B,((*(B)) & SMALLBIT) | (VAL)) 69 | #define SETBROTHER(B,VAL) SETVAL(B+1,VAL) 70 | 71 | #define SETDISTANCE(B,VAL) SETVAL(B+2,VAL);\ 72 | SETVAL(B,(*(B)) | SMALLBIT) 73 | #define SETDEPTHHEADPOS(DP,HP) SETVAL(stree->nextfreebranch+2,DP);\ 74 | SETVAL(stree->nextfreebranch+3,HP) 75 | 76 | #define SETNEWCHILD(B,VAL) SETVAL(B,VAL) 77 | #define SETNEWCHILDBROTHER(CH,BR) SETVAL(stree->nextfreebranch,CH);\ 78 | SETVAL(stree->nextfreebranch+1,BR) 79 | 80 | #define SETSUFFIXLINK(SL) SETVAL(stree->nextfreebranch+4,SL) 81 | 82 | #define LEAFBROTHERVAL(V) (V) 83 | #define SETLEAFBROTHER(B,VAL) *(B) = (VAL) 84 | 85 | #define GETCHAINEND(C,B,D) C = (B) + MULTBYSMALLINTS(D) 86 | #define MAKEBRANCHADDR(V) (V) 87 | #define SETBRANCHNODEOFFSET /* nothing */ 88 | 89 | //\Ignore{ 90 | 91 | #ifdef DEBUG 92 | #define CHILDREFERSTOLEAF(B) ISLEAF(*(B)) 93 | #endif 94 | 95 | //} 96 | 97 | //\Ignore{ 98 | 99 | #if SYMBOLBYTES == 1 100 | #define LARGESTCHARINDEX UCHAR_MAX 101 | #else 102 | #define LARGESTCHARINDEX stree->lastcharindex 103 | #endif 104 | 105 | #endif 106 | 107 | //} 108 | -------------------------------------------------------------------------------- /src/kurtz/mm3src/Dependencies.mf: -------------------------------------------------------------------------------- 1 | findmaxmat.o: findmaxmat.c ../streesrc/streedef.h \ 2 | ../libbasedir/types.h ../streesrc/streemac.h ../streesrc/symboldef.h \ 3 | ../libbasedir/errordef.h ../streesrc/streetyp.h \ 4 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 5 | ../streesrc/streeproto.h ../libbasedir/debugdef.h maxmatdef.h \ 6 | ../libbasedir/chardef.h ../libbasedir/multidef.h 7 | findmumcand.o: findmumcand.c ../streesrc/streedef.h \ 8 | ../libbasedir/types.h ../streesrc/streemac.h ../streesrc/symboldef.h \ 9 | ../libbasedir/errordef.h ../streesrc/streetyp.h \ 10 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 11 | ../streesrc/streeproto.h ../libbasedir/debugdef.h maxmatdef.h \ 12 | ../libbasedir/chardef.h ../libbasedir/multidef.h 13 | maxmat3.o: maxmat3.c ../libbasedir/types.h ../libbasedir/debugdef.h \ 14 | ../libbasedir/errordef.h ../libbasedir/protodef.h \ 15 | ../libbasedir/optdesc.h ../libbasedir/multidef.h \ 16 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 17 | ../libbasedir/mumcand.h ../libbasedir/megabytes.h maxmatdef.h \ 18 | ../libbasedir/chardef.h 19 | maxmatinp.o: maxmatinp.c ../libbasedir/chardef.h \ 20 | ../libbasedir/spacedef.h ../libbasedir/types.h \ 21 | ../libbasedir/errordef.h ../libbasedir/protodef.h \ 22 | ../libbasedir/optdesc.h ../libbasedir/multidef.h \ 23 | ../libbasedir/arraydef.h ../libbasedir/mumcand.h \ 24 | ../libbasedir/debugdef.h maxmatdef.h 25 | maxmatopt.o: maxmatopt.c ../libbasedir/types.h ../libbasedir/optdesc.h \ 26 | ../libbasedir/errordef.h ../libbasedir/debugdef.h \ 27 | ../libbasedir/protodef.h ../libbasedir/multidef.h \ 28 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 29 | ../libbasedir/mumcand.h maxmatdef.h ../libbasedir/chardef.h 30 | procmaxmat.o: procmaxmat.c ../libbasedir/types.h \ 31 | ../libbasedir/debugdef.h ../libbasedir/errordef.h \ 32 | ../libbasedir/protodef.h ../libbasedir/optdesc.h \ 33 | ../libbasedir/multidef.h ../libbasedir/arraydef.h \ 34 | ../libbasedir/spacedef.h ../libbasedir/mumcand.h \ 35 | ../streesrc/streedef.h ../streesrc/streemac.h ../streesrc/symboldef.h \ 36 | ../streesrc/streetyp.h ../streesrc/streeproto.h maxmatdef.h \ 37 | ../libbasedir/chardef.h 38 | findmaxmat.dbg.o: findmaxmat.c ../streesrc/streedef.h \ 39 | ../libbasedir/types.h ../streesrc/streemac.h ../streesrc/symboldef.h \ 40 | ../libbasedir/errordef.h ../streesrc/streetyp.h \ 41 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 42 | ../streesrc/streeproto.h ../libbasedir/debugdef.h maxmatdef.h \ 43 | ../libbasedir/chardef.h ../libbasedir/multidef.h 44 | findmumcand.dbg.o: findmumcand.c ../streesrc/streedef.h \ 45 | ../libbasedir/types.h ../streesrc/streemac.h ../streesrc/symboldef.h \ 46 | ../libbasedir/errordef.h ../streesrc/streetyp.h \ 47 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 48 | ../streesrc/streeproto.h ../libbasedir/debugdef.h maxmatdef.h \ 49 | ../libbasedir/chardef.h ../libbasedir/multidef.h 50 | maxmat3.dbg.o: maxmat3.c ../libbasedir/types.h ../libbasedir/debugdef.h \ 51 | ../libbasedir/errordef.h ../libbasedir/protodef.h \ 52 | ../libbasedir/optdesc.h ../libbasedir/multidef.h \ 53 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 54 | ../libbasedir/mumcand.h ../libbasedir/megabytes.h maxmatdef.h \ 55 | ../libbasedir/chardef.h 56 | maxmatinp.dbg.o: maxmatinp.c ../libbasedir/chardef.h \ 57 | ../libbasedir/spacedef.h ../libbasedir/types.h \ 58 | ../libbasedir/errordef.h ../libbasedir/protodef.h \ 59 | ../libbasedir/optdesc.h ../libbasedir/multidef.h \ 60 | ../libbasedir/arraydef.h ../libbasedir/mumcand.h \ 61 | ../libbasedir/debugdef.h maxmatdef.h 62 | maxmatopt.dbg.o: maxmatopt.c ../libbasedir/types.h ../libbasedir/optdesc.h \ 63 | ../libbasedir/errordef.h ../libbasedir/debugdef.h \ 64 | ../libbasedir/protodef.h ../libbasedir/multidef.h \ 65 | ../libbasedir/arraydef.h ../libbasedir/spacedef.h \ 66 | ../libbasedir/mumcand.h maxmatdef.h ../libbasedir/chardef.h 67 | procmaxmat.dbg.o: procmaxmat.c ../libbasedir/types.h \ 68 | ../libbasedir/debugdef.h ../libbasedir/errordef.h \ 69 | ../libbasedir/protodef.h ../libbasedir/optdesc.h \ 70 | ../libbasedir/multidef.h ../libbasedir/arraydef.h \ 71 | ../libbasedir/spacedef.h ../libbasedir/mumcand.h \ 72 | ../streesrc/streedef.h ../streesrc/streemac.h ../streesrc/symboldef.h \ 73 | ../streesrc/streetyp.h ../streesrc/streeproto.h maxmatdef.h \ 74 | ../libbasedir/chardef.h 75 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "fopen.h" 19 | #include "debugdef.h" 20 | #include "errordef.h" 21 | #include "megabytes.h" 22 | 23 | //} 24 | 25 | /*EE 26 | This module defines functions for handling debug levels and 27 | other information related to producing debugging messages. 28 | The debug mechanism is only available if the \texttt{DEBUG} compiler 29 | flag is used. 30 | */ 31 | 32 | #ifdef DEBUG 33 | 34 | static Sint debuglevel = 0; // the value of \texttt{DEBUGLEVEL} 35 | static BOOL debugwhere = False; // the value of \texttt{DEBUGWHERE} 36 | /*@null@*/ static FILE 37 | *debugfileptr = NULL; // the file pointer to show the debug info 38 | 39 | /*EE 40 | The following function returns the \texttt{DEBUGLEVEL}. 41 | */ 42 | 43 | Sint getdebuglevel(void) 44 | { 45 | return debuglevel; 46 | } 47 | 48 | /*EE 49 | The following function returns the value of \texttt{DEBUGWHERE}. 50 | */ 51 | 52 | BOOL getdebugwhere(void) 53 | { 54 | return debugwhere; 55 | } 56 | 57 | /*EE 58 | The following function sets the debug level by looking up the 59 | environment variable \texttt{DEBUGLEVEL}. Moreover, the environment 60 | variable \texttt{DEBUGWHERE} is read and \texttt{debugwhere} is set 61 | accordingly. 62 | */ 63 | 64 | void setdebuglevel(void) 65 | { 66 | char *envstring; 67 | 68 | debugfileptr = stdout; 69 | if((envstring = getenv("DEBUGLEVEL")) != NULL) 70 | { 71 | if(!(strlen(envstring) == (size_t) 1 && 72 | isdigit((Ctypeargumenttype) *envstring))) 73 | { 74 | fprintf(stderr,"environment variable DEBUGLEVEL=%s, ",envstring); 75 | fprintf(stderr,"it must be a digit between 0 and %lu\n", 76 | (Showuint) MAXDEBUGLEVEL); 77 | exit(EXIT_FAILURE); 78 | } 79 | if ((debuglevel = atoi(envstring)) > MAXDEBUGLEVEL) 80 | { 81 | fprintf(stderr,"environment variable DEBUGLEVEL=%s, ",envstring); 82 | fprintf(stderr,"it must be a digit between 0 and %lu\n", 83 | (Showuint) MAXDEBUGLEVEL); 84 | exit(EXIT_FAILURE); 85 | } 86 | } 87 | if((envstring = getenv("DEBUGWHERE")) != (char *) NULL) 88 | { 89 | if(strcmp(envstring,"on") == 0) 90 | { 91 | debugwhere = True; 92 | } else 93 | { 94 | if(strcmp(envstring,"off") == 0) 95 | { 96 | debugwhere = False; 97 | } else 98 | { 99 | fprintf(stderr,"environment variable DEBUGWHERE=%s, ",envstring); 100 | fprintf(stderr,"it must be set to \"on\" or \"off\"\n"); 101 | exit(EXIT_FAILURE); 102 | } 103 | } 104 | } 105 | CHECKALLTYPESIZES 106 | #ifdef WITHSYSCONF 107 | showmemsize(); 108 | #endif 109 | } 110 | 111 | /*EE 112 | The following function opens the given filename for writing the debug 113 | messages to. It also sets the debug level. 114 | This function is called only very rarely. If only \texttt{setdebuglevel} 115 | is called, then the output goes to standard output. 116 | */ 117 | 118 | void setdebuglevelfilename(char *filename) 119 | { 120 | FILEOPEN(debugfileptr,filename,"w"); 121 | setdebuglevel(); 122 | } 123 | 124 | /*EE 125 | The following function looks up the output pointer. 126 | */ 127 | 128 | FILE *getdbgfp(void) 129 | { 130 | if(debugfileptr == NULL) 131 | { 132 | fprintf(stderr,"DEBUGLEVELSET not called\n"); 133 | exit(EXIT_FAILURE); 134 | } 135 | return debugfileptr; 136 | } 137 | 138 | /*EE 139 | The following function closes the debug output pointer, if it is not 140 | standard out. 141 | */ 142 | 143 | void debugclosefile(void) 144 | { 145 | if(debugfileptr == NULL) 146 | { 147 | fprintf(stderr,"cannot close debugfileptr\n"); 148 | exit(EXIT_FAILURE); 149 | } 150 | if(fclose(debugfileptr) != 0) 151 | { 152 | NOTSUPPOSED; 153 | } 154 | } 155 | 156 | #endif /* DEBUG */ 157 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/streesmall.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //} 10 | 11 | //\FILEINFO{streesmall.h}{Stefan Kurtz}{November 1999} 12 | 13 | //\Ignore{ 14 | 15 | #ifndef STREESTDEF_H 16 | #define STREESTDEF_H 17 | #include 18 | #include 19 | #include 20 | 21 | //} 22 | 23 | /* 24 | This header file defines the constants and macros used for the improved 25 | linked list implementation technique for suffix trees as described 26 | in \cite{KUR:BAL:1999}. The implementation technique requires 27 | one integer for each leaf, two integers for each small node and 28 | 3 integers for each large node, provided 29 | \(n\leq 2^{21}-1=2~\emph{megabytes}\). 30 | For more details, see \cite{KUR:1998,KUR:BAL:1999} and the bit layout, 31 | as depicted in the file \texttt{bitlayout.ps}. 32 | */ 33 | 34 | #define SMALLINTS 2 35 | #define LARGEINTS 3 36 | #define MULTBYSMALLINTS(V) ((V) << 1) 37 | #define DIVBYSMALLINTS(V) ((V) >> 1) 38 | 39 | #define DISTBITS 16 40 | #define MAXDISTANCE ((1 << DISTBITS) - 1) 41 | 42 | #define INDEXBITS 23 43 | #define NILBIT (1 << INDEXBITS) 44 | #define LARGEBIT (1 << INDEXBITS) 45 | #define MAXINDEX (NILBIT - 1) 46 | 47 | #define ISLEAF(V) ((V) < stree->branchnodeoffset) 48 | #define ISLARGE(V) ((V) & LARGEBIT) 49 | #define MAKELEAF(V) (V) 50 | #define MAKELARGE(V) (V) 51 | #define MAKELARGELEAF(V) (V) 52 | #define MAKEBRANCHADDR(V) ((V) + stree->branchnodeoffset) 53 | #define GETLEAFINDEX(V) (V) 54 | #define GETBRANCHINDEX(V) ((V) - stree->branchnodeoffset) 55 | 56 | #define SMALLDEPTHBITS 11 57 | #define SMALLDEPTHMARK (1 << (INDEXBITS+1)) 58 | #define SMALLDEPTH ((1 << SMALLDEPTHBITS) - 1) 59 | #define ISSMALLDEPTH(V) (((V) & ~SMALLDEPTH) == 0) 60 | 61 | #define NILPTR(P) ((P) & NILBIT) 62 | #define UNDEFINEDREFERENCE (~((Uint) 0)) 63 | #define MAXTEXTLEN 2097150 64 | 65 | #define GETCHILD(B) ((*(B)) & MAXINDEX) 66 | #define SETCHILD(B,VAL) SETVAL(B,((*(B)) & (511 << 23)) | (VAL)) 67 | 68 | #define GETDISTANCE(B) (((*(B)) >> 24) | (((*((B)+1)) >> 16) & (255 << 8))) 69 | 70 | #define SETDISTANCE(B,VAL)\ 71 | SETVAL(B,((*(B)) & ((1 << 23) - 1)) | ((VAL) << 24));\ 72 | SETVAL(B+1,((*((B)+1)) & ((1 << 24) - 1)) | (((VAL) & (255 << 8)) << 16)) 73 | 74 | #define GETBROTHER(B) ((*((B)+1)) & (NILBIT | MAXINDEX)) 75 | #define SETBROTHER(B,VAL) SETVAL((B)+1,((*((B)+1)) & (255 << 24)) | (VAL)) 76 | 77 | #define GETDEPTH(B) getdepth(B) 78 | #define GETHEADPOS(B) ((*((B)+2)) & ((1 << 21) - 1)) 79 | 80 | #define SETDEPTHHEADPOS(DP,HD) setdepthheadposition(stree,DP,HD) 81 | 82 | #define GETSUFFIXLINK(B) getlargelinkconstruction(stree) 83 | 84 | #define SETNEWCHILD(B,CH) SETVAL(B,(CH) | LARGEBIT) 85 | #define SETNEWCHILDBROTHER(CH,BR)\ 86 | SETVAL(stree->nextfreebranch,(CH) | LARGEBIT);\ 87 | SETVAL(stree->nextfreebranch+1,BR) 88 | 89 | #define SETSUFFIXLINK(SL) setsuffixlink(stree,SL) 90 | 91 | #define LEAFBROTHERVAL(V) ((V) & (MAXINDEX | NILBIT)) 92 | #define SETLEAFBROTHER(B,VAL) *(B) = (*(B) & (255 << 24)) | (VAL) 93 | 94 | #define GETCHAINEND(C,B,D) C = (B) + (MULTBYSMALLINTS(D)) 95 | #define SETBRANCHNODEOFFSET stree->branchnodeoffset = stree->textlen + 1 96 | 97 | //\Ignore{ 98 | 99 | #ifdef DEBUG 100 | #define CHILDREFERSTOLEAF(B) ISLEAF(*(B)) 101 | #endif 102 | 103 | //} 104 | 105 | /* 106 | This following function looks up the depth of a large node. 107 | \emph{btptr} refers to the first integer of that node. 108 | */ 109 | 110 | static Uint getdepth(Uint *btptr) 111 | { 112 | if(*(btptr+1) & SMALLDEPTHMARK) 113 | { 114 | return *(btptr+2) >> 21; 115 | } 116 | return ((*btptr & (7 << 29)) >> 11) | 117 | ((*(btptr+1) & (127 << 25)) >> 14) | 118 | (*(btptr+2) >> 21); 119 | } 120 | 121 | //\Ignore{ 122 | 123 | #if SYMBOLBYTES == 1 124 | #define LARGESTCHARINDEX UCHAR_MAX 125 | #else 126 | #define LARGESTCHARINDEX stree->lastcharindex 127 | #endif 128 | 129 | 130 | #endif 131 | 132 | //} 133 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/construct.gen: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | CONSTRUCT 10 | { 11 | DECLAREEXTRA; 12 | 13 | CHECKTEXTLEN; 14 | 15 | DEBUGCODE(3,showvalues()); 16 | 17 | initSuffixtree(stree,text,textlen); 18 | while(stree->tailptr < stree->sentinel || 19 | stree->headnodedepth != 0 || stree->headend != NULL) 20 | { 21 | //CHECKSTEP; 22 | // case (1): headloc is root 23 | if(stree->headnodedepth == 0 && stree->headend == NULL) 24 | { 25 | (stree->tailptr)++; 26 | scanprefix(stree); 27 | } else 28 | { 29 | if(stree->headend == NULL) // case (2.1): headloc is a node 30 | { 31 | FOLLOWSUFFIXLINK; 32 | scanprefix(stree); 33 | } else // case (2.2) 34 | { 35 | if(stree->headnodedepth == 0) // case (2.2.1): at root: do not use links 36 | { 37 | if(stree->headstart == stree->headend) // rescan not necessary 38 | { 39 | stree->headend = NULL; 40 | } else 41 | { 42 | (stree->headstart)++; 43 | rescan(stree); 44 | } 45 | } else 46 | { 47 | FOLLOWSUFFIXLINK; // case (2.2.2) 48 | rescan(stree); 49 | } 50 | if(stree->headend == NULL) // case (2.2.3): headloc is a node 51 | { 52 | SETSUFFIXLINK(BRADDR2NUM(stree,stree->headnode)); 53 | COMPLETELARGEFIRST; 54 | scanprefix(stree); 55 | } else 56 | { 57 | if(stree->smallnotcompleted == MAXDISTANCE) // artifical large node 58 | { 59 | DEBUGCODE(1,stree->artificial++); 60 | DEBUG1(3,"#artifical large node %lu\n", 61 | (Showuint) stree->nextfreebranchnum); 62 | SETSUFFIXLINK(stree->nextfreebranchnum + LARGEINTS); 63 | COMPLETELARGESECOND; 64 | } else 65 | { 66 | if(stree->chainstart == NULL) 67 | { 68 | stree->chainstart = stree->nextfreebranch; // start new chain 69 | } 70 | (stree->smallnotcompleted)++; 71 | (stree->nextfreebranch) += SMALLINTS; // case (2.2.4) 72 | (stree->nextfreebranchnum) += SMALLINTS; 73 | stree->smallnode++; 74 | } 75 | } 76 | } 77 | } 78 | 79 | PROCESSHEAD; 80 | 81 | if(stree->headend == NULL) 82 | { 83 | insertleaf(stree); // case (a) 84 | } else 85 | { 86 | insertbranchnode(stree); // case (b) 87 | } 88 | DEBUGCODE(5,showtable(stree,False)); 89 | } 90 | stree->chainstart = NULL; 91 | linkrootchildren(stree); 92 | 93 | //\Ignore{ 94 | 95 | DEBUG1(2,"#integers for branchnodes %lu\n", 96 | (Showuint) stree->nextfreebranchnum); 97 | DEBUG4(2,"#small %lu large %lu textlen %lu all %lu ", 98 | (Showuint) stree->smallnode,(Showuint) stree->largenode, 99 | (Showuint) stree->textlen, 100 | (Showuint) (stree->smallnode+stree->largenode)); 101 | DEBUG1(2,"ratio %f\n", 102 | (double) (stree->smallnode+stree->largenode)/stree->nextfreeleafnum); 103 | DEBUG1(2,"#splitleafedge = %lu\n",(Showuint) stree->splitleafedge); 104 | DEBUG1(2,"#splitinternaledge = %lu\n",(Showuint) stree->splitinternaledge); 105 | DEBUG1(2,"#insertleafcalls = %lu\n",(Showuint) stree->insertleafcalls); 106 | DEBUG1(2,"#artificial = %lu\n",(Showuint) stree->artificial); 107 | DEBUG1(2,"#multiplications = %lu\n",(Showuint) stree->multiplications); 108 | DEBUGCODE(4,showtable(stree,True)); 109 | DEBUGCODE(3,showstree(stree)); 110 | #ifdef DEBUG 111 | { 112 | DEBUG3(2,"#largelinks %lu largelinklinkwork %lu largelinkwork %lu ", 113 | (Showuint) stree->largelinks, 114 | (Showuint) stree->largelinklinkwork, 115 | (Showuint) stree->largelinkwork); 116 | DEBUG2(2,"#ratio1 %.4f ratio2 %.4f\n", 117 | (double) stree->largelinkwork/stree->largelinks, 118 | (double) stree->largelinkwork/stree->textlen); 119 | } 120 | #endif 121 | DEBUG2(2,"#%6lu %6lu\n",(Showuint) stree->smallnode, 122 | (Showuint) stree->largenode); 123 | DEBUGCODE(2,showspace()); 124 | DEBUGCODE(1,checkstree(stree)); 125 | 126 | //} 127 | //FINALPROGRESS; 128 | return 0; 129 | } 130 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/optdesc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef OPTDESC_H 12 | #define OPTDESC_H 13 | #include "types.h" 14 | #include "errordef.h" 15 | 16 | //} 17 | 18 | /* 19 | This file defines some macros to manipulate and a type to store 20 | information about options. 21 | */ 22 | 23 | /* 24 | The macro \texttt{OPTION} fills the component of a structure of 25 | type \texttt{OptionDesc}. This macro should not be used. It 26 | is mainly for compatibility of the code. 27 | */ 28 | 29 | #define OPTION(S,N,O,D)\ 30 | S[N].optname = O;\ 31 | S[N].description = D;\ 32 | S[N].optval = N;\ 33 | S[N].isalreadyset = False;\ 34 | S[N].declared = True 35 | 36 | /* 37 | The macro \texttt{ADDOPTION} has a similar effect, but adding the 38 | option is done via the function \texttt{addoption}. This is the 39 | recommended way to add an option. 40 | */ 41 | 42 | #define ADDOPTION(N,O,D)\ 43 | if(addoption(&options[0],(Uint) NUMOFOPTIONS,(Uint) N,O,D) != 0)\ 44 | {\ 45 | return -1;\ 46 | } 47 | 48 | /* 49 | The following macro checks if an option is already set. 50 | */ 51 | 52 | #define ISSET(N) (options[N].isalreadyset) 53 | 54 | /* 55 | The following macro checks if an option is used. If not, then 56 | an error is reported. 57 | */ 58 | 59 | #define OPTIONMANDATORY(A)\ 60 | if(!ISSET(A))\ 61 | {\ 62 | ERROR1("option %s is mandatory",options[A].optname);\ 63 | return -1;\ 64 | } 65 | 66 | /* 67 | The following four macros check if all options \texttt{B} 68 | (\texttt{C}, \texttt{D}, \texttt{E}) are used, whenever option 69 | \texttt{A} is used. 70 | */ 71 | 72 | #define OPTIONIMPLY(A,B)\ 73 | if(ISSET(A) && !ISSET(B))\ 74 | {\ 75 | ERROR2("option %s requires option %s",\ 76 | options[A].optname,options[B].optname);\ 77 | return -1;\ 78 | } 79 | 80 | #define OPTIONIMPLYEITHER2(A,B,C)\ 81 | if(ISSET(A))\ 82 | {\ 83 | if(!ISSET(B) && !ISSET(C))\ 84 | {\ 85 | ERROR3("option %s requires either option %s or %s",\ 86 | options[A].optname,options[B].optname,\ 87 | options[C].optname);\ 88 | return -1;\ 89 | }\ 90 | } 91 | 92 | #define OPTIONIMPLYEITHER3(A,B,C,D)\ 93 | if(ISSET(A))\ 94 | {\ 95 | if(!ISSET(B) && !ISSET(C) && !ISSET(D))\ 96 | {\ 97 | ERROR4("option %s requires one of the options %s, %s, %s",\ 98 | options[A].optname,\ 99 | options[B].optname,\ 100 | options[C].optname,\ 101 | options[D].optname);\ 102 | return -1;\ 103 | }\ 104 | } 105 | 106 | #define OPTIONIMPLYEITHER4(A,B,C,D,E)\ 107 | if(ISSET(A))\ 108 | {\ 109 | if(!ISSET(B) && !ISSET(C) && !ISSET(D) && !ISSET(E))\ 110 | {\ 111 | ERROR5("option %s requires one of the options %s, %s, %s, %s",\ 112 | options[A].optname,\ 113 | options[B].optname,\ 114 | options[C].optname,\ 115 | options[D].optname,\ 116 | options[E].optname);\ 117 | return -1;\ 118 | }\ 119 | } 120 | 121 | /* 122 | The following macro checks if two options are used simultaneously. 123 | If so, then an error is reported. 124 | */ 125 | 126 | #define OPTIONEXCLUDE(A,B)\ 127 | if(ISSET(A) && ISSET(B))\ 128 | {\ 129 | ERROR2("option %s and option %s exclude each other",\ 130 | options[A].optname,options[B].optname);\ 131 | return -1;\ 132 | } 133 | 134 | /* 135 | An option is described by the following type. 136 | */ 137 | 138 | typedef struct 139 | { 140 | char *optname, // the option string, begins with - 141 | *description; // help text describing purpose of option 142 | Uint optval; // the unique number of an option 143 | BOOL isalreadyset, // has the option already been set? 144 | declared; // is the option declared by 145 | // a line of the form \texttt{ADDOPTION} 146 | } OptionDescription; // \Typedef{OptionDescription} 147 | 148 | //\Ignore{ 149 | 150 | #endif 151 | 152 | //} 153 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/multidef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef MULTIDEF_H 12 | #define MULTIDEF_H 13 | #include 14 | #include 15 | #include "arraydef.h" 16 | 17 | //} 18 | 19 | /* 20 | This file defines the datatype \texttt{Multiseq} which stores information 21 | about \(k\)-sequences \(T_{0}\), \(\ldots\), \(T_{k-1}\): 22 | \begin{enumerate} 23 | \item 24 | For each \(i\in[0,k-1]\), \texttt{startdesc[i]} stores the index in 25 | \texttt{descspace.spaceUchar}, where a textual description for sequence 26 | \(T_{i}\) starts. A description for sequence \(T_{i}\) 27 | ends with a newline character at index \texttt{startdesc[i+1]-1}. 28 | The description can e.g.\ be the text following the symbol 29 | \texttt{>} in a fasta formatted file. 30 | \item 31 | For each \(i\in[0,k-2]\), \texttt{markpos[i]} is the position of a 32 | \emph{separator character} between sequence \(T_{i}\) and \(T_{i+1}\). 33 | \item 34 | Let \(i\in[0,k-1]\). 35 | If \(i=0\), then \(T_{i}\) is stored in the component \texttt{sequence} 36 | from index \(0\) to index \(\Size{T_{i}}-1\). 37 | If \(i>0\), then \(T_{i}\) is stored in the component \texttt{sequence} 38 | from index \(\texttt{markpos[i-1]+1}\) to index 39 | \(\texttt{markpos[i-1]}+1+\Size{T_{i}}\). 40 | \item 41 | \texttt{numofsequences} is the number \(k\) of sequences stored. 42 | \item 43 | \texttt{totallength} is the total length of the stored sequences 44 | including the \(k-1\) separator characters. 45 | \end{enumerate} 46 | */ 47 | 48 | /* 49 | The following defines the separator symbol for fasta files. 50 | */ 51 | 52 | #define FASTASEPARATOR '>' 53 | 54 | /* 55 | For a given multiseq and sequence number, the following macros deliver 56 | a pointer to the first character of the description, and the 57 | length of the description. 58 | */ 59 | 60 | #define DESCRIPTIONSTARTDESC(MS,SN)\ 61 | ((MS)->startdesc[SN]) 62 | 63 | #define DESCRIPTIONPTR(MS,SN)\ 64 | ((MS)->descspace.spaceUchar + DESCRIPTIONSTARTDESC(MS,SN)) 65 | 66 | #define DESCRIPTIONLENGTH(MS,SN)\ 67 | (DESCRIPTIONSTARTDESC(MS,(SN)+1) - DESCRIPTIONSTARTDESC(MS,SN)) 68 | 69 | /* 70 | The following macros specifies a default initialization of a structure 71 | of type \texttt{Showdescinfo}. 72 | */ 73 | 74 | #define ASSIGNDEFAULTSHOWDESC(DESC)\ 75 | (DESC)->defined = True;\ 76 | (DESC)->skipprefix = 0;\ 77 | (DESC)->maxlength = 0;\ 78 | (DESC)->replaceblanks = False;\ 79 | (DESC)->untilfirstblank = False 80 | 81 | /* 82 | The following defines the undefined file separator position 83 | */ 84 | 85 | #define UNDEFFILESEP 0 86 | 87 | typedef struct 88 | { 89 | ArrayPosition markpos; 90 | Uint *startdesc, // of length numofsequences + 1 91 | numofsequences, // the number of sequences 92 | totallength; // the total length of all sequences 93 | ArrayCharacters descspace; // the space for the descriptions 94 | Uchar *sequence, // the concatenated sequences 95 | *rcsequence, // NULL or points to 96 | // reverse complemented sequences 97 | *originalsequence; // NULL or points to orig. sequence 98 | 99 | } Multiseq; // \Typedef{Multiseq} 100 | 101 | /* 102 | The following type describes how to format a sequence description. 103 | */ 104 | 105 | typedef struct 106 | { 107 | BOOL defined, // show a description 108 | replaceblanks, // replaceblanks by underscore 109 | untilfirstblank; // only show sequence until first blank 110 | Uint skipprefix, // always skip this number of prefixes 111 | maxlength; // maximal number of chars of description to be shown 112 | } Showdescinfo; 113 | 114 | /* 115 | The following type is used to store some basic information about 116 | a sequence stored in a \texttt{Multiseq}-record. 117 | */ 118 | 119 | typedef struct 120 | { 121 | Uint seqnum, // the sequence number in multiseq 122 | seqstartpos, // the position of the first character in multiseq.sequence 123 | seqlength, // the length of the sequence 124 | relposition; // the relative position of the sequence 125 | } Seqinfo; // \Typedef{Seqinfo} 126 | 127 | //\Ignore{ 128 | 129 | #endif 130 | 131 | //} 132 | -------------------------------------------------------------------------------- /docs/run-mummer3.README: -------------------------------------------------------------------------------- 1 | -=- run-mummer3 (MUMmer3.0) README -=- 2 | 3 | ** NOTE ** 4 | This manual is outdated, please refer to the HTML documentation included in 5 | this distribution or at: 6 | 7 | http://mummer.sourceforge.net 8 | http://mummer.sourceforge.net/manual 9 | http://mummer.sourceforge.net/examples 10 | 11 | If any of this code is used in any publication, please cite the following: 12 | 13 | Fast algorithms for large-scale genome alignment and comparison. 14 | A.L. Delcher. A. Phillippy, J. Carlton, and S.L. Salzberg. Nucleic 15 | Acids Research 30:11 (2002), 2478-2483. 16 | 17 | 18 | USAGE: ./run-mummer3 19 | 20 | specifies the file with the first sequence in FastA 21 | format. No more than on sequence is allowed. 22 | specifies the multi-fasta sequence FastA file that contains 23 | the query sequences, to be aligned to the reference. 24 | specifies the file prefix for the output files. 25 | 26 | NOTE: 27 | Coordinates from this script will be relative to their respective 28 | strand. Thus reverse matches will have coordinates that reference the 29 | reverse complemented query sequence! If this coordinate system is 30 | confusing, use nucmer instead. 31 | 32 | 33 | MATCHING PARAMETERS: 34 | It is important to customize the command line parameters of the matching 35 | and clustering algorithms to reflect the users desired alignment results. 36 | All of the programs in the run-mummer3 script (mummer, mgaps, and combineMUMs) 37 | can be passed various parameters to alter their performance and output. To view 38 | these options, run each program from the command line with the "-h" option to 39 | view their definable parameters. Then to make a permanent change to the script, 40 | simply add the desired parameters to the script using a standard text editor. 41 | 42 | NOTE: For SNP hunters the -D option to combineMUMs will be very handy for 43 | locating and parsing the difference positions. 44 | 45 | 46 | MATCHING ALGORITHMS: 47 | It is also possible to change the matching algorithm used in the alignment 48 | generation. type 'mummer -help' to see the algorithm switches. 49 | 50 | 51 | OUTPUT FILES: 52 | The four output files of this script are: 53 | .out 54 | .gaps 55 | .errorsgaps 56 | .align 57 | 58 | + .out 59 | This file lists the coordinates of the matches found and the length 60 | of each match found. A group of matches to a specific sequence in 61 | the query file is headed by the FastA tag of that sequence. The first 62 | and second columns list the start coordinates in the reference and 63 | query sequences respectively. The final column is the length of the 64 | match. 65 | 66 | + .gaps 67 | The headers and 1st - 3rd columns of this file are exactly like the 68 | .out file above. However, matches are now sorted and clustered 69 | according to their position in each of the sequences. Clusters of 70 | matches are separated by a "#" character and matches from different 71 | sequences in the query file are still separated by the FastA header 72 | for that sequence. 73 | The additional columns in this file (4th - 6th) describe 74 | the gaps between adjacent matches. The 4th column represents the 75 | number of overlapping characters between the current match and the 76 | previous match. The 5th column displays the number of characters 77 | between the beginning of this match in the reference and the end 78 | of the previous match in the reference. Finally, the 6th column 79 | displays the number of characters between the beginning of this 80 | match in the query sequence and the end of the previous match in 81 | the query sequence. 82 | 83 | + .errorsgaps 84 | This file is identical to the .gaps file, except for the 85 | addition of a 7th column that displays the number of errors in the 86 | gap described by columns 5 and 6. This is perhaps the most helpful 87 | output file of the script, as it is easy to parse and interpret. 88 | 89 | + .align 90 | This file also expands on the .gaps file, but in a different 91 | way than the witherrors.gaps file. This file intersperses the lines 92 | of the .gaps file with an actual alignment of the gap between 93 | the previous two matches. Additionally, wherever there was a "#" 94 | character in the .gaps file, the .align file adds 95 | a line that lists the encompassing start and stop coordinates of the 96 | previous alignment region, a error ratio, and an error percentage. 97 | 98 | 99 | Email questions, comments or bug reports to: 100 | -------------------------------------------------------------------------------- /docs/run-mummer1.README: -------------------------------------------------------------------------------- 1 | -=- run-mummer1 (MUMmer1.0) README -=- 2 | 3 | ** NOTE ** 4 | This manual is outdated, please refer to the HTML documentation included in 5 | this distribution or at: 6 | 7 | http://mummer.sourceforge.net 8 | http://mummer.sourceforge.net/manual 9 | http://mummer.sourceforge.net/examples 10 | 11 | This is the README for the original MUMmer 1.0 system, which is 12 | included in the MUMmer 3 package. It is slower and uses more memory, 13 | but it does have some slightly different functions and output so we 14 | make it available. 15 | 16 | 17 | 18 | MUMmer 1.0 code and documentation are copyright (c) 1999 by The Institute 19 | for Genomic Research. The principle architect for the system was 20 | Arthur Delcher. 21 | 22 | This directory contains the source code for MUMmer program for 23 | aligning long DNA sequences. If you use this code in any publication, 24 | please cite the following: 25 | A.L. Delcher, S. Kasif, R.D. Fleischmann, J. Peterson, 26 | O. White, and S.L. Salzberg. Alignment of whole genomes. 27 | Nucleic Acids Research, 27:11 (1999), 2369-2376. 28 | 29 | MUMmer works on Unix only. This README file is the only documentation 30 | besides the code itself. Since it is free, we cannot provide any 31 | other support. The system is very easy to use, but you need to invest 32 | a few minutes up front reading this file and figuring out how to 33 | interpret the output. If you discover bugs, we would be interested in 34 | hearing about them so we can correct them. Address bug reports to 35 | . The system uses a LOT of RAM - if 36 | it crashes for that reason, that's not a bug. We recommend at least 37 | 512Mb to align most pairs of bacterial genomes, and 1Gb or more may be 38 | required. 39 | 40 | To use this system, first compile it by typing 'make' at the 41 | command line. There is a script, 'run-mummer1.csh', that runs all 42 | the steps of aligning two genomes. The script takes these arguments: 43 | 44 | run-mummer1.csh [-r] 45 | 46 | The two genomes must DNA sequences in FASTA format. Multi-FASTA 47 | files don't work. The tag is used to create 4 output files, 48 | all with 'tag' as a prefix. -flip will reverse complement . 49 | 50 | Of the four output files, two are intended for your inspection. 51 | .errorsgaps lists the alignment of all the MUMs (maximal unique 52 | matches - read the paper for definitions), and includes the longest 53 | ascending sequence of MUMs first. This sequence is the best alignment 54 | of the two genomes by the program. In between the MUMs are gaps, 55 | which are aligned using a Smith-Waterman implementation of our own. 56 | Those Smith-Waterman's are contained in the file .align. 57 | This can be a very long file if there are lots of gaps. If either 58 | of the two gaps is too long (over 5000bp), then the alignment is 59 | not performed. 60 | 61 | IMPORTANT: the performance of the program can critically depend on the 62 | minimum MUM length you use. The default is 20bp. If you want to 63 | change it, do the following: edit the file run-mummer1.csh. Add a new 64 | length switch to the 'mummer' call. 65 | 66 | The other file - one that we often spend lots of time analyzing - is 67 | .errorsgaps. The lines in that file are the MUMs, for example: 68 | 46989 271588 23 none 3262 3304 1022 69 | 47013 271612 24 none 1 1 1 70 | Columns 1 and 2 are the positions of a MUM in genomes 1 and 2. The 71 | MUM is 24bp in length, shown in column 3. Column 4 is the overlap 72 | from the previous MUM - usually this will be 'none' except when there 73 | are repeats present. Columns 5 and 6 show the gaps from the *end* 74 | of the previous MUM. Column 7 shows the number of errors - indels 75 | or mismatches - in the S-W alignment of the gap before this MUM. 76 | Hence in the two lines shown here, the second line is a MUM of 24bp, 77 | and it follows the previous MUM after a gap of just 1bp in each genome. 78 | This indicates a single nucleotide polymorphism. 79 | 80 | Files in this directory: 81 | 82 | annotate.cc Adds alignment info to gaps file produced by gaps 83 | or gaps2 . Reads frag info from the file named on the '>' 84 | lines of the gap file. The word "reverse" after that name 85 | will make that sequence get reverse-complemented. 86 | Also produces file witherrors.gaps which is the same as the 87 | gaps input file, put with an extra column of number of 88 | errors. 89 | 90 | gaps.cc Finds longest consistent set of matches in list 91 | produced by mummer1 program. 92 | 93 | run-mummer1.csh Script to run alignment programs. Format is: 94 | run-mummer1.csh [-flip] 95 | will be used to make output files: .out , .gaps 96 | and .align . -r will reverse complement 97 | 98 | Email questions, comments or bug reports to: 99 | 100 | -------------------------------------------------------------------------------- /docs/web/examples/data/nucmer.coords: -------------------------------------------------------------------------------- 1 | /home/aphillip/web/mummer/examples/data/B_anthracis_Mslice.fasta /home/aphillip/web/mummer/examples/data/B_anthracis_contigs.fasta 2 | NUCMER 3 | 4 | [S1] [E1] | [S2] [E2] | [LEN 1] [LEN 2] | [% IDY] | [LEN R] [LEN Q] | [COV R] [COV Q] | [TAGS] 5 | =============================================================================================================================== 6 | 5224 12174 | 6944 1 | 6951 6944 | 99.80 | 312600 6944 | 2.22 100.00 | B_anthracis_Mslice 138389 7 | 12256 19905 | 7647 1 | 7650 7647 | 99.88 | 312600 7647 | 2.45 100.00 | B_anthracis_Mslice 138310 8 | 19959 52829 | 32872 1 | 32871 32872 | 99.98 | 312600 32872 | 10.52 100.00 | B_anthracis_Mslice 138291 9 | 23368 24230 | 858 1 | 863 858 | 98.96 | 312600 879 | 0.28 97.61 | B_anthracis_Mslice 137829 10 | 29078 29933 | 1 851 | 856 851 | 98.95 | 312600 851 | 0.27 100.00 | B_anthracis_Mslice 137827 11 | 40129 40827 | 1 701 | 699 701 | 98.86 | 312600 701 | 0.22 100.00 | B_anthracis_Mslice 137892 12 | 52816 75314 | 22500 1 | 22499 22500 | 99.99 | 312600 22500 | 7.20 100.00 | B_anthracis_Mslice 138388 13 | 75501 76288 | 781 1 | 788 781 | 97.59 | 312600 781 | 0.25 100.00 | B_anthracis_Mslice 138123 14 | 76589 80244 | 3656 1 | 3656 3656 | 100.00 | 312600 3659 | 1.17 99.92 | B_anthracis_Mslice 138262 15 | 80219 92609 | 12394 2 | 12391 12393 | 99.97 | 312600 12394 | 3.96 99.99 | B_anthracis_Mslice 138239 16 | 93043 100464 | 7422 1 | 7422 7422 | 100.00 | 312600 7422 | 2.37 100.00 | B_anthracis_Mslice 138261 17 | 100476 109286 | 8814 4 | 8811 8811 | 99.99 | 312600 8814 | 2.82 99.97 | B_anthracis_Mslice 138186 18 | 109391 113981 | 4590 1 | 4591 4590 | 99.93 | 312600 4590 | 1.47 100.00 | B_anthracis_Mslice 138238 19 | 113952 157080 | 43159 33 | 43129 43127 | 99.99 | 312600 43159 | 13.80 99.93 | B_anthracis_Mslice 138237 20 | 131175 132041 | 863 1 | 867 863 | 98.73 | 312600 863 | 0.28 100.00 | B_anthracis_Mslice 137795 21 | 133048 134036 | 3 985 | 989 983 | 98.38 | 312600 985 | 0.32 99.80 | B_anthracis_Mslice 137797 22 | 156798 187944 | 31147 1 | 31147 31147 | 99.99 | 312600 31149 | 9.96 99.99 | B_anthracis_Mslice 138387 23 | 188452 189423 | 973 1 | 972 973 | 99.79 | 312600 973 | 0.31 100.00 | B_anthracis_Mslice 138043 24 | 189647 190336 | 693 1 | 690 693 | 99.57 | 312600 693 | 0.22 100.00 | B_anthracis_Mslice 138127 25 | 190507 191708 | 1202 1 | 1202 1202 | 100.00 | 312600 1202 | 0.38 100.00 | B_anthracis_Mslice 138059 26 | 191975 200488 | 8514 1 | 8514 8514 | 99.98 | 312600 8514 | 2.72 100.00 | B_anthracis_Mslice 138233 27 | 200483 203490 | 3008 1 | 3008 3008 | 100.00 | 312600 3008 | 0.96 100.00 | B_anthracis_Mslice 138232 28 | 203485 204496 | 1 1012 | 1012 1012 | 100.00 | 312600 1012 | 0.32 100.00 | B_anthracis_Mslice 138088 29 | 204351 205767 | 1 1414 | 1417 1414 | 98.87 | 312600 1414 | 0.45 100.00 | B_anthracis_Mslice 137999 30 | 205825 223920 | 18096 4 | 18096 18093 | 99.98 | 312600 18096 | 5.79 99.98 | B_anthracis_Mslice 138259 31 | 223993 230697 | 6708 3 | 6705 6706 | 99.99 | 312600 6708 | 2.14 99.97 | B_anthracis_Mslice 138236 32 | 230583 235156 | 1 4574 | 4574 4574 | 100.00 | 312600 4574 | 1.46 100.00 | B_anthracis_Mslice 138021 33 | 235270 270455 | 1 35186 | 35186 35186 | 99.99 | 312600 35186 | 11.26 100.00 | B_anthracis_Mslice 138378 34 | 270657 271776 | 1 1120 | 1120 1120 | 100.00 | 312600 1120 | 0.36 100.00 | B_anthracis_Mslice 138045 35 | 272163 282983 | 1 10819 | 10821 10819 | 99.96 | 312600 10819 | 3.46 100.00 | B_anthracis_Mslice 138330 36 | 282914 285798 | 1 2878 | 2885 2878 | 99.65 | 312600 2878 | 0.92 100.00 | B_anthracis_Mslice 138207 37 | 285887 311490 | 1 25604 | 25604 25604 | 99.98 | 312600 25608 | 8.19 99.98 | B_anthracis_Mslice 138208 38 | 294295 295119 | 1 822 | 825 822 | 98.30 | 312600 822 | 0.26 100.00 | B_anthracis_Mslice 137957 39 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/Filegoals.mf: -------------------------------------------------------------------------------- 1 | access.dbg.o:access.c 2 | $(CC) $(CFLAGS) -DDEBUG -c access.c -o $@ 3 | 4 | addleafcount.dbg.o:addleafcount.c 5 | $(CC) $(CFLAGS) -DDEBUG -c addleafcount.c -o $@ 6 | 7 | construct.dbg.o:construct.c 8 | $(CC) $(CFLAGS) -DDEBUG -c construct.c -o $@ 9 | 10 | depthtab.dbg.o:depthtab.c 11 | $(CC) $(CFLAGS) -DDEBUG -c depthtab.c -o $@ 12 | 13 | dfs.dbg.o:dfs.c 14 | $(CC) $(CFLAGS) -DDEBUG -c dfs.c -o $@ 15 | 16 | ex2leav.dbg.o:ex2leav.c 17 | $(CC) $(CFLAGS) -DDEBUG -c ex2leav.c -o $@ 18 | 19 | iterator.dbg.o:iterator.c 20 | $(CC) $(CFLAGS) -DDEBUG -c iterator.c -o $@ 21 | 22 | linkloc.dbg.o:linkloc.c 23 | $(CC) $(CFLAGS) -DDEBUG -c linkloc.c -o $@ 24 | 25 | loc.dbg.o:loc.c 26 | $(CC) $(CFLAGS) -DDEBUG -c loc.c -o $@ 27 | 28 | overmax.dbg.o:overmax.c 29 | $(CC) $(CFLAGS) -DDEBUG -c overmax.c -o $@ 30 | 31 | oversucc.dbg.o:oversucc.c 32 | $(CC) $(CFLAGS) -DDEBUG -c oversucc.c -o $@ 33 | 34 | scanpref.dbg.o:scanpref.c 35 | $(CC) $(CFLAGS) -DDEBUG -c scanpref.c -o $@ 36 | 37 | stree.dbg.o:stree.c 38 | $(CC) $(CFLAGS) -DDEBUG -c stree.c -o $@ 39 | 40 | streedbg.dbg.o:streedbg.c 41 | $(CC) $(CFLAGS) -DDEBUG -c streedbg.c -o $@ 42 | 43 | streefiledoc.dbg.o:streefiledoc.c 44 | $(CC) $(CFLAGS) -DDEBUG -c streefiledoc.c -o $@ 45 | 46 | access.prepro:access.c 47 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c access.c -o $@ 48 | 49 | addleafcount.prepro:addleafcount.c 50 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c addleafcount.c -o $@ 51 | 52 | construct.prepro:construct.c 53 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c construct.c -o $@ 54 | 55 | depthtab.prepro:depthtab.c 56 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c depthtab.c -o $@ 57 | 58 | dfs.prepro:dfs.c 59 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c dfs.c -o $@ 60 | 61 | ex2leav.prepro:ex2leav.c 62 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c ex2leav.c -o $@ 63 | 64 | iterator.prepro:iterator.c 65 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c iterator.c -o $@ 66 | 67 | linkloc.prepro:linkloc.c 68 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c linkloc.c -o $@ 69 | 70 | loc.prepro:loc.c 71 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c loc.c -o $@ 72 | 73 | overmax.prepro:overmax.c 74 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c overmax.c -o $@ 75 | 76 | oversucc.prepro:oversucc.c 77 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c oversucc.c -o $@ 78 | 79 | scanpref.prepro:scanpref.c 80 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c scanpref.c -o $@ 81 | 82 | stree.prepro:stree.c 83 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c stree.c -o $@ 84 | 85 | streedbg.prepro:streedbg.c 86 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c streedbg.c -o $@ 87 | 88 | streefiledoc.prepro:streefiledoc.c 89 | $(CC) -E -g3 $(CFLAGS) -DDEBUG -c streefiledoc.c -o $@ 90 | 91 | access.pr:access.c 92 | skproto.x access.c > $@ 93 | 94 | addleafcount.pr:addleafcount.c 95 | skproto.x addleafcount.c > $@ 96 | 97 | construct.pr:construct.c 98 | skproto.x construct.c > $@ 99 | 100 | depthtab.pr:depthtab.c 101 | skproto.x depthtab.c > $@ 102 | 103 | dfs.pr:dfs.c 104 | skproto.x dfs.c > $@ 105 | 106 | ex2leav.pr:ex2leav.c 107 | skproto.x ex2leav.c > $@ 108 | 109 | iterator.pr:iterator.c 110 | skproto.x iterator.c > $@ 111 | 112 | linkloc.pr:linkloc.c 113 | skproto.x linkloc.c > $@ 114 | 115 | loc.pr:loc.c 116 | skproto.x loc.c > $@ 117 | 118 | overmax.pr:overmax.c 119 | skproto.x overmax.c > $@ 120 | 121 | oversucc.pr:oversucc.c 122 | skproto.x oversucc.c > $@ 123 | 124 | scanpref.pr:scanpref.c 125 | skproto.x scanpref.c > $@ 126 | 127 | stree.pr:stree.c 128 | skproto.x stree.c > $@ 129 | 130 | streedbg.pr:streedbg.c 131 | skproto.x streedbg.c > $@ 132 | 133 | streefiledoc.pr:streefiledoc.c 134 | skproto.x streefiledoc.c > $@ 135 | 136 | access.splint:access.c 137 | splint ${SPLINTFLAGS} access.c 138 | touch access.splint 139 | 140 | addleafcount.splint:addleafcount.c 141 | splint ${SPLINTFLAGS} addleafcount.c 142 | touch addleafcount.splint 143 | 144 | construct.splint:construct.c 145 | splint ${SPLINTFLAGS} construct.c 146 | touch construct.splint 147 | 148 | depthtab.splint:depthtab.c 149 | splint ${SPLINTFLAGS} depthtab.c 150 | touch depthtab.splint 151 | 152 | dfs.splint:dfs.c 153 | splint ${SPLINTFLAGS} dfs.c 154 | touch dfs.splint 155 | 156 | ex2leav.splint:ex2leav.c 157 | splint ${SPLINTFLAGS} ex2leav.c 158 | touch ex2leav.splint 159 | 160 | iterator.splint:iterator.c 161 | splint ${SPLINTFLAGS} iterator.c 162 | touch iterator.splint 163 | 164 | linkloc.splint:linkloc.c 165 | splint ${SPLINTFLAGS} linkloc.c 166 | touch linkloc.splint 167 | 168 | loc.splint:loc.c 169 | splint ${SPLINTFLAGS} loc.c 170 | touch loc.splint 171 | 172 | overmax.splint:overmax.c 173 | splint ${SPLINTFLAGS} overmax.c 174 | touch overmax.splint 175 | 176 | oversucc.splint:oversucc.c 177 | splint ${SPLINTFLAGS} oversucc.c 178 | touch oversucc.splint 179 | 180 | scanpref.splint:scanpref.c 181 | splint ${SPLINTFLAGS} scanpref.c 182 | touch scanpref.splint 183 | 184 | stree.splint:stree.c 185 | splint ${SPLINTFLAGS} stree.c 186 | touch stree.splint 187 | 188 | streedbg.splint:streedbg.c 189 | splint ${SPLINTFLAGS} streedbg.c 190 | touch streedbg.splint 191 | 192 | streefiledoc.splint:streefiledoc.c 193 | splint ${SPLINTFLAGS} streefiledoc.c 194 | touch streefiledoc.splint 195 | 196 | splintall:${SPLINTALL} 197 | 198 | splintclean: 199 | rm -f *.splint 200 | 201 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/addleafcount.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include "types.h" 10 | #include "protodef.h" 11 | #include "debugdef.h" 12 | #include "streedef.h" 13 | #include "spacedef.h" 14 | #include "arraydef.h" 15 | 16 | typedef struct 17 | { 18 | Suffixtree *stree; // suffix tree info 19 | ArrayUint countstack; 20 | } Countstate; 21 | 22 | static Sint processleaf(/*@unused@*/ Uint leafnumber, 23 | /*@unused@*/ Bref lcpnode,void *info) 24 | { 25 | Countstate *cstate = (Countstate *) info; 26 | 27 | cstate->countstack.spaceUint[cstate->countstack.nextfreeUint - 1]++; 28 | return 0; 29 | } 30 | 31 | static BOOL processbranch1(/*@unused@*/ Bref nodeptr,void *info) 32 | { 33 | Countstate *cstate = (Countstate *) info; 34 | 35 | CHECKARRAYSPACE(&(cstate->countstack),Uint,128); 36 | cstate->countstack.spaceUint[cstate->countstack.nextfreeUint++] = 0; 37 | return True; 38 | } 39 | 40 | #ifdef REPNUM 41 | static Uint tmpleafcount, repnum = 0; 42 | #endif 43 | 44 | static Sint processbranch2(Bref nodeptr,void *info) 45 | { 46 | Countstate *cstate = (Countstate *) info; 47 | Branchinfo branchinfo; 48 | Uint *father; 49 | 50 | cstate->countstack.nextfreeUint--; 51 | father = cstate->countstack.spaceUint + cstate->countstack.nextfreeUint - 1; 52 | *father += *(father+1); 53 | getbranchinfostree(cstate->stree,ACCESSDEPTH | ACCESSHEADPOS, 54 | &branchinfo,nodeptr); 55 | #ifdef REPNUM 56 | if(branchinfo.depth >= 12) 57 | { 58 | tmpleafcount = *(father+1); 59 | repnum += ((tmpleafcount * tmpleafcount) >> 1); 60 | } 61 | #endif 62 | cstate->stree->leafcounts[branchinfo.headposition] = *(father+1); 63 | DEBUG2(3,"leafcount(%lu) = %lu\n", 64 | (Showuint) BRADDR2NUM(cstate->stree,nodeptr), 65 | (Showuint) *(father+1)); 66 | *(father+1) = 0; 67 | return 0; 68 | } 69 | 70 | /* 71 | depth first traversal of the tree. 72 | push branch node on stack when visited first. 73 | suppose there is an edge \(father -> son\) such that son is the root of 74 | a subtree which has been processed. 75 | If son is leaf then call processleaf(father,son). 76 | If son is not a leaf, then call processbranch(father,son) 77 | */ 78 | 79 | Uint getleafcountstree(Suffixtree *stree,Bref nodeptr) 80 | { 81 | Branchinfo branchinfo; 82 | 83 | #ifdef DEBUG 84 | if(stree->leafcounts == NULL) 85 | { 86 | fprintf(stderr,"leafcounts are not stored yet. First call \"addleafcountsstree\"\n"); 87 | exit(EXIT_FAILURE); 88 | } 89 | #endif 90 | getbranchinfostree(stree,ACCESSHEADPOS,&branchinfo,nodeptr); 91 | return stree->leafcounts[branchinfo.headposition]; 92 | } 93 | 94 | #ifdef DEBUG 95 | 96 | static Sint countleafs(/*@unused@*/ Uint leafindex, 97 | /*@unused@*/ Bref lcanode,void *info) 98 | { 99 | Uint *lc = (Uint *) info; 100 | 101 | (*lc)++; 102 | return 0; 103 | } 104 | 105 | static void checkleafcount(Suffixtree *stree, 106 | Bref nodeptr, 107 | /*@unused@*/ Uint depth, 108 | Uint headposition, 109 | /*@unused@*/ void *info) 110 | { 111 | Reference ref; 112 | Uint lc = 0; 113 | 114 | DEBUG1(3,"checkleafcount of %lu\n",(Showuint) BRADDR2NUM(stree,nodeptr)); 115 | ref.toleaf = False; 116 | ref.address = nodeptr; 117 | if(depthfirststree(stree,&ref,countleafs,NULL,NULL, 118 | NULL,NULL,(void *) &lc) != 0) 119 | { 120 | fprintf(stderr,"depthfirststree failed\n"); 121 | exit(EXIT_FAILURE); 122 | } 123 | if(stree->leafcounts[headposition] != lc) 124 | { 125 | fprintf(stderr,"leafcount[%lu] = %lu != %lu lc\n", 126 | (Showuint) BRADDR2NUM(stree,nodeptr), 127 | (Showuint) stree->leafcounts[headposition], 128 | (Showuint) lc); 129 | exit(EXIT_FAILURE); 130 | } 131 | } 132 | 133 | static void checkleafcountall(Suffixtree *stree) 134 | { 135 | overallstree(stree,True,checkleafcount,NULL); 136 | } 137 | #endif 138 | 139 | Sint addleafcountsstree(Suffixtree *stree) 140 | { 141 | Countstate cstate; 142 | Reference rootref; 143 | Uint i; 144 | 145 | cstate.stree = stree; 146 | INITARRAY(&(cstate.countstack),Uint); 147 | CHECKARRAYSPACE(&(cstate.countstack),Uint,128); 148 | stree->leafcounts = ALLOCSPACE(NULL,Uint,stree->nextfreeleafnum+1); 149 | for(i=0; i<=stree->nextfreeleafnum; i++) 150 | { 151 | stree->leafcounts[i] = 0; 152 | } 153 | cstate.countstack.spaceUint[cstate.countstack.nextfreeUint++] = 0; 154 | rootref.toleaf = False; 155 | rootref.address = ROOT(stree); 156 | if(depthfirststree(stree,&rootref,processleaf,processbranch1, 157 | processbranch2,NULL,NULL,(void *) &cstate) != 0) 158 | { 159 | return -1; 160 | } 161 | DEBUGCODE(1,checkleafcountall(stree)); 162 | FREEARRAY(&(cstate.countstack),Uint); 163 | #ifdef REPNUM 164 | printf("repnum=%lu\n",(Showuint) repnum); 165 | #endif 166 | return 0; 167 | } 168 | -------------------------------------------------------------------------------- /src/kurtz/libbasedir/arraydef.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | //\Ignore{ 10 | 11 | #ifndef ARRAYDEF_H 12 | #define ARRAYDEF_H 13 | #include "types.h" 14 | #include "errordef.h" 15 | #include "spacedef.h" 16 | 17 | //} 18 | 19 | /* 20 | This file defines macros to conveniently declare and 21 | manipulate dynamic arrays whose size grow on demand. Each dynamic 22 | array over some type \texttt{T} 23 | is implemented by a structure consisting of three components: 24 | \begin{enumerate} 25 | \item 26 | \texttt{space\#\#T} is a pointer to the space block of type \texttt{T} 27 | allocated for the array. 28 | \item 29 | \texttt{allocated\#\#T} is an \texttt{Uint} storing the number 30 | of entries in the array currently allocated. 31 | \item 32 | \texttt{nextfree\#\#T} holds the smallest index of the array where no 33 | value is stored. 34 | \end{enumerate} 35 | Here \texttt{\#\#} is the concatenation operator of the C-preprocessor. 36 | The following macro expands to a corresponding type definition over 37 | some given \texttt{TYPE}. 38 | */ 39 | 40 | #define DECLAREARRAYSTRUCT(TYPE)\ 41 | typedef struct\ 42 | {\ 43 | TYPE *space##TYPE;\ 44 | Uint allocated##TYPE, nextfree##TYPE;\ 45 | } Array##TYPE 46 | 47 | /* 48 | \texttt{INITARRAY} initializes an empty array. 49 | */ 50 | 51 | #define INITARRAY(A,TYPE)\ 52 | (A)->space##TYPE = NULL;\ 53 | (A)->allocated##TYPE = (A)->nextfree##TYPE = 0 54 | 55 | /* 56 | \texttt{CHECKARRAYSPACE} checks if the integer \texttt{nextfree\#\#T} 57 | points to an index for which the space is not allocated yet. If this is 58 | the case, the number of cells allocated is incremented by \texttt{L}. The 59 | contents of the previously filled array elements is of course maintained. 60 | */ 61 | 62 | #define CHECKARRAYSPACE(A,TYPE,L)\ 63 | if((A)->nextfree##TYPE >= (A)->allocated##TYPE)\ 64 | {\ 65 | (A)->allocated##TYPE += L;\ 66 | (A)->space##TYPE\ 67 | = (TYPE *) allocandusespaceviaptr(__FILE__,(Uint) __LINE__,\ 68 | (A)->space##TYPE,\ 69 | (Uint) sizeof(TYPE),\ 70 | (A)->allocated##TYPE);\ 71 | }\ 72 | NOTSUPPOSEDTOBENULL((A)->space##TYPE) 73 | 74 | /* 75 | The next macro is a variation of \texttt{CHECKARRAYSPACE}, 76 | which checks if the next 77 | \texttt{L} cells have been allocated. If not, then this is done. 78 | */ 79 | 80 | #define CHECKARRAYSPACEMULTI(A,TYPE,L)\ 81 | if((A)->nextfree##TYPE + (L) >= (A)->allocated##TYPE)\ 82 | {\ 83 | (A)->allocated##TYPE += L;\ 84 | (A)->space##TYPE\ 85 | = (TYPE *) allocandusespaceviaptr(__FILE__,(Uint) __LINE__,\ 86 | (A)->space##TYPE,\ 87 | (Uint) sizeof(TYPE),\ 88 | (A)->allocated##TYPE);\ 89 | }\ 90 | NOTSUPPOSEDTOBENULL((A)->space##TYPE) 91 | 92 | /* 93 | This macro checks the space and delivers a pointer \texttt{P} 94 | to the next free element in the array. 95 | */ 96 | 97 | #define GETNEXTFREEINARRAY(P,A,TYPE,L)\ 98 | CHECKARRAYSPACE(A,TYPE,L);\ 99 | P = (A)->space##TYPE + (A)->nextfree##TYPE++; 100 | 101 | /* 102 | This macro checks the space and stores \texttt{V} in the 103 | \texttt{nextfree}-component of the array. \texttt{nextfree} 104 | is incremented. 105 | */ 106 | 107 | #define STOREINARRAY(A,TYPE,L,VAL)\ 108 | CHECKARRAYSPACE(A,TYPE,L);\ 109 | (A)->space##TYPE[(A)->nextfree##TYPE++] = VAL 110 | 111 | /* 112 | This macro frees the space for an array if it is not \texttt{NULL}. 113 | */ 114 | 115 | #define FREEARRAY(A,TYPE)\ 116 | if((A)->space##TYPE != NULL)\ 117 | {\ 118 | FREESPACE((A)->space##TYPE);\ 119 | } 120 | 121 | /* 122 | Some declarations for the most common array types. 123 | */ 124 | 125 | DECLAREARRAYSTRUCT(Uchar); 126 | DECLAREARRAYSTRUCT(Ushort); 127 | DECLAREARRAYSTRUCT(char); 128 | DECLAREARRAYSTRUCT(Uint); 129 | DECLAREARRAYSTRUCT(Sint); 130 | DECLAREARRAYSTRUCT(PairUint); 131 | DECLAREARRAYSTRUCT(ThreeUint); 132 | 133 | /* 134 | And some type synonyms. 135 | */ 136 | 137 | typedef ArrayUint ArrayPosition; // \Typedef{ArrayPosition} 138 | typedef ArrayUchar ArrayCharacters; // \Typedef{ArrayCharacters} 139 | 140 | /* 141 | The following array type has some extra components. However, it can be 142 | manipulated by the macros above since the record-components 143 | \texttt{spaceStrings}, \texttt{nextfreeStrings}, and 144 | \texttt{allocatedStrings} is declared appropriately. 145 | */ 146 | 147 | typedef struct 148 | { 149 | Stringtype *spaceStrings; 150 | Uchar *stringbuffer; 151 | Uint stringbufferlength, nextfreeStrings, allocatedStrings; 152 | } ArrayStrings; // \Typedef{ArrayStrings} 153 | 154 | //\Ignore{ 155 | 156 | #endif 157 | 158 | //} 159 | -------------------------------------------------------------------------------- /src/kurtz/streesrc/linkloc.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2003 by Stefan Kurtz and The Institute for 3 | Genomic Research. This is OSI Certified Open Source Software. 4 | Please see the file LICENSE for licensing information and 5 | the file ACKNOWLEDGEMENTS for names of contributors to the 6 | code base. 7 | */ 8 | 9 | #include "streedef.h" 10 | #include "protodef.h" 11 | #include "debugdef.h" 12 | #include "streeacc.h" 13 | 14 | void rescanstree(Suffixtree *stree,Location *loc, 15 | Bref btptr,SYMBOL *left,SYMBOL *right) 16 | { 17 | Uint *nodeptr, *largeptr = NULL, leafindex, nodedepth, 18 | node, distance = 0, prefixlen, headposition, tmpnodedepth; 19 | SYMBOL *lptr; 20 | 21 | lptr = left; 22 | nodeptr = btptr; 23 | if(nodeptr == stree->branchtab) 24 | { 25 | nodedepth = 0; 26 | headposition = 0; 27 | } else 28 | { 29 | GETBOTH(nodedepth,headposition,nodeptr); 30 | } 31 | loc->nextnode.toleaf = False; 32 | loc->nextnode.address = nodeptr; 33 | loc->locstring.start = headposition; 34 | loc->locstring.length = nodedepth; 35 | loc->remain = 0; 36 | while(True) 37 | { 38 | if(lptr > right) // check for empty word 39 | { 40 | return; 41 | } 42 | if(nodeptr == stree->branchtab) // at the root 43 | { 44 | node = stree->rootchildren[(Uint) *lptr]; 45 | prefixlen = (Uint) (right - lptr + 1); 46 | if(ISLEAF(node)) // stop if successor is leaf 47 | { 48 | leafindex = GETLEAFINDEX(node); 49 | loc->firstptr = stree->text + leafindex; 50 | loc->previousnode = stree->branchtab; 51 | loc->edgelen = stree->textlen - leafindex + 1; 52 | loc->remain = loc->edgelen - prefixlen; 53 | loc->nextnode.toleaf = True; 54 | loc->nextnode.address = stree->leaftab + leafindex; 55 | loc->locstring.start = leafindex; 56 | loc->locstring.length = prefixlen; 57 | return; 58 | } 59 | nodeptr = stree->branchtab + GETBRANCHINDEX(node); 60 | GETONLYHEADPOS(headposition,nodeptr); 61 | loc->firstptr = stree->text + headposition; 62 | } else 63 | { 64 | node = GETCHILD(nodeptr); 65 | while(True) // traverse the list of successors 66 | { 67 | if(ISLEAF(node)) // successor is leaf 68 | { 69 | leafindex = GETLEAFINDEX(node); 70 | loc->firstptr = stree->text + (nodedepth + leafindex); 71 | if(*(loc->firstptr) == *lptr) // correct edge found 72 | { 73 | prefixlen = (Uint) (right - lptr + 1); 74 | loc->previousnode = loc->nextnode.address; 75 | loc->edgelen = stree->textlen - (nodedepth + leafindex) + 1; 76 | loc->remain = loc->edgelen - prefixlen; 77 | loc->nextnode.toleaf = True; 78 | loc->nextnode.address = stree->leaftab + leafindex; 79 | loc->locstring.start = leafindex; 80 | loc->locstring.length = nodedepth + prefixlen; 81 | return; 82 | } 83 | node = LEAFBROTHERVAL(stree->leaftab[leafindex]); 84 | } else // successor is branch node 85 | { 86 | nodeptr = stree->branchtab + GETBRANCHINDEX(node); 87 | GETONLYHEADPOS(headposition,nodeptr); 88 | loc->firstptr = stree->text + (nodedepth + headposition); 89 | if(*(loc->firstptr) == *lptr) // correct edge found 90 | { 91 | /*@innerbreak@*/ break; 92 | } 93 | node = GETBROTHER(nodeptr); 94 | } 95 | } 96 | } 97 | GETONLYDEPTH(tmpnodedepth,nodeptr); // get info about succ node 98 | loc->edgelen = tmpnodedepth - nodedepth; 99 | prefixlen = (Uint) (right - lptr + 1); 100 | loc->previousnode = loc->nextnode.address; 101 | loc->nextnode.toleaf = False; 102 | loc->nextnode.address = nodeptr; 103 | loc->locstring.start = headposition; 104 | loc->locstring.length = nodedepth + prefixlen; 105 | if(loc->edgelen > prefixlen) // can reach the successor node 106 | { 107 | loc->remain = loc->edgelen - prefixlen; 108 | return; 109 | } 110 | if(loc->edgelen == prefixlen) 111 | { 112 | loc->remain = 0; 113 | return; 114 | } 115 | lptr += loc->edgelen; 116 | nodedepth = tmpnodedepth; 117 | } 118 | } 119 | 120 | void linklocstree(Suffixtree *stree,Location *outloc,Location *inloc) 121 | { 122 | Branchinfo branchinfo; 123 | 124 | if(inloc->remain == 0) 125 | { 126 | outloc->remain = 0; 127 | outloc->nextnode.toleaf = False; 128 | getbranchinfostree(stree,ACCESSSUFFIXLINK,&branchinfo, 129 | inloc->nextnode.address); 130 | outloc->nextnode.address = branchinfo.suffixlink; 131 | outloc->locstring.start = inloc->locstring.start + 1; 132 | outloc->locstring.length = inloc->locstring.length - 1; 133 | } else 134 | { 135 | if(inloc->previousnode == stree->branchtab) 136 | { 137 | rescanstree(stree,outloc,stree->branchtab,inloc->firstptr+1, 138 | inloc->firstptr + (inloc->edgelen - inloc->remain) - 1); 139 | } else 140 | { 141 | getbranchinfostree(stree,ACCESSSUFFIXLINK,&branchinfo, 142 | inloc->previousnode); 143 | rescanstree(stree,outloc,branchinfo.suffixlink,inloc->firstptr, 144 | inloc->firstptr + (inloc->edgelen - inloc->remain) - 1); 145 | 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | -=- MUMmer3.xx OPEN SOURCE LICENSE -=- 2 | 3 | The Artistic License 4 | 5 | Preamble 6 | 7 | The intent of this document is to state the conditions under which a 8 | Package may be copied, such that the Copyright Holder maintains some 9 | semblance of artistic control over the development of the package, 10 | while giving the users of the package the right to use and distribute 11 | the Package in a more-or-less customary fashion, plus the right to 12 | make reasonable modifications. 13 | 14 | Definitions: 15 | * "Package" refers to the collection of files distributed by the 16 | Copyright Holder, and derivatives of that collection of files 17 | created through textual modification. 18 | * "Standard Version" refers to such a Package if it has not been 19 | modified, or has been modified in accordance with the wishes of 20 | the Copyright Holder. 21 | * "Copyright Holder" is whoever is named in the copyright or 22 | copyrights for the package. 23 | * "You" is you, if you're thinking about copying or distributing 24 | this Package. 25 | * "Reasonable copying fee" is whatever you can justify on the 26 | basis of media cost, duplication charges, time of people 27 | involved, and so on. (You will not be required to justify it to 28 | the Copyright Holder, but only to the computing community at 29 | large as a market that must bear the fee.) 30 | * "Freely Available" means that no fee is charged for the item 31 | itself, though there may be fees involved in handling the 32 | item. It also means that recipients of the item may redistribute 33 | it under the same conditions they received it. 34 | 35 | 1. You may make and give away verbatim copies of the source form of 36 | the Standard Version of this Package without restriction, provided 37 | that you duplicate all of the original copyright notices and 38 | associated disclaimers. 39 | 40 | 2. You may apply bug fixes, portability fixes and other modifications 41 | derived from the Public Domain or from the Copyright Holder. A 42 | Package modified in such a way shall still be considered the 43 | Standard Version. 44 | 45 | 3. You may otherwise modify your copy of this Package in any way, 46 | provided that you insert a prominent notice in each changed file 47 | stating how and when you changed that file, and provided that you 48 | do at least ONE of the following: 49 | 50 | a) place your modifications in the Public Domain or otherwise make 51 | them Freely Available, such as by posting said modifications to 52 | Usenet or an equivalent medium, or placing the modifications on a 53 | major archive site such as ftp.uu.net, or by allowing the 54 | Copyright Holder to include your modifications in the Standard 55 | Version of the Package. 56 | 57 | b) use the modified Package only within your corporation or 58 | organization. 59 | 60 | c) rename any non-standard executables so the names do not 61 | conflict with standard executables, which must also be provided, 62 | and provide a separate manual page for each non-standard 63 | executable that clearly documents how it differs from the Standard 64 | Version. 65 | 66 | d) make other distribution arrangements with the Copyright Holder. 67 | 68 | 4. You may distribute the programs of this Package in object code or 69 | executable form, provided that you do at least ONE of the 70 | following: 71 | 72 | a) distribute a Standard Version of the executables and library 73 | files, together with instructions (in the manual page or 74 | equivalent) on where to get the Standard Version. 75 | 76 | b) accompany the distribution with the machine-readable source of 77 | the Package with your modifications. 78 | 79 | c) accompany any non-standard executables with their corresponding 80 | Standard Version executables, giving the non-standard executables 81 | non-standard names, and clearly documenting the differences in 82 | manual pages (or equivalent), together with instructions on where 83 | to get the Standard Version. 84 | 85 | d) make other distribution arrangements with the Copyright Holder. 86 | 87 | 5. You may charge a reasonable copying fee for any distribution of 88 | this Package. You may charge any fee you choose for support of this 89 | Package. You may not charge a fee for this Package itself. However, 90 | you may distribute this Package in aggregate with other (possibly 91 | commercial) programs as part of a larger (possibly commercial) 92 | software distribution provided that you do not advertise this 93 | Package as a product of your own. 94 | 95 | 6. The scripts and library files supplied as input to or produced as 96 | output from the programs of this Package do not automatically fall 97 | under the copyright of this Package, but belong to whomever 98 | generated them, and may be sold commercially, and may be aggregated 99 | with this Package. 100 | 101 | 7. C or perl subroutines supplied by you and linked into this Package 102 | shall not be considered part of this Package. 103 | 104 | 8. The name of the Copyright Holder may not be used to endorse or 105 | promote products derived from this software without specific prior 106 | written permission. 107 | 108 | 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED 109 | WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES 110 | OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 111 | 112 | The End 113 | This license is approved by the Open Source Initiative 114 | (www.opensource.org) for certifying software as OSI Certified Open 115 | Source. 116 | 117 | --------------------------------------------------------------------------------