Third-party code in sapphyre_tools
========================================================================

sapphyre_tools is distributed under the GNU General Public License,
version 3 or later (see LICENSE). Parts of it are derived from the
projects in sections 1 to 3, whose notices are reproduced here as their
licenses require. Section 4 acknowledges data and parameter values,
section 5 the origin of pn2codon.


========================================================================
1. BATH and HMMER
========================================================================

src/genome_splice/avx.rs is ported from BATH (impl_avx: fwdback_avx.c,
decoding_avx.c, optacc_avx.c, p7_oprofile_avx.c). src/genome_splice/align.rs
follows HMMER's generic profile configuration and its Forward, Backward,
posterior decoding and optimal accuracy routines, as BATH uses them.
The exon score in src/genome_splice/score.rs follows BATH's
p7_splice_ScoreExons, and the aligner in src/genome_splice/orf.rs falls
back from the SIMD routines to the generic ones as HMMER's tracealign.c
does. The BATH LICENSE file, which contains the HMMER license, in full:

BATH - Better Alignments with Translated HMMER
-----------------------------------------------------------------------

The code of BATH is highly derivative of HMMER - enough that 
the entire LICENCE file for HMMER is reproduced below.

BATH-specific code includes contributions and input from 
   Genevieve Krause
   Walt Shands
   Travis Wheeler

Copyright (C) 2022-2026 The Arizona Board of Regents on behalf of 
                        The University of Arizona

The BATH-specific contributions are released under the BSD three-clause 
license reproduced at the bottom of this file, with the BATH copyright 
holders substituted as appropriate.


-----------------------------------------------------------------------
-----------------------------------------------------------------------

HMMER - Biological sequence analysis with profile hidden Markov models
Copyright (C) 1992-2020 Sean R. Eddy
Copyright (C) 2000-2020 Howard Hughes Medical Institute
Copyright (C) 2015-2020 President and Fellows of Harvard College
Copyright (C) 1992-2004 Washington University School of Medicine
Copyright (C) 1992-1994 MRC Laboratory of Molecular Biology
-----------------------------------------------------------------------

The code includes contributions and input from current and past
members of the HMMER development team, as well as other colleagues and
sources, including:

   Bill Arndt        
   Jeremy Buhler     
   Tyler Camp
   Nick Carter        
   Sergi Castellano  
   Goran Ceric       
   Michael Farrar    
   Rob Finn          
   Ian Holmes        
   Bjarne Knudsen    
   Diana Kolbe       
   Erik Lindahl      
   Graeme Mitchison  
   Eric Nawrocki     
   Lee Newberg       
   Elena Rivas        
   Walt Shands  
   Travis Wheeler    

HMMER also includes copyrighted and licensed code that has been
incorporated from other sources, including:

   Yuta Mori (libdivsufsort-lite)
   Apple Computer                  
   Free Software Foundation, Inc.  
   IBM TJ Watson Research Center   
   X Consortium                    

HMMER uses the Easel software library, which has its own license and
copyright information. See easel/LICENSE.

HMMER includes patent-pending SIMD technology under a nonexclusive
license from the estate of Michael Farrar. You are sublicensed to use
this technology specifically for the use, modification, and
redistribution of HMMER.

HMMER development is supported in part by the National Human Genome
Research Institute of the US National Institutes of Health under grant
number R01HG009116. The content is solely the responsibility of the
authors and does not necessarily represent the official views of the
National Institutes of Health.

HMMER source code is distributed as open source under the terms of the
BSD three-clause license:

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:

   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

   3. Neither the name of any copyright holder nor the names of 
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   OF THE POSSIBILITY OF SUCH DAMAGE.






   


========================================================================
2. Easel
========================================================================

The SIMD helpers in src/genome_splice/avx.rs (exponential, horizontal
sum and maximum, lane shifts) follow Easel's esl_sse and esl_avx. The
Easel LICENSE file in full:

Easel - a library of C functions for biological sequence analysis
Copyright (C) 1990-2022 Sean R. Eddy
Copyright (C) 2000-2022 Howard Hughes Medical Institute
Copyright (C) 2015-2022 President and Fellows of Harvard College
Copyright (C) 1995-2006 Washington University School of Medicine
Copyright (C) 1992-1995 MRC Laboratory of Molecular Biology, UK
-------------------------------------------------------------------

