~ubuntu-branches/debian/experimental/ncbi-tools6/experimental

« back to all changes in this revision

Viewing changes to api/asn2gnb3.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2008-12-17 19:45:48 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081217194548-s86rrujnezfxr1pv
Tags: 6.1.20081116a-2
* debian/control: per Lintian's advice, depend on ${misc:Depends} across
  the board, in case Debhelper ever populates it.
* debian/{control,rules}: split newly added large BLAST databases into a
  new ncbi-rrna-data package to keep ncbi-data to a reasonable size.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
*
31
31
* Version Creation Date:   10/21/98
32
32
*
33
 
* $Revision: 1.81 $
 
33
* $Revision: 1.95 $
34
34
*
35
35
* File Description:  New GenBank flatfile generator - work in progress
36
36
*
120
120
      first = FALSE;
121
121
      if ( GetWWW(ajp) ) {
122
122
        FFAddOneString (ffstring, " gi:", FALSE, FALSE, TILDE_IGNORE);
123
 
        FFAddTextToString (ffstring, "<a href=", link_seq, NULL, FALSE, FALSE, TILDE_IGNORE);
 
123
        FFAddTextToString (ffstring, "<a href=\"", link_seq, NULL, FALSE, FALSE, TILDE_IGNORE);
124
124
        sprintf (buf, "%ld", (long) gi);
125
 
        FFAddTextToString (ffstring, "val=", buf, ">", FALSE, FALSE, TILDE_IGNORE);
 
125
        FFAddTextToString (ffstring, "val=", buf, "\">", FALSE, FALSE, TILDE_IGNORE);
126
126
        FFAddOneString (ffstring, buf, FALSE, FALSE, TILDE_EXPAND);
127
127
        FFAddOneString (ffstring, "</a>", FALSE, FALSE, TILDE_IGNORE);
128
128
      } else {
421
421
static CharPtr reftxtg = " The reference sequence was generated based on analysis of ";
422
422
static CharPtr reftxt1 = " This record is predicted by genome sequence analysis and is not yet supported by experimental evidence.";
423
423
static CharPtr reftxt2 = " This record has not yet been subject to final NCBI review.";
424
 
static CharPtr reftxt3 = " The mRNA record is supported by experimental evidence; however, the coding sequence is predicted.";
425
 
static CharPtr reftxt4 = " This record has undergone preliminary review of the sequence, but has not yet been subject to final review.";
 
424
static CharPtr reftxt3 = " This record has not been reviewed and the function is unknown.";
 
425
static CharPtr reftxt4 = " This record has undergone validation or preliminary review.";
426
426
static CharPtr reftxt5 = " This record has been curated by ";
427
427
static CharPtr reftxt6 = " This record is predicted by automated computational analysis.";
428
428
static CharPtr reftxt7 = " This record is provided to represent a collection of whole genome shotgun sequences.";
429
429
static CharPtr reftxt9 = " This record is derived from an annotated genomic sequence (";
 
430
static CharPtr reftxt41 = " This record is based on preliminary annotation provided by ";
430
431
 
431
432
static CharPtr GetStatusForRefTrack (
432
433
  UserObjectPtr uop
474
475
}
475
476
 
476
477
 
 
478
static Boolean URLHasSuspiciousHtml (
 
479
  IntAsn2gbJobPtr ajp,
 
480
  CharPtr searchString
 
481
)
 
482
 
 
483
{
 
484
  Char        ch;
 
485
  CharPtr     ptr;
 
486
  Int4        state;
 
487
  ValNodePtr  matches;
 
488
 
 
489
  if (StringHasNoText (searchString)) return FALSE;
 
490
 
 
491
  state = 0;
 
492
  ptr = searchString;
 
493
  ch = *ptr;
 
494
 
 
495
  while (ch != '\0') {
 
496
    matches = NULL;
 
497
    ch = TO_LOWER (ch);
 
498
    state = TextFsaNext (ajp->bad_html_fsa, state, ch, &matches);
 
499
    if (matches != NULL) {
 
500
      return TRUE;
 
501
    }
 
502
    ptr++;
 
503
    ch = *ptr;
 
504
  }
 
505
 
 
506
  return FALSE;
 
507
}
 
508
 
 
509
 
477
510
static void AddStrForRefTrack (
478
511
  IntAsn2gbJobPtr ajp,
479
512
  StringItemPtr ffstring,
481
514
)
482
515
 
483
516
{
484
 
  CharPtr       accn, curator = NULL, name, source = NULL, st;
 
517
  CharPtr       accn, curator = NULL, name, source = NULL, st, url = NULL;
485
518
  Char          buf [64];
486
519
  ObjectIdPtr   oip;
487
520
  UserFieldPtr  ufp, tmp, u, urf = NULL;
488
 
  Int4          from, to;
 
521
  Int4          from, to, gi;
489
522
  Int2          i = 0;
490
523
  Int2          review = 0;
491
524
  Boolean       generated = FALSE;
525
558
      if (! StringHasNoText (st)) {
526
559
        curator = st;
527
560
      }
 
561
    } else if (StringCmp (oip->str, "CollaboratorURL") == 0) {
 
562
      st = (CharPtr) ufp->data.ptrvalue;
 
563
      if (! StringHasNoText (st)) {
 
564
        url = st;
 
565
      }
528
566
    } else if (StringCmp (oip->str, "GenomicSource") == 0) {
529
567
      st = (CharPtr) ufp->data.ptrvalue;
530
568
      if (! StringHasNoText (st)) {
544
582
    }
545
583
  }
546
584
  if ( GetWWW(ajp) ) {
547
 
    FFAddTextToString(ffstring, "<a href=", ref_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
585
    FFAddTextToString(ffstring, "<a href=\"", ref_link, "\">", FALSE, FALSE, TILDE_IGNORE);
548
586
    FFAddOneString (ffstring, "REFSEQ", FALSE, FALSE, TILDE_IGNORE);
549
587
    FFAddOneString (ffstring, "</a>", FALSE, FALSE, TILDE_IGNORE);
550
588
  } else {
554
592
  if (review == 1) {
555
593
    FFAddOneString (ffstring, reftxt1, FALSE, FALSE, TILDE_IGNORE);
556
594
  } else if (review == 2) {
557
 
    FFAddOneString (ffstring, reftxt2, FALSE, FALSE, TILDE_IGNORE);
 
595
    if (curator == NULL) {
 
596
      FFAddOneString (ffstring, reftxt2, FALSE, FALSE, TILDE_IGNORE);
 
597
    }
558
598
  } else if (review == 3) {
559
599
    FFAddOneString (ffstring, reftxt3, FALSE, FALSE, TILDE_IGNORE);
560
600
  } else if (review == 4) {
563
603
    if (curator == NULL) {
564
604
      curator = "NCBI staff";
565
605
    }
566
 
    FFAddOneString (ffstring, reftxt5, FALSE, FALSE, TILDE_IGNORE);
567
 
    FFAddOneString (ffstring, curator, FALSE, FALSE, TILDE_IGNORE);
568
 
    FFAddOneString (ffstring, ".", FALSE, FALSE, TILDE_IGNORE);
569
606
  } else if (review == 6) {
570
607
    FFAddOneString (ffstring, reftxt6, FALSE, FALSE, TILDE_IGNORE);
571
608
  } else if (review == 7) {
572
609
    FFAddOneString (ffstring, reftxt7, FALSE, FALSE, TILDE_IGNORE);
573
610
  } else if (review == 8) {
574
611
  }
575
 
  if (review != 5 && curator != NULL) {
576
 
    FFAddOneString (ffstring, reftxt5, FALSE, FALSE, TILDE_IGNORE);
577
 
    FFAddOneString (ffstring, curator, FALSE, FALSE, TILDE_IGNORE);
 
612
  if (curator != NULL) {
 
613
    if (review == 2) {
 
614
      FFAddOneString (ffstring, reftxt41, FALSE, FALSE, TILDE_IGNORE);
 
615
    } else {
 
616
      FFAddOneString (ffstring, reftxt5, FALSE, FALSE, TILDE_IGNORE);
 
617
    }
 
618
    if (GetWWW (ajp) && url != NULL && (! URLHasSuspiciousHtml (ajp, url))) {
 
619
      if (StringNCmp (url, "http://", 7) == 0 || StringNCmp (url, "https://", 8) == 0) {
 
620
        FFAddTextToString(ffstring, "<a href=\"", url, "\">", FALSE, FALSE, TILDE_IGNORE);
 
621
        FFAddOneString (ffstring, curator, FALSE, FALSE, TILDE_IGNORE);
 
622
        FFAddOneString (ffstring, "</a>", FALSE, FALSE, TILDE_IGNORE);
 
623
      } else if (StringNCmp (url, "www.", 4) == 0) {
 
624
        FFAddTextToString(ffstring, "<a href=http://\"", url, "\">", FALSE, FALSE, TILDE_IGNORE);
 
625
        FFAddOneString (ffstring, curator, FALSE, FALSE, TILDE_IGNORE);
 
626
        FFAddOneString (ffstring, "</a>", FALSE, FALSE, TILDE_IGNORE);
 
627
      } else {
 
628
        FFAddOneString (ffstring, curator, FALSE, FALSE, TILDE_IGNORE);
 
629
      }
 
630
    } else {
 
631
      FFAddOneString (ffstring, curator, FALSE, FALSE, TILDE_IGNORE);
 
632
    }
578
633
    FFAddOneString (ffstring, ".", FALSE, FALSE, TILDE_IGNORE);
579
634
  }
580
635
  if (source != NULL) {
581
636
    FFAddOneString (ffstring, reftxt9, FALSE, FALSE, TILDE_IGNORE);
582
637
    if (GetWWW (ajp) && ValidateAccn (source) == 0) {
583
 
      FFAddTextToString(ffstring, "<a href=", link_seq, NULL, FALSE, FALSE, TILDE_IGNORE);
584
 
      FFAddTextToString(ffstring, "val=", source, ">", FALSE, FALSE, TILDE_IGNORE);
 
638
      FFAddTextToString(ffstring, "<a href=\"", link_seq, NULL, FALSE, FALSE, TILDE_IGNORE);
 
639
      FFAddTextToString(ffstring, "val=", source, "\">", FALSE, FALSE, TILDE_IGNORE);
585
640
      FFAddOneString (ffstring, source, FALSE, FALSE, TILDE_IGNORE);
586
641
      FFAddOneString (ffstring, "</a>", FALSE, FALSE, TILDE_IGNORE);
587
642
    } else {
601
656
      from = 0;
602
657
      to = 0;
603
658
      name = NULL;
 
659
      gi = 0;
604
660
      for (u = tmp->data.ptrvalue; u != NULL; u = u->next) {
605
661
        oip = u->label;
606
662
        if (oip != NULL && oip->str != NULL) {
612
668
            to = u->data.intvalue;
613
669
          } else if (StringICmp (oip->str, "name") == 0 && u->choice == 1) {
614
670
            name = (CharPtr) u->data.ptrvalue;
 
671
          } else if (StringICmp (oip->str, "gi") == 0 && u->choice == 2) {
 
672
            gi = u->data.intvalue;
615
673
          }
616
674
        }
617
675
      }
618
676
      if (StringDoesHaveText (accn)) {
619
677
        if (GetWWW (ajp) && ValidateAccn (accn) == 0) {
620
 
          FFAddTextToString(ffstring, "<a href=", link_seq, NULL, FALSE, FALSE, TILDE_IGNORE);
621
 
          FFAddTextToString(ffstring, "val=", accn, ">", FALSE, FALSE, TILDE_IGNORE);
 
678
          FFAddTextToString(ffstring, "<a href=\"", link_seq, NULL, FALSE, FALSE, TILDE_IGNORE);
 
679
          if (gi > 0) {
 
680
            sprintf (buf, "%ld", (long) gi);
 
681
            FFAddTextToString(ffstring, "val=", buf, "\">", FALSE, FALSE, TILDE_IGNORE);
 
682
          } else {
 
683
            FFAddTextToString(ffstring, "val=", accn, "\">", FALSE, FALSE, TILDE_IGNORE);
 
684
          }
622
685
          FFAddOneString (ffstring, accn, FALSE, FALSE, TILDE_IGNORE);
623
686
          FFAddOneString (ffstring, "</a>", FALSE, FALSE, TILDE_IGNORE);
624
687
        } else {
940
1003
static Boolean IsTpa (
941
1004
  BioseqPtr bsp,
942
1005
  Boolean has_tpa_assembly,
943
 
  BoolPtr isRefSeqP
 
1006
  BoolPtr isRefSeqP,
 
1007
  BoolPtr isTsaP
944
1008
)
945
1009
 
946
1010
{
947
 
  DbtagPtr  dbt;
948
 
  Boolean   has_bankit = FALSE;
949
 
  Boolean   has_genbank = FALSE;
950
 
  Boolean   has_gi = FALSE;
951
 
  Boolean   has_local = FALSE;
952
 
  Boolean   has_refseq = FALSE;
953
 
  Boolean   has_smart = FALSE;
954
 
  Boolean   has_tpa = FALSE;
955
 
  SeqIdPtr  sip;
 
1011
  SeqMgrDescContext  dcontext;
 
1012
  DbtagPtr           dbt;
 
1013
  Boolean            has_bankit = FALSE;
 
1014
  Boolean            has_genbank = FALSE;
 
1015
  Boolean            has_gi = FALSE;
 
1016
  Boolean            has_local = FALSE;
 
1017
  Boolean            has_refseq = FALSE;
 
1018
  Boolean            has_smart = FALSE;
 
1019
  Boolean            has_tpa = FALSE;
 
1020
  Boolean            is_tsa = FALSE;
 
1021
  MolInfoPtr         mip;
 
1022
  SeqDescrPtr        sdp;
 
1023
  SeqIdPtr           sip;
956
1024
 
957
1025
  if (bsp == NULL || bsp->id == NULL) return FALSE;
958
1026
  for (sip = bsp->id; sip != NULL; sip = sip->next) {
995
1063
    }
996
1064
  }
997
1065
 
 
1066
  sdp = SeqMgrGetNextDescriptor (bsp, NULL, Seq_descr_molinfo, &dcontext);
 
1067
  if (sdp != NULL && sdp->choice == Seq_descr_molinfo) {
 
1068
    mip = (MolInfoPtr) sdp->data.ptrvalue;
 
1069
    if (mip != NULL) {
 
1070
      if (mip->tech == MI_TECH_tsa) {
 
1071
        is_tsa = TRUE;
 
1072
        if (isTsaP != NULL) {
 
1073
          *isTsaP = TRUE;
 
1074
        }
 
1075
      }
 
1076
    }
 
1077
  }
 
1078
 
 
1079
  if (is_tsa) return TRUE;
998
1080
  if (has_genbank) return FALSE;
999
1081
  if (has_tpa) return TRUE;
1000
1082
  if (has_refseq) return TRUE;
1103
1185
}
1104
1186
 
1105
1187
static CharPtr GetStrForTpaOrRefSeqHist (
1106
 
  BioseqPtr bsp
 
1188
  BioseqPtr bsp,
 
1189
  Boolean isRefSeq,
 
1190
  Boolean isTsa
1107
1191
)
1108
1192
 
1109
1193
{
1114
1198
  ValNodePtr   head = NULL;
1115
1199
  SeqHistPtr   hist;
1116
1200
  SeqIdPtr     id;
1117
 
  Boolean      isRefSeq = FALSE;
1118
1201
  Boolean      minus1;
1119
1202
  Boolean      minus2;
1120
1203
  SeqAlignPtr  salp;
1126
1209
  Char         tmp [80];
1127
1210
 
1128
1211
  if (bsp == NULL) return NULL;
1129
 
  for (sip = bsp->id; sip != NULL; sip = sip->next) {
1130
 
    if (sip->choice == SEQID_OTHER) {
1131
 
      isRefSeq = TRUE;
1132
 
    }
1133
 
  }
1134
1212
  hist = bsp->hist;
1135
1213
  if (hist != NULL && hist->assembly != NULL) {
1136
1214
    salp = SeqAlignListDup (hist->assembly);
1157
1235
          if (head == NULL) {
1158
1236
            if (isRefSeq) {
1159
1237
              ValNodeCopyStr (&head, 0, "REFSEQ_SPAN         PRIMARY_IDENTIFIER PRIMARY_SPAN        COMP");
 
1238
            } else if (isTsa) {
 
1239
              ValNodeCopyStr (&head, 0, "TSA_SPAN            PRIMARY_IDENTIFIER PRIMARY_SPAN        COMP");
1160
1240
            } else {
1161
1241
              ValNodeCopyStr (&head, 0, "TPA_SPAN            PRIMARY_IDENTIFIER PRIMARY_SPAN        COMP");
1162
1242
            }
1229
1309
  Int2          i;
1230
1310
  Char          id [41];
1231
1311
  Boolean       isRefSeq = FALSE;
 
1312
  Boolean       isTsa = FALSE;
1232
1313
  Int2          j;
1233
1314
  size_t        len;
1234
1315
  ObjectIdPtr   oip;
1243
1324
  if (bsp == NULL) return NULL;
1244
1325
  hist = bsp->hist;
1245
1326
  if (hist != NULL && hist->assembly != NULL) return NULL;
1246
 
  if (! IsTpa (bsp, TRUE, &isRefSeq)) return NULL;
 
1327
  if (! IsTpa (bsp, TRUE, &isRefSeq, &isTsa)) return NULL;
1247
1328
  if (isRefSeq) return NULL;
1248
1329
 
1249
1330
  len = StringLen (tpaString) + StringLen ("entries ") + StringLen ("and ") + 5;
1399
1480
    }
1400
1481
  }
1401
1482
 
 
1483
  if (StringHasNoText (prefix)) {
 
1484
    prefix = "##Metadata-START##";
 
1485
  }
 
1486
  if (StringHasNoText (suffix)) {
 
1487
    suffix = "##Metadata-END##";
 
1488
  }
 
1489
 
1402
1490
  if (StringDoesHaveText (prefix)) {
1403
1491
    tmp = (CharPtr) MemNew (StringLen (prefix) + 4);
1404
1492
    if (tmp != NULL) {
1677
1765
  Boolean            has_tsa = FALSE;
1678
1766
  SeqHistPtr         hist;
1679
1767
  Boolean            isRefSeq = FALSE;
 
1768
  Boolean            isTsa = FALSE;
1680
1769
  ObjectIdPtr        oip;
1681
1770
  SeqDescrPtr        sdp;
1682
1771
  CharPtr            str;
1717
1806
  }
1718
1807
 
1719
1808
  hist = bsp->hist;
1720
 
  if ((! IsTpa (bsp, has_tpa_assembly, &isRefSeq)) ||
 
1809
  if ((! IsTpa (bsp, has_tpa_assembly, &isRefSeq, &isTsa)) ||
1721
1810
      hist == NULL || hist->assembly == NULL) {
1722
1811
    if (awp->forcePrimaryBlock) {
1723
1812
      AddAltPrimaryBlock (awp);
1728
1817
  ffstring = FFGetString(ajp);
1729
1818
  if ( ffstring == NULL ) return;
1730
1819
 
1731
 
  str = GetStrForTpaOrRefSeqHist (bsp);
 
1820
  str = GetStrForTpaOrRefSeqHist (bsp, isRefSeq, isTsa);
1732
1821
  if (str != NULL) {
1733
1822
 
1734
1823
    bbp = (BaseBlockPtr) Asn2gbAddBlock (awp, PRIMARY_BLOCK, sizeof (BaseBlock));
1968
2057
              FFAddOneString (ffstring, "GENOME ANNOTATION ", FALSE, FALSE, TILDE_IGNORE);
1969
2058
 
1970
2059
              if ( GetWWW(ajp) ) {
1971
 
                FFAddTextToString (ffstring, "<a href=", ref_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
2060
                FFAddTextToString (ffstring, "<a href=\"", ref_link, "\">", FALSE, FALSE, TILDE_IGNORE);
1972
2061
              }
1973
2062
              FFAddOneString (ffstring, "REFSEQ", FALSE, FALSE, TILDE_IGNORE);
1974
2063
              if ( GetWWW(ajp) ) {
1988
2077
              FFAddOneString (ffstring, " [see ", FALSE, FALSE, TILDE_EXPAND);
1989
2078
 
1990
2079
              if ( GetWWW(ajp) ) {
1991
 
                FFAddTextToString (ffstring, "<a href=", doc_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
2080
                FFAddTextToString (ffstring, "<a href=\"", doc_link, "\">", FALSE, FALSE, TILDE_IGNORE);
1992
2081
              }
1993
2082
              FFAddOneString (ffstring, "documentation", FALSE, FALSE, TILDE_IGNORE);
1994
2083
              if ( GetWWW(ajp) ) {
2028
2117
 
2029
2118
              FFAddOneString (ffstring, "This record was provided by the ", FALSE, FALSE, TILDE_EXPAND);
2030
2119
              if ( GetWWW(ajp) ) {
2031
 
                FFAddTextToString (ffstring, "<a href=", link_encode, ">", FALSE, FALSE, TILDE_IGNORE);
 
2120
                FFAddTextToString (ffstring, "<a href=\"", link_encode, "\">", FALSE, FALSE, TILDE_IGNORE);
2032
2121
              }
2033
2122
              FFAddOneString (ffstring, "ENCODE", FALSE, FALSE, TILDE_EXPAND);
2034
2123
              if ( GetWWW(ajp) ) {
2070
2159
              FFAddOneString (ffstring, "GENOME ANNOTATION ", FALSE, FALSE, TILDE_IGNORE);
2071
2160
 
2072
2161
              if ( GetWWW(ajp) ) {
2073
 
                FFAddTextToString (ffstring, "<a href=", ref_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
2162
                FFAddTextToString (ffstring, "<a href=\"", ref_link, "\">", FALSE, FALSE, TILDE_IGNORE);
2074
2163
              }
2075
2164
              FFAddOneString (ffstring, "REFSEQ", FALSE, FALSE, TILDE_IGNORE);
2076
2165
              if ( GetWWW(ajp) ) {
2091
2180
                FFAddOneString (ffstring, " [see ", FALSE, FALSE, TILDE_EXPAND);
2092
2181
 
2093
2182
                if ( GetWWW(ajp) ) {
2094
 
                  FFAddTextToString (ffstring, "<a href=", doc_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
2183
                  FFAddTextToString (ffstring, "<a href=\"", doc_link, "\">", FALSE, FALSE, TILDE_IGNORE);
2095
2184
                }
2096
2185
                FFAddOneString (ffstring, "documentation", FALSE, FALSE, TILDE_IGNORE);
2097
2186
                if ( GetWWW(ajp) ) {
2106
2195
                FFAddOneString (ffstring, "~Also see:~    ", FALSE, FALSE, TILDE_EXPAND);
2107
2196
 
2108
2197
                if ( GetWWW(ajp) ) {
2109
 
                  FFAddTextToString (ffstring, "<a href=", doc_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
2198
                  FFAddTextToString (ffstring, "<a href=\"", doc_link, "\">", FALSE, FALSE, TILDE_IGNORE);
2110
2199
                }
2111
2200
                FFAddOneString (ffstring, "Documentation", FALSE, FALSE, TILDE_IGNORE);
2112
2201
                if ( GetWWW(ajp) ) {
2153
2242
              FFAddOneString (ffstring, "MODEL ", FALSE, FALSE, TILDE_IGNORE);
2154
2243
 
2155
2244
              if ( GetWWW(ajp) ) {
2156
 
                FFAddTextToString (ffstring, "<a href=", ref_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
2245
                FFAddTextToString (ffstring, "<a href=\"", ref_link, "\">", FALSE, FALSE, TILDE_IGNORE);
2157
2246
              }
2158
2247
              FFAddOneString (ffstring, "REFSEQ", FALSE, FALSE, TILDE_IGNORE);
2159
2248
              if ( GetWWW(ajp) ) {
2164
2253
              FFAddTextToString (ffstring, NULL, reftxt11, " (", FALSE, FALSE, TILDE_IGNORE);
2165
2254
 
2166
2255
              if ( GetWWW(ajp) ) {
2167
 
                FFAddTextToString (ffstring, "<a href=", nt_link, name, FALSE, FALSE, TILDE_IGNORE);
2168
 
                FFAddOneString (ffstring, ">", FALSE, FALSE, TILDE_IGNORE);
 
2256
                FFAddTextToString (ffstring, "<a href=\"", nt_link, name, FALSE, FALSE, TILDE_IGNORE);
 
2257
                FFAddOneString (ffstring, "\">", FALSE, FALSE, TILDE_IGNORE);
2169
2258
              }
2170
2259
              FFAddOneString (ffstring, name, FALSE, FALSE, TILDE_IGNORE);
2171
2260
              if ( GetWWW(ajp) ) {
2194
2283
                locusID [0] = '\0';
2195
2284
                taxID [0] = '\0';
2196
2285
                if ( GetWWW(ajp) && GetGeneAndLocus (bsp, &geneName, locusID, taxID)) {
2197
 
                  FFAddTextToString (ffstring, "<a href=", ev_link, NULL, FALSE, FALSE, TILDE_IGNORE);
 
2286
                  FFAddTextToString (ffstring, "<a href=\"", ev_link, NULL, FALSE, FALSE, TILDE_IGNORE);
2198
2287
                  FFAddTextToString (ffstring, "contig=", name, NULL, FALSE, FALSE, TILDE_IGNORE);
2199
2288
                  FFAddTextToString (ffstring, "&gene=", geneName, NULL, FALSE, FALSE, TILDE_IGNORE);
2200
2289
                  FFAddTextToString (ffstring, "&lid=", locusID, NULL, FALSE, FALSE, TILDE_IGNORE);
2201
2290
                  if (! StringHasNoText (taxID)) {
2202
2291
                    FFAddTextToString (ffstring, "&taxid=", taxID, NULL, FALSE, FALSE, TILDE_IGNORE);
2203
2292
                  }
2204
 
                  FFAddOneString (ffstring, ">", FALSE, FALSE, TILDE_IGNORE);
 
2293
                  FFAddOneString (ffstring, "\">", FALSE, FALSE, TILDE_IGNORE);
2205
2294
                  FFAddOneString (ffstring, "evidence", FALSE, FALSE, TILDE_IGNORE);
2206
2295
                  FFAddOneString (ffstring, "</a>", FALSE, FALSE, TILDE_IGNORE);
2207
2296
                } else {
2214
2303
              FFAddOneString (ffstring, "~Also see:~    ", FALSE, FALSE, TILDE_EXPAND);
2215
2304
 
2216
2305
              if ( GetWWW(ajp) ) {
2217
 
                FFAddTextToString (ffstring, "<a href=", doc_link, ">", FALSE, FALSE, TILDE_IGNORE);
 
2306
                FFAddTextToString (ffstring, "<a href=\"", doc_link, "\">", FALSE, FALSE, TILDE_IGNORE);
2218
2307
              }
2219
2308
              FFAddOneString (ffstring, "Documentation", FALSE, FALSE, TILDE_IGNORE);
2220
2309
              if ( GetWWW(ajp) ) {
4399
4488
      if (sap->type != 1) continue;
4400
4489
      for (sfp = (SeqFeatPtr) sap->data; sfp != NULL; sfp = sfp->next) {
4401
4490
        publist = NULL;
4402
 
        CleanUpSeqFeat (sfp, FALSE, TRUE, &publist);
 
4491
        CleanUpSeqFeat (sfp, FALSE, FALSE, TRUE, &publist);
4403
4492
        sfp->idx.subtype = FindFeatDefType (sfp);
4404
4493
        ValNodeFreeData (publist);
4405
4494
        ValNodeAddPointer (&head, 0, (Pointer) sfp);
4606
4695
 
4607
4696
  /* check feature customization flags */
4608
4697
 
4609
 
  if (awp->hideImpFeats && sfp->data.choice == SEQFEAT_IMP) return TRUE;
 
4698
  if (awp->hideImpFeats && sfp->data.choice == SEQFEAT_IMP && fcontext->featdeftype != FEATDEF_operon) return TRUE;
4610
4699
  if (awp->hideVariations && fcontext->featdeftype == FEATDEF_variation) return TRUE;
4611
4700
  if (awp->hideRepeatRegions && fcontext->featdeftype == FEATDEF_repeat_region) return TRUE;
4612
4701
  if (awp->hideGaps && fcontext->featdeftype == FEATDEF_gap) return TRUE;