~ubuntu-branches/ubuntu/saucy/ncbi-tools6/saucy-proposed

« back to all changes in this revision

Viewing changes to sequin/sequin3.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2009-08-11 22:03:47 UTC
  • mfrom: (1.4.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20090811220347-g4b6lzdvphvvbpiu
* New upstream release.
* debian/libncbi6.symbols: update accordingly.
* debian/control: clean up obsolete or redundant relationship declarations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
*
30
30
* Version Creation Date:   1/22/95
31
31
*
32
 
* $Revision: 6.960 $
 
32
* $Revision: 6.978 $
33
33
*
34
34
* File Description: 
35
35
*
78
78
#include <objmacro.h>
79
79
#include <macrodlg.h>
80
80
#include <macroapi.h>
 
81
#include <valdlg.h>
81
82
 
82
83
/* For converting primer names to primer seqs and vice versa */
83
84
static void PrimerSeqToPrimerNameCallback (BioSourcePtr biop, Pointer userdata)
189
190
}
190
191
 
191
192
 
 
193
NLM_EXTERN void ReportNonTSABioseqs (BioseqPtr bsp, Pointer userdata)
 
194
{
 
195
  LogInfoPtr lip;
 
196
  Char id_str[255];
 
197
 
 
198
  if (bsp == NULL || (lip = (LogInfoPtr) userdata) == NULL || lip->fp == NULL || ISA_aa (bsp->mol)) {
 
199
    return;
 
200
  }
 
201
  if (bsp->hist == NULL || bsp->hist->assembly == NULL) {
 
202
    SeqIdWrite (SeqIdFindBest (bsp->id, SEQID_GENBANK), id_str, PRINTID_REPORT, sizeof (id_str) - 1);
 
203
    fprintf (lip->fp, "%s has no TSA table\n", id_str);
 
204
    lip->data_in_log = TRUE;
 
205
  }
 
206
}
 
207
 
 
208
 
192
209
static void AddTSATableToBioseq (IteM i)
193
210
{
194
211
  BaseFormPtr  bfp;
248
265
  ValNodeLink (&err_list, ApplyTranscriptomeIdListWithProgress (ids_list, GetSeqAlignTSA));
249
266
 
250
267
  coverage_report = ReportCoverageForTranscriptomeIdsListSeqHist (ids_list);
 
268
  ValNodeLink (&coverage_report, ReportGapsInSeqHistAlignmentsForIdsList (ids_list));
251
269
 
252
270
  ids_list = TranscriptomeIdsListFree (ids_list);
253
271
 
254
272
  ValNodeLink (&coverage_report, err_list);
255
273
  err_list = coverage_report;
256
274
 
 
275
  lip = OpenLog ("TSA Table Problems");
257
276
  if (err_list != NULL) {
258
 
    lip = OpenLog ("TSA Table Problems");
259
277
    for (vnp = err_list; vnp != NULL; vnp = vnp->next) {
260
278
      fprintf (lip->fp, "%s\n", vnp->data.ptrvalue);
261
279
    }
262
280
    lip->data_in_log = TRUE;
263
 
    CloseLog (lip);
264
 
    lip = FreeLog (lip);
265
281
    err_list = ValNodeFreeData (err_list);
266
282
  }
 
283
  VisitBioseqsInSep (sep, lip, ReportNonTSABioseqs);
 
284
  CloseLog (lip);
 
285
  lip = FreeLog (lip);
 
286
 
267
287
  ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
268
288
  ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
269
289
}
294
314
  ValNodeLink (&err_list, ApplyTranscriptomeIdListWithProgress (ids_list, GetSeqAlignTSA));
295
315
 
296
316
  coverage_report = ReportCoverageForTranscriptomeIdsListSeqHist (ids_list);
 
317
  ValNodeLink (&coverage_report, ReportGapsInSeqHistAlignmentsForIdsList (ids_list));
297
318
 
298
319
  ids_list = TranscriptomeIdsListFree (ids_list);
299
320
 
300
321
  ValNodeLink (&coverage_report, err_list);
301
322
  err_list = coverage_report;
302
323
 
 
324
 
 
325
  lip = OpenLog ("TSA Table Problems");