Easel's code includes contributions from members of the Eddy/Rivas
laboratory at Harvard University, the HMMER and Infernal development
teams, and other colleagues, including:

   Tyler Camp        
   Nick Carter       
   Michael Farrar    
   Graeme Mitchison  
   Eric Nawrocki     
   Sam Petti
   Elena Rivas       
   Travis Wheeler    

Easel also includes code we have incorporated from other sources and
authors -- including public domain code, and licensed copyrighted
code. Sources and licenses are noted in the appropriate places in
individual files. Copyright holders and contributors include:

   Barry W. Brown, James Lovato        esl_random:esl_rnd_Gaussian()   
   Bob Jenkins                         esl_random::esl_rnd_mix3()
   Steven G. Johnson, and others       autoconf macros in m4/
   Kevin Lawler                        esl_rand64::esl_rand64_Deal()
   Stephen Moshier                     SIMD vectorized logf,expf
   Takuji Nishimura, Makoto Matsumoto  esl_random, esl_rand64
   Julien Pommier                      SIMD vectorized logf,expf
   David Robert Nadeau                 esl_stopwatch
   Henry Spencer                       esl_regexp
   David Wheeler                       easel::esl_tmpfile()
   Free Software Foundation, Inc.      configure	
   FreeBSD 		               easel::esl_strsep()
   Sun Microsystems, Inc.              esl_stats::esl_erfc()

Easel development is supported in part by the National Human Genome
Research Institute of the US National Institutes of Health under grant
number R01HG009116. The content is solely the responsibility of the
authors and does not necessarily represent the official views of the
National Institutes of Health.

The Easel library is open source software. It is freely distributed
under the terms of the BSD (Berkeley Software Distribution) open
source license:

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:

   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
   OF THE POSSIBILITY OF SUCH DAMAGE.

Easel's esl_sse.c carries this further notice for its exponential and
logarithm routines:

In addition to our own copyrights, esl_sse_logf() and esl_sse_expf() are also:
 Copyright (C) 2007 Julien Pommier
 Copyright (C) 1992 Stephen Moshier

These functions derived from zlib-licensed routines by
Julien Pommier, http://gruntthepeon.free.fr/ssemath/. The
zlib license:

-------------------------------------------------------------------------
Copyright (C) 2007  Julien Pommier

 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages
 arising from the use of this software.

 Permission is granted to anyone to use this software for any purpose,
 including commercial applications, and to alter it and redistribute it
 freely, subject to the following restrictions:

 1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.
 2. Altered source versions must be plainly marked as such, and must not be
    misrepresented as being the original software.
 3. This notice may not be removed or altered from any source distribution.

-------------------------------------------------------------------------

In turn, Pommier had derived the logf() and expf() functions from
serial versions in the Cephes math library. According to its
readme, Cephes is "copyrighted by the author" and "may be used
freely but it comes with no support or guarantee."  Cephes is
available in NETLIB [http://www.netlib.org/cephes/]. NETLIB is
widely considered to be a free scientific code repository, though
the copyright and license status of many parts, including Cephes,
is ill-defined. We have attached Moshier's copyright,
to credit his original contribution. Thanks to both Pommier and
Moshier for their clear code.


========================================================================
3. fastp
========================================================================

src/reads/ is ported from fastp 1.3.6 (https://github.com/OpenGene/fastp).

MIT License

Copyright (c) 2016 OpenGene - Open Source Genetics Toolbox

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.


========================================================================
4. Splice site data and scoring parameters (acknowledgement)
========================================================================

No code in sapphyre_tools is taken from exonerate. The donor splice site
frequencies in src/genome_splice/sites.rs are the primate frequencies
published in

  P. Senapathy, M. B. Shapiro and N. L. Harris (1990). Splice junctions,
  branch point sites, and exons: sequence statistics, identification, and
  applications to genome project. Methods in Enzymology 183:252-278.

as tabulated in exonerate 2.4.0 by Guy St.C. Slater. Their log-odds
scaling, and the intron and frameshift costs in
src/genome_splice/splice.rs, take the values exonerate uses.


========================================================================
5. PAL2NAL (acknowledgement)
========================================================================

src/pn2codon.rs began as a port of the pn2codon routine of PAL2NAL
(pal2nal.pl, Mikita Suyama) and has since been rewritten: it checks
consecutive codons against the NCBI tables instead of searching with
PAL2NAL's reverse-translation patterns.

  M. Suyama, D. Torrents and P. Bork (2006). PAL2NAL: robust conversion of
  protein sequence alignments into the corresponding codon alignments.
  Nucleic Acids Research 34:W609-W612.
