[med-svn] [Git][med-team/daligner][master] 6 commits: routine-update: New upstream version

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Sat Dec 30 10:41:01 GMT 2023



Étienne Mollier pushed to branch master at Debian Med / daligner


Commits:
aae9505f by Étienne Mollier at 2023-12-30T11:25:16+01:00
routine-update: New upstream version

- - - - -
6ccb5459 by Étienne Mollier at 2023-12-30T11:26:10+01:00
New upstream version 1.0+git20231217.518d4c2
- - - - -
591967a3 by Étienne Mollier at 2023-12-30T11:26:10+01:00
Update upstream source from tag 'upstream/1.0+git20231217.518d4c2'

Update to upstream version '1.0+git20231217.518d4c2'
with Debian dir 22230a7c9fca5c58df89962131189951ea294033
- - - - -
bd766493 by Étienne Mollier at 2023-12-30T11:32:08+01:00
cross.patch: document issue open that would ease crossbuilds.

- - - - -
3e93b8be by Étienne Mollier at 2023-12-30T11:39:32+01:00
typos.patch: forwarded upstream.

- - - - -
518386ee by Étienne Mollier at 2023-12-30T11:40:10+01:00
ready to upload to unstable.

- - - - -


6 changed files:

- LAshow.c
- align.c
- align.h
- debian/changelog
- debian/patches/cross.patch
- debian/patches/typos.patch


Changes:

=====================================
LAshow.c
=====================================
@@ -22,7 +22,7 @@
 #include "align.h"
 
 static char *Usage[] =