303
326
  if (err_list != NULL) {
304
 
    lip = OpenLog ("TSA Table Problems");
305
327
    for (vnp = err_list; vnp != NULL; vnp = vnp->next) {
306
328
      fprintf (lip->fp, "%s\n", vnp->data.ptrvalue);
307
329
    }
308
330
    lip->data_in_log = TRUE;
309
 
    CloseLog (lip);
310
 
    lip = FreeLog (lip);
311
331
    err_list = ValNodeFreeData (err_list);
312
332
  }
 
333
  VisitBioseqsInSep (sep, lip, ReportNonTSABioseqs);
 
334
  CloseLog (lip);
 
335
  lip = FreeLog (lip);
 
336
 
313
337
  ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
314
338
  ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
315
339
}
336
360
}
337
361
 
338
362
 
 
363
static void CreateTSAIDsFromTable (IteM i)
 
364
{
 
365
  BaseFormPtr  bfp;
 
366
  SeqEntryPtr  sep;
 
367
  Char         path [PATH_MAX];
 
368
  FILE         *fp;
 
369
  ValNodePtr   table, sequence_lists, err_list = NULL, vnp, vnp_rs, vnp_s, vnp_rt, vnp_t;
 
370
  MatchTypeData match;
 
371
  LogInfoPtr   lip;
 
372
  BioseqPtr    bsp;
 
373
  Int4         gpid = 0;
 
374
  SeqIdPtr     sip_new;
 
375
  DbtagPtr     dbtag;
 
376
  CharPtr      id_fmt = "gpid:%d";
 
377
 
 
378
#ifdef WIN_MAC
 
379
  bfp = currentFormDataPtr;
 
380
#else
 
381
  bfp = GetObjectExtra (i);
 
382
#endif
 
383
  if (bfp == NULL) return;
 
384
  sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
 
385
  if (sep == NULL) return;
 
386
 
 
387
  if (! GetInputFileName (path, sizeof (path), "", "TEXT")) return;
 
388
  fp = FileOpen (path, "r");
 
389
  if (fp == NULL) return;
 
390
  table = ReadTabTableFromFile (fp);
 
391
  FileClose (fp);
 
392
 
 
393
  match.choice = eTableMatchNucID;
 
394
  match.data = NULL;
 
395
  match.match_location = String_location_equals;
 
396
 
 
397
  sequence_lists = GetSequenceListsForMatchTypeInTabTable (sep, table, 0, &match, &err_list);
 
398
 
 
399
  if (err_list != NULL) {
 
400
    lip = OpenLog ("Table Problems");
 
401
    for (vnp = err_list; vnp != NULL; vnp = vnp->next) {
 
402
      fprintf (lip->fp, "%s\n", vnp->data.ptrvalue);
 
403
    }
 
404
    lip->data_in_log = TRUE;
 
405
    CloseLog (lip);
 
406
    lip = FreeLog (lip);
 
407
    err_list = ValNodeFreeData (err_list);
 
408
    if (ANS_YES != Message (MSG_YN, "Continue with table problems")) {
 
409
      sequence_lists = FreeSequenceLists(sequence_lists);
 
410
      table = FreeTabTable (table);
 
411
      return;
 
412
    }
 
413
  }
 
414
 
 
415
  WatchCursor();
 
416
  Update();
 
417
  for (vnp_rs = sequence_lists, vnp_rt = table;
 
418
       vnp_rs != NULL && vnp_rt != NULL;
 
419
       vnp_rs = vnp_rs->next, vnp_rt = vnp_rt->next) {
 
420
    vnp_s = vnp_rs->data.ptrvalue;
 
421
    vnp_t = vnp_rt->data.ptrvalue;
 
422
    if (vnp_s == NULL || vnp_t == NULL) {
 
423
      continue;
 
424
    }
 
425
    vnp_t = vnp_t->next;
 
426
    if (vnp_t == NULL || StringHasNoText (vnp_t->data.ptrvalue)) {
 
427
      continue;
 
428
    }
 
429
    while (vnp_s != NULL) {
 
430
      bsp = (BioseqPtr) vnp_s->data.ptrvalue;
 
431
      gpid = GetGenomeProjectID (bsp);
 
432
      if (gpid > 0) {
 
433
        dbtag = DbtagNew ();
 
434
        dbtag->db = MemNew (sizeof (Char) * (StringLen (id_fmt) + 15));
 
435
        sprintf (dbtag->db, id_fmt, gpid);
 
436
        dbtag->tag = ObjectIdNew ();
 
437
        dbtag->tag->str = StringSave (vnp_t->data.ptrvalue);
 
438
        sip_new = ValNodeNew (NULL);
 
439
        sip_new->choice = SEQID_GENERAL;
 
440
        sip_new->data.ptrvalue = dbtag;
 
441
        sip_new->next = bsp->id;
 
442
        bsp->id = sip_new;
 
443
        SeqMgrReplaceInBioseqIndex (bsp);
 
444
      }
 
445
      vnp_s = vnp_s->next;
 
446
    }
 
447
  }
 
448
  sequence_lists = FreeSequenceLists(sequence_lists);
 
449
  table = FreeTabTable (table);
 
450
  ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
 
451
  ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
 
452
  ArrowCursor();
 
453
  Update();
 
454
 
 
455
}
 
