~ubuntu-branches/ubuntu/feisty/ncbi-tools6/feisty

« back to all changes in this revision

Viewing changes to sequin/sequin9.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
*
30
30
* Version Creation Date:   4/20/99
31
31
*
32
 
* $Revision: 6.423 $
 
32
* $Revision: 6.427 $
33
33
*
34
34
* File Description: 
35
35
*
385
385
  if (bsp == NULL) return;
386
386
  if (! ISA_na (bsp->mol)) return;
387
387
 
388
 
  desc = ValNodeNew (NULL);
 
388
  desc = SeqDescrNew (NULL);
389
389
  desc->choice = Annot_descr_name;
390
390
  desc->data.ptrvalue = StringSave ("cutsites");
391
391
 
12734
12734
    /* If either sequence is not raw and not indexer version, do not allow sequence update */
12735
12735
    return FALSE;
12736
12736
  }  
12737
 
  else if ((upp->salp == NULL || ignore_alignment) && action == eSequenceUpdatePatch)
 
12737
  else if (action == eSequenceUpdatePatch
 
12738
           && (upp->salp == NULL || ignore_alignment 
 
12739
             || (! RawSequencePatchOk (upp->orig_bsp, upp->update_bsp)
 
12740
                 && !DeltaSequencePatchOk (upp->orig_bsp, upp->update_bsp))))
12738
12741
  {
12739
 
    /* If no alignment then disable the patch button */
 
12742
    /* If no alignment or patch not available then disable the patch button */
12740
12743
    return FALSE;
12741
12744
  }
12742
12745
  else if (ignore_alignment 
13617
13620
    ch1 = dlg->aln2 [j];
13618
13621
    if (ch1 != '-') {
13619
13622
      if (dlg->revcomp) {
13620
 
        realpos = (dlg->uald.old5 + dlg->uald.olda + dlg->uald.old3 - pos - 1);
 
13623
        realpos = (dlg->uald.new5 + dlg->uald.newa + dlg->uald.new3 - pos - 1);
13621
13624
      } else {
13622
13625
        realpos = pos;
13623
13626
      }
15317
15320
{
15318
15321
  SeqIdPtr sip_next;
15319
15322
  Char     id_txt1 [128], id_txt2 [128];
 
15323
  CharPtr  ptr;
 
15324
  Int4     len;
15320
15325
  
15321
15326
  if (sip == NULL || sip_list == NULL || sip->choice != SEQID_LOCAL)
15322
15327
  {
15337
15342
      {
15338
15343
        return TRUE;
15339
15344
      }
 
15345
      ptr = StringChr (id_txt2, '.');
 
15346
      if (ptr != NULL)  /* ID in list has version */
 
15347
      {
 
15348
        len = StringLen (id_txt1);
 
15349
        if (len == ptr - id_txt2 && StringNCmp (id_txt1, id_txt2, len) == 0)
 
15350
        {
 
15351
          return TRUE;
 
15352
        }
 
15353
      }
15340
15354
    }
15341
15355
    sip_list = sip_list->next;
15342
15356
  }
17223
17237
  Char                       path [PATH_MAX];
17224
17238
  ReadBufferData             rbd;
17225
17239
  CharPtr                    line, ptr;
17226
 
  SeqIdPtr                   sip_orig, sip_update;
 
17240
  SeqIdPtr                   sip_1, sip_2, sip_orig, sip_update;
17227
17241
  BioseqPtr                  bsp_orig, bsp_update;
17228
17242
  Int4                       orig_position, update_position;
17229
17243
  ValNodePtr                 update_vnp;
17255
17269
    ptr += StringCSpn (ptr, "\t ");
17256
17270
    if (*ptr != 0 && ptr != line)
17257
17271
    {
 
17272
      /* truncate string after first ID */
17258
17273
      *ptr = '\0';
17259
 
      /* original ID first on line, followed by tab, followed by update ID */
17260
 
      sip_orig = MakeSeqID (line);
17261
 
      sip_update = MakeSeqID (ptr + 1);
17262
 
      
17263
 
      bsp_orig = FindBioseqInList (usfp->no_updates_list, sip_orig, &orig_position);
17264
 
      bsp_update = FindBioseqInList (usfp->unmatched_updates_list, sip_update, &update_position);
 
17274
      ptr++;
 
17275
      /* skip over any white space before second ID */
 
17276
      ptr += StringSpn (ptr, "\t ");
 
17277
      /* truncate trailing white space */
 
17278
      while (*(ptr + StringLen (ptr) - 1) == ' ' || *(ptr + StringLen (ptr) - 1) == '\t')
 
17279
      {
 
17280
        *(ptr + StringLen (ptr) - 1) = 0;
 
17281
      }
 
17282
      
 
17283
      sip_1 = MakeSeqID (line);
 
17284
      sip_2 = MakeSeqID (ptr);
 
17285
      
 
17286
      /* try to determine which is original and which is update */
 
17287
      bsp_orig = FindBioseqInList (usfp->no_updates_list, sip_1, &orig_position);
 
17288
      bsp_update = FindBioseqInList (usfp->unmatched_updates_list, sip_2, &update_position);
 
17289
      if (bsp_orig == NULL && bsp_update == NULL)
 
17290
      {
 
17291
        bsp_orig = FindBioseqInList (usfp->no_updates_list, sip_2, &orig_position);
 
17292
        bsp_update = FindBioseqInList (usfp->unmatched_updates_list, sip_1, &update_position);
 
17293
        sip_orig = sip_2;
 
17294
        sip_update = sip_1;
 
17295
      }
 
17296
      else
 
17297
      {
 
17298
        sip_orig = sip_1;
 
17299
        sip_update = sip_2;
 
17300
      }
 
17301
 
17265
17302
      if (bsp_orig != NULL && bsp_update != NULL)
17266
17303
      {
17267
17304
        /* remove Bioseq from no update list and add to list of originals */