-    { "[-caroUF] [-i<int(4)>] [-w<int(100)>] [-b<int(10)>] ",
+    { "[-caroU] [-i<int(4)>] [-w<int(100)>] [-b<int(10)>] ",
       "    <src1:db|dam> [ <src2:db|dam> ] <align:las> [ <reads:FILE> | <reads:range> ... ]"
     };
 
@@ -39,17 +39,19 @@ int main(int argc, char *argv[])
   Alignment _aln, *aln = &_aln;
 
   FILE   *input;
-  int     sameDB;
   int64   novl;
   int     tspace, tbytes, small;
   int     reps, *pts;
   int     input_pts;
 
   int     ALIGN, CARTOON, REFERENCE, OVERLAP;
-  int     FLIP, MAP;
   int     INDENT, WIDTH, BORDER, UPPERCASE;
   int     ISTWO;
 
+  int     dam1, dam2;
+  int    *amap, *alen, *actg, nascaff, amaxlen, actgmax;
+  int    *bmap, *blen, *bctg, nbscaff, bmaxlen, bctgmax;
+
   //  Process options
 
   { int    i, j, k;
@@ -67,7 +69,7 @@ int main(int argc, char *argv[])
       if (argv[i][0] == '-')
         switch (argv[i][1])
         { default:
-            ARG_FLAGS("caroUFM")
+            ARG_FLAGS("caroU")
             break;
           case 'i':
             ARG_NON_NEGATIVE(INDENT,"Indent")
@@ -88,8 +90,6 @@ int main(int argc, char *argv[])
     REFERENCE = flags['r'];
     OVERLAP   = flags['o'];
     UPPERCASE = flags['U'];
-    FLIP      = flags['F'];
-    MAP       = flags['M'];
 
     if (argc <= 2)
       { fprintf(stderr,"Usage: %s %s\n",Prog_Name,Usage[0]);
@@ -111,29 +111,28 @@ int main(int argc, char *argv[])
 
   //  Open trimmed DB or DB pair
 
-  { int   status;
-    char *pwd, *root;
+  { char *pwd, *root;
     FILE *input;
+    int   s, r;
     struct stat stat1, stat2;
 
     ISTWO  = 0;
-    status = Open_DB(argv[1],db1);
-    if (status < 0)
+    dam1   = Open_DB(argv[1],db1);
+    if (dam1 < 0)
       exit (1);
     if (db1->part > 0)
       { fprintf(stderr,"%s: Cannot be called on a block: %s\n",Prog_Name,argv[1]);
         exit (1);
       }
 
-    sameDB = 1;
     if (argc > 3)
       { pwd   = PathTo(argv[3]);
         root  = Root(argv[3],".las");
         if ((input = fopen(Catenate(pwd,"/",root,".las"),"r")) != NULL)
           { ISTWO = 1;
             fclose(input);
-            status = Open_DB(argv[2],db2);
-            if (status < 0)
+            dam2 = Open_DB(argv[2],db2);
+            if (dam2 < 0)
               exit (1);
             if (db2->part > 0)
               { fprintf(stderr,"%s: Cannot be called on a block: %s\n",Prog_Name,argv[2]);
@@ -141,18 +140,93 @@ int main(int argc, char *argv[])
               }
            stat(Catenate(db1->path,"","",".idx"),&stat1);
            stat(Catenate(db2->path,"","",".idx"),&stat2);
-           if (stat1.st_ino != stat2.st_ino)
-             sameDB = 0;
-            Trim_DB(db2);
+           if (stat1.st_ino == stat2.st_ino)
+             { db2   = db1;
+               dam2  = dam1;
+               ISTWO = 0;
+             }
+           else
+             Trim_DB(db2);
           }
         else
-          db2 = db1;
+          { db2  = db1;
+            dam2 = dam1;
+          }
         free(root);
         free(pwd);
       }
     else
-      db2 = db1;
+      { db2  = db1;
+        dam2 = dam1;
+      }
     Trim_DB(db1);
+
+    if (dam1)
+      { amap = (int *) Malloc(sizeof(int)*3*db1->treads,"Allocating scaffold map");
+        if (amap == NULL)
+          exit (1);
+        alen = amap + db1->treads;
+        actg = alen + db1->treads;
+
+        s = -1;
+        amaxlen = 0;
+        for (r = 0; r < db1->treads; r++)
+          { if (db1->reads[r].fpulse == 0)
+              { s += 1;
+                actg[s] = r;
+              }
+            alen[s] = db1->reads[r].fpulse + db1->reads[r].rlen;
+            amap[r] = s;
+            if (alen[s] > amaxlen)
+              amaxlen = alen[s];
+          }
+        nascaff = s+1;
+        actgmax = 0;
+        for (r = db1->treads-1; r >= 0; r--)
+          { alen[r] = alen[amap[r]];
+            actg[r] = r - actg[amap[r]];
+            if (actg[r] > actgmax)
+              actgmax = actg[r];
+          }
+      }
+    if (dam2)
+      { if ( ISTWO)
+          { bmap = (int *) Malloc(sizeof(int)*3*db2->treads,"Allocating scaffold map");
+            if (bmap == NULL)
+              exit (1);
+            blen = bmap + db2->treads;
+            bctg = blen + db2->treads;
+
+            s = -1;
+            bmaxlen = 0;
+            for (r = 0; r < db2->treads; r++)
+              { if (db2->reads[r].fpulse == 0)
+                  { s += 1;
+                    bctg[s] = r;
+                  }
+                blen[s] = db2->reads[r].fpulse + db2->reads[r].rlen;
+                bmap[r] = s;
+                if (blen[s] > bmaxlen)
+                  bmaxlen = blen[s];
+              }
+            nbscaff = s+1;
+            bctgmax = 0;
+            for (r = db2->treads-1; r >= 0; r--)
+              { blen[r] = blen[bmap[r]];
+                bctg[r] = r - bctg[bmap[r]];
+                if (bctg[r] > bctgmax)
+                  bctgmax = bctg[r];
+              }
+          }
+        else
+          { bmap = amap;
+            blen = alen;
+            bctg = actg;
+            nbscaff = nascaff;
+            bctgmax = actgmax;
+            bmaxlen = amaxlen;
+          }
+      }
   }
 
   //  Process read index arguments into a sorted list of read ranges
@@ -327,9 +401,13 @@ int main(int argc, char *argv[])
     int        in, npt, idx, ar;
     int64      tps;
 
+    int        aread, bread;
+    int        aoffs, boffs;
+    int        alens, blens;
     char      *abuffer, *bbuffer;
     int        ar_wide, br_wide;
     int        ai_wide, bi_wide;
+    int        ac_wide, bc_wide;
     int        mn_wide, mx_wide;
     int        tp_wide;
     int        blast, match, seen, lhalf, rhalf;
@@ -355,12 +433,26 @@ int main(int argc, char *argv[])
     npt = pts[0];
     idx = 1;
 
-    ar_wide = Number_Digits((int64) db1->nreads);
-    br_wide = Number_Digits((int64) db2->nreads);
-    ai_wide = Number_Digits((int64) db1->maxlen);
-    bi_wide = Number_Digits((int64) db2->maxlen);
+    if (dam1)
+      { ar_wide = Number_Digits((int64) nascaff);
+        ai_wide = Number_Digits((int64) amaxlen);
+        ac_wide = Number_Digits((int64) actgmax);
+      }
+    else
+      { ar_wide = Number_Digits((int64) db1->nreads);
+        ai_wide = Number_Digits((int64) db1->maxlen);
+      }
+    if (dam2)
+      { br_wide = Number_Digits((int64) nbscaff);
+        bi_wide = Number_Digits((int64) bmaxlen);
+        bc_wide = Number_Digits((int64) bctgmax);
+      }
+    else
+      { br_wide = Number_Digits((int64) db2->nreads);
+        bi_wide = Number_Digits((int64) db2->maxlen);
+      }
     if (db1->maxlen < db2->maxlen)
-      { mn_wide = ai_wide;
+      { mn_wide = Number_Digits((int64) db1->maxlen);
         mx_wide = bi_wide;
         if (tspace > 0)
           tp_wide = Number_Digits((int64) db1->maxlen/tspace+2);
@@ -368,7 +460,7 @@ int main(int argc, char *argv[])
           tp_wide = 0;
       }
     else
-      { mn_wide = bi_wide;
+      { mn_wide = Number_Digits((int64) db2->maxlen);
         mx_wide = ai_wide;
         if (tspace > 0)
           tp_wide = Number_Digits((int64) db2->maxlen/tspace+2);
@@ -382,12 +474,6 @@ int main(int argc, char *argv[])
     mn_wide += (mn_wide-1)/3;
     tp_wide += (tp_wide-1)/3;
 
-    if (FLIP)
-      { int x;
-        x = ar_wide; ar_wide = br_wide; br_wide = x;
-        x = ai_wide; ai_wide = bi_wide; bi_wide = x;
-      }
-
     //  For each record do
 
     blast = -1;
@@ -408,18 +494,21 @@ int main(int argc, char *argv[])
         ovl->path.trace = (void *) trace;
         Read_Trace(input,ovl,tbytes);
 
-        if (ovl->aread >= db1->nreads)
+        aread = ovl->aread;
+        bread = ovl->bread;
+
+        if (aread >= db1->nreads)
           { fprintf(stderr,"%s: A-read is out-of-range of DB %s\n",Prog_Name,argv[1]);
             exit (1);
           }
-        if (ovl->bread >= db2->nreads)
+        if (bread >= db2->nreads)
           { fprintf(stderr,"%s: B-read is out-of-range of DB %s\n",Prog_Name,argv[1+ISTWO]);
             exit (1);
           }
 
         //  Determine if it should be displayed
 
-        ar = ovl->aread+1;
+        ar = aread+1;
         if (in)
           { while (ar > npt)
               { npt = pts[idx++];
@@ -443,44 +532,36 @@ int main(int argc, char *argv[])
         if (!in)
           continue;
 
-        //  If -o check display only overlaps
-
-        aln->alen  = db1->reads[ovl->aread].rlen;
-        aln->blen  = db2->reads[ovl->bread].rlen;
+        aln->alen  = db1->reads[aread].rlen;
+        aln->blen  = db2->reads[bread].rlen;
+        if (dam1)
+          { aoffs = db1->reads[aread].fpulse;
+            alens = alen[aread];
+          }
+        else
+          { aoffs = 0;
+            alens = aln->alen;
+          }
+        if (dam2)
+          { boffs = db2->reads[bread].fpulse;
+            blens = blen[bread];
+          }
+        else
+          { boffs = 0;
+            blens = aln->blen;
+          }
         aln->flags = ovl->flags;
         tps        = ovl->path.tlen/2;
 
+        //  If -o check display only overlaps
+
         if (OVERLAP)
-          { if (ovl->path.abpos != 0 && ovl->path.bbpos != 0)
+          { if (ovl->path.abpos+aoffs != 0 && ovl->path.bbpos+boffs != 0)
               continue;
-            if (ovl->path.aepos != aln->alen && ovl->path.bepos != aln->blen)
+            if (ovl->path.aepos+aoffs != alens && ovl->path.bepos+boffs != blens)
               continue;
           }
 
-        //  If -M option then check the completeness of the implied mapping
-
-        if (MAP)
-          { while (ovl->bread != blast)
-              { if (!match && seen && !(lhalf && rhalf))
-                  { printf("Missing ");
-                    Print_Number((int64) blast+1,br_wide+1,stdout);
-                    printf(" %d ->%lld\n",db2->reads[blast].rlen,db2->reads[blast].coff);
-                  }
-                match = 0;
-                seen  = 0; 
-                lhalf = rhalf = 0;
-                blast += 1;
-              }
-            seen = 1;
-            if (ovl->path.abpos == 0)
-              rhalf = 1;
-            if (ovl->path.aepos == aln->alen)
-              lhalf = 1;
-            if (ovl->path.bbpos != 0 || ovl->path.bepos != aln->blen)
-              continue;
-            match = 1;
-          }
-
         //  Display it
             
         if (ALIGN || CARTOON || REFERENCE)
@@ -493,47 +574,49 @@ int main(int argc, char *argv[])
         else if (CHAIN_NEXT(ovl->flags))
           printf(" -");
 
-        if (FLIP)
-          { Flip_Alignment(aln,0);
-            Print_Number((int64) ovl->bread+1,ar_wide+1,stdout);
-            printf("  ");
-            Print_Number((int64) ovl->aread+1,br_wide+1,stdout);
+        if (dam1)
+          { Print_Number((int64) amap[aread]+1,ar_wide+1,stdout);
+            printf(".%0*d",ac_wide,actg[aread]+1);
           }
         else
-          { Print_Number((int64) ovl->aread+1,ar_wide+1,stdout);
-            printf("  ");
-            Print_Number((int64) ovl->bread+1,br_wide+1,stdout);
+          Print_Number((int64) aread+1,ar_wide+1,stdout);
+        printf("  ");
+        if (dam2)
+          { Print_Number((int64) bmap[bread]+1,br_wide+1,stdout);
+            printf(".%0*d",bc_wide,bctg[bread]+1);
           }
+        else
+          Print_Number((int64) bread+1,br_wide+1,stdout);
         if (COMP(ovl->flags))
           printf(" c");
         else
           printf(" n");
-        if (ovl->path.abpos == 0)
+        if (ovl->path.abpos+aoffs == 0)
           printf("   <");
         else
           printf("   [");
-        Print_Number((int64) ovl->path.abpos,ai_wide,stdout);
+        Print_Number((int64) ovl->path.abpos+aoffs,ai_wide,stdout);
         printf("..");
-        Print_Number((int64) ovl->path.aepos,ai_wide,stdout);
-        if (ovl->path.aepos == aln->alen)
+        Print_Number((int64) ovl->path.aepos+aoffs,ai_wide,stdout);
+        if (ovl->path.aepos+aoffs == alens)
           printf("> x ");
         else
           printf("] x ");
-        if (ovl->path.bbpos == 0)
+        if (ovl->path.bbpos+boffs == 0)
           printf("<");
         else
           printf("[");
         if (COMP(ovl->flags))
-          { Print_Number((int64) (aln->blen - ovl->path.bbpos),bi_wide,stdout);
+          { Print_Number((int64) (blens - (ovl->path.bbpos+boffs)),bi_wide,stdout);
             printf("..");
-            Print_Number((int64) (aln->blen - ovl->path.bepos),bi_wide,stdout);
+            Print_Number((int64) (blens - (ovl->path.bepos+boffs)),bi_wide,stdout);
           }
         else
-          { Print_Number((int64) ovl->path.bbpos,bi_wide,stdout);
+          { Print_Number((int64) ovl->path.bbpos+boffs,bi_wide,stdout);
             printf("..");
-            Print_Number((int64) ovl->path.bepos,bi_wide,stdout);
+            Print_Number((int64) ovl->path.bepos+boffs,bi_wide,stdout);
           }
-        if (ovl->path.bepos == aln->blen)
+        if (ovl->path.bepos+boffs == blens)
           printf(">");
         else
           printf("]");
@@ -542,9 +625,9 @@ int main(int argc, char *argv[])
           printf("  ~  %5.2f%% ",(200.*ovl->path.diffs) /
                  ((ovl->path.aepos - ovl->path.abpos) + (ovl->path.bepos - ovl->path.bbpos)) );
         printf("  (");
-        Print_Number(aln->alen,ai_wide,stdout);
+        Print_Number(alens,ai_wide,stdout);
         printf(" x ");
-        Print_Number(aln->blen,bi_wide,stdout);
+        Print_Number(blens,bi_wide,stdout);
         printf(" bps,");
         if (CARTOON)
           { Print_Number(tps,tp_wide,stdout);
@@ -564,12 +647,10 @@ int main(int argc, char *argv[])
                 int   bmin,  bmax;
                 int   self;
 
-                if (FLIP)
-                  Flip_Alignment(aln,0);
                 if (small)
                   Decompress_TraceTo16(ovl);
 
-                self = sameDB && (ovl->aread == ovl->bread) && !COMP(ovl->flags);
+                self = (ISTWO == 0) && (aread == bread) && !COMP(ovl->flags);
 
                 amin = ovl->path.abpos - BORDER;
                 if (amin < 0) amin = 0;
@@ -594,9 +675,9 @@ int main(int argc, char *argv[])
                       }
                   }
 
-                aseq = Load_Subread(db1,ovl->aread,amin,amax,abuffer,0);
+                aseq = Load_Subread(db1,aread,amin,amax,abuffer,0);
                 if (!self)
-                  bseq = Load_Subread(db2,ovl->bread,bmin,bmax,bbuffer,0);
+                  bseq = Load_Subread(db2,bread,bmin,bmax,bbuffer,0);
                 else
                   bseq = aseq;
 
@@ -614,17 +695,28 @@ int main(int argc, char *argv[])
                   Compute_Trace_IRR(aln,work,GREEDIEST);
                 else
                   Compute_Trace_PTS(aln,work,tspace,GREEDIEST);
+              }
 
-                if (FLIP)
-                  { if (COMP(aln->flags))
-                      { Complement_Seq(aseq,amax-amin);
-                        Complement_Seq(bseq,bmax-bmin);
-                        aln->aseq = aseq - (aln->alen - amax);
-                        aln->bseq = bseq - bmin;
-                      }
-                    Flip_Alignment(aln,1);
-                  }
+            aln->path->abpos += aoffs;
+            aln->path->aepos += aoffs;
+            aln->alen = alens;
+            aln->path->bbpos += boffs;
+            aln->path->bepos += boffs;
+            aln->blen = blens;
+            if (ALIGN || REFERENCE)
+              { int *trace = aln->path->trace;
+                int  tlen  = aln->path->tlen;
+                int  i;
+
+                aln->aseq -= aoffs;
+                aln->bseq -= boffs;
+                for (i = 0; i < tlen; i++)
+                  if (trace[i] < 0)
+                    trace[i] -= aoffs;
+                  else
+                    trace[i] += boffs;
               }
+
             if (CARTOON)
               Alignment_Cartoon(stdout,aln,INDENT,mx_wide);
             if (REFERENCE)
@@ -642,6 +734,9 @@ int main(int argc, char *argv[])
       }
   }
 
+  if (ISTWO && dam2)
+    free(bmap);
+  free(amap);
   Close_DB(db1);
   if (ISTWO)
     Close_DB(db2);


=====================================
align.c
=====================================
@@ -163,6 +163,8 @@ void Free_Work_Data(Work_Data *ework)
                          //     2*TRIM_LEN edits are prefix-positive at rate ave_corr*f(bias)
                          //     (max value is 20)
 
+#define DUB_TRIM    45   //  = 3*TRIM_LEN
+
 #define PATH_LEN    60   //  Follow the last PATH_LEN columns/edges (max value is 63)
 
   //  Derivative fixed parameters
@@ -236,6 +238,8 @@ Align_Spec *New_Align_Spec(double ave_corr, int trace_space, float *freq, int re
   spec->freq[3]     = freq[3];
 
   match = freq[0] + freq[3];
+  if ((match <= 0.) == (match > 0.))   //  frequencies accidentally undefined?
+    match = .5;
   if (match > .5)
     match = 1.-match;
   bias = (int) ((match+.025)*20.-1.);
@@ -1729,6 +1733,7 @@ Path *Local_Alignment(Alignment *align, Work_Data *ework, Align_Spec *espec,
   int   aoff, boff;
   int   minp, maxp;
   int   selfie;
+  int   fshort, rshort;
 
   { int alen, blen;
     int maxtp, wsize;
@@ -1765,6 +1770,9 @@ Path *Local_Alignment(Alignment *align, Work_Data *ework, Align_Spec *espec,
 #endif
 
   selfie = (align->aseq == align->bseq);
+
+  while (((anti-hgh) >> 1) < 0)
+    hgh -= 1;
    
   if (lbord < 0)
     { if (selfie && low >= 0)
@@ -1799,9 +1807,11 @@ Path *Local_Alignment(Alignment *align, Work_Data *ework, Align_Spec *espec,
   if (forward_wave(work,spec,align,bpath,&low,hgh,anti,minp,maxp,aoff,boff))
     EXIT(NULL);
 
+  fshort = ((apath->aepos + apath->bepos) - anti < DUB_TRIM);
+
 #ifdef DEBUG_PASSES
   printf("F1 (%d,%d) ~ %d => (%d,%d) %d\n",
-         (2*anti+(low+hgh))/4,(anti-(low+hgh))/4,hgh-low,
+         (2*anti+(low+hgh))/4,(2*anti-(low+hgh))/4,hgh-low,
          apath->aepos,apath->bepos,apath->diffs);
 #endif
 
@@ -1813,6 +1823,37 @@ Path *Local_Alignment(Alignment *align, Work_Data *ework, Align_Spec *espec,
          (anti+low)/2,(anti-low)/2,apath->abpos,apath->bbpos,apath->diffs);
 #endif
 
+  rshort = (anti - (apath->abpos + apath->bbpos) < DUB_TRIM);
+
+  if (fshort)
+    { if (rshort)
+        { apath->aepos = apath->abpos = (apath->abpos+apath->aepos)/2;
+          apath->bepos = apath->bbpos = (apath->bbpos+apath->bepos)/2;
+          bpath->aepos = bpath->abpos = (bpath->abpos+bpath->aepos)/2;
+          bpath->bepos = bpath->bbpos = (bpath->bbpos+bpath->bepos)/2;
+          apath->tlen  = 0;
+          bpath->tlen  = 0;
+        }
+      else
+        { low  = apath->abpos - apath->bbpos;
+          anti = apath->abpos + apath->bbpos;
+          apath->tlen = bpath->tlen = 0;
+          if (forward_wave(work,spec,align,bpath,&low,low,anti,minp,maxp,aoff,boff))
+            EXIT(NULL);
+        }
+    }
+  else
+    { if (rshort)
+        { low  = apath->aepos - apath->bepos;
+          anti = apath->aepos + apath->bepos;
+          apath->tlen = bpath->tlen = 0;
+          apath->diffs = 0;
+          if (reverse_wave(work,spec,align,bpath,low,low,anti,minp,maxp,aoff,boff))
+            EXIT(NULL);
+        }
+    }
+        
+
   bpath->diffs = apath->diffs;
   if (ACOMP(align->flags))
     { uint16 *trace = (uint16 *) apath->trace;
@@ -3389,19 +3430,18 @@ int Print_Alignment(FILE *file, Alignment *align, Work_Data *ework,
   b = align->bseq - 1;
 
   o  = 0;
-  i = j = 1;
+  i = align->path->abpos;
+  j = align->path->bbpos;
 
-  prefa = align->path->abpos;
-  prefb = align->path->bbpos;
+  prefa = 0;
+  for (prefa = 0; prefa < border && a[i] != 4; prefa++)
+    i -= 1;
+  i += 1;
 
-  if (prefa > border)
-    { i = prefa-(border-1);
-      prefa = border;
-    }
-  if (prefb > border)
-    { j = prefb-(border-1);
-      prefb = border;
-    }
+  prefb = 0;
+  for (prefb = 0; prefb < border && b[j] != 4; prefb++)
+    j -= 1;
+  j += 1;
 
   sa   = i-1;
   sb   = j-1;
@@ -3652,19 +3692,18 @@ int Print_Reference(FILE *file, Alignment *align, Work_Data *ework,
   b = align->bseq - 1;
 
   o  = 0;
-  i = j = 1;
-
-  prefa = align->path->abpos;
-  prefb = align->path->bbpos;
-
-  if (prefa > border)
-    { i = prefa-(border-1);
-      prefa = border;
-    }
-  if (prefb > border)
-    { j = prefb-(border-1);
-      prefb = border;
-    }
+  i = align->path->abpos;
+  j = align->path->bbpos;
+
+  prefa = 0;
+  for (prefa = 0; prefa < border && a[i] != 4; prefa++)
+    i -= 1;
+  i += 1;
+
+  prefb = 0;
+  for (prefb = 0; prefb < border && b[j] != 4; prefb++)
+    j -= 1;
+  j += 1;
 
   s0   = i;
   sa   = i-1;


=====================================
align.h
=====================================
@@ -99,12 +99,12 @@ typedef struct
 
      An alignment is modeled by an Alignment record, which in addition to a *pointer* to a
      'path', gives pointers to the A and B sequences, their lengths, and indicates whether
-     the B-sequence needs to be complemented ('comp' non-zero if so).  The 'trace' pointer
-     of the 'path' subrecord can be either NULL, a list of pass-through points, or an exact
+     the B- or A-sequence needs to be complemented ('comp' non-zero if so).  The 'trace' pointer
+     of the 'path' subrecord can be either NULL, a list of trace points, or an exact
      trace depending on what routines have been called on the record.
 
      One can (1) compute a trace, with Compute_Trace, either from scratch if 'path.trace' = NULL,
-     or using the sequence of pass-through points in trace, (2) print an ASCII representation
+     or using the sequence of trace points in trace, (2) print an ASCII representation
      of an alignment, or (3) reverse the roles of A and B, and (4) complement a sequence
      (which is a reversible process).
 
@@ -209,8 +209,8 @@ void Complement_Seq(char *a, int n);
        (b) it passes through one of the points (anti+k)/2,(anti-k)/2 for k in [low,hgh] within
              the underlying dynamic programming matrix (i.e. the points on diagonals low to hgh
              on anti-diagonal anti or anti-1 (depending on whether the diagonal is odd or even)),
-       (c) if lbord >= 0, then the alignment is always above diagonal low-lbord, and
-       (d) if hbord >= 0, then the alignment is always below diagonal hgh+hbord.
+       (c) if lbord >= 0, then the alignment is always above or on diagonal low-lbord, and
+       (d) if hbord >= 0, then the alignment is always below or on diagonal hgh+hbord.
 
      The path record of 'align' has its 'trace' filled from the point of view of an overlap
      between the aread and the bread.  In addition a Path record from the point of view of the
@@ -244,7 +244,7 @@ void Complement_Seq(char *a, int n);
 
      Compute_Trace_PTS computes a trace by computing the trace between successive trace points.
      It is much, much faster than Compute_Alignment below but at the tradeoff of not necessarily
-     being optimal as pass-through points are not all perfect.  Compute_Trace_MID computes a trace
+     being optimal as trace points are not all perfect.  Compute_Trace_MID computes a trace
      by computing the trace between the mid-points of alignments between two adjacent pairs of trace
      points.  It is generally twice as slow as Compute_Trace_PTS, but it produces nearer optimal
      alignments.  Both these routines return 1 if an error occurred and 0 otherwise.
@@ -307,7 +307,8 @@ void Complement_Seq(char *a, int n);
 
      Flip_Alignment modifies align so the roles of A and B are reversed.  If full is off then
      the trace is ignored, otherwise the trace must be to a full alignment trace and this trace
-     is also appropriately inverted.
+     is also appropriately inverted.  Similarly, Complement_Alignment switches which sequence
+     is complemented when an alignment involves said, and does nothing otherwise.
   */
 
   void Alignment_Cartoon(FILE *file, Alignment *align, int indent, int coord);


=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+daligner (1.0+git20231217.518d4c2-1) unstable; urgency=medium
+
+  * New upstream version
+  * cross.patch: document issue open that would ease crossbuilds.
+  * typos.patch: forwarded upstream.
+
+ -- Étienne Mollier <emollier at debian.org>  Sat, 30 Dec 2023 11:39:48 +0100
+
 daligner (1.0+git20230620.f9a35a8-1) unstable; urgency=medium
 
   * New upstream version 1.0+git20230620.f9a35a8


=====================================
debian/patches/cross.patch
=====================================
@@ -1,6 +1,7 @@
 Date: Sat, 15 Aug 2020 07:24:26 +0200
 From: Helmut Grohne <helmut at subdivi.de>
 Description: Do not hard code gcc
+Bug: https://github.com/thegenemyers/DALIGNER/pull/54
 Bug-Debian: https://bugs.debian.org/968434
 
 --- a/Makefile


=====================================
debian/patches/typos.patch
=====================================
@@ -1,6 +1,6 @@
 Description: fix a couple of typos caught by lintian.
 Author: Étienne Mollier <emollier at debian.org>
-Forwarded: no
+Forwarded: https://github.com/thegenemyers/DALIGNER/pull/95
 Last-Update: 2023-07-20
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/



View it on GitLab: https://salsa.debian.org/med-team/daligner/-/compare/f3b985d7f529118c592576dd36926f553c8cc845...518386eef4e6d13464270b59d0fc5839676e0860

-- 
View it on GitLab: https://salsa.debian.org/med-team/daligner/-/compare/f3b985d7f529118c592576dd36926f553c8cc845...518386eef4e6d13464270b59d0fc5839676e0860
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20231230/32c15830/attachment-0001.htm>


More information about the debian-med-commit mailing list