texlive[44211] Master: gotoh (5may17)
commits+karl at tug.org
commits+karl at tug.org
Sat May 6 00:47:42 CEST 2017
Revision: 44211
http://tug.org/svn/texlive?view=revision&revision=44211
Author: karl
Date: 2017-05-06 00:47:42 +0200 (Sat, 06 May 2017)
Log Message:
-----------
gotoh (5may17)
Modified Paths:
--------------
trunk/Master/tlpkg/bin/tlpkg-ctan-check
trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/gotoh/
trunk/Master/texmf-dist/doc/latex/gotoh/LICENSE
trunk/Master/texmf-dist/doc/latex/gotoh/README.md
trunk/Master/texmf-dist/source/latex/gotoh/
trunk/Master/texmf-dist/source/latex/gotoh/gotoh.dtx
trunk/Master/texmf-dist/source/latex/gotoh/gotoh.ins
trunk/Master/texmf-dist/tex/latex/gotoh/
trunk/Master/texmf-dist/tex/latex/gotoh/gotoh.sty
trunk/Master/tlpkg/tlpsrc/gotoh.tlpsrc
Added: trunk/Master/texmf-dist/doc/latex/gotoh/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/gotoh/LICENSE (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/gotoh/LICENSE 2017-05-05 22:47:42 UTC (rev 44211)
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Watson (wtsnjp)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
Added: trunk/Master/texmf-dist/doc/latex/gotoh/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/gotoh/README.md (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/gotoh/README.md 2017-05-05 22:47:42 UTC (rev 44211)
@@ -0,0 +1,35 @@
+# Package Gotoh (v1.0)
+
+
+LaTeX package: An implementation of the Gotoh sequence alignment algorithm.
+
+## System Requirements
+
+* TeX format: LaTeX2e
+* TeX engine: any engine
+* Document class: any class
+* Prerequisite package: xkeyval
+
+## Installation
+
+To install the package, interpret the `gotoh.ins` file with LaTeX.
+
+```
+latex gotoh.ins
+```
+
+Then move the files as follows (in a system compliant to TDS 1.1).
+
+* `*.sty`: $TEXMF/tex/latex/gotoh/
+* `*.dtx`, `*.ins`: $TEXMF/source/latex/gotoh/
+* `*.pdf`, `*.tex`: $TEXMF/doc/latex/gotoh/
+
+And rehash your TEXMF trees if necessary.
+
+## License
+
+This package is distributed under [the MIT license](./LICENSE).
+
+---
+
+Takuto ASAKURA ([wtsnjp](https://twitter.com/wtsnjp))
Property changes on: trunk/Master/texmf-dist/doc/latex/gotoh/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/gotoh/gotoh.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/gotoh/gotoh.dtx (rev 0)
+++ trunk/Master/texmf-dist/source/latex/gotoh/gotoh.dtx 2017-05-05 22:47:42 UTC (rev 44211)
@@ -0,0 +1,877 @@
+% ^^A -*- latex -*-
+% \iffalse meta-comment
+%
+% This is file `gotoh.dtx'.
+%
+% Copyright (c) 2017 Takuto ASAKURA (wtsnjp)
+% GitHub: https://github.com/wtsnjp
+% Twitter: @wtsnjp
+%
+% This package is distributed under the MIT License.
+%
+% \fi
+%
+% \CheckSum{971}
+%
+% \changes{v1.0}{2017/05/05}{The first version}
+%
+% \iffalse
+%<*package>
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{gotoh}[2017/05/05 v1.0 Sequence alignment algorithm]
+%</package>
+%<*driver>
+\documentclass[draft]{ltxdoc}
+\usepackage{amsmath}
+\usepackage{enumitem}
+\usepackage{gotoh}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\setlength\hfuzz{15pt}
+\hbadness=7000
+\newcommand{\pkgName}[1]{\textsf{#1}}
+\newcommand{\pkgGotoh}{\pkgName{Gotoh}}
+\newcommand{\synKey}[1]{\texttt{#1}}
+\newcommand{\synOr}{\quad or\quad}
+\newcommand{\synBool}{\meta{\normalfont\texttt{true\textbar false}}}
+\newcommand{\defeq}{\equiv}
+\newcommand{\eqsep}{\;}
+\setlist[description]{font={\normalfont}}
+\begin{document}
+\DocInput{gotoh.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \GetFileInfo{gotoh.sty}
+%
+% \DoNotIndex{%
+% \@empty,\@ne,\\,\advance,\bgroup,\csname,\def,\do,\edef,\egroup,\else,%
+% \endcsname,\expandafter,\fi,\global,\hbox,\hss,\ht,\let,\m at ne,\mbox,%
+% \multiply,\newcommand,\newcount,\newdimen,\newif,\number,\PackageError,%
+% \PackageWarningNoLine,\relax,\RequirePackage,\sbox,\texttt,\the,\xdef,\z@}
+%
+% \title{The {\pkgGotoh} package}
+% \author{Takuto ASAKURA (wtsnjp)}
+% \date{{\fileversion} [\filedate]}
+% \maketitle
+%
+% \MakeShortVerb{\|}
+%
+% \begin{abstract}
+% This package is an implementation in {\TeX} of the Gotoh algorithm, which
+% calculates biological sequence alignments. The package provides only two user
+% commands: |\Gotoh| for executing the algorithm and |\GotohConfig| for setting
+% various parameters with a key-value list.
+% \end{abstract}
+%
+% ^^A\tableofcontents
+%
+% \section{System Requirements}
+%
+% System requirements of {\pkgGotoh} are shown bellow.
+% \begin{itemize}
+% \item {\TeX} engine: any engine
+% \item {\TeX} format: {\LaTeXe}
+% \item Document class: any class
+% \item Required package: \pkgName{xkeyval}
+% \end{itemize}
+%
+% \section{Loading the {\pkgGotoh} Package}
+%
+% To use the {\pkgGotoh} package, load |gotoh.sty| with |\usepackage| command
+% in preamble. No package option is available.
+% \begin{quote}
+% |\usepackage{gotoh}|
+% \end{quote}
+%
+% \section{Calculating the Alignment}
+%
+% \DescribeMacro{\Gotoh}
+% The |\Gotoh| command simply takes two sequences as its arguments.
+% \begin{quote}
+% |\Gotoh|\marg{sequence A}\marg{sequence B}
+% \end{quote}
+% The command puts the optimal score of the alignment to specified control
+% sequence (default: |\GotohScore|) after executing the Gotoh algorithm, and
+% returns the alignment results to other control sequences (default:
+% |\GotohResultA| and |\GotohResultB|). Note that these assignments are done
+% globally. The control sequences to store the score and results can be changed
+% with |\GotohConfig| command.
+%
+% \section{Configuration}
+%
+% \DescribeMacro{\GotohConfig}
+% You can change various settings and parameters related to this package with
+% |\GotohConfig| command. The command takes a key-value list of the settings as
+% its argument and changes the values locally.
+% \begin{quote}
+% |\GotohConfig|\marg{key-value list}
+% \end{quote}
+%
+% \subsection{Control Sequences to Store Results}
+%
+% \DescribeMacro{\GotohScore}
+% \DescribeMacro{\GotohResultA}
+% \DescribeMacro{\GotohResultB}
+% Control sequences which |\Gotoh| command return results can be specified with
+% following keys:
+%
+% \begin{description}
+% \item[\synKey{score} |=| \meta{control sequence}]\hfill |\GotohScore| \\
+% sets the control sequence to store optimal score of the last alignment
+% which calculated by |\Gotoh| command.
+% \item[\synKey{result A} |=| \meta{control sequence}]\hfill |\GotohResultA|
+% \item[\synKey{result B} |=| \meta{control sequence}]\hfill |\GotohResultB| \\
+% specify the control sequences to store alignment results respectively
+% corresponding to \meta{sequence A} and \meta{sequence B} of the arguments
+% of |\Gotoh|.
+% \end{description}
+%
+% \subsection{Algorithm Parameters}
+%
+% The default value of algorithm parameters which define the scoring are
+% \begin{equation}
+% \mathrm{match} = 1,\eqsep \mathrm{mismatch} = -1,\eqsep d = 7,\eqsep e= 1.
+% \label{eq:parameters}
+% \end{equation}
+% Parameters $\mathrm{match}, \mathrm{mismatch}$ define the penalties of a
+% \emph{match} and \emph{mismatch} respectively, and $d, e$ are used in a gap
+% penalty (see section \ref{sect:calc}). The parameters appeared in the above
+% equations are able to be changed with following keys:
+%
+% \begin{description}
+% \item[\synKey{match} |=| \meta{number}]\hfill |1|
+% \item[\synKey{mismatch} |=| \meta{number}]\hfill |-1|
+% \item[\synKey{d} |=| \meta{number}]\hfill |7|
+% \item[\synKey{e} |=| \meta{number}]\hfill |1| \\
+% set the parameters appear in the above equations.
+% \end{description}
+%
+% Though the |\Gotoh| command calculates sequence alignment with standard
+% dynamic programming as default, you can use memoization functions instead.
+% Note that both of the methods produce exactly the same results.
+%
+% \begin{description}
+% \item[\synKey{memoization} |=| \synBool \synOr \synKey{memoization}]\hfill |false| \\
+% If true, use memoization functions to execute the Gotoh algorithm.
+% \end{description}
+%
+% \subsection{Others}
+%
+% \begin{description}
+% \item[\synKey{gap char} |=| \meta{character}]\hfill |.| (period) \\
+% is inserted to the alignment results where gaps appear. Note that you have
+% to be careful if using |-| (hyphen) as gap characters because successive
+% hyphens automatically converted to dashes by {\TeX}. In this case, you can
+% specify |\mbox{-}| instead.
+% \item[\synKey{uppercase} |=| \synBool \synOr \synKey{uppercase}]\hfill |false| \\
+% If true, uppercase both \meta{sequence A} and \meta{sequence B} before
+% executing the algorithm.
+% \end{description}
+%
+% \StopEventually{\PrintIndex\PrintChanges}
+%
+% \section{Algorithm and Implementation}
+%
+% \subsection{Required package}
+%
+% Package \pkgName{xkeyval} is required to process key-value lists.
+% \begin{macrocode}
+\RequirePackage{xkeyval}
+% \end{macrocode}
+%
+% \subsection{Messages}
+%
+% \begin{macro}{\gth at warn}
+% \begin{macro}{\gth at error}
+% Commands for warning and error messages.
+% \begin{macrocode}
+\def\gth at pkgname{gotoh}
+\def\gth at warn{\PackageWarningNoLine\gth at pkgname}
+\def\gth at error{\PackageError\gth at pkgname}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Switches, Registers and Constants}
+%
+% All boolean switches, count registers and dimen registers used by this
+% package are declared here.
+%
+% \begin{macro}{\if at gth@first@}
+% \begin{macro}{\if at gth@renain@}
+% \begin{macro}{\if at gth@gap@}
+% \begin{macro}{\if at gth@gapx@}
+% \begin{macro}{\if at gth@gapy@}
+% A switch |\if at gth@first@| is for a calculation command |\gth at max|, and the
+% other switches are for trace back (in macro |\gth at gotoh|).
+% \begin{macrocode}
+\newif\if at gth@first@
+\newif\if at gth@remain@
+\newif\if at gth@gap@
+\newif\if at gth@gapx@
+\newif\if at gth@gapy@
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gth at tempcnta}
+% \begin{macro}{\gth at tempcntb}
+% \begin{macro}{\gth at tempcntc}
+% \begin{macro}{\gth at tempcntd}
+% \begin{macro}{\gth at calc}
+% Scratch four count registers for general use and one for some calculation
+% routines.
+% \begin{macrocode}
+\newcount\gth at tempcnta
+\newcount\gth at tempcntb
+\newcount\gth at tempcntc
+\newcount\gth at tempcntd
+\newcount\gth at calc
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gth at sn}
+% This is \emph{not} a counter register but a macro to store \meta{number}
+% which is used as `serial number'.
+% \begin{macrocode}
+\edef\gth at sn{\number\z@}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gth at min}
+% This macro stores a large negative \meta{number} which is used instead of
+% $-\infty$. Here |\gth at M| is a largest constant which can be defined by
+% |\mathchardef| primitive (in traditional {\TeX} engine).
+% \begin{macrocode}
+\mathchardef\gth at M="7FFF
+\edef\gth at min{-\number\gth at M}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gth at tempdima}
+% Scratch a dimen register for general use.
+% \begin{macrocode}
+\newdimen\gth at tempdima
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Defining and Setting Keys}
+%
+% \begin{macro}{\gth at match}
+% \begin{macro}{\gth at mismatch}
+% \begin{macro}{\gth at d}
+% \begin{macro}{\gth at e}
+% These are keys for setting the parameters of the algorithm. The default
+% values which are shown in equations~(\ref{eq:parameters}) are set here, and
+% stored in the macros (\emph{not} count registers) respectively.
+% \begin{macrocode}
+\define at cmdkeys[gth]{config}[gth@]{match, mismatch, d, e}
+\setkeys[gth]{config}{match=1, mismatch=-1, d=7, e=1}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gth at score}
+% \begin{macro}{\gth at resulta}
+% \begin{macro}{\gth at resultb}
+% The macros to store the result of the algorithms are also stored in internal
+% macros.
+% \begin{macrocode}
+\define at key[gth]{config}{score}{\def\gth at score{#1}}
+\define at key[gth]{config}{result A}{\def\gth at resulta{#1}}
+\define at key[gth]{config}{result B}{\def\gth at resultb{#1}}
+\setkeys[gth]{config}{
+ score=\GotohScore, result A=\GotohResultA, result B=\GotohResultB}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\if at gth@memoization}
+% \begin{macro}{\if at gth@uppercase}
+% \begin{macro}{\gth at gap@char}
+% Both boolean keys |\if at gth@memoization| and |\if at gth@uppercase| are set false
+% as default. The gap char is stored in |\gth at gap@char|.
+% \begin{macrocode}
+\define at boolkeys[gth]{config}[@gth@]{memoization, uppercase}[true]
+\define at key[gth]{config}{gap char}{\def\gth at gap@char{#1}}
+\setkeys[gth]{config}{memoization=false, uppercase=false, gap char={.}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Utility Commands}
+%
+% \begin{macro}{\gth at nameuse}
+% \begin{macro}{\gth at name@edef}
+% \begin{macro}{\gth at name@xdef}
+% \begin{macro}{\gth at glet}
+% Some primitives to use, define or copy control sequences are wrapped.
+% \begin{macrocode}
+\def\gth at nameuse#1{\csname gth@#1\endcsname}
+\def\gth at name@edef#1{\expandafter\edef\csname gth@#1\endcsname}
+\def\gth at name@xdef#1{\expandafter\xdef\csname gth@#1\endcsname}
+\def\gth at glet{\global\let}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\gth at advance}
+% \begin{macro}{\gth at increment}
+% \begin{macro}{\gth at decrement}
+% Commands to treate macros which store \meta{number} like count registers.
+% \begin{macrocode}
+\def\gth at advance#1#2{%
+ \gth at calc#1\advance\gth at calc#2\edef#1{\the\gth at calc}}
+\def\gth at increment#1{\gth at advance#1\@ne}
+\def\gth at decrement#1{\gth at advance#1\m at ne}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Calculation Routines}\label{sect:calc}
+%
+% Since these calculation routines (macros) are \emph{not} full expandable, all
+% commands defined here return the results by storing the value in the counter
+% register |\gth at calc|. This assignments are done locally.
+%
+% \begin{macro}{\gth at max}
+% This command take comma-separated list of \meta{number} and returns the max
+% value of them.
+% \begin{macrocode}
+\def\gth at max#1{%
+ \@gth at first@true
+ \@for\gth at member:=#1\do{%
+ \if at gth@first@
+ \gth at calc\gth at member
+ \@gth at first@false
+ \else
+ \ifnum\gth at member>\gth at calc
+ \gth at calc\gth at member
+ \fi
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gth at gap@penalty}
+% This command takes $l$, the length of a \emph{gap}, as its argument and
+% calculates its penalty which defined by following function\footnote{This form
+% of gap penalty is called `Affine gaps'.}:
+% \begin{equation}
+% g(l) = -d - (l-1)e. \label{eq:gap}
+% \end{equation}
+% In this equation, $d$ and $e$ are parameters of the algorithm, which have
+% default values shown in equations~(\ref{eq:parameters}).
+% \begin{macrocode}
+\def\gth at gap@penalty#1{%
+ \gth at calc#1\relax
+ \advance\gth at calc\m at ne
+ \multiply\gth at calc-\gth at e
+ \advance\gth at calc-\gth at d}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Printing Matrixes}
+%
+% \begin{macro}{\gth at print@matrix}
+% This command shows the matrixes $M$, $I_x$ or $I_y$ (See
+% section~\ref{sect:algorithm}). The argument of this macro specifies which
+% matrix to show, so you can detect |m|, |ix|, or |iy|. However, this macro is
+% currently only for the author of this package to debug.
+% \begin{macrocode}
+\def\gth at tab#1{%
+ \bgroup
+ \sbox\z@ 0%
+ \expandafter\gth at tempdima\ht\z@
+ \multiply\gth at tempdima 8%
+ \mbox{\hbox to\gth at tempdima{\hss #1}}%
+ \egroup}
+\def\gth at print@matrix#1{%
+ \bgroup\texttt
+ #1:\\
+ \gth at tempcnta\z@
+ \@whilenum\gth at tempcnta<\gth at m\do{%
+ \gth at tempcntb\z@
+ \@whilenum\gth at tempcntb<\gth at n\do{%
+ \gth at tab{%
+ \gth at nameuse{\gth at sn @#1@\the\gth at tempcnta
+ @\the\gth at tempcntb}}%
+ \advance\gth at tempcntb\@ne}\\
+ \advance\gth at tempcnta\@ne}%
+ \egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Executing the Gotoh Algorithm}\label{sect:algorithm}
+%
+% \begin{macro}{\Gotoh}
+% This is the user interface to execute the Gotoh algorithm. If the boolean
+% switch |\if at gth@uppercase| is true, the arguments are processed by
+% |\uppercase| preamble before passing them to |\gth at gotoh| macro.
+% \begin{macrocode}
+\newcommand{\Gotoh}[2]{%
+ \if at gth@uppercase
+ \uppercase{\gth at gotoh{#1}{#2}}%
+ \else
+ \gth at gotoh{#1}{#2}%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\gth at gotoh}
+% This macro actually executes the Gotoh algorithm.~\cite{gotoh1982} The input
+% of the algorithm is two biological sequences
+% \[
+% A \defeq a_1a_2a_3\dots a_m,\eqsep B \defeq b_1b_2b_3\dots b_n
+% \]
+% where $a_i$ and $b_j$ are chosen from a finite alphabet, e.g.~$\{\mathrm{A},
+% \mathrm{T}, \mathrm{G}, \mathrm{C}\}$. The command takes these sequences as
+% its arguments, and calculate following recurrence formula\footnote{This
+% calculation is done in $O(mn)$ time.} to get optimal score of the algorithm:
+% \begin{equation}
+% M_{i+1, j+1}
+% = \max\left\{M_{ij}, {I_x}_{ij}, {I_y}_{ij}\right\} + c_{a_ib_j}
+% \label{eq:m}
+% \end{equation}
+% where
+% \begin{align}
+% {I_x}_{i+1, j} &= \max\left\{ M_{ij}-d, {I_x}_{ij}-e, {I_y}_{ij}-d \right\},
+% \label{eq:ix} \\
+% {I_y}_{i, j+1} &= \max\left\{ M_{ij}-d, {I_y}_{ij}-e \right\},
+% \label{eq:iy}
+% \end{align}
+% and $c_{a_ib_j}$ is a score for a pair $(a_i, b_j)$, namely
+% \[
+% c_{a_ib_j} = \left\{
+% \begin{array}{rll}
+% 1 & \text{if\enspace} a_i = b_j & \text{(match)} \\
+% -1 & \text{otherwise} & \text{(mismatch)}. \\
+% \end{array}
+% \right.
+% \]
+%
+% \begin{macrocode}
+\def\gth at gotoh#1#2{%
+% \end{macrocode}
+%
+% \subsubsection{Preparation}
+%
+% First, the `serial number' is incremented. The whole other part of this macro
+% contained in a group because a number of temporary macros are defined during
+% processing.
+% \begin{macrocode}
+ \gth at increment\gth at sn
+ \bgroup
+% \end{macrocode}
+%
+% \subsubsection{Getting sequences}
+%
+% \begin{macro}{\gth at m}
+% \begin{macro}{\gth at n}
+% Here each calacters $a_i, b_j$ in the input sequences are stored in
+% |\gth at seqa@|$a_i$ and |\gth at seqa@|$b_j$, and the lengthes of the sequences
+% $m, n$ are stored in |\gth at m| and |\gth at n| respectively.
+% \begin{macrocode}
+ \gth at tempcnta\z@
+ \@tfor\gth at member:=#1\do{%
+ \gth at name@edef{seqa@\the\gth at tempcnta}{\gth at member}%
+ \advance\gth at tempcnta\@ne}%
+ \advance\gth at tempcnta\@ne
+ \edef\gth at m{\the\gth at tempcnta}%
+ \gth at tempcntb\z@
+ \@tfor\gth at member:=#2\do{%
+ \gth at name@edef{seqb@\the\gth at tempcntb}{\gth at member}%
+ \advance\gth at tempcntb\@ne}%
+ \advance\gth at tempcntb\@ne
+ \edef\gth at n{\the\gth at tempcntb}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{Initialization}
+%
+% We have to be careful with initialization because many implementations of the
+% Gotoh algorithm have problems here.~\cite{flouri2015} Specifically, the
+% package initialzes the matrxes with following equations:
+% \begin{align*}
+% M_{i0} &= -\infty, M_{0j} = -\infty, M_{00} = 0, \\
+% {I_x}_{i0} &= -g(i), {I_x}_{0j} = -\infty, \\
+% {I_y}_{i0} &= -\infty, {I_y}_{0j} = -g(j).
+% \end{align*}
+% Note that function $g(l)$ is a gap penalty (shown in equation~(\ref{eq:gap}))
+% and can be calculated with the macro |\gth at gap@penalty|.
+%
+% \begin{macrocode}
+ \gth at tempcnta\z@
+ \@whilenum\gth at tempcnta<\gth at m\do{%
+ \gth at gap@penalty{\gth at tempcnta}%
+ \gth at name@xdef{\gth at sn @m@\the\gth at tempcnta @0}{\gth at min}%
+ \gth at name@xdef{\gth at sn @ix@\the\gth at tempcnta @0}{\the\gth at calc}%
+ \gth at name@xdef{\gth at sn @iy@\the\gth at tempcnta @0}{\gth at min}%
+ \advance\gth at tempcnta\@ne}%
+ \gth at tempcntb\z@
+ \@whilenum\gth at tempcntb<\gth at n\do{%
+ \gth at gap@penalty{\gth at tempcntb}%
+ \gth at name@xdef{\gth at sn @m at 0@\the\gth at tempcntb}{\gth at min}%
+ \gth at name@xdef{\gth at sn @ix at 0@\the\gth at tempcntb}{\gth at min}%
+ \gth at name@xdef{\gth at sn @iy at 0@\the\gth at tempcntb}{\the\gth at calc}%
+ \advance\gth at tempcntb\@ne}%
+ \gth at name@xdef{\gth at sn @m at 0@0}{\number\z@}%
+% \end{macrocode}
+%
+% \subsubsection{Memoization}
+%
+% If the switch |\if at gth@memoization| is true, memoization functions (See
+% section~\ref{sect:memofunc}) are called recursively.
+% \begin{macrocode}
+ \if at gth@memoization
+ \gth at decrement\gth at m \gth at decrement\gth at n
+ \gth at memo@ix{\gth at m}{\gth at n}%
+ \gth at memo@iy{\gth at m}{\gth at n}%
+ \gth at memo@m{\gth at m}{\gth at n}%
+ \gth at increment\gth at m \gth at increment\gth at n
+% \end{macrocode}
+%
+% \subsubsection{Dynamic Programming}
+%
+% To fill matrxes $M$, $I_x$ and $I_y$ the package use the recurrence formula
+%
+% \begin{macrocode}
+ \else
+ \gth at tempcnta\@ne
+ \@whilenum\gth at tempcnta<\gth at m\do{%
+ \gth at tempcntb\@ne
+ \@whilenum\gth at tempcntb<\gth at n\do{%
+% \end{macrocode}
+% First, $I_x$ is calculated with equation (\ref{eq:ix}).
+% \begin{macrocode}
+ \advance\gth at tempcnta\m at ne
+ \gth at max{%
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb},%
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}}%
+ \gth at tempcntc\gth at calc
+ \gth at tempcntd
+ \gth at nameuse{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}%
+ \advance\gth at tempcntc-\gth at d\advance\gth at tempcntd-\gth at e
+ \advance\gth at tempcnta\@ne
+ \gth at max{\gth at tempcntc,\gth at tempcntd}%
+ \gth at name@xdef{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+% \end{macrocode}
+% Secondly, $I_y$ is calculated with equation (\ref{eq:iy}).
+% \begin{macrocode}
+ \advance\gth at tempcntb\m at ne
+ \gth at tempcntc
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}%
+ \gth at tempcntd
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}%
+ \advance\gth at tempcntc-\gth at d\advance\gth at tempcntd-\gth at e
+ \advance\gth at tempcntb\@ne
+ \gth at max{\gth at tempcntc,\gth at tempcntd}%
+ \gth at name@xdef{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+% \end{macrocode}
+% Finally, $M$ is calculated with equation (\ref{eq:m}) and a loop is completed.
+% \begin{macrocode}
+ \advance\gth at tempcnta\m at ne\advance\gth at tempcntb\m at ne
+ \gth at max{%
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb},%
+ \gth at nameuse{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb},%
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}}%
+ \edef\gth at tmpa{\gth at nameuse{seqa@\the\gth at tempcnta}}%
+ \edef\gth at tmpb{\gth at nameuse{seqb@\the\gth at tempcntb}}%
+ \advance\gth at tempcnta\@ne\advance\gth at tempcntb\@ne
+ \ifx\gth at tmpa\gth at tmpb
+ \advance\gth at calc\gth at match
+ \else
+ \advance\gth at calc\gth at mismatch
+ \fi
+ \gth at name@xdef{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \advance\gth at tempcntb\@ne}%
+ \advance\gth at tempcnta\@ne}%
+ \fi
+% \end{macrocode}
+%
+% \subsubsection{Printing Matrixes}
+%
+% This is piece of code for debugging the package (so usually commented out).
+%
+% \begin{macrocode}
+ %\gth at print@matrix{m}%
+ %\gth at print@matrix{ix}%
+ %\gth at print@matrix{iy}%
+% \end{macrocode}
+%
+% \subsubsection{Returning the Optimal Score}
+%
+% The calculated optimal score of the alignment stored here to the control
+% sequences which stored in |\gth at score|.
+% \begin{macrocode}
+ \bgroup
+ \gth at decrement\gth at m \gth at decrement\gth at n
+ \expandafter\xdef\gth at score{%
+ \gth at nameuse{\gth at sn @m@\gth at m @\gth at n}}%
+ \egroup
+% \end{macrocode}
+%
+% \subsubsection{Trace Back}
+%
+% \begin{macrocode}
+ \let\gth at rseq@x\@empty\let\gth at rseq@y\@empty\let\gth at mode@seq\@empty
+ \@gth at remain@true\@gth at gapx@false\@gth at gapy@false
+ \@whilesw\if at gth@remain@\fi{%
+ \ifnum\gth at m=\z@
+ \gth at decrement\gth at n
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqb@\gth at n}\relax\else
+ \edef\gth at rseq@x{\gth at gap@char\gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at nameuse{seqb@\gth at n}%
+ \gth at rseq@y}%
+ \fi
+ \else\ifnum\gth at n=\z@
+ \gth at decrement\gth at m
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqa@\gth at m}\relax\else
+ \edef\gth at rseq@x{\gth at nameuse{seqa@\gth at m}%
+ \gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at gap@char\gth at rseq@y}%
+ \fi
+ \else
+ \if at gth@gapx@
+ % mode: gap x
+ \gth at decrement\gth at m
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqa@\gth at m}\relax\else
+ \edef\gth at rseq@x{\gth at nameuse{seqa@\gth at m}%
+ \gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at gap@char\gth at rseq@y}%
+ \fi
+ \gth at tempcnta\gth at nameuse{\gth at sn @m@\gth at m @\gth at n}%
+ \gth at tempcntb\gth at nameuse{\gth at sn @ix@\gth at m @\gth at n}%
+ \gth at tempcntc\gth at nameuse{\gth at sn @iy@\gth at m @\gth at n}%
+ \advance\gth at tempcnta-\gth at d
+ \advance\gth at tempcntb-\gth at e
+ \advance\gth at tempcntc-\gth at d
+ \ifnum\gth at tempcnta>\gth at tempcntb
+ \@gth at gapx@false
+ \else\ifnum\gth at tempcntb<\gth at tempcntc
+ \@gth at gapx@false\@gth at gapy@true
+ \fi\fi
+ \else\if at gth@gapy@
+ % mode: gap y
+ \gth at decrement\gth at n
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqb@\gth at n}\relax\else
+ \edef\gth at rseq@x{\gth at gap@char\gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at nameuse{seqb@\gth at n}%
+ \gth at rseq@y}%
+ \fi
+ \gth at tempcnta\gth at nameuse{\gth at sn @m@\gth at m @\gth at n}%
+ \gth at tempcntb\gth at nameuse{\gth at sn @iy@\gth at m @\gth at n}%
+ \advance\gth at tempcnta-\gth at d\advance\gth at tempcntb-\gth at e
+ \ifnum\gth at tempcnta>\gth at tempcntb
+ \@gth at gapy@false
+ \fi
+ \else
+ % mode: default
+ \gth at decrement\gth at m
+ \gth at decrement\gth at n
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqa@\gth at m}\relax\else
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqb@\gth at n}\relax\else
+ \edef\gth at rseq@x{\gth at nameuse{seqa@\gth at m}%
+ \gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at nameuse{seqb@\gth at n}%
+ \gth at rseq@y}%
+ \fi
+ \fi
+ \gth at tempcnta\gth at nameuse{\gth at sn @m@\gth at m @\gth at n}%
+ \gth at tempcntb\gth at nameuse{\gth at sn @ix@\gth at m @\gth at n}%
+ \gth at tempcntc\gth at nameuse{\gth at sn @iy@\gth at m @\gth at n}%
+ \@gth at gap@false
+ \ifnum\gth at tempcnta<\gth at tempcntb\@gth at gap@true\fi
+ \ifnum\gth at tempcnta<\gth at tempcntc\@gth at gap@true\fi
+ \if at gth@gap@
+ \ifnum\gth at tempcntb>\gth at tempcntc
+ \@gth at gapx@true
+ \else
+ \@gth at gapy@true
+ \fi
+ \fi
+ \fi\fi
+ \fi\fi
+ \ifnum\gth at m<\@ne\ifnum\gth at n<\@ne
+ \@gth at remain@false
+ \fi\fi}%
+% \end{macrocode}
+%
+% \subsubsection{Returning Results}
+%
+% Finally, the results of alignments which stored in |\gth at resq@x| and
+% |\gth at resq@y| are copied globally to the control sequences which stored in
+% |\gth at resulta| and |\gth at resultb|.
+% \begin{macrocode}
+ \expandafter\gth at glet\gth at resulta\gth at rseq@x
+ \expandafter\gth at glet\gth at resultb\gth at rseq@y
+ \egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Memoization Functions}\label{sect:memofunc}
+%
+% \begin{macro}{\gth at memo@ix}
+% \begin{macro}{\gth at memo@iy}
+% \begin{macro}{\gth at memo@m}
+% These are memoization functions for calculating $I_x, I_y, M$ respectively.
+% \begin{macrocode}
+\def\gth at memo@ix#1#2{%
+ \bgroup
+ \gth at tempcnta#1\gth at tempcntb#2\relax
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}\relax
+ \advance\gth at tempcnta\m at ne
+ \gth at memo@ix{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@ix at return{\gth at ix@return}%
+ \gth at memo@iy{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@iy at return{\gth at iy@return}%
+ \gth at memo@m{\gth at tempcnta}{\gth at tempcntb}%
+ \advance\gth at tempcnta\@ne
+ \gth at advance{\gth at m@return}{-\gth at d}%
+ \gth at advance{\gth at tmp@ix at return}{-\gth at e}%
+ \gth at advance{\gth at tmp@iy at return}{-\gth at d}%
+ \gth at max{\gth at m@return,\gth at tmp@ix at return,\gth at tmp@iy at return}%
+ \gth at name@xdef{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \xdef\gth at ix@return{\the\gth at calc}
+ \else
+ \xdef\gth at ix@return{%
+ \gth at nameuse{\gth at sn @ix@\the\gth at tempcnta @\the\gth at tempcntb}}
+ \fi
+ \egroup}
+\def\gth at memo@iy#1#2{%
+ \bgroup
+ \gth at tempcnta#1\gth at tempcntb#2\relax
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}\relax
+ \advance\gth at tempcntb\m at ne
+ \gth at memo@iy{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@iy at return{\gth at iy@return}%
+ \gth at memo@m{\gth at tempcnta}{\gth at tempcntb}%
+ \advance\gth at tempcntb\@ne
+ \gth at advance{\gth at m@return}{-\gth at d}%
+ \gth at advance{\gth at tmp@iy at return}{-\gth at e}%
+ \gth at max{\gth at m@return,\gth at tmp@iy at return}%
+ \gth at name@xdef{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \xdef\gth at iy@return{\the\gth at calc}%
+ \else
+ \xdef\gth at iy@return{%
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta @\the\gth at tempcntb}}
+ \fi
+ \egroup}
+\def\gth at memo@m#1#2{%
+ \bgroup
+ \gth at tempcnta#1\gth at tempcntb#2\relax
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}\relax
+ \advance\gth at tempcnta\m at ne\advance\gth at tempcntb\m at ne
+ \gth at memo@ix{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@ix at return{\gth at ix@return}%
+ \gth at memo@iy{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@iy at return{\gth at iy@return}%
+ \gth at memo@m{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmpa{\gth at nameuse{seqa@\the\gth at tempcnta}}%
+ \edef\gth at tmpb{\gth at nameuse{seqb@\the\gth at tempcntb}}%
+ \advance\gth at tempcnta\@ne\advance\gth at tempcntb\@ne
+ \gth at max{\gth at m@return,\gth at tmp@ix at return,\gth at tmp@iy at return}%
+ \ifx\gth at tmpa\gth at tmpb
+ \advance\gth at calc\gth at match
+ \else
+ \advance\gth at calc\gth at mismatch
+ \fi
+ \gth at name@xdef{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \xdef\gth at m@return{\the\gth at calc}%
+ \else
+ \xdef\gth at m@return{%
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta @\the\gth at tempcntb}}%
+ \fi
+ \egroup}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Configuration Command}
+%
+% \begin{macro}{\GotohConfig}
+% This is just a wrap command of |\setkeys|.
+% \begin{macrocode}
+\newcommand{\GotohConfig}[1]{\setkeys[gth]{config}{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{thebibliography}{9}
+% \bibitem{flouri2015}
+% Flouri, Tom\'a\v s \textit{et al}., ``Are all global alignment
+% algorithms and implementations correct?''. \textit{bioRxiv}, 031500, 2015.
+% \bibitem{gotoh1982}
+% Gotoh, Osamu, ``An improved algorithm for matching biological sequences''.
+% \textit{Journal of Molecular Biology} \textbf{162}(3), 705-708, 1982.
+% \end{thebibliography}
+%
+% \Finale
+%
+\endinput
+% EOF
Property changes on: trunk/Master/texmf-dist/source/latex/gotoh/gotoh.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/latex/gotoh/gotoh.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/gotoh/gotoh.ins (rev 0)
+++ trunk/Master/texmf-dist/source/latex/gotoh/gotoh.ins 2017-05-05 22:47:42 UTC (rev 44211)
@@ -0,0 +1,26 @@
+%%
+%% This is file `gotoh.ins'.
+%%
+%% Copyright (c) 2017 Takuto ASAKURA (wtsnjp)
+%% GitHub: https://github.com/wtsnjp
+%% Twitter: @wtsnjp
+%%
+%% This package is distributed under the MIT License.
+%%
+
+\input docstrip
+
+\preamble
+
+Copyright (c) 2017 Takuto ASAKURA (wtsnjp)
+ GitHub: https://github.com/wtsnjp
+ Twitter: @wtsnjp
+
+This package is distributed under the MIT License.
+
+\endpreamble
+
+\generate{\file{gotoh.sty}{\from{gotoh.dtx}{package}}}
+\endbatchfile
+
+%% EOF
Added: trunk/Master/texmf-dist/tex/latex/gotoh/gotoh.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/gotoh/gotoh.sty (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/gotoh/gotoh.sty 2017-05-05 22:47:42 UTC (rev 44211)
@@ -0,0 +1,367 @@
+%%
+%% This is file `gotoh.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% gotoh.dtx (with options: `package')
+%%
+%% Copyright (c) 2017 Takuto ASAKURA (wtsnjp)
+%% GitHub: https://github.com/wtsnjp
+%% Twitter: @wtsnjp
+%%
+%% This package is distributed under the MIT License.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{gotoh}[2017/05/05 v1.0 Sequence alignment algorithm]
+\RequirePackage{xkeyval}
+\def\gth at pkgname{gotoh}
+\def\gth at warn{\PackageWarningNoLine\gth at pkgname}
+\def\gth at error{\PackageError\gth at pkgname}
+\newif\if at gth@first@
+\newif\if at gth@remain@
+\newif\if at gth@gap@
+\newif\if at gth@gapx@
+\newif\if at gth@gapy@
+\newcount\gth at tempcnta
+\newcount\gth at tempcntb
+\newcount\gth at tempcntc
+\newcount\gth at tempcntd
+\newcount\gth at calc
+\edef\gth at sn{\number\z@}
+\mathchardef\gth at M="7FFF
+\edef\gth at min{-\number\gth at M}
+\newdimen\gth at tempdima
+\define at cmdkeys[gth]{config}[gth@]{match, mismatch, d, e}
+\setkeys[gth]{config}{match=1, mismatch=-1, d=7, e=1}
+\define at key[gth]{config}{score}{\def\gth at score{#1}}
+\define at key[gth]{config}{result A}{\def\gth at resulta{#1}}
+\define at key[gth]{config}{result B}{\def\gth at resultb{#1}}
+\setkeys[gth]{config}{
+ score=\GotohScore, result A=\GotohResultA, result B=\GotohResultB}
+\define at boolkeys[gth]{config}[@gth@]{memoization, uppercase}[true]
+\define at key[gth]{config}{gap char}{\def\gth at gap@char{#1}}
+\setkeys[gth]{config}{memoization=false, uppercase=false, gap char={.}}
+\def\gth at nameuse#1{\csname gth@#1\endcsname}
+\def\gth at name@edef#1{\expandafter\edef\csname gth@#1\endcsname}
+\def\gth at name@xdef#1{\expandafter\xdef\csname gth@#1\endcsname}
+\def\gth at glet{\global\let}
+\def\gth at advance#1#2{%
+ \gth at calc#1\advance\gth at calc#2\edef#1{\the\gth at calc}}
+\def\gth at increment#1{\gth at advance#1\@ne}
+\def\gth at decrement#1{\gth at advance#1\m at ne}
+\def\gth at max#1{%
+ \@gth at first@true
+ \@for\gth at member:=#1\do{%
+ \if at gth@first@
+ \gth at calc\gth at member
+ \@gth at first@false
+ \else
+ \ifnum\gth at member>\gth at calc
+ \gth at calc\gth at member
+ \fi
+ \fi}}
+\def\gth at gap@penalty#1{%
+ \gth at calc#1\relax
+ \advance\gth at calc\m at ne
+ \multiply\gth at calc-\gth at e
+ \advance\gth at calc-\gth at d}
+\def\gth at tab#1{%
+ \bgroup
+ \sbox\z@ 0%
+ \expandafter\gth at tempdima\ht\z@
+ \multiply\gth at tempdima 8%
+ \mbox{\hbox to\gth at tempdima{\hss #1}}%
+ \egroup}
+\def\gth at print@matrix#1{%
+ \bgroup\texttt
+ #1:\\
+ \gth at tempcnta\z@
+ \@whilenum\gth at tempcnta<\gth at m\do{%
+ \gth at tempcntb\z@
+ \@whilenum\gth at tempcntb<\gth at n\do{%
+ \gth at tab{%
+ \gth at nameuse{\gth at sn @#1@\the\gth at tempcnta
+ @\the\gth at tempcntb}}%
+ \advance\gth at tempcntb\@ne}\\
+ \advance\gth at tempcnta\@ne}%
+ \egroup}
+\newcommand{\Gotoh}[2]{%
+ \if at gth@uppercase
+ \uppercase{\gth at gotoh{#1}{#2}}%
+ \else
+ \gth at gotoh{#1}{#2}%
+ \fi}
+\def\gth at gotoh#1#2{%
+ \gth at increment\gth at sn
+ \bgroup
+ \gth at tempcnta\z@
+ \@tfor\gth at member:=#1\do{%
+ \gth at name@edef{seqa@\the\gth at tempcnta}{\gth at member}%
+ \advance\gth at tempcnta\@ne}%
+ \advance\gth at tempcnta\@ne
+ \edef\gth at m{\the\gth at tempcnta}%
+ \gth at tempcntb\z@
+ \@tfor\gth at member:=#2\do{%
+ \gth at name@edef{seqb@\the\gth at tempcntb}{\gth at member}%
+ \advance\gth at tempcntb\@ne}%
+ \advance\gth at tempcntb\@ne
+ \edef\gth at n{\the\gth at tempcntb}%
+ \gth at tempcnta\z@
+ \@whilenum\gth at tempcnta<\gth at m\do{%
+ \gth at gap@penalty{\gth at tempcnta}%
+ \gth at name@xdef{\gth at sn @m@\the\gth at tempcnta @0}{\gth at min}%
+ \gth at name@xdef{\gth at sn @ix@\the\gth at tempcnta @0}{\the\gth at calc}%
+ \gth at name@xdef{\gth at sn @iy@\the\gth at tempcnta @0}{\gth at min}%
+ \advance\gth at tempcnta\@ne}%
+ \gth at tempcntb\z@
+ \@whilenum\gth at tempcntb<\gth at n\do{%
+ \gth at gap@penalty{\gth at tempcntb}%
+ \gth at name@xdef{\gth at sn @m at 0@\the\gth at tempcntb}{\gth at min}%
+ \gth at name@xdef{\gth at sn @ix at 0@\the\gth at tempcntb}{\gth at min}%
+ \gth at name@xdef{\gth at sn @iy at 0@\the\gth at tempcntb}{\the\gth at calc}%
+ \advance\gth at tempcntb\@ne}%
+ \gth at name@xdef{\gth at sn @m at 0@0}{\number\z@}%
+ \if at gth@memoization
+ \gth at decrement\gth at m \gth at decrement\gth at n
+ \gth at memo@ix{\gth at m}{\gth at n}%
+ \gth at memo@iy{\gth at m}{\gth at n}%
+ \gth at memo@m{\gth at m}{\gth at n}%
+ \gth at increment\gth at m \gth at increment\gth at n
+ \else
+ \gth at tempcnta\@ne
+ \@whilenum\gth at tempcnta<\gth at m\do{%
+ \gth at tempcntb\@ne
+ \@whilenum\gth at tempcntb<\gth at n\do{%
+ \advance\gth at tempcnta\m at ne
+ \gth at max{%
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb},%
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}}%
+ \gth at tempcntc\gth at calc
+ \gth at tempcntd
+ \gth at nameuse{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}%
+ \advance\gth at tempcntc-\gth at d\advance\gth at tempcntd-\gth at e
+ \advance\gth at tempcnta\@ne
+ \gth at max{\gth at tempcntc,\gth at tempcntd}%
+ \gth at name@xdef{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \advance\gth at tempcntb\m at ne
+ \gth at tempcntc
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}%
+ \gth at tempcntd
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}%
+ \advance\gth at tempcntc-\gth at d\advance\gth at tempcntd-\gth at e
+ \advance\gth at tempcntb\@ne
+ \gth at max{\gth at tempcntc,\gth at tempcntd}%
+ \gth at name@xdef{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \advance\gth at tempcnta\m at ne\advance\gth at tempcntb\m at ne
+ \gth at max{%
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb},%
+ \gth at nameuse{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb},%
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}}%
+ \edef\gth at tmpa{\gth at nameuse{seqa@\the\gth at tempcnta}}%
+ \edef\gth at tmpb{\gth at nameuse{seqb@\the\gth at tempcntb}}%
+ \advance\gth at tempcnta\@ne\advance\gth at tempcntb\@ne
+ \ifx\gth at tmpa\gth at tmpb
+ \advance\gth at calc\gth at match
+ \else
+ \advance\gth at calc\gth at mismatch
+ \fi
+ \gth at name@xdef{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \advance\gth at tempcntb\@ne}%
+ \advance\gth at tempcnta\@ne}%
+ \fi
+ %\gth at print@matrix{m}%
+ %\gth at print@matrix{ix}%
+ %\gth at print@matrix{iy}%
+ \bgroup
+ \gth at decrement\gth at m \gth at decrement\gth at n
+ \expandafter\xdef\gth at score{%
+ \gth at nameuse{\gth at sn @m@\gth at m @\gth at n}}%
+ \egroup
+ \let\gth at rseq@x\@empty\let\gth at rseq@y\@empty\let\gth at mode@seq\@empty
+ \@gth at remain@true\@gth at gapx@false\@gth at gapy@false
+ \@whilesw\if at gth@remain@\fi{%
+ \ifnum\gth at m=\z@
+ \gth at decrement\gth at n
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqb@\gth at n}\relax\else
+ \edef\gth at rseq@x{\gth at gap@char\gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at nameuse{seqb@\gth at n}%
+ \gth at rseq@y}%
+ \fi
+ \else\ifnum\gth at n=\z@
+ \gth at decrement\gth at m
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqa@\gth at m}\relax\else
+ \edef\gth at rseq@x{\gth at nameuse{seqa@\gth at m}%
+ \gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at gap@char\gth at rseq@y}%
+ \fi
+ \else
+ \if at gth@gapx@
+ % mode: gap x
+ \gth at decrement\gth at m
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqa@\gth at m}\relax\else
+ \edef\gth at rseq@x{\gth at nameuse{seqa@\gth at m}%
+ \gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at gap@char\gth at rseq@y}%
+ \fi
+ \gth at tempcnta\gth at nameuse{\gth at sn @m@\gth at m @\gth at n}%
+ \gth at tempcntb\gth at nameuse{\gth at sn @ix@\gth at m @\gth at n}%
+ \gth at tempcntc\gth at nameuse{\gth at sn @iy@\gth at m @\gth at n}%
+ \advance\gth at tempcnta-\gth at d
+ \advance\gth at tempcntb-\gth at e
+ \advance\gth at tempcntc-\gth at d
+ \ifnum\gth at tempcnta>\gth at tempcntb
+ \@gth at gapx@false
+ \else\ifnum\gth at tempcntb<\gth at tempcntc
+ \@gth at gapx@false\@gth at gapy@true
+ \fi\fi
+ \else\if at gth@gapy@
+ % mode: gap y
+ \gth at decrement\gth at n
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqb@\gth at n}\relax\else
+ \edef\gth at rseq@x{\gth at gap@char\gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at nameuse{seqb@\gth at n}%
+ \gth at rseq@y}%
+ \fi
+ \gth at tempcnta\gth at nameuse{\gth at sn @m@\gth at m @\gth at n}%
+ \gth at tempcntb\gth at nameuse{\gth at sn @iy@\gth at m @\gth at n}%
+ \advance\gth at tempcnta-\gth at d\advance\gth at tempcntb-\gth at e
+ \ifnum\gth at tempcnta>\gth at tempcntb
+ \@gth at gapy@false
+ \fi
+ \else
+ % mode: default
+ \gth at decrement\gth at m
+ \gth at decrement\gth at n
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqa@\gth at m}\relax\else
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{seqb@\gth at n}\relax\else
+ \edef\gth at rseq@x{\gth at nameuse{seqa@\gth at m}%
+ \gth at rseq@x}%
+ \edef\gth at rseq@y{\gth at nameuse{seqb@\gth at n}%
+ \gth at rseq@y}%
+ \fi
+ \fi
+ \gth at tempcnta\gth at nameuse{\gth at sn @m@\gth at m @\gth at n}%
+ \gth at tempcntb\gth at nameuse{\gth at sn @ix@\gth at m @\gth at n}%
+ \gth at tempcntc\gth at nameuse{\gth at sn @iy@\gth at m @\gth at n}%
+ \@gth at gap@false
+ \ifnum\gth at tempcnta<\gth at tempcntb\@gth at gap@true\fi
+ \ifnum\gth at tempcnta<\gth at tempcntc\@gth at gap@true\fi
+ \if at gth@gap@
+ \ifnum\gth at tempcntb>\gth at tempcntc
+ \@gth at gapx@true
+ \else
+ \@gth at gapy@true
+ \fi
+ \fi
+ \fi\fi
+ \fi\fi
+ \ifnum\gth at m<\@ne\ifnum\gth at n<\@ne
+ \@gth at remain@false
+ \fi\fi}%
+ \expandafter\gth at glet\gth at resulta\gth at rseq@x
+ \expandafter\gth at glet\gth at resultb\gth at rseq@y
+ \egroup}
+\def\gth at memo@ix#1#2{%
+ \bgroup
+ \gth at tempcnta#1\gth at tempcntb#2\relax
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}\relax
+ \advance\gth at tempcnta\m at ne
+ \gth at memo@ix{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@ix at return{\gth at ix@return}%
+ \gth at memo@iy{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@iy at return{\gth at iy@return}%
+ \gth at memo@m{\gth at tempcnta}{\gth at tempcntb}%
+ \advance\gth at tempcnta\@ne
+ \gth at advance{\gth at m@return}{-\gth at d}%
+ \gth at advance{\gth at tmp@ix at return}{-\gth at e}%
+ \gth at advance{\gth at tmp@iy at return}{-\gth at d}%
+ \gth at max{\gth at m@return,\gth at tmp@ix at return,\gth at tmp@iy at return}%
+ \gth at name@xdef{\gth at sn @ix@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \xdef\gth at ix@return{\the\gth at calc}
+ \else
+ \xdef\gth at ix@return{%
+ \gth at nameuse{\gth at sn @ix@\the\gth at tempcnta @\the\gth at tempcntb}}
+ \fi
+ \egroup}
+\def\gth at memo@iy#1#2{%
+ \bgroup
+ \gth at tempcnta#1\gth at tempcntb#2\relax
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}\relax
+ \advance\gth at tempcntb\m at ne
+ \gth at memo@iy{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@iy at return{\gth at iy@return}%
+ \gth at memo@m{\gth at tempcnta}{\gth at tempcntb}%
+ \advance\gth at tempcntb\@ne
+ \gth at advance{\gth at m@return}{-\gth at d}%
+ \gth at advance{\gth at tmp@iy at return}{-\gth at e}%
+ \gth at max{\gth at m@return,\gth at tmp@iy at return}%
+ \gth at name@xdef{\gth at sn @iy@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \xdef\gth at iy@return{\the\gth at calc}%
+ \else
+ \xdef\gth at iy@return{%
+ \gth at nameuse{\gth at sn @iy@\the\gth at tempcnta @\the\gth at tempcntb}}
+ \fi
+ \egroup}
+\def\gth at memo@m#1#2{%
+ \bgroup
+ \gth at tempcnta#1\gth at tempcntb#2\relax
+ \expandafter\expandafter\expandafter
+ \ifx\gth at nameuse{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}\relax
+ \advance\gth at tempcnta\m at ne\advance\gth at tempcntb\m at ne
+ \gth at memo@ix{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@ix at return{\gth at ix@return}%
+ \gth at memo@iy{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmp@iy at return{\gth at iy@return}%
+ \gth at memo@m{\gth at tempcnta}{\gth at tempcntb}%
+ \edef\gth at tmpa{\gth at nameuse{seqa@\the\gth at tempcnta}}%
+ \edef\gth at tmpb{\gth at nameuse{seqb@\the\gth at tempcntb}}%
+ \advance\gth at tempcnta\@ne\advance\gth at tempcntb\@ne
+ \gth at max{\gth at m@return,\gth at tmp@ix at return,\gth at tmp@iy at return}%
+ \ifx\gth at tmpa\gth at tmpb
+ \advance\gth at calc\gth at match
+ \else
+ \advance\gth at calc\gth at mismatch
+ \fi
+ \gth at name@xdef{\gth at sn @m@\the\gth at tempcnta
+ @\the\gth at tempcntb}{%
+ \the\gth at calc}%
+ \xdef\gth at m@return{\the\gth at calc}%
+ \else
+ \xdef\gth at m@return{%
+ \gth at nameuse{\gth at sn @m@\the\gth at tempcnta @\the\gth at tempcntb}}%
+ \fi
+ \egroup}
+\newcommand{\GotohConfig}[1]{\setkeys[gth]{config}{#1}}
+\endinput
+%%
+%% End of file `gotoh.sty'.
Property changes on: trunk/Master/texmf-dist/tex/latex/gotoh/gotoh.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check 2017-05-05 22:46:35 UTC (rev 44210)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check 2017-05-05 22:47:42 UTC (rev 44211)
@@ -299,7 +299,7 @@
glossaries-serbian glossaries-spanish
gmdoc gmdoc-enhance
gmiflink gmp gmutils gmverb gmverse gnuplottex
- go gobble gofonts gost gothic
+ go gobble gofonts gost gothic gotoh
gradientframe gradstudentresume grafcet grant graphbox graphics
graphics-cfg graphics-def graphics-pln
graphicx-psmin graphicxbox graphviz grayhints greek-fontenc greek-inputenc
Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc 2017-05-05 22:46:35 UTC (rev 44210)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc 2017-05-05 22:47:42 UTC (rev 44211)
@@ -72,6 +72,7 @@
depend gastex
depend gene-logic
depend ghsystem
+depend gotoh
depend grundgesetze
depend gu
depend hep
Added: trunk/Master/tlpkg/tlpsrc/gotoh.tlpsrc
===================================================================
More information about the tex-live-commits
mailing list