456
 
 
457
 
 
458
static void CreateBarcodeIDsFromLocalIDs (IteM i)
 
459
{
 
460
  BaseFormPtr  bfp;
 
461
  SeqEntryPtr  sep;
 
462
 
 
463
#ifdef WIN_MAC
 
464
  bfp = currentFormDataPtr;
 
465
#else
 
466
  bfp = GetObjectExtra (i);
 
467
#endif
 
468
  if (bfp == NULL) return;
 
469
  sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
 
470
  if (sep == NULL) return;
 
471
 
 
472
  ConvertLocalIdsToBarcodeIds (sep);
 
473
 
 
474
  ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
 
475
  ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
 
476
}
 
477
 
 
478
 
339
479
static void AddmRNASequenceCallback (SeqDescrPtr sdp, Pointer data)
340
480
{
341
481
  Int4 len, len_add;
2134
2274
  sfp1 = SeqMgrGetNextFeature (bsp, NULL, 0,h->featdef, &fcontext);
2135
2275
  while (sfp1 != NULL) {
2136
2276
    sfp2 = SeqMgrGetNextFeature (bsp, sfp1, 0, h->featdef, &fcontext);
 
2277
    if (sfp1 == sfp2) {
 
2278
      break;
 
2279
    }
2137
2280
    if (DoFeaturesMatch (sfp1, sfp2, FALSE, h->case_sensitive, h->ignore_partials)) {
2138
2281
      h->num_feat++;
2139
2282
      if (sfp2->data.choice == SEQFEAT_CDREGION && sfp2->product != NULL) {
2405
2548
 
2406
2549
  sfp = SeqMgrGetNextFeature (bsp, NULL, 0, 0, &fcontext);
2407
2550
  while (sfp != NULL) {
2408
 
    if (sfp->data.choice != SEQFEAT_GENE) {
2409
 
      grp = SeqMgrGetGeneXref (sfp);
2410
 
      if (grp != NULL && (! SeqMgrGeneIsSuppressed (grp))) {
2411
 
        sfpx = SeqMgrGetOverlappingGene (sfp->location, NULL);
2412
 
        if (sfpx != NULL && sfpx->data.choice == SEQFEAT_GENE) {
2413
 
          grpx = (GeneRefPtr) sfpx->data.value.ptrvalue;
2414
 
          if (grpx != NULL) {
2415
 
 
2416
 
            redundantgenexref = TRUE;
2417
 
            if ((!StringHasNoText (grp->locus)) && (!StringHasNoText (grpx->locus))) {
2418
 
              if ((StringICmp (grp->locus, grpx->locus) != 0)) {
2419
 
                redundantgenexref = FALSE;
2420
 
              }
2421
 
            } else if (StringDoesHaveText (grp->locus_tag) && StringDoesHaveText (grp->locus_tag)) {
2422
 
              if ((StringICmp (grp->locus_tag, grpx->locus_tag) != 0)) {
2423
 
                redundantgenexref = FALSE;
2424
 
              }
2425
 
            } else if (grp->syn != NULL && grpx->syn != NULL) {
2426
 
              syn1 = (CharPtr) grp->syn->data.ptrvalue;
2427
 
              syn2 = (CharPtr) grpx->syn->data.ptrvalue;
2428
 
              if ((!StringHasNoText (syn1)) && (!StringHasNoText (syn2))) {
2429
 
                if ((StringICmp (syn1, syn2) != 0)) {
2430
 
                  redundantgenexref = FALSE;
2431
 
                }
2432
 
              }
2433
 
            }
2434
 
 
2435
 
            if (redundantgenexref) {
2436
 
              MemSet ((Pointer) &dsd, 0, sizeof (DummySmfeData));
2437
 
              dsd.max = INT4_MAX;
2438
 
              dsd.num_at_max = 0;
2439
 
              count = SeqMgrGetAllOverlappingFeatures (sfp->location, FEATDEF_GENE, NULL, 0,
2440
 
                                                       LOCATION_SUBSET, (Pointer) &dsd, SQNDummySMFEProc);
2441
 
 
2442
 
              if (dsd.num_at_max < 2) {
2443
 
                last = (SeqFeatXrefPtr PNTR) &(sfp->xref);
2444
 
                curr = sfp->xref;
2445
 
                while (curr != NULL) {
2446
 
                  next = curr->next;
2447
 
                  if (curr->data.choice == SEQFEAT_GENE) {
2448
 
                    *last = next;
2449
 
                    curr->next = NULL;
2450
 
                    SeqFeatXrefFree (curr);
2451
 
                  } else {
2452
 
                    last = &(curr->next);
2453
 
                  }
2454
 
                  curr = next;
2455
 
                }
 
2551
    grp = SeqMgrGetGeneXref (sfp);
 
2552
    if (grp != NULL && (! SeqMgrGeneIsSuppressed (grp))) {
 
2553
      sfpx = SeqMgrGetOverlappingGene (sfp->location, NULL);
 
2554
      if (sfpx != NULL && sfpx->data.choice == SEQFEAT_GENE) {
 
2555
        grpx = (GeneRefPtr) sfpx->data.value.ptrvalue;
 
2556
        if (grpx != NULL) {
 
2557
 
 
2558
          redundantgenexref = TRUE;
 
2559
          if ((!StringHasNoText (grp->locus)) && (!StringHasNoText (grpx->locus))) {
 
2560
            if ((StringICmp (grp->locus, grpx->locus) != 0)) {
 
2561
              redundantgenexref = FALSE;
 
2562
            }
 
2563
          } else if (StringDoesHaveText (grp->locus_tag) && StringDoesHaveText (grp->locus_tag)) {
 
2564
            if ((StringICmp (grp->locus_tag, grpx->locus_tag) != 0)) {
 
2565
              redundantgenexref = FALSE;
 
2566
            }
 
2567
          } else if (grp->syn != NULL && grpx->syn != NULL) {
 
2568
            syn1 = (CharPtr) grp->syn->data.ptrvalue;
 
2569
            syn2 = (CharPtr) grpx->syn->data.ptrvalue;
 
2570
            if ((!StringHasNoText (syn1)) && (!StringHasNoText (syn2))) {
 
2571
              if ((StringICmp (syn1, syn2) != 0)) {
 
2572
                redundantgenexref = FALSE;
 
2573
              }
 
2574
            }
 
2575
          }
 
2576
 
 
2577
          if (redundantgenexref) {
 
2578
            MemSet ((Pointer) &dsd, 0, sizeof (DummySmfeData));
 
2579
            dsd.max = INT4_MAX;
 
2580
            dsd.num_at_max = 0;
 
2581
            count = SeqMgrGetAllOverlappingFeatures (sfp->location, FEATDEF_GENE, NULL, 0,
 
2582
                                                      LOCATION_SUBSET, (Pointer) &dsd, SQNDummySMFEProc);
 
2583
 
 
2584
            if (dsd.num_at_max < 2) {
 
2585
              last = (SeqFeatXrefPtr PNTR) &(sfp->xref);
 
2586
              curr = sfp->xref;
 
2587
              while (curr != NULL) {
 
2588
                next = curr->next;
 
2589
                if (curr->data.choice == SEQFEAT_GENE) {
 
2590
                  *last = next;
 
2591
                  curr->next = NULL;
 
2592
                  SeqFeatXrefFree (curr);
 
2593
                } else {
 
2594
                  last = &(curr->next);
 
2595
                }
 
2596
                curr = next;
2456
2597
              }
2457
2598
            }
2458
2599
          }
2459
2600
        }
2460
 
      } 
2461
 
    }
 
2601
      }
 
2602
    } 
2462
2603
    sfp = SeqMgrGetNextFeature (bsp, sfp, 0, 0, &fcontext);
2463
2604
  }
2464
2605
 
3096
3237
}
3097
3238
 
3098
3239
 
 
3240
static void RemoveMissingFeatureXrefsCallback (SeqFeatPtr sfp, Pointer data)
 
3241
 
 
3242
{
 
3243
  SeqFeatXrefPtr  xref, xref_next, xref_prev = NULL;
 
3244
  SeqFeatPtr      matchsfp;
 
3245
 
 
3246
  if (sfp == NULL) {
 
3247
    return;
 
3248
  }
 
3249
 
 
3250
  for (xref = sfp->xref; xref != NULL; xref = xref_next) {
 
3251
    xref_next = xref->next;
 
3252
    if (xref->id.choice != 0
 
3253
        && (matchsfp = SeqMgrGetFeatureByFeatID (sfp->idx.entityID, NULL, NULL, xref, NULL)) == NULL) {
 
3254
      if (xref_prev == NULL) {
 
3255
        sfp->xref = xref->next;
 
3256
      } else {
 
3257
        xref_prev->next = xref->next;
 
3258
      }
 
3259
      xref->next = NULL;
 
3260
      xref = SeqFeatXrefFree (xref);
 
3261
    } else {
 
3262
      xref_prev = xref;
 
3263
    }
 
3264
  }
 
3265
}
 
3266
 
 
3267
 
 
3268
static void RemoveMissingFeatureXrefs (IteM i)
 
3269
 
 
3270
{
 
3271
  BaseFormPtr  bfp;
 
3272
  SeqEntryPtr  sep;
 
3273
 
 
3274
#ifdef WIN_MAC
 
3275
  bfp = currentFormDataPtr;
 
3276
#else
 
3277
  bfp = GetObjectExtra (i);
 
3278
#endif
 
3279
  if (bfp == NULL) return;
 
3280
  sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
 
3281
  if (sep == NULL) return;
 
3282
  WatchCursor();
 
3283
  Update();
 
3284
  VisitFeaturesInSep (sep, NULL, RemoveMissingFeatureXrefsCallback);
 
3285
  ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
 
3286
  ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
 
3287
  ArrowCursor();
 
3288
  Update();
 
3289
}
 
3290
 
 
3291
 
3099
3292
static void ClearPubFig (PubdescPtr pdp, Pointer userdata)
3100
3293
 
3101
3294
{
6346
6539
  TexT    append_text;
6347
6540
  ButtoN  accept_btn;
6348
6541
  ButtoN  fuse_multiple_btn;
 
6542
  ButtoN  include_utr_btn;
6349
6543
  
6350
6544
  Int4       featdef_choice;
6351
6545
  ValNodePtr gene_field_list;
6355
6549
  Int4       caps_choice;
6356
6550
  Boolean    fuse_multiple;
6357
6551
  Boolean    makemRNA;
 
6552
  Boolean    include_utr;
6358
6553
  SeqEntryPtr sep;
6359
6554
  LogInfoData lid;
6360
6555
  
6698
6893
}
6699
6894
 
6700
6895
 
6701
 
static SeqFeatPtr MakemRNA (SeqLocPtr location, CharPtr protName, SeqEntryPtr sep)
 
6896
static SeqFeatPtr MakemRNA (SeqLocPtr location, CharPtr protName, SeqEntryPtr sep, Boolean include_utr)
6702
6897
{
6703
6898
  SeqFeatPtr sfp;
6704
6899
  RnaRefPtr  rrp;
6714
6909
  
6715
6910
  CheckSeqLocForPartial (location, &partial5, &partial3);
6716
6911
  sfp->location = SeqLocFree (sfp->location);
6717
 
  sfp->location = AsnIoMemCopy ((Pointer) location,
6718
 
                                (AsnReadFunc) SeqLocAsnRead,
6719
 
                                (AsnWriteFunc) SeqLocAsnWrite);
 
6912
  if (include_utr) {
 
6913
    sfp->location = GetmRNALocationFromCDSLocation (location, sfp->idx.entityID);
 
6914
  } else {
 
6915
    sfp->location = AsnIoMemCopy ((Pointer) location,
 
6916
                                  (AsnReadFunc) SeqLocAsnRead,
 
6917
                                  (AsnWriteFunc) SeqLocAsnWrite);
 
6918
  }
6720
6919
  sfp->partial = partial5 | partial3;
6721
6920
  
6722
6921
  return sfp;
6790
6989
  }
6791
6990
  
6792
6991
  if (fp->makemRNA) {
6793
 
    cds = MakemRNA (sfp->location, protName, fp->sep);
 
6992
    cds = MakemRNA (sfp->location, protName, fp->sep, fp->include_utr);
6794
6993
  } else {
6795
6994
    cds = MakeCDS(sfp->location, protName, fp->input_entityID, fp->sep, &(fp->lid));
6796
6995
  }
7049
7248
  fp->append_string = JustSaveStringFromText (fp->append_text);
7050
7249
  
7051
7250
  fp->fuse_multiple = GetStatus (fp->fuse_multiple_btn);
 
7251
  if (fp->makemRNA) {
 
7252
    fp->include_utr = GetStatus (fp->include_utr_btn);
 
7253
  }
7052
7254
 
7053
7255
  VisitBioseqsInSep (fp->sep, (Pointer) fp, FeatureToCDSBioseqCheckCallback);
7054
7256
 
7064
7266
  Update ();
7065
7267
 
7066
7268
  ObjMgrSetDirtyFlag (fp->input_entityID, TRUE);
7067
 
  ObjMgrSendMsg (OM_MSG_UPDATE, fp->input_entityID, 0, 0);  
7068
 
  Remove (fp->form); 
 
7269
  ObjMgrSendMsg (OM_MSG_UPDATE, fp->input_entityID, 0, 0); 
 
7270
  if (GetStatus (fp->leave_dlg_up)) {
 
7271
    Show (fp->form);
 
7272
  } else {
 
7273
    Remove (fp->form);
 
7274
  }
7069
7275
}
7070
7276
 
7071
7277
static void FeatureToCDSormRNA (IteM i, Boolean makemRNA)
7148
7354
  
7149
7355
  if(makemRNA) {
7150
7356
    fp->fuse_multiple_btn = CheckBox (h, "Fuse multiple intervals for new mRNA", NULL);
 
7357
    fp->include_utr_btn = CheckBox (h, "Include UTR regions in mRNA location", NULL);
7151
7358
  } else {
7152
7359
    fp->fuse_multiple_btn = CheckBox (h, "Fuse multiple intervals for new CDS", NULL);
 
7360
    fp->include_utr_btn = NULL;
7153
7361
  }
7154
7362
   
7155
7363
  c = HiddenGroup (h, 4, 0, NULL); 
7158
7366
  EnableFeatureToCDSControls (fp);
7159
7367
  
7160
7368
  PushButton (c, "Cancel", StdCancelButtonProc);
7161
 
 
 
7369
  fp->leave_dlg_up = CheckBox (c, "Leave Dialog Up", NULL);
7162
7370
 
7163
7371
  AlignObjects (ALIGN_CENTER, (HANDLE) fp->feature_choice,
7164
7372
                              (HANDLE) g,
7165
7373
                              (HANDLE) fp->qual_caps_grp,
7166
7374
                              (HANDLE) m, 
7167
7375
                              (HANDLE) fp->fuse_multiple_btn, 
7168
 
                              (HANDLE) c, NULL);
 
7376
                              (HANDLE) c, 
 
7377
                              (HANDLE) fp->include_utr_btn,
 
7378
                              NULL);
7169
7379
                
7170
7380
  RealizeWindow (w);
7171
7381
  Show (w);
20181
20391
      affil = alp->affil;
20182
20392
      if (affil == NULL) continue;
20183
20393
      FixCapitalizationInElement (&(affil->affil), TRUE, TRUE, FALSE);
 
20394
      FixAffiliationShortWordsInElement (&(affil->affil));
20184
20395
      FixCapitalizationInElement (&(affil->div), TRUE, TRUE, FALSE);
 
20396
      FixAffiliationShortWordsInElement (&(affil->div));
20185
20397
      FixCapitalizationInElement (&(affil->city), FALSE, TRUE, FALSE);
 
20398
      FixAffiliationShortWordsInElement (&(affil->city));
20186
20399
 
20187
20400
      /* special handling for states */
20188
20401
      if (affil->sub != NULL && StringLen (affil->sub) == 2
20192
20405
        affil->sub[1] = toupper(affil->sub[1]);
20193
20406
      } else {
20194
20407
        FixCapitalizationInElement (&(affil->sub), FALSE, TRUE, FALSE);
 
20408
        FixAffiliationShortWordsInElement (&(affil->sub));
20195
20409
      }
20196
20410
      FixCapitalizationInElement (&(affil->country), TRUE, TRUE, FALSE);
20197
20411
      FixCapitalizationInElement (&(affil->street), FALSE, TRUE, FALSE);
 
20412
      FixAffiliationShortWordsInElement (&(affil->street));
20198
20413
    }
20199
20414
  }
20200
20415
}
21394
21609
}
21395
21610
 
21396
21611
 
 
21612
static void ApplyKeywordWithStringConstraint (IteM i)
 
21613
{
 
21614
  BaseFormPtr    bfp;
 
21615
 
 
21616
#ifdef WIN_MAC
 
21617
  bfp = currentFormDataPtr;
 
21618
#else
 
21619
  bfp = GetObjectExtra (i);
 
21620
#endif
 
21621
  if (bfp == NULL) return;
 
21622
 
 
21623
  MacroApplyKeyword (bfp->input_entityID, TRUE);
 
21624
}
 
21625
 
 
21626
 
21397
21627
static void TestNewParse (IteM i)
21398
21628
{
21399
21629
  BaseFormPtr  bfp;
21595
21825
    SeparatorItem (s);
21596
21826
    i = CommandItem (s, "BARCODE Discrepancy Tool", BarcodeTestTool);
21597
21827
    SetObjectExtra (i, bfp, NULL);
 
21828
    i = CommandItem (s, "Create BARCODE IDs", CreateBarcodeIDsFromLocalIDs);
 
21829
    SetObjectExtra (i, bfp, NULL);
21598
21830
    i = CommandItem (s, "Apply BARCODE Dbxrefs", ApplyBarcodeDbxrefs);
21599
21831
    SetObjectExtra (i, bfp, NULL);
21600
21832
    SeparatorItem (s);
21605
21837
    SetObjectExtra (i, bfp, NULL);
21606
21838
    i = CommandItem (s, "Refresh TSA Tables", RefreshTSATables);
21607
21839
    SetObjectExtra (i, bfp, NULL);
21608
 
    i = CommandItem (s, "Create TSA IDs", CreateTSAIDsFromLocalIDs); 
21609
 
    SetObjectExtra (i, bfp, NULL);
 
21840
 
 
21841
    x = SubMenu (s, "Create TSA IDs");
 
21842
    i = CommandItem (x, "From Local IDs", CreateTSAIDsFromLocalIDs); 
 
21843
    SetObjectExtra (i, bfp, NULL);
 
21844
    i = CommandItem (x, "From Table", CreateTSAIDsFromTable);
 
21845
    SetObjectExtra (i, bfp, NULL);
 
21846
 
21610
21847
    i = CommandItem (s, "Edit TSA Assembly", EditTSAAssembly);
21611
21848
    SetObjectExtra (i, bfp, NULL);
21612
21849
    i = CommandItem (s, "Add mRNA sequence to deflines", AddmRNASequenceToDeflines);
21620
21857
    SeparatorItem (s);
21621
21858
    i = CommandItem (s, "Create Structured Comments from Table", CreateStructuredCommentsItem);
21622
21859
    SetObjectExtra (i, bfp, NULL); 
 
21860
    SeparatorItem (s);
 
21861
    i = CommandItem (s, "Retranscribe mRNAs", RetranscribemRNA);
 
21862
    SetObjectExtra (i, bfp, NULL); 
21623
21863
 
21624
21864
    /* remove after retro */
21625
21865
    SeparatorItem (s);
21821
22061
  i = CommandItem (s, "Remove Nth Seg's CDS for Each SegSet",
21822
22062
                   RemoveNthCDSFromSegSets_Callback);
21823
22063
  SetObjectExtra (i, bfp, NULL);
21824
 
 
 
22064
  i = CommandItem (x, "Remove All CDD Features and Dbxrefs", CleanupCDD);
 
22065
  SetObjectExtra (i, bfp, NULL);
21825
22066
  SeparatorItem (s);
21826
22067
 
21827
22068
  i = CommandItem (s, "Remove BankIt Comments", RemoveBankitComments);
21901
22142
  SetObjectExtra (i, bfp, NULL);
21902
22143
  i = CommandItem (y, "From All Features and BioSources", RemoveAllDbxrefs);
21903
22144
  SetObjectExtra (i, bfp, NULL);
 
22145
 
 
22146
  y = SubMenu (x, "Feature Xrefs");
 
22147
  i = CommandItem (y, "For Missing Features", RemoveMissingFeatureXrefs);
 
22148
  SetObjectExtra (i, bfp, NULL);
21904
22149
  
21905
22150
  SeparatorItem (s);
21906
22151
  y = SubMenu (s, "Remove Titles");
21946
22191
 
21947
22192
    i = CommandItem (y, "LOCUS from Parts", RemoveLocusFromParts);
21948
22193
    SetObjectExtra (i, bfp, NULL);    
 
22194
 
21949
22195
    SeparatorItem (s);
21950
22196
  }
21951
22197
  
21952
22198
  i = CommandItem (s, "Remove Empty Genome Project ID Descriptors", RemoveEmptyGenomeProjectIDs);
21953
22199
  SetObjectExtra (i, bfp, NULL);
 
22200
  i = CommandItem (s, "Remove All Genome Project IDs", RemoveGenomeProjectIDs);
 
22201
  SetObjectExtra (i, bfp, NULL);    
 
22202
 
21954
22203
}
21955
22204
 
21956
22205
static void MakeSpecialConvertMenu (MenU m, BaseFormPtr bfp)
22154
22403
 
22155
22404
  SeparatorItem (s);
22156
22405
  x = SubMenu (s, "Extend Partial Features");
22157
 
  i = CommandItem (x, "All", ExtendPartialFeatures);
 
22406
  i = CommandItem (x, "All to Ends", ExtendPartialFeatures);
22158
22407
  SetObjectExtra (i, bfp, NULL);
22159
22408
  i = CommandItem (x, "With Constraint", ExtendPartialFeaturesWithConstraint);
22160
22409
  SetObjectExtra (i, bfp, NULL);
22286
22535
  SeparatorItem (s);
22287
22536
  i = CommandItem (s, "Flip Intervals Between Gaps", FlipSequenceIntervals);
22288
22537
  SetObjectExtra (i, bfp, NULL);
 
22538
  SeparatorItem (s);
 
22539
  i = CommandItem (s, "Remove Contigs from Scaffolds", RemoveContigFromScaffoldMenuItem);
 
22540
  SetObjectExtra (i, bfp, NULL);
22289
22541
}
22290
22542
 
22291
22543
static void MakeSpecialSelectMenu (MenU m, BaseFormPtr bfp)
22735
22987
    SeparatorItem (s);
22736
22988
    i = CommandItem (s, "Normalize Descriptor Order", DoNormalizeDescs);
22737
22989
    SetObjectExtra (i, bfp, NULL);
 
22990
    SeparatorItem (s);
 
22991
    i = CommandItem (s, "Convert repeat_region rpt_unit_range to location", ConvertRptUnitRangeToLocation);
 
22992
    SetObjectExtra (i, bfp, NULL);
22738
22993
  }  
22739
22994
 
22740
22995
  MakeSpecialLocusTagMenu (m, bfp);
22827
23082
  SeparatorItem (m);
22828
23083
  i = CommandItem (m, "Macro Editor", LaunchMacroEditor);
22829
23084
  SetObjectExtra (i, bfp, NULL);
 
23085
#ifdef TEST_VALIDAPI
 
23086
  i = CommandItem (m, "Rules Editor", LaunchCommentRulesEditor);
 
23087
  SetObjectExtra (i, bfp, NULL);
 
23088
#endif
22830
23089
 
22831
23090
  /*
22832
23091
  SeparatorItem (m);