Skip to content
Commits on Source (5)
......@@ -58,3 +58,4 @@ src/external/hmmer-2.3.2/squid/squid.h
src/external/hmmer-2.3.2/squid/squidconf.h
src/external/hmmer-2.3.2/src/config.h
tags
www/genomethreader.org/htdocs/distributions/gth-*
changes in version 1.7.3 (2020-01-08)
- Include GenomeThreader related code from GenomeTools.
changes in version 1.7.2 (2020-01-06)
- Open-source release, no functionality changes.
changes in version 1.7.1 (2018-09-11)
- gthbssmtrain gives an error if no donor or acceptor sites were found.
......
......@@ -19,6 +19,7 @@ INCLUDEOPT:=-I$(CURDIR)/../genometools/src \
-I$(CURDIR)/../genometools/src/external/zlib-1.2.8 \
-I$(CURDIR)/../genometools/src/external/bzip2-1.0.6 \
-I$(CURDIR)/../genometools/src/external/expat-2.0.1/lib \
-I$(CURDIR)/../genometools/src/external/lua-5.1.5/src \
-I$(CURDIR)/src -I$(CURDIR)/obj \
# these variables are exported by the configuration script
CC:=gcc
......@@ -33,7 +34,7 @@ ifneq ($(fpic),no)
endif
# ...while those starting with GTH_ are for internal purposes only
GTH_CFLAGS:=-g -Wall -Wunused-parameter -pipe $(FPIC) -Wpointer-arith -fno-stack-protector -Wno-error=misleading-indentation
GTH_CFLAGS:=-g -Wall -Wunused-parameter -pipe $(FPIC) -Wpointer-arith -fno-stack-protector -Wno-unknown-pragmas
# mkvtree needs -DWITHLCP
# rnv needs -DUNISTD_H="<unistd.h>" -DEXPAT_H="<expat.h>" -DRNV_VERSION="\"1.7.8\""
EXT_FLAGS:= -DWITHLCP -DUNISTD_H="<unistd.h>" -DEXPAT_H="<expat.h>" \
......@@ -78,6 +79,12 @@ ifeq ($(wrapmemcpy),yes)
GTH_LDFLAGS+=-Wl,--wrap=memcpy
endif
ifneq ($(SYSTEM),Darwin)
ifneq ($(MACHINE),ARMv6_hf)
GTH_CFLAGS+=-Wno-error=misleading-indentation
endif
endif
# system specific stuff (concerning 64bit compilation)
ifeq ($(SYSTEM),Darwin)
ifeq ($(64bit),yes)
......@@ -186,7 +193,7 @@ ifeq ($(wrapmemcpy),yes)
RNVMAIN_OBJ+=../genometools/obj/src/memcpy.o
endif
LIBGENOMETHREADER_DIRS:= src/libgenomethreader
LIBGENOMETHREADER_DIRS:= src/libgenomethreader src/gth
# the GenomeThreader library
LIBGENOMETHREADER_SRC:=$(foreach DIR,$(LIBGENOMETHREADER_DIRS),$(wildcard $(DIR)/*.c))
......@@ -201,8 +208,8 @@ patch ?= patch
all: lib/libgenomethreader.a bin/gth bin/gthconsensus bin/gthbssmfileinfo \
bin/gthbssmbuild bin/gthbssmprint bin/gthbssmrmsd bin/gthbssmtrain \
bin/gthfilestat bin/gthsplit bin/gthunit bin/gthgetseq bin/align_dna \
bin/rnv
bin/gthfilestat bin/gthmkbssmfiles bin/gthsplit bin/gthunit \
bin/gthgetseq bin/align_dna bin/rnv
lib/libgenomethreader.a: obj/gth_config.h $(LIBGENOMETHREADER_OBJ)
@echo "[link $(@F)]"
......@@ -261,6 +268,10 @@ $(eval $(call PROGRAM_template, bin/gthfilestat, obj/src/gthfilestat.o \
lib/libgenomethreader.a \
$(GTHLIBS) ../genometools/lib/libgenometools.a))
$(eval $(call PROGRAM_template, bin/gthmkbssmfiles, obj/src/gthmkbssmfiles.o \
lib/libgenomethreader.a \
$(GTHLIBS) ../genometools/lib/libgenometools.a))
$(eval $(call PROGRAM_template, bin/gthsplit, obj/src/gthsplit.o \
lib/libgenomethreader.a \
$(GTHLIBS) ../genometools/lib/libgenometools.a))
......@@ -508,9 +519,9 @@ obj/train: bin/gthbssmbuild
-gtdonor -agacceptor -gzip
@touch $@
obj/old_train: ../genometools/bin/gt
obj/old_train: bin/gthmkbssmfiles
@echo "[write old BSSMs]"
@../genometools/bin/gt dev gthmkbssmfiles bin/bssm
@bin/gthmkbssmfiles bin/bssm
@touch $@
obj/gthdata:
......
genomethreader (1.7.2+dfsg-1) unstable; urgency=medium
genomethreader (1.7.3+dfsg-1) unstable; urgency=medium
* Initial release (Closes: #)
* Initial release (Closes: #948526)
-- Sascha Steinbiss <satta@debian.org> Mon, 30 Dec 2019 14:49:09 +0100
-- Sascha Steinbiss <satta@debian.org> Thu, 09 Jan 2020 20:51:38 +0100
......@@ -5,9 +5,8 @@ Section: science
Priority: optional
Build-Depends: debhelper (>= 12),
debhelper-compat (= 12),
genometools,
libgenometools0-dev,
libgenometools0-private-dev,
genometools (>= 1.6.1),
libgenometools0-dev (>= 1.6.1),
libvmatch-dev,
zlib1g-dev,
libbz2-dev,
......
......@@ -5,8 +5,62 @@ Files-Excluded: src/external
www
Files: *
Copyright: © 2007-2019 Gordon Gremme <gordon@gremme.org>
2007-2008 Center for Bioinformatics, University of Hamburg
Copyright: © 2003-2019 Gordon Gremme <gordon@gremme.org>
2003-2008 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/bssm_param.c
Copyright: (c) 2003-2013 Gordon Gremme <gordon@gremme.org>
(c) 2003-2005 Michael E Sparks <mespar1@iastate.edu>
(c) 2003-2008 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/bssm_param.h
Copyright: (c) 2003-2010 Gordon Gremme <gordon@gremme.org>
(c) 2003-2005 Michael E Sparks <mespar1@iastate.edu>
(c) 2003-2008 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/bssm_param_hard_coded.h
Copyright: (c) 2003-2007 Gordon Gremme <gordon@gremme.org>
(c) 2003 Michael E Sparks <mespar1@iastate.edu>
(c) 2003-2007 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/bssm_param_rep.h
Copyright: (c) 2003-2010 Gordon Gremme <gordon@gremme.org>
(c) 2003-2005 Michael E Sparks <mespar1@iastate.edu>
(c) 2003-2008 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/editoperation.c
Copyright: (c) 2003-2009 Gordon Gremme <gordon@gremme.org>
(c) 2003 Stefan Kurtz <kurtz@zbh.uni-hamburg.de>
(c) 2003-2008 Center for Bioinformatics, University of Hamburg
License: ISC
File: src/gth/editoperation.h
Copyright: (c) 2003-2009 Gordon Gremme <gordon@gremme.org>
(c) 2003 Stefan Kurtz <kurtz@zbh.uni-hamburg.de>
(c) 2003-2007 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/gt_gthbssmbuild.c src/gth/gt_gthbssmprint.c src/gth/gt_gthmkbssmfiles.c
Copyright: (c) 2004-2009 Gordon Gremme <gordon@gremme.org>
(c) 2004 Michael E Sparks <mespar1@iastate.edu>
(c) 2004-2008 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/gthalignment.c src/gth/gthalignment.h
Copyright: (c) 2003-2009 Gordon Gremme <gordon@gremme.org>
(c) 2000-2004 Stefan Kurtz <kurtz@zbh.uni-hamburg.de>
(c) 2003-2008 Center for Bioinformatics, University of Hamburg
License: ISC
Files: src/gth/gthprobdef.h
Copyright: (c) 2004-2007 Gordon Gremme <gordon@gremme.org>
(c) 2004 Michael E Sparks <mespar1@iastate.edu>
(c) 2004-2007 Center for Bioinformatics, University of Hamburg
License: ISC
License: ISC
......
--- a/Makefile
+++ b/Makefile
@@ -15,10 +15,8 @@
@@ -15,19 +15,17 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
......@@ -8,12 +8,15 @@
- -I$(CURDIR)/../genometools/src/external/zlib-1.2.8 \
- -I$(CURDIR)/../genometools/src/external/bzip2-1.0.6 \
- -I$(CURDIR)/../genometools/src/external/expat-2.0.1/lib \
- -I$(CURDIR)/../genometools/src/external/lua-5.1.5/src \
+INCLUDEOPT:=-I/usr/include/genometools \
+ -I/usr/include/vmatch \
+ -I/usr/include/lua5.1 \
-I$(CURDIR)/src -I$(CURDIR)/obj \
# these variables are exported by the configuration script
CC:=gcc
@@ -26,7 +24,7 @@
-CC:=gcc
+#CC:=gcc
CXX:=g++
EXP_CFLAGS:=$(CFLAGS)
EXP_CXXFLAGS:=$(CXXFLAGS)
EXP_CPPFLAGS:=$(CPPFLAGS)
......@@ -22,7 +25,7 @@
ifneq ($(fpic),no)
FPIC:=-fPIC
@@ -123,11 +121,11 @@
@@ -130,11 +128,11 @@
GTMAIN_DEP:=$(GTMAIN_SRC:%.c=obj/%.d)
VSTREEDIR:=../vstree/src
......@@ -39,17 +42,16 @@
GTH_CPPFLAGS+=-I$(CURDIR)/$(VSTREEDIR)/include \
-I$(CURDIR)/$(VSTREEDIR)/Vmatch \
@@ -201,8 +199,7 @@
@@ -209,7 +207,7 @@
all: lib/libgenomethreader.a bin/gth bin/gthconsensus bin/gthbssmfileinfo \
bin/gthbssmbuild bin/gthbssmprint bin/gthbssmrmsd bin/gthbssmtrain \
- bin/gthfilestat bin/gthsplit bin/gthunit bin/gthgetseq bin/align_dna \
- bin/rnv
+ bin/gthfilestat bin/gthsplit bin/gthunit bin/gthgetseq bin/align_dna
bin/gthfilestat bin/gthmkbssmfiles bin/gthsplit bin/gthunit \
- bin/gthgetseq bin/align_dna bin/rnv
+ bin/gthgetseq bin/align_dna
lib/libgenomethreader.a: obj/gth_config.h $(LIBGENOMETHREADER_OBJ)
@echo "[link $(@F)]"
@@ -224,63 +221,63 @@
@@ -231,67 +229,67 @@
$(1): $(2)
@echo "[link $$(@F)]"
@test -d $$(@D) || mkdir -p $$(@D)
......@@ -62,62 +64,67 @@
$(eval $(call PROGRAM_template, bin/gth, obj/src/gth.o \
lib/libgenomethreader.a \
- $(GTHLIBS) ../genometools/lib/libgenometools.a))
+ $(GTHLIBS) /usr/lib/libgenometools.a))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthconsensus, obj/src/gthconsensus.o \
lib/libgenomethreader.a \
- $(GTHLIBS) ../genometools/lib/libgenometools.a))
+ $(GTHLIBS) /usr/lib/libgenometools.a))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthbssmfileinfo, obj/src/gthbssmfileinfo.o \
lib/libgenomethreader.a \
- ../genometools/lib/libgenometools.a $(GTHLIBS)))
+ /usr/lib/libgenometools.a $(GTHLIBS)))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthbssmbuild, obj/src/gthbssmbuild.o \
lib/libgenomethreader.a \
- ../genometools/lib/libgenometools.a $(GTHLIBS)))
+ /usr/lib/libgenometools.a $(GTHLIBS)))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthbssmprint, obj/src/gthbssmprint.o \
lib/libgenomethreader.a \
- ../genometools/lib/libgenometools.a $(GTHLIBS)))
+ /usr/lib/libgenometools.a $(GTHLIBS)))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthbssmrmsd, obj/src/gthbssmrmsd.o \
lib/libgenomethreader.a \
- ../genometools/lib/libgenometools.a $(GTHLIBS)))
+ /usr/lib/libgenometools.a $(GTHLIBS)))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthbssmtrain, obj/src/gthbssmtrain.o \
lib/libgenomethreader.a \
- ../genometools/lib/libgenometools.a $(GTHLIBS)))
+ /usr/lib/libgenometools.a $(GTHLIBS)))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthfilestat, obj/src/gthfilestat.o \
lib/libgenomethreader.a \
- $(GTHLIBS) ../genometools/lib/libgenometools.a))
+ $(GTHLIBS) /usr/lib/libgenometools.a))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthmkbssmfiles, obj/src/gthmkbssmfiles.o \
lib/libgenomethreader.a \
- $(GTHLIBS) ../genometools/lib/libgenometools.a))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthsplit, obj/src/gthsplit.o \
lib/libgenomethreader.a \
- $(GTHLIBS) ../genometools/lib/libgenometools.a))
+ $(GTHLIBS) /usr/lib/libgenometools.a))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthunit, obj/src/gthunit.o \
lib/libgenomethreader.a \
- $(GTHLIBS) ../genometools/lib/libgenometools.a))
+ $(GTHLIBS) /usr/lib/libgenometools.a))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/gthgetseq, obj/src/gthgetseq.o \
lib/libgenomethreader.a \
- ../genometools/lib/libgenometools.a $(GTHLIBS)))
+ /usr/lib/libgenometools.a $(GTHLIBS)))
+ $(GTHLIBS)))
$(eval $(call PROGRAM_template, bin/align_dna, obj/src/align_dna.o \
lib/libgenomethreader.a \
- ../genometools/lib/libgenometools.a $(GTHLIBS)))
+ /usr/lib/libgenometools.a $(GTHLIBS)))
+ $(GTHLIBS)))
-bin/rnv: $(RNVMAIN_OBJ) lib/librnv.a ../genometools/lib/libexpat.a
- @echo "[link $(@F)]"
......@@ -130,7 +137,7 @@
obj/gth_config.h: VERSION
@echo '[create $@]'
@@ -310,9 +307,9 @@
@@ -321,9 +319,9 @@
$(1): $(2)
@echo "[compile $$(@F)]"
@test -d $$(@D) || mkdir -p $$(@D)
......@@ -142,7 +149,7 @@
$(3) -MM -MP -MT $$@
endef
@@ -321,17 +318,17 @@
@@ -332,17 +330,17 @@
obj/%.o: %.cxx
@echo "[compile $(@F)]"
@test -d $(@D) || mkdir -p $(@D)
......@@ -164,15 +171,3 @@
-MT $@
obj/src/core/versionfunc.o: obj/gth_config.h
@@ -508,9 +505,9 @@
-gtdonor -agacceptor -gzip
@touch $@
-obj/old_train: ../genometools/bin/gt
+obj/old_train:
@echo "[write old BSSMs]"
- @../genometools/bin/gt dev gthmkbssmfiles bin/bssm
+ @gt dev gthmkbssmfiles bin/bssm
@touch $@
obj/gthdata:
......@@ -13,8 +13,7 @@ ISPELLALL=author.ispell\
speciestable.ispell
all: ispellall\
gthmanual.pdf\
gthlicense.pdf
gthmanual.pdf
${GTHMANUALTMP}.tex: gthmanual.tex execcommand.pl
#findemptyoutfiles.sh
......
\documentclass[12pt]{article}
\usepackage{times,url,a4wide,xspace}
\parindent0pt
\parskip5pt
\newcommand{\Software}[0]{\emph{GenomeThreader}\xspace}
\newcommand{\Licensorname}[0]{\emph{Gordon Gremme, Universit\"at Hamburg}\xspace}
\newcommand{\Thepaper}[0]{web-site: \par\url{http://www.genomethreader.org}\xspace}
\newcommand{\Email}[0]{\texttt{\small gordon@gremme.org}\xspace}
\newcommand{\Persontocontact}[0]{Gordon Gremme\xspace}
\newcommand{\Noncommercial}[0]{\\{\normalsize for non-commerical users}}
\newcommand{\Licensor}[0]{\textsc{Licensor}\xspace}
\newcommand{\Licensee}[0]{\textsc{Licensee}\xspace}
\newcommand{\Agreement}[0]{\textsc{Agreement}\xspace}
\newcommand{\Sites}[0]{\textsc{Sites}\xspace}
\newcommand{\Fillline}[0]{\rule{10cm}{1pt}}
\newcommand{\Paragraph}[2]{\item \textbf{#1:} #2}
\title{\Software License Agreement\Noncommercial}
\author{\vspace*{-1cm}}
\date{\vspace*{-1cm}\today}
\begin{document}
\maketitle
This document is the license agreement for the \Software Software Package.
There is no distribution fee for \Software for non commercial research
institutions. Commercial research institutions who want to use \Software
should directly contact \Persontocontact via Email at
\begin{center}
\Email
\end{center}
\Licensorname (\Licensor), as sole holder of all the proprietary rights to
\Software grants to the licensee as defined in paragraph \ref{DefSites}
(\Licensee) a perpetual, non-exclusive, non-assignable, personal
license to use the proprietary \Software software, subject to
the conditions set forth below.
\begin{enumerate}
\Paragraph{Restricted License}{Use of \Software, or any part
thereof, or any software derived in whole or in part therefrom, is
restricted to use by \Licensee only, and is limited to the following
uses unless \Licensor agrees otherwise by prior written agreement.
}
\begin{itemize}
\item
\Licensee is authorized to use \Software on all computers
at the separate geographic locations itemized in paragraph \ref{DefSites} below
(the \Sites) and at no other locations. The \Sites must include all
locations from which remote (telephone or network) access will be
made.
\item
\Licensee may not copy \Software, or any part thereof in
any form, except for backup or archiving purposes, and for the
purpose of distributing it to computers at the given \Sites. \Licensee
agrees not to remove or destroy any proprietary markings or
confidential legends placed upon or contained within \Software
and any related materials.
\item
\Licensee may not sell, rent, sublicense, or otherwise distribute
in any manner whatsoever \Software, or any part thereof, or
any software derived in whole or in part therefrom, without the prior
written approval of \Licensor.
\end{itemize}
\Paragraph{Title}{The \Agreement grants \Licensee no title or right of
ownership in \Software, and no property rights in any
copyrighted materials delivered hereunder.
}
\Paragraph{Non-Disclosure}{\Licensee agrees to receive and keep
\Software in confidence and not to disclose it to any third
party without the express written consent of \Licensor.
}
\Paragraph{Proper Credit and Recognition}{Appropriate credits consist
of including in any documentation and publications about research
using \Software a reference to the following \Thepaper
}
\Paragraph{Disclaimer of Warranty}{\Licensor provides \Software
on an \textbf{as is} basis. \Licensor does not warrant its validity of
performance, efficiency, or suitability, nor does \Licensor warrant
that \Software is free from errors. All warranties,
including without limitation, any warranty or merchantability or
fitness for a particular purpose, are hereby excluded.
}
\Paragraph{Lack of Maintenance Services}{\Licensee understands and
agrees that \Licensor (or any other person or entity with proprietary
rights in the software licensed hereunder) is under no obligation to
provide either maintenance services, update services, notices of
latent defects, or correction of defects for \Software.
\Licensor nevertheless reserves the right to update, modify, or
discontinue this software at any time.
}
\Paragraph{Limitation of Liability, Indemnification}{Even if advised
of the possibility of such damages, under no circumstances shall
\Licensor (or any other person or entity with proprietary rights in
the software licensed hereunder) be liable to \Licensee or any third
party for direct, indirect, or consequential damages of any
character, including, without limitation, loss of profits, loss of
use, loss of good will, or computer failure or malfunction,
regardless of the nature of the claim or action, whether in
negligence or other tort, breach of contract, product liability, or
otherwise. \Licensee agrees to indemnify \Licensor (or any other person
or entity with proprietary rights in the software licensed hereunder)
for any and all liability it may incur to third parties resulting
from \Licensee's use of
\Software.
%\Software, subject to the limits of Florida law.
}
\Paragraph{Applicable Law}{This \Agreement is deemed to be made under,
and shall be governed by the laws of the Federal Republic of Germany.
Both parties consent to jurisdiction in the Federal Republic of Germany.
German law applies to this \Agreement without giving effect to its
conflict of laws (IPR) provisions.
}
\Paragraph{Binding Effect Agreement}{This \Agreement shall be binding
upon and inure to the benefit of the heirs, successors and assigns of
\Licensee, but \Licensee may not assign this \Agreement or any of its
rights or obligations hereunder without the prior written approval of
\Licensor.
}
\Paragraph{Entire Agreement}{This \Agreement represents the complete
and exclusive statement of the agreements between the parties
relating to the licensing of \Software, and supersedes all
prior and simultaneous agreements and representations between them
relating to such licensing. This \Agreement may not be modified except
with the written approval of the \Licensor.
}
\newpage
\Paragraph{Definition of Sites}{
The separate geographical locations
referred to as \Sites are listed below:
\begin{center}
\begin{tabular}{ll}
1.&\Fillline\\[5mm]
2.&\Fillline\\[5mm]
3.&\Fillline
\end{tabular}
\end{center}
}
\label{DefSites}
\Paragraph{Mailing Address}{A signed copy of this license \Agreement
shall be mailed or sent as a FAX by \Licensee to \Licensor at the
following address:
\begin{tabular}{@{}l}
\Persontocontact\\
Zentrum f\"ur Bioinformatik\\
Universit\"at Hamburg\\
Bundesstrasse 43\\
20146 Hamburg\\
Germany\\
FAX: +49 40 42838 7312
\end{tabular}
An Email describing how to download \Software shall be send by \Licensor to
\Licensee to the following Email address:
\begin{center}
\begin{tabular}{lc}
Electronic Mail:&\Fillline\\[5mm]
Name:&\Fillline
\end{tabular}
\end{center}
In previous cases, we had problems with our FAX machine or could not
decipher the E-mail address of the \Licensor.
To verify that we have received the FAX properly, you may want send a
short E-mail to \Email stating that you have send the FAX.
Once we have received the signed agreement we will process it a soon as
possible.
}
\Paragraph{Execution and Delivery}{By its execution and delivery of
this \Agreement, \Licensee covenants and agrees to be bound by the
above stated terms and conditions, and warrants and represents that
the person or persons signing this Licensing \Agreement is authorized
to bind and commit \Licensee to this \Agreement.
}
\end{enumerate}
\begin{center}
\begin{tabular}{lc}
Research Institution:&\Fillline\\[5mm]
Address:&\Fillline\\[5mm]
Signature:&\Fillline\\[5mm]
Name and Title:&\Fillline\\[5mm]
Date:&\Fillline
\end{tabular}
\end{center}
\end{document}
This directory contains the binary distribution of GenomeThreader (gth).
All rights reserved. Do not distribute.
It contains the following directories
......
#include "core/tooldriver.h"
#include "core/tooldriver_api.h"
#include "libgenomethreader/gt_align_dna.h"
#include "libgenomethreader/gthversionfunc.h"
......
#include "gth_config.h"
#include "core/tooldriver.h"
#include "core/tooldriver_api.h"
#include "gth/gt_gth.h"
#include "libgenomethreader/gthpre.h"
#include "libgenomethreader/gthversionfunc.h"
......
/*
Copyright (c) 2004-2009 Gordon Gremme <gordon@gremme.org>
Copyright (c) 2004-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "gth/ags.h"
struct GthAGSObject {
const GthPGL *pgl;
};
GthAGS* gth_ags_new(const GthPGL *pgl)
{
GthAGS *ags;
gt_assert(pgl);
ags = gt_malloc(sizeof *ags);
ags->agso = gt_malloc(sizeof *ags->agso);
ags->agso->pgl = pgl;
ags->gen_id = NULL;
ags->exons = gt_array_new(sizeof (GthExonAGS));
ags->splicesiteprobs = gt_array_new(sizeof (GthSpliceSiteProb));
ags->alignments = gt_array_new(sizeof (GthSA*));
ags->numofstoredsaclusters = 0;
ags->overallscore = GTH_UNDEF_GTHDBL;
return ags;
}
void gth_ags_delete(GthAGS *ags)
{
if (!ags) return;
gt_str_delete(ags->gen_id);
gt_array_delete(ags->exons);
gt_array_delete(ags->splicesiteprobs);
gt_array_delete(ags->alignments);
gt_free(ags->agso);
gt_free(ags);
}
bool gth_ags_is_forward(const GthAGS *ags)
{
gt_assert(ags);
return gth_pgl_is_forward(ags->agso->pgl);
}
GtUword gth_ags_filenum(const GthAGS *ags)
{
gt_assert(ags);
return gth_pgl_filenum(ags->agso->pgl);
}
GtUword gth_ags_total_length(const GthAGS *ags)
{
gt_assert(ags);
return gth_pgl_total_length(ags->agso->pgl);
}
GtUword gth_ags_genomic_offset(const GthAGS *ags)
{
gt_assert(ags);
return gth_pgl_genomic_offset(ags->agso->pgl);
}
GtStr* gth_ags_get_gen_id(const GthAGS *ags)
{
gt_assert(ags && ags->gen_id);
return ags->gen_id;
}
GthExonAGS* gth_ags_get_exon(const GthAGS *ags, GtUword exon)
{
gt_assert(ags && ags->exons);
gt_assert(exon < gt_array_size(ags->exons));
return gt_array_get(ags->exons, exon);
}
GtUword gth_ags_num_of_exons(const GthAGS *ags)
{
gt_assert(ags && ags->exons);
return gt_array_size(ags->exons);
}
GtStrand gth_ags_genomic_strand(const GthAGS *ags)
{
gt_assert(ags);
return gth_ags_is_forward(ags) ? GT_STRAND_FORWARD : GT_STRAND_REVERSE;
}
static GtUword gth_ags_left_intron_border(const GthAGS *ags,
GtUword intron)
{
GthExonAGS *exon;
gt_assert(ags);
exon = gth_ags_get_exon(ags, intron);
return SHOWGENPOSAGS(exon->range.end + 1);
}
static GtUword gth_ags_right_intron_border(const GthAGS *ags,
GtUword intron)
{
GthExonAGS *exon;
gt_assert(ags);
exon = gth_ags_get_exon(ags, intron + 1);
return SHOWGENPOSAGS(exon->range.start - 1);
}
GtRange gth_ags_donor_site_range(const GthAGS *ags, GtUword intron)
{
GtRange range;
gt_assert(ags);
range.start = gth_ags_left_intron_border(ags, intron);
range.end = range.start + 1;
return range;
}
GtRange gth_ags_acceptor_site_range(const GthAGS *ags, GtUword intron)
{
GtRange range;
gt_assert(ags);
range.end = gth_ags_right_intron_border(ags, intron);
range.start = range.end - 1;
return range;
}
double gth_ags_donor_site_prob(const GthAGS *ags, GtUword intron)
{
gt_assert(ags);
return ((GthSpliceSiteProb*) gt_array_get(ags->splicesiteprobs, intron))
->donorsiteprob;
}
double gth_ags_acceptor_site_prob(const GthAGS *ags, GtUword intron)
{
gt_assert(ags);
return ((GthSpliceSiteProb*) gt_array_get(ags->splicesiteprobs, intron))
->acceptorsiteprob;
}
/*
Copyright (c) 2003-2009 Gordon Gremme <gordon@gremme.org>
Copyright (c) 2003-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef AGS_H
#define AGS_H
#include "core/array_api.h"
#include "core/error_api.h"
#include "gth/gthoutput.h"
#include "gth/bssm_param.h"
#include "gth/pgl.h"
#include "gth/sa.h"
#define SHOWGENPOSAGS(P)\
SHOWGENPOS(gth_ags_is_forward(ags), gth_ags_total_length(ags),\
gth_ags_genomic_offset(ags), P)
typedef struct {
GtRange range; /* the borders of the exon in the genomic sequence */
GthDbl score;
} GthExonAGS;
typedef struct {
GthFlt donorsiteprob,
acceptorsiteprob;
} GthSpliceSiteProb;
typedef struct GthAGSObject GthAGSObject;
/* the alternative gene structure (AGS) class */
typedef struct GthAGS {
GtStr *gen_id; /* the id of the genomic sequence this two
values could also be included in the PGL
structure, but including them here is better
for the stand alone version of the assemble
program */
GtArray *exons, /* contains the actual structure of the AGS and
the exonscores */
*splicesiteprobs, /* contains the splice site probabilities */
*alignments; /* pointer to the generating spliced alignments
I.e., the alignments which constitute this
alternative gene structure. */
GtUword numofstoredsaclusters; /* number of stored SA clusters */
/* (needed in assembly phase) */
GthDbl overallscore; /* overall score used for sorting of AGSs */
GthAGSObject *agso;
} GthAGS;
GthAGS* gth_ags_new(const GthPGL*);
void gth_ags_delete(GthAGS*);
bool gth_ags_is_forward(const GthAGS*);
GtUword gth_ags_filenum(const GthAGS*);
GtUword gth_ags_total_length(const GthAGS*);
GtUword gth_ags_genomic_offset(const GthAGS*);
GtStr* gth_ags_get_gen_id(const GthAGS*);
GthExonAGS* gth_ags_get_exon(const GthAGS *ags, GtUword exon);
GtUword gth_ags_num_of_exons(const GthAGS *ags);
GtStrand gth_ags_genomic_strand(const GthAGS*);
GtRange gth_ags_donor_site_range(const GthAGS*, GtUword intron);
GtRange gth_ags_acceptor_site_range(const GthAGS*, GtUword intron);
double gth_ags_donor_site_prob(const GthAGS*, GtUword intron);
double gth_ags_acceptor_site_prob(const GthAGS*, GtUword intron);
#endif
/*
Copyright (c) 2003-2011 Gordon Gremme <gordon@gremme.org>
Copyright (c) 2003-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "gth/ags_build.h"
typedef struct {
GthDbl exonscore; /* the score of this exonnode */
GtUword lengthofscoringexon; /* the length of the exon where the
exonscore came from */
} Exonscoreinfo;
typedef struct {
/* begin of core */
GtRange range; /* the range of the exonnode */
bool leftmergeable, /* true if the left border is mergeable */
rightmergeable; /* true if the right border is mergeable */
Introninfo *successorintron; /* points to the successor intron of this exon,
if defined. points to NULL, otherwise. */
/* end of core */
GtArray *exonscores; /* all exon scores of all exons, where this node
resulted from */
} Exonnode;
#define SAVE_EXONSCORE_ALLOWED_DIFFERENCE 30
typedef enum
{
MERGEABLE_LEFTSIDE_A_BEFORE_B = 0,
MERGEABLE_LEFTSIDE_A_EQUALS_B,
MERGEABLE_LEFTSIDE_A_AFTER_B,
NON_MERGEABLE_LEFTSIDE,
} Leftsidestatus;
typedef enum
{
MERGEABLE_RIGHTSIDE_A_BEFORE_B = 0,
MERGEABLE_RIGHTSIDE_A_EQUALS_B,
MERGEABLE_RIGHTSIDE_A_AFTER_B,
NON_MERGEABLE_RIGHTSIDE,
} Rightsidestatus;
/*
The following function returns the core of an Exonnode.
That is, the node without the pointers to the successors of this node.
The input is the spliced alignment \textit{sa}, and the index <exonindex>
of the exon to be processed.
*/
Exonnode getcoreExonnodefromSA(GthSA *sa, GtUword exonindex)
{
Exonnode node;
Exonscoreinfo scoreinfo;
/* alignment contains at least one exon */
gt_assert(gth_sa_num_of_exons(sa));
/* number of exons minus 1 equals number of introns */
gt_assert(gth_sa_num_of_exons(sa) - 1 ==
gth_sa_num_of_introns(sa));
/* exonindex is valid */
gt_assert(exonindex < gth_sa_num_of_exons(sa));
node.exonscores = gt_array_new(sizeof (Exonscoreinfo));
node.range.start = gth_sa_get_exon(sa, exonindex)->leftgenomicexonborder;
node.range.end = gth_sa_get_exon(sa, exonindex)->rightgenomicexonborder;
if (exonindex == 0) /* this is the first exon */
node.leftmergeable = true;
else
node.leftmergeable = false;
if (exonindex == gth_sa_num_of_exons(sa) - 1) {
/* this is the last exon */
node.rightmergeable = true;
}
else
node.rightmergeable = false;
/* save successor intron */
if (exonindex < gth_sa_num_of_exons(sa) - 1) {
/* exon has successor intron */
node.successorintron = gth_sa_get_intron(sa, exonindex);
}
else {
/* exon has no successor intron */
node.successorintron = NULL;
}
/* save exonscore */
scoreinfo.exonscore = gth_sa_get_exon(sa, exonindex)->exonscore;
scoreinfo.lengthofscoringexon = node.range.end - node.range.start + 1;
gt_array_add(node.exonscores, scoreinfo);
return node;
}
static void freecoreExonnode(Exonnode *node)
{
if (!node) return;
gt_array_delete(node->exonscores);
}
static Leftsidestatus getleftsidestatus(Exonnode *nodeA, Exonnode *nodeB)
{
/* -------...
]-----... */
if (nodeA->range.start < nodeB->range.start && nodeB->leftmergeable)
return MERGEABLE_LEFTSIDE_A_BEFORE_B;
/* -------...
-------... */
if (nodeA->range.start == nodeB->range.start)
return MERGEABLE_LEFTSIDE_A_EQUALS_B;
/* ]-----...
-------... */
if (nodeA->range.start > nodeB->range.start && nodeA->leftmergeable)
return MERGEABLE_LEFTSIDE_A_AFTER_B;
return NON_MERGEABLE_LEFTSIDE;
}
#ifndef NDEBUG
static bool leftsideismergeable(Exonnode *nodeA, Exonnode *nodeB)
{
switch (getleftsidestatus(nodeA, nodeB))
{
case MERGEABLE_LEFTSIDE_A_BEFORE_B:
case MERGEABLE_LEFTSIDE_A_EQUALS_B:
case MERGEABLE_LEFTSIDE_A_AFTER_B:
return true;
case NON_MERGEABLE_LEFTSIDE:
return false;
default:
gt_assert(0);
return false;
}
}
#endif
static Rightsidestatus getrightsidestatus(Exonnode *nodeA, Exonnode *nodeB)
{
/* ...-----[
...------- */
if (nodeA->range.end < nodeB->range.end && nodeA->rightmergeable)
return MERGEABLE_RIGHTSIDE_A_BEFORE_B;
/* ...-------
...------- */
if (nodeA->range.end == nodeB->range.end)
return MERGEABLE_RIGHTSIDE_A_EQUALS_B;
/* ...-------
...-----[ */
if (nodeA->range.end > nodeB->range.end && nodeB->rightmergeable)
return MERGEABLE_RIGHTSIDE_A_AFTER_B;
return NON_MERGEABLE_RIGHTSIDE;
}
#ifndef NDEBUG
static bool rightsideismergeable(Exonnode *nodeA, Exonnode *nodeB)
{
switch (getrightsidestatus(nodeA, nodeB)) {
case MERGEABLE_RIGHTSIDE_A_BEFORE_B:
case MERGEABLE_RIGHTSIDE_A_EQUALS_B:
case MERGEABLE_RIGHTSIDE_A_AFTER_B:
return true;
case NON_MERGEABLE_RIGHTSIDE:
return false;
default:
gt_assert(0);
return false;
}
}
#endif
#ifndef NDEBUG
static bool nodesaremergeable(Exonnode *nodeA, Exonnode *nodeB)
{
if (gt_range_overlap(&nodeA->range, &nodeB->range) &&
leftsideismergeable(nodeA, nodeB) &&
rightsideismergeable(nodeA, nodeB)) {
return true;
}
return false;
}
#endif
static void mergeleftside(Exonnode *nodeA, Exonnode *nodeB)
{
switch (getleftsidestatus(nodeA, nodeB)) {
case MERGEABLE_LEFTSIDE_A_BEFORE_B:
/* -------...
]-----...
nothing to do */
break;
case MERGEABLE_LEFTSIDE_A_EQUALS_B:
/* -------...
-------... */
if (!nodeA->leftmergeable || !nodeB->leftmergeable)
nodeA->leftmergeable = false;
break;
case MERGEABLE_LEFTSIDE_A_AFTER_B:
/* ]-----...
-------... */
nodeA->range.start = nodeB->range.start;
nodeA->leftmergeable = nodeB->leftmergeable;
break;
case NON_MERGEABLE_LEFTSIDE:
default: gt_assert(0);
}
}
static void mergerightside(Exonnode *nodeA, Exonnode *nodeB)
{
switch (getrightsidestatus(nodeA, nodeB)) {
case MERGEABLE_RIGHTSIDE_A_BEFORE_B:
/* ...-----[
...------- */
nodeA->range.end = nodeB->range.end;
nodeA->rightmergeable = nodeB->rightmergeable;
break;
case MERGEABLE_RIGHTSIDE_A_EQUALS_B:
/* ...-------
...------- */
if (!nodeA->rightmergeable || !nodeB->rightmergeable)
nodeA->rightmergeable = false;
break;
case MERGEABLE_RIGHTSIDE_A_AFTER_B:
/* ...-------
...-----[
nothing to do */
break;
case NON_MERGEABLE_RIGHTSIDE:
default: gt_assert(0);
}
}
/*
The following function merges the exon nodes <nodeA> and
<nodeB>. That is, <nodeA> is modified to the merged node and
<nodeB> stays the same.
*/
static void mergenodes(Exonnode *nodeA, Exonnode *nodeB)
{
GtUword i;
gt_assert(nodesaremergeable(nodeA, nodeB));
/* merge nodes */
mergeleftside(nodeA, nodeB);
mergerightside(nodeA, nodeB);
/* merge successor introns */
if (nodeA->successorintron == NULL && nodeB->successorintron != NULL) {
/* save successor intron of node B in node A */
nodeA->successorintron = nodeB->successorintron;
}
/* in the cases that (nodeA==NULL && nodeB==NULL) and that
(nodeA!=NULL && nodeB==NULL) nothing has to be done */
/* merge the exonscores */
for (i = 0; i < gt_array_size(nodeB->exonscores); i++) {
gt_array_add(nodeA->exonscores,
*(Exonscoreinfo*) gt_array_get(nodeB->exonscores, i));
}
}
static GthDbl computeexonscore(Exonnode *node)
{
GtUword i, maxlength = 0;
GthDbl maxscore = DBL_MIN;
Exonscoreinfo *exonscoreinfo;
/* compute maximal length */
for (i = 0; i < gt_array_size(node->exonscores); i++) {
exonscoreinfo = gt_array_get(node->exonscores, i);
if (exonscoreinfo->lengthofscoringexon > maxlength)
maxlength = exonscoreinfo->lengthofscoringexon;
}
/* save exonscore */
for (i = 0; i < gt_array_size(node->exonscores); i++) {
exonscoreinfo = gt_array_get(node->exonscores, i);
if ((exonscoreinfo->lengthofscoringexon
+ SAVE_EXONSCORE_ALLOWED_DIFFERENCE >= maxlength) &&
(exonscoreinfo->exonscore > maxscore)) {
maxscore = exonscoreinfo->exonscore;
}
}
return maxscore;
}
static void addSAtoAGS(GthAGS *ags, GthSACluster *sacluster, GtArray *nodes)
{
GtUword i, currentnode = 0, currentexon = 0,
numofexons = gth_sa_num_of_exons(sacluster->representative);
Exonnode node;
/* genomic strands equal */
gt_assert(gth_ags_is_forward(ags) ==
gth_sa_gen_strand_forward(sacluster->representative));
/* set genomic id */
if (!ags->gen_id)
ags->gen_id = gt_str_ref(gth_sa_gen_id_str(sacluster->representative));
#ifndef NDEBUG
else {
/* genomic ids equal */
gt_assert(!gt_str_cmp(ags->gen_id,
gth_sa_gen_id_str(sacluster->representative)));
}
#endif
/* save SA pointers */
gt_array_add(ags->alignments, sacluster->representative);
for (i = 0; i < gt_array_size(sacluster->members); i++) {
gt_array_add(ags->alignments, *(GthSA**)
gt_array_get(sacluster->members, i));
}
ags->numofstoredsaclusters++;
while (currentexon < numofexons) {
node = getcoreExonnodefromSA(sacluster->representative, currentexon);
if (currentnode < gt_array_size(nodes)) {
/* compare current node with current exon */
if (!gt_range_overlap(&node.range,
&((Exonnode*) gt_array_get(nodes, currentnode))
->range)) {
/* the current exon does not overlap with the current node,
visit next node */
currentnode++;
}
else {
/* left borders are equal, merge exon and node */
mergenodes(gt_array_get(nodes, currentnode), &node);
currentnode++;
currentexon++;
}
freecoreExonnode(&node);
}
else {
/* save this node */
gt_array_add(nodes, node);
currentnode++;
currentexon++;
}
}
}
void gth_build_AGS_from_assembly(GthAGS *ags, GtBittab *assembly,
GtArray *saclusters)
{
GtUword i;
GtArray *nodes;
GthExonAGS exonAGS;
GthSpliceSiteProb splicesiteprob;
Exonnode *exonnode;
nodes = gt_array_new(sizeof (Exonnode));
/* compute AGS, the exons are stored es Exonnodes, which are saved later
(see below) */
for (i = 0; i < gt_array_size(saclusters); i++) {
if (gt_bittab_bit_is_set(assembly, i))
addSAtoAGS(ags, *(GthSACluster**) gt_array_get(saclusters, i), nodes);
}
/* save exons */
for (i = 0; i < gt_array_size(nodes); i++) {
exonnode = gt_array_get(nodes, i);
exonAGS.range = exonnode->range;
exonAGS.score = computeexonscore(exonnode);
gt_array_add(ags->exons, exonAGS);
}
/* at least one exon node exists */
gt_assert(gt_array_size(nodes));
/* save the splice site probabilites (stored in the intron infos) */
for (i = 0; i < gt_array_size(nodes) - 1; i++) {
exonnode = gt_array_get(nodes, i);
splicesiteprob.donorsiteprob = exonnode->successorintron
->donorsiteprobability;
splicesiteprob.acceptorsiteprob = exonnode->successorintron
->acceptorsiteprobability;
gt_array_add(ags->splicesiteprobs, splicesiteprob);
}
/* last successor intron info points to null */
gt_assert(((Exonnode*) gt_array_get_last(nodes))->successorintron == NULL);
/* free space for nodes */
for (i = 0; i < gt_array_size(nodes); i++) {
exonnode = gt_array_get(nodes, i);
freecoreExonnode(exonnode);
}
gt_array_delete(nodes);
}
/*
Copyright (c) 2003-2011 Gordon Gremme <gordon@gremme.org>
Copyright (c) 2003-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef AGS_BUILD_H
#define AGS_BUILD_H
#include "core/bittab_api.h"
#include "gth/ags.h"
#include "gth/pgl.h"
void gth_build_AGS_from_assembly(GthAGS*, GtBittab *assembly,
GtArray *saclusters);
#endif
/*
Copyright (c) 2003-2009 Gordon Gremme <gordon@gremme.org>
Copyright (c) 2003-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ALIGN_COMMON_H
#define ALIGN_COMMON_H
/* This modules contains the common functions which are used in the dna and the
protein DP. */
#include "gth/bssm_param.h"
#include "gth/dp_param.h"
#include "gth/stat.h"
#define SCORE(T,N,M) dpm->core.score[T][N][M]
#define GTH_MINUSINFINITY ((GthFlt) -99999.0)
#define DASH (GT_SEPARATOR-3)
#define UNSET (GT_SEPARATOR-4)
/*
The following updates maxvalue if it is smaller than value.
The variable <retrace> is defined accordingly.
*/
#define UPDATEMAX(C)\
if (maxvalue < value)\
{\
maxvalue = value;\
retrace = (GthPath) C;\
}
typedef unsigned char GthPath;
#endif
This diff is collapsed.
/*
Copyright (c) 2003-2010 Gordon Gremme <gordon@gremme.org>
Copyright (c) 2003-2008 Center for Bioinformatics, University of Hamburg
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef ALIGN_DNA_H
#define ALIGN_DNA_H
#include "gth/align_common.h"
#include "gth/dp_options_core.h"
#include "gth/dp_options_est.h"
#include "gth/dp_options_postpro.h"
#include "gth/path_matrix.h"
#include "gth/sa.h"
#define DASH_DASH_WEIGHT 0.0
/* XXX: precompute this for performance reasons (part of core DP) */
#define ADDOUTPUTWEIGHT(VAR,N,M)\
if ((N) < (gen_alphabet_mapsize-1))\
{\
if ((M) < (gen_alphabet_mapsize-1))\
{\
if ((N)==(M))\
{\
VAR += dp_options_est->identityweight;\
}\
else\
{\
VAR += dp_options_est->mismatchweight;\
}\
}\
else if ((M) == DASH)\
{\
VAR += dp_options_est->deletionweight;\
}\
else\
{\
VAR += dp_options_est->undetcharweight;\
}\
}\
else if ((N) == DASH)\
{\
if ((M) == DASH)\
{\
/* N=M=DASH: can happen in gthcomputescores() */\
VAR += DASH_DASH_WEIGHT;\
}\
else\
{\
VAR += dp_options_est->deletionweight;\
}\
}\
else\
{\
if ((M) == DASH)\
{\
VAR += dp_options_est->deletionweight;\
}\
else\
{\
VAR += dp_options_est->undetcharweight;\
}\
}
typedef struct GthDPMatrix GthDPMatrix;
typedef void (*GthDNACompletePathMatrixJT)(GthDPMatrix *dpm,
const unsigned char *gen_seq_tran,
const unsigned char *ref_seq_tran,
GtUword genomic_offset,
GtAlphabet *gen_alphabet,
GthDPParam *dp_param,
GthDPOptionsEST *dp_options_est,
GthDPOptionsCore *dp_options_core,
GthJumpTable *jumpt_table,
GtArray *gen_ranges,
GtUword ref_dp_length,
GtUword ref_offset,
GthPathMatrix **pm);
#define ADDOUTPUTWEIGHTIDENTITY(VAR,N)\
if ((N) < (gen_alphabet_mapsize-1))\
{\
VAR += dp_options_est->identityweight;\
}\
else if ((N) == DASH)\
{\
VAR += DASH_DASH_WEIGHT;\
}\
else\
{\
VAR += dp_options_est->undetcharweight;\
}
/* The following function implements the Spliced Alignment of Genomic DNA with
cDNA, as described by Usuka, Zhu and Brendel. */
int gth_align_dna(GthSA*,
GtArray *gen_ranges,
const unsigned char *gen_seq_tran,
const unsigned char *gen_seq_orig,
const unsigned char *ref_seq_tran,
const unsigned char *ref_seq_orig,
GtUword ref_dp_length,
GtAlphabet *gen_alphabet,
GtAlphabet *ref_alphabet,
bool introncutout,
GtUword autoicmaxmatrixsize,
bool showeops,
bool comments,
bool gs2out,
const GtRange *gen_seq_bounds,
GthSpliceSiteModel *splice_site_model,
GthDPOptionsCore *dp_options_core,
GthDPOptionsEST *dp_options_est,
GthDPOptionsPostpro *dp_options_postpro,
GthDNACompletePathMatrixJT complete_path_matrix_jt,
GthJumpTable *jump_table,
GtUword ref_offset,
GthStat*,
GtFile*);
/* can return NULL */
GthSA* gth_align_dna_simple(GthInput *input,
const GtRange *gen_range,
GtUword gen_file_num,
GtUword gen_seq_num,
bool gen_strand_forward,
GtUword ref_file_num,
GtUword ref_seq_num,
GthSpliceSiteModel *splice_site_model);
void gth_show_backtrace_matrix(GthPath **path,
GtUword gen_dp_length,
GtUword ref_dp_length,
const GtRange *btmatrixgenrange,
const GtRange *btmatrixrefrange);
#endif