7b0d192
diff -up EMBOSS-6.6.0/emboss/acd/epscan.acd.fixconflict EMBOSS-6.6.0/emboss/acd/epscan.acd
7b0d192
--- EMBOSS-6.6.0/emboss/acd/epscan.acd.fixconflict	2015-10-30 09:50:32.562390934 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/acd/epscan.acd	2015-10-30 09:50:32.562390934 -0400
7b0d192
@@ -0,0 +1,63 @@
7b0d192
+application: epscan [
7b0d192
+  documentation: "Scans protein sequence(s) with fingerprints from
7b0d192
+                  the PRINTS database"
7b0d192
+  groups: "Protein:Motifs"
7b0d192
+    relations: "EDAM:0000158 topic Sequence motifs"
7b0d192
+    relations: "EDAM:0000382 operation Sequence motif recognition (protein)"
7b0d192
+    relations: "EDAM:0000347 operation Sequence database search
7b0d192
+                (by motif or pattern)"
7b0d192
+    relations: "EDAM:0000340 operation Protein secondary database search"
7b0d192
+]
7b0d192
+
7b0d192
+section: input [
7b0d192
+  information: "Input section"
7b0d192
+  type: "page"
7b0d192
+]
7b0d192
+
7b0d192
+  seqall: sequence [
7b0d192
+    parameter: "Y"
7b0d192
+    type: "Protein"
7b0d192
+    relations: "EDAM:0002886 data Sequence record (protein)"
7b0d192
+  ]
7b0d192
+
7b0d192
+endsection: input
7b0d192
+
7b0d192
+section: required [
7b0d192
+  information: "Required section"
7b0d192
+  type: "page"
7b0d192
+]
7b0d192
+
7b0d192
+  integer: emin [
7b0d192
+    standard: "Y"
7b0d192
+    minimum: "1"
7b0d192
+    maximum: "20"
7b0d192
+    default: "2"
7b0d192
+    information: "Minimum number of elements per fingerprint"
7b0d192
+    relations: "EDAM:0002527 data Parameter or primitive"
7b0d192
+  ]
7b0d192
+
7b0d192
+  integer: emax [
7b0d192
+    standard: "Y"
7b0d192
+    minimum: "$(emin)"
7b0d192
+    maximum: "20"
7b0d192
+    failrange: "N"
7b0d192
+    trueminimum: "N"
7b0d192
+    default: "20"
7b0d192
+    information: "Maximum number of elements per fingerprint"
7b0d192
+    relations: "EDAM:0002527 data Parameter or primitive"
7b0d192
+  ]
7b0d192
+
7b0d192
+endsection: required
7b0d192
+
7b0d192
+section: output [
7b0d192
+  information: "Output section"
7b0d192
+  type: "page"
7b0d192
+]
7b0d192
+
7b0d192
+  outfile: outfile [
7b0d192
+    parameter: "Y"
7b0d192
+    knowntype: "pscan output"
7b0d192
+    relations: "EDAM:0001420 data Sequence-profile alignment (fingerprint)"
7b0d192
+  ]
7b0d192
+
7b0d192
+endsection: output
7b0d192
diff -up EMBOSS-6.6.0/emboss/acd/Makefile.am.fixconflict EMBOSS-6.6.0/emboss/acd/Makefile.am
7b0d192
--- EMBOSS-6.6.0/emboss/acd/Makefile.am.fixconflict	2013-07-15 17:25:46.000000000 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/acd/Makefile.am	2015-10-30 09:50:32.562390934 -0400
7b0d192
@@ -264,7 +264,7 @@ profit.acd \
7b0d192
 prophecy.acd \
7b0d192
 prophet.acd \
7b0d192
 prosextract.acd \
7b0d192
-pscan.acd \
7b0d192
+epscan.acd \
7b0d192
 psiphi.acd \
7b0d192
 rebaseextract.acd \
7b0d192
 recoder.acd \
7b0d192
diff -up EMBOSS-6.6.0/emboss/acd/Makefile.in.fixconflict EMBOSS-6.6.0/emboss/acd/Makefile.in
7b0d192
--- EMBOSS-6.6.0/emboss/acd/Makefile.in.fixconflict	2013-07-15 17:27:30.000000000 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/acd/Makefile.in	2015-10-30 09:50:32.562390934 -0400
7b0d192
@@ -532,7 +532,7 @@ profit.acd \
7b0d192
 prophecy.acd \
7b0d192
 prophet.acd \
7b0d192
 prosextract.acd \
7b0d192
-pscan.acd \
7b0d192
+epscan.acd \
7b0d192
 psiphi.acd \
7b0d192
 rebaseextract.acd \
7b0d192
 recoder.acd \
7b0d192
diff -up EMBOSS-6.6.0/emboss/acd/printsextract.acd.fixconflict EMBOSS-6.6.0/emboss/acd/printsextract.acd
7b0d192
--- EMBOSS-6.6.0/emboss/acd/printsextract.acd.fixconflict	2012-03-12 13:46:17.000000000 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/acd/printsextract.acd	2015-10-30 09:50:32.562390934 -0400
7b0d192
@@ -1,5 +1,5 @@
7b0d192
 application: printsextract [
7b0d192
-  documentation: "Extract data from PRINTS database for use by pscan"
7b0d192
+  documentation: "Extract data from PRINTS database for use by epscan"
7b0d192
   groups: "Utils:Database creation"
7b0d192
   gui: "no"
7b0d192
   batch: "no"
7b0d192
diff -up EMBOSS-6.6.0/emboss/data/edamtoacd.dat.fixconflict EMBOSS-6.6.0/emboss/data/edamtoacd.dat
7b0d192
--- EMBOSS-6.6.0/emboss/data/edamtoacd.dat.fixconflict	2009-09-30 12:53:21.000000000 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/data/edamtoacd.dat	2015-10-30 09:50:32.563390927 -0400
7b0d192
@@ -159,7 +159,7 @@ outfile        |  "EDAM:Primer report"
7b0d192
 outfile        |  "EDAM:Primer report"                                       | knowntype:"primersearch output"                 
7b0d192
 outfile        |  "EDAM:Sequence-profile alignment report"                   | knowntype:"profit output"                       
7b0d192
 outfile        |  "EDAM:Sequence profile record"                             | knowntype:"prophecy output"                     
7b0d192
-outfile        |  "EDAM:Fingerprint alignment report"                        | knowntype:"pscan output"                        
7b0d192
+outfile        |  "EDAM:Fingerprint alignment report"                        | knowntype:"epscan output"                        
7b0d192
 outfile        |  "EDAM:Restriction enzyme report"                           | knowntype:"redata output"                       
7b0d192
 outfile        |  "EDAM:Restriction map report"                              | knowntype:"remap output"                        
7b0d192
 outfile        |  "EDAM:EMBOSS restover recognition site report"             | knowntype:"restover output"                        
7b0d192
diff -up EMBOSS-6.6.0/emboss/epscan.c.fixconflict EMBOSS-6.6.0/emboss/epscan.c
7b0d192
--- EMBOSS-6.6.0/emboss/epscan.c.fixconflict	2015-10-30 09:50:32.563390927 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/epscan.c	2015-10-30 09:50:32.563390927 -0400
7b0d192
@@ -0,0 +1,481 @@
7b0d192
+/* @source pscan application
7b0d192
+**
7b0d192
+** Reports fingerprints in a protein sequence
7b0d192
+** @author Copyright (C) Alan Bleasby (ableasby@hgmp.mrc.ac.uk)
7b0d192
+** @@
7b0d192
+**
7b0d192
+** This program is free software; you can redistribute it and/or
7b0d192
+** modify it under the terms of the GNU General Public License
7b0d192
+** as published by the Free Software Foundation; either version 2
7b0d192
+** of the License, or (at your option) any later version.
7b0d192
+**
7b0d192
+** This program is distributed in the hope that it will be useful,
7b0d192
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
7b0d192
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7b0d192
+** GNU General Public License for more details.
7b0d192
+**
7b0d192
+** You should have received a copy of the GNU General Public License
7b0d192
+** along with this program; if not, write to the Free Software
7b0d192
+** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
7b0d192
+******************************************************************************/
7b0d192
+
7b0d192
+#include "emboss.h"
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+static void pscan_print_hits(AjPFile outf, AjPList l, ajuint nmotifs,
7b0d192
+			     ajuint begin);
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+/* @prog pscan ****************************************************************
7b0d192
+**
7b0d192
+** Scans proteins using PRINTS
7b0d192
+**
7b0d192
+******************************************************************************/
7b0d192
+
7b0d192
+int main(int argc, char **argv)
7b0d192
+{
7b0d192
+    AjPSeqall seqall;
7b0d192
+    AjPSeq seq   = NULL;
7b0d192
+    AjPFile outf = NULL;
7b0d192
+    ajint begin;
7b0d192
+    ajint end;
7b0d192
+    ajuint emin;
7b0d192
+    ajuint emax;
7b0d192
+
7b0d192
+    AjPFile mfile = NULL;
7b0d192
+    EmbPMatPrints s = NULL;
7b0d192
+    AjPList l = NULL;
7b0d192
+    AjPStr strand = NULL;
7b0d192
+    AjPStr substr = NULL;
7b0d192
+    AjPStr name = NULL;
7b0d192
+
7b0d192
+    AjBool all;
7b0d192
+    AjBool ordered;
7b0d192
+
7b0d192
+    ajint hits;
7b0d192
+    ajint nmotifs;
7b0d192
+
7b0d192
+    embInit("pscan", argc, argv);
7b0d192
+
7b0d192
+    seqall = ajAcdGetSeqall("sequence");
7b0d192
+    outf   = ajAcdGetOutfile("outfile");
7b0d192
+    emin   = ajAcdGetInt("emin");
7b0d192
+    emax   = ajAcdGetInt("emax");
7b0d192
+
7b0d192
+    substr = ajStrNew();
7b0d192
+    name   = ajStrNew();
7b0d192
+
7b0d192
+    all = ordered = ajTrue;
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+    while(ajSeqallNext(seqall, &seq))
7b0d192
+    {
7b0d192
+	begin = ajSeqallGetseqBegin(seqall);
7b0d192
+	end   = ajSeqallGetseqEnd(seqall);
7b0d192
+
7b0d192
+	ajStrAssignC(&name,ajSeqGetNameC(seq));
7b0d192
+	strand = ajSeqGetSeqCopyS(seq);
7b0d192
+
7b0d192
+	ajStrAssignSubC(&substr,ajStrGetPtr(strand),begin-1,end-1);
7b0d192
+
7b0d192
+	nmotifs = 0;
7b0d192
+	ajDebug("pscan sequence '%S'\n", ajSeqGetNameS(seq));
7b0d192
+	embMatPrintsInit(&mfile);
7b0d192
+	ajDebug("pscan prints file '%F'\n", mfile);
7b0d192
+	l = ajListNew();
7b0d192
+	while((s = embMatProtReadInt(mfile)))
7b0d192
+	{
7b0d192
+	    ajDebug("pscan file '%F' read\n", mfile);
7b0d192
+	    if(s->n >= emin && s->n <= emax)
7b0d192
+	    {
7b0d192
+		hits=embMatProtScanInt(substr,name,s,&l,&all,&ordered,
7b0d192
+					    1);
7b0d192
+		if(hits)
7b0d192
+		    ++nmotifs;
7b0d192
+	    }
7b0d192
+	    embMatProtDelInt(&s);
7b0d192
+	}
7b0d192
+
7b0d192
+	pscan_print_hits(outf, l, nmotifs, begin);
7b0d192
+	ajListFree(&l);
7b0d192
+
7b0d192
+
7b0d192
+	ajStrDel(&strand);
7b0d192
+	ajFileClose(&mfile);
7b0d192
+    }
7b0d192
+
7b0d192
+    ajStrDel(&substr);
7b0d192
+    ajStrDel(&name);
7b0d192
+
7b0d192
+    ajSeqallDel(&seqall);
7b0d192
+    ajSeqDel(&seq;;
7b0d192
+    ajFileClose(&outf);
7b0d192
+
7b0d192
+    embExit();
7b0d192
+
7b0d192
+    return 0;
7b0d192
+}
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+/* @funcstatic pscan_print_hits ***********************************************
7b0d192
+**
7b0d192
+** Undocumented.
7b0d192
+**
7b0d192
+** @param [u] outf [AjPFile] outfile
7b0d192
+** @param [u] l [AjPList] hits
7b0d192
+** @param [r] nmotifs [ajuint] number of hits
7b0d192
+** @param [r] begin [ajuint] start position
7b0d192
+** @@
7b0d192
+******************************************************************************/
7b0d192
+
7b0d192
+static void pscan_print_hits(AjPFile outf, AjPList l, ajuint nmotifs,
7b0d192
+			     ajuint begin)
7b0d192
+{
7b0d192
+    EmbPMatMatch mm;
7b0d192
+    ajuint i;
7b0d192
+    ajuint j;
7b0d192
+    AjBool found;
7b0d192
+    ajuint nleft;
7b0d192
+    ajuint maxelem = 0;
7b0d192
+    ajuint maxhpm;
7b0d192
+    ajuint hpm = 0;
7b0d192
+
7b0d192
+    nleft = nmotifs;
7b0d192
+
7b0d192
+
7b0d192
+    ajFmtPrintF(outf,"\n\nCLASS 1\n");
7b0d192
+    ajFmtPrintF(outf,"Fingerprints with all elements in order\n\n");
7b0d192
+
7b0d192
+
7b0d192
+    found = ajTrue;
7b0d192
+
7b0d192
+    while(found && nleft)
7b0d192
+    {
7b0d192
+	found = ajFalse;
7b0d192
+	maxelem = 0;
7b0d192
+	for(i=0;i
7b0d192
+	{
7b0d192
+	    ajListPop(l,(void **)&mm;;
7b0d192
+	    if(mm->all && mm->ordered)
7b0d192
+	    {
7b0d192
+		maxelem = AJMAX(maxelem,mm->n);
7b0d192
+		found = ajTrue;
7b0d192
+	    }
7b0d192
+	    hpm = mm->hpm;
7b0d192
+
7b0d192
+	    ajListPushAppend(l,(void *)mm);
7b0d192
+	    for(j=1;j
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+	    }
7b0d192
+	}
7b0d192
+
7b0d192
+
7b0d192
+	if(found)
7b0d192
+	{
7b0d192
+	    found = ajFalse;
7b0d192
+	    for(i=0;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		hpm = mm->hpm;
7b0d192
+
7b0d192
+		if(mm->all && mm->ordered && maxelem==mm->n)
7b0d192
+		    break;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+
7b0d192
+		for(j=1;j
7b0d192
+		{
7b0d192
+		    ajListPop(l,(void **)&mm;;
7b0d192
+		    ajListPushAppend(l,(void *)mm);
7b0d192
+		}
7b0d192
+	    }
7b0d192
+
7b0d192
+	    if(mm->all && mm->ordered && maxelem==mm->n)
7b0d192
+	    {
7b0d192
+		ajFmtPrintF(outf,"Fingerprint %s Elements %d\n",
7b0d192
+			    ajStrGetPtr(mm->cod),mm->n);
7b0d192
+		ajFmtPrintF(outf,"    Accession number %s\n",
7b0d192
+			    ajStrGetPtr(mm->acc));
7b0d192
+		ajFmtPrintF(outf,"    %s\n",ajStrGetPtr(mm->tit));
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    for(i=1;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    --nleft;
7b0d192
+	}
7b0d192
+
7b0d192
+    }
7b0d192
+
7b0d192
+    ajFmtPrintF(outf,"\n\nCLASS 2\n");
7b0d192
+    ajFmtPrintF(outf,"All elements match but not all in the "
7b0d192
+		"correct order\n\n");
7b0d192
+
7b0d192
+    found = ajTrue;
7b0d192
+
7b0d192
+    while(found && nleft)
7b0d192
+    {
7b0d192
+	found = ajFalse;
7b0d192
+	maxelem = 0;
7b0d192
+
7b0d192
+	for(i=0;i
7b0d192
+	{
7b0d192
+	    ajListPop(l,(void **)&mm;;
7b0d192
+	    if(mm->all)
7b0d192
+	    {
7b0d192
+		maxelem = AJMAX(maxelem,mm->n);
7b0d192
+		found = ajTrue;
7b0d192
+	    }
7b0d192
+	    hpm = mm->hpm;
7b0d192
+	    ajListPushAppend(l,(void *)mm);
7b0d192
+
7b0d192
+	    for(j=1;j
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+	    }
7b0d192
+	}
7b0d192
+
7b0d192
+	if(found)
7b0d192
+	{
7b0d192
+
7b0d192
+	    found=ajFalse;
7b0d192
+	    for(i=0;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		hpm = mm->hpm;
7b0d192
+		if(mm->all && maxelem==mm->n)
7b0d192
+		    break;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+
7b0d192
+		for(j=1;j
7b0d192
+		{
7b0d192
+		    ajListPop(l,(void **)&mm;;
7b0d192
+		    ajListPushAppend(l,(void *)mm);
7b0d192
+		}
7b0d192
+	    }
7b0d192
+
7b0d192
+	    if(mm->all && maxelem==mm->n)
7b0d192
+	    {
7b0d192
+		ajFmtPrintF(outf,"Fingerprint %s Elements %d\n",
7b0d192
+			    ajStrGetPtr(mm->cod),mm->n);
7b0d192
+		ajFmtPrintF(outf,"    Accession number %s\n",
7b0d192
+			    ajStrGetPtr(mm->acc));
7b0d192
+		ajFmtPrintF(outf,"    %s\n",ajStrGetPtr(mm->tit));
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    for(i=1;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    --nleft;
7b0d192
+	}
7b0d192
+
7b0d192
+    }
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+    ajFmtPrintF(outf,"\n\nCLASS 3\n");
7b0d192
+    ajFmtPrintF(outf,
7b0d192
+		"Not all elements match but those that do are in order\n\n");
7b0d192
+
7b0d192
+    found = ajTrue;
7b0d192
+
7b0d192
+    while(found && nleft)
7b0d192
+    {
7b0d192
+	found  = ajFalse;
7b0d192
+	maxhpm = 0;
7b0d192
+	for(i=0;i
7b0d192
+	{
7b0d192
+	    ajListPop(l,(void **)&mm;;
7b0d192
+	    if(mm->ordered)
7b0d192
+	    {
7b0d192
+		maxhpm = AJMAX(maxelem,mm->hpm);
7b0d192
+		found  = ajTrue;
7b0d192
+	    }
7b0d192
+	    hpm = mm->hpm;
7b0d192
+	    ajListPushAppend(l,(void *)mm);
7b0d192
+
7b0d192
+	    for(j=1;j
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+	    }
7b0d192
+	}
7b0d192
+
7b0d192
+
7b0d192
+	if(found)
7b0d192
+	{
7b0d192
+	    found = ajFalse;
7b0d192
+	    for(i=0;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		hpm = mm->hpm;
7b0d192
+
7b0d192
+		if(mm->ordered && maxhpm==mm->hpm)
7b0d192
+		    break;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+
7b0d192
+		for(j=1;j
7b0d192
+		{
7b0d192
+		    ajListPop(l,(void **)&mm;;
7b0d192
+		    ajListPushAppend(l,(void *)mm);
7b0d192
+		}
7b0d192
+	    }
7b0d192
+
7b0d192
+	    if(mm->ordered && maxhpm==mm->hpm)
7b0d192
+	    {
7b0d192
+		ajFmtPrintF(outf,"Fingerprint %s Elements %d\n",
7b0d192
+			    ajStrGetPtr(mm->cod),mm->n);
7b0d192
+		ajFmtPrintF(outf,"    Accession number %s\n",
7b0d192
+			    ajStrGetPtr(mm->acc));
7b0d192
+		ajFmtPrintF(outf,"    %s\n",ajStrGetPtr(mm->tit));
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    for(i=1;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    --nleft;
7b0d192
+	}
7b0d192
+
7b0d192
+    }
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+
7b0d192
+    ajFmtPrintF(outf,"\n\nCLASS 4\n");
7b0d192
+    ajFmtPrintF(outf,
7b0d192
+		"Remaining partial matches\n\n");
7b0d192
+
7b0d192
+    found = ajTrue;
7b0d192
+
7b0d192
+    while(found && nleft)
7b0d192
+    {
7b0d192
+	found = ajFalse;
7b0d192
+	maxhpm = 0;
7b0d192
+
7b0d192
+	for(i=0;i
7b0d192
+	{
7b0d192
+	    ajListPop(l,(void **)&mm;;
7b0d192
+	    maxhpm = AJMAX(maxelem,mm->hpm);
7b0d192
+	    found = ajTrue;
7b0d192
+
7b0d192
+	    hpm = mm->hpm;
7b0d192
+	    ajListPushAppend(l,(void *)mm);
7b0d192
+	    for(j=1;j
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+	    }
7b0d192
+	}
7b0d192
+
7b0d192
+
7b0d192
+	if(found)
7b0d192
+	{
7b0d192
+	    found = ajFalse;
7b0d192
+	    for(i=0;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		hpm = mm->hpm;
7b0d192
+
7b0d192
+		if(maxhpm==mm->hpm)
7b0d192
+		    break;
7b0d192
+		ajListPushAppend(l,(void *)mm);
7b0d192
+
7b0d192
+		for(j=1;j
7b0d192
+		{
7b0d192
+		    ajListPop(l,(void **)&mm;;
7b0d192
+		    ajListPushAppend(l,(void *)mm);
7b0d192
+		}
7b0d192
+	    }
7b0d192
+
7b0d192
+	    if(maxhpm==mm->hpm)
7b0d192
+	    {
7b0d192
+		ajFmtPrintF(outf,"Fingerprint %s Elements %d\n",
7b0d192
+			    ajStrGetPtr(mm->cod),mm->n);
7b0d192
+		ajFmtPrintF(outf,"    Accession number %s\n",
7b0d192
+			    ajStrGetPtr(mm->acc));
7b0d192
+		ajFmtPrintF(outf,"    %s\n",ajStrGetPtr(mm->tit));
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    for(i=1;i
7b0d192
+	    {
7b0d192
+		ajListPop(l,(void **)&mm;;
7b0d192
+		ajFmtPrintF(outf,"  Element %d Threshold %d%% Score %d%%\n",
7b0d192
+			    mm->element+1, mm->thresh, mm->score);
7b0d192
+		ajFmtPrintF(outf,"             Start position %d Length %d\n",
7b0d192
+			    mm->start+begin,mm->len);
7b0d192
+
7b0d192
+		embMatMatchDel(&mm;;
7b0d192
+	    }
7b0d192
+
7b0d192
+	    --nleft;
7b0d192
+	}
7b0d192
+
7b0d192
+    }
7b0d192
+
7b0d192
+
7b0d192
+    while(ajListPop(l,(void **)&mm))
7b0d192
+	if(mm)
7b0d192
+	    embMatMatchDel(&mm;;
7b0d192
+
7b0d192
+    return;
7b0d192
+}
7b0d192
diff -up EMBOSS-6.6.0/emboss/Makefile.am.fixconflict EMBOSS-6.6.0/emboss/Makefile.am
7b0d192
--- EMBOSS-6.6.0/emboss/Makefile.am.fixconflict	2015-10-30 09:50:32.554390990 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/Makefile.am	2015-10-30 09:51:26.065016794 -0400
7b0d192
@@ -309,7 +309,7 @@ profit \
7b0d192
 prophecy \
7b0d192
 prophet \
7b0d192
 prosextract \
7b0d192
-pscan \
7b0d192
+epscan \
7b0d192
 psiphi \
7b0d192
 rebaseextract \
7b0d192
 recoder \
7b0d192
@@ -587,7 +587,7 @@ profit_SOURCES = profit.c
7b0d192
 prophecy_SOURCES = prophecy.c
7b0d192
 prophet_SOURCES = prophet.c
7b0d192
 prosextract_SOURCES = prosextract.c
7b0d192
-pscan_SOURCES = pscan.c
7b0d192
+epscan_SOURCES = epscan.c
7b0d192
 psiphi_SOURCES = psiphi.c
7b0d192
 rebaseextract_SOURCES = rebaseextract.c
7b0d192
 recoder_SOURCES = recoder.c
7b0d192
diff -up EMBOSS-6.6.0/emboss/Makefile.in.fixconflict EMBOSS-6.6.0/emboss/Makefile.in
7b0d192
--- EMBOSS-6.6.0/emboss/Makefile.in.fixconflict	2013-07-15 17:27:30.000000000 -0400
7b0d192
+++ EMBOSS-6.6.0/emboss/Makefile.in	2015-10-30 09:50:32.565390913 -0400
7b0d192
@@ -142,7 +142,7 @@ bin_PROGRAMS = aaindexextract$(EXEEXT) a
7b0d192
 	plotorf$(EXEEXT) polydot$(EXEEXT) preg$(EXEEXT) \
7b0d192
 	prettyplot$(EXEEXT) prettyseq$(EXEEXT) primersearch$(EXEEXT) \
7b0d192
 	printsextract$(EXEEXT) profit$(EXEEXT) prophecy$(EXEEXT) \
7b0d192
-	prophet$(EXEEXT) prosextract$(EXEEXT) pscan$(EXEEXT) \
7b0d192
+	prophet$(EXEEXT) prosextract$(EXEEXT) epscan$(EXEEXT) \
7b0d192
 	psiphi$(EXEEXT) rebaseextract$(EXEEXT) recoder$(EXEEXT) \
7b0d192
 	redata$(EXEEXT) refseqget$(EXEEXT) remap$(EXEEXT) \
7b0d192
 	restover$(EXEEXT) restrict$(EXEEXT) revseq$(EXEEXT) \
7b0d192
@@ -1993,10 +1993,10 @@ prosextract_DEPENDENCIES = ../nucleus/li
7b0d192
 	../ajax/core/libajax.la $(am__append_3) \
7b0d192
 	../ajax/pcre/libepcre.la ../plplot/libeplplot.la \
7b0d192
 	$(am__DEPENDENCIES_1)
7b0d192
-am_pscan_OBJECTS = pscan.$(OBJEXT)
7b0d192
-pscan_OBJECTS = $(am_pscan_OBJECTS)
7b0d192
-pscan_LDADD = $(LDADD)
7b0d192
-pscan_DEPENDENCIES = ../nucleus/libnucleus.la ../ajax/acd/libacd.la \
7b0d192
+am_epscan_OBJECTS = epscan.$(OBJEXT)
7b0d192
+epscan_OBJECTS = $(am_epscan_OBJECTS)
7b0d192
+epscan_LDADD = $(LDADD)
7b0d192
+epscan_DEPENDENCIES = ../nucleus/libnucleus.la ../ajax/acd/libacd.la \
7b0d192
 	../ajax/ajaxdb/libajaxdb.la ../ajax/ensembl/libensembl.la \
7b0d192
 	../ajax/graphics/libajaxg.la ../ajax/core/libajax.la \
7b0d192
 	$(am__append_3) ../ajax/pcre/libepcre.la \
7b0d192
@@ -2821,7 +2821,7 @@ SOURCES = $(aaindexextract_SOURCES) $(ab
7b0d192
 	$(preg_SOURCES) $(prettyplot_SOURCES) $(prettyseq_SOURCES) \
7b0d192
 	$(prima_SOURCES) $(primers_SOURCES) $(primersearch_SOURCES) \
7b0d192
 	$(printsextract_SOURCES) $(profit_SOURCES) $(prophecy_SOURCES) \
7b0d192
-	$(prophet_SOURCES) $(prosextract_SOURCES) $(pscan_SOURCES) \
7b0d192
+	$(prophet_SOURCES) $(prosextract_SOURCES) $(epscan_SOURCES) \
7b0d192
 	$(psiphi_SOURCES) $(rebaseextract_SOURCES) $(recoder_SOURCES) \
7b0d192
 	$(redata_SOURCES) $(refseqget_SOURCES) $(remap_SOURCES) \
7b0d192
 	$(restover_SOURCES) $(restrict_SOURCES) $(revseq_SOURCES) \
7b0d192
@@ -2934,7 +2934,7 @@ DIST_SOURCES = $(aaindexextract_SOURCES)
7b0d192
 	$(preg_SOURCES) $(prettyplot_SOURCES) $(prettyseq_SOURCES) \
7b0d192
 	$(prima_SOURCES) $(primers_SOURCES) $(primersearch_SOURCES) \
7b0d192
 	$(printsextract_SOURCES) $(profit_SOURCES) $(prophecy_SOURCES) \
7b0d192
-	$(prophet_SOURCES) $(prosextract_SOURCES) $(pscan_SOURCES) \
7b0d192
+	$(prophet_SOURCES) $(prosextract_SOURCES) $(epscan_SOURCES) \
7b0d192
 	$(psiphi_SOURCES) $(rebaseextract_SOURCES) $(recoder_SOURCES) \
7b0d192
 	$(redata_SOURCES) $(refseqget_SOURCES) $(remap_SOURCES) \
7b0d192
 	$(restover_SOURCES) $(restrict_SOURCES) $(revseq_SOURCES) \
7b0d192
@@ -3414,7 +3414,7 @@ profit_SOURCES = profit.c
7b0d192
 prophecy_SOURCES = prophecy.c
7b0d192
 prophet_SOURCES = prophet.c
7b0d192
 prosextract_SOURCES = prosextract.c
7b0d192
-pscan_SOURCES = pscan.c
7b0d192
+epscan_SOURCES = epscan.c
7b0d192
 psiphi_SOURCES = psiphi.c
7b0d192
 rebaseextract_SOURCES = rebaseextract.c
7b0d192
 recoder_SOURCES = recoder.c
7b0d192
@@ -4266,9 +4266,9 @@ prophet$(EXEEXT): $(prophet_OBJECTS) $(p
7b0d192
 prosextract$(EXEEXT): $(prosextract_OBJECTS) $(prosextract_DEPENDENCIES) $(EXTRA_prosextract_DEPENDENCIES) 
7b0d192
 	@rm -f prosextract$(EXEEXT)
7b0d192
 	$(LINK) $(prosextract_OBJECTS) $(prosextract_LDADD) $(LIBS)
7b0d192
-pscan$(EXEEXT): $(pscan_OBJECTS) $(pscan_DEPENDENCIES) $(EXTRA_pscan_DEPENDENCIES) 
7b0d192
-	@rm -f pscan$(EXEEXT)
7b0d192
-	$(LINK) $(pscan_OBJECTS) $(pscan_LDADD) $(LIBS)
7b0d192
+epscan$(EXEEXT): $(epscan_OBJECTS) $(epscan_DEPENDENCIES) $(EXTRA_epscan_DEPENDENCIES) 
7b0d192
+	@rm -f epscan$(EXEEXT)
7b0d192
+	$(LINK) $(epscan_OBJECTS) $(epscan_LDADD) $(LIBS)
7b0d192
 psiphi$(EXEEXT): $(psiphi_OBJECTS) $(psiphi_DEPENDENCIES) $(EXTRA_psiphi_DEPENDENCIES) 
7b0d192
 	@rm -f psiphi$(EXEEXT)
7b0d192
 	$(LINK) $(psiphi_OBJECTS) $(psiphi_LDADD) $(LIBS)
7b0d192
@@ -4748,7 +4748,7 @@ distclean-compile:
7b0d192
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prophecy.Po@am__quote@
7b0d192
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prophet.Po@am__quote@
7b0d192
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prosextract.Po@am__quote@
7b0d192
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pscan.Po@am__quote@
7b0d192
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epscan.Po@am__quote@
7b0d192
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psiphi.Po@am__quote@
7b0d192
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rebaseextract.Po@am__quote@
7b0d192
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recoder.Po@am__quote@