3
/*functions to print everything between two genes */
9
typedef struct print_gene {
16
Uint1 prev_type; /*the type of the previously recorded marker*/
17
}PrintGene, PNTR PrintGenePtr;
20
static ColData prt_col = {0, 0, 0, 'l', TRUE, TRUE, FALSE};
21
static ParData prt_par = {FALSE};
23
#define MAX_HTML_SIZE 1000
24
static Char HTML_buffer[MAX_HTML_SIZE];
26
static void print_store_for_html PROTO((CharPtr temp, CharPtr html_buf, Int4Ptr c_pos, Int4 width, FILE *fp));
28
static void print_store_buf(CharPtr temp, CharPtr buf, Int4 buf_size, Int4Ptr cur_len,
33
len = StringLen(temp);
34
if(len + (*cur_len) > buf_size)
37
SendTextToFile (fp, buf, &prt_par, &prt_col);
53
/**********************************************************
55
* functions to print a feature to a FILE
57
**********************************************************/
58
static Boolean PrintQual(GBQualPtr qdata, FILE *fp, CharPtr buf, Int4 buf_size)
66
sprintf(buf, "Qualifier ");
70
sprintf (temp, "%s=%s ", qdata->qual, qdata->val);
71
print_store_buf(temp, buf, buf_size, &len, fp);
78
SendTextToFile (fp, buf, &prt_par, &prt_col);
84
static Boolean print_sfp_ext (SeqFeatPtr sfp, FILE *fp, CharPtr buf, Int4 buf_size)
100
if(StringCmp(oip->str, "MapMarkerInfo") == 0)
106
if(StringCmp(oip->str, "Bin Order") == 0)
107
{ /* the order of the 1000:1 bin */
108
if(ufp->choice == 2) /*integer */
109
sprintf(temp, "Bin Order is %ld\n", (long) ufp->data.intvalue);
110
print_store_buf(temp, buf, buf_size, &len, fp);
112
else if(StringCmp(oip->str, "Marker Type" ) == 0)
116
switch (ufp->data.intvalue)
119
sprintf(temp, "Framework Marker\n");
122
sprintf(temp, "Recombination Mimimum Marker\n");
125
sprintf(temp, "Likely Loci Marker\n");
128
sprintf(temp, "Duplicated Marker\n");
131
sprintf(temp, "Multiple Duplicated Marker\n");
134
sprintf(temp, "STS Marker on YAC Contig\n");
139
print_store_buf(temp, buf, buf_size, &len, fp);
143
else if(StringCmp(oip->str, "Marker Category" ) == 0)
147
switch (ufp->data.intvalue)
150
sprintf(temp, "This is a YAC End\n");
153
sprintf(temp, "This is a Random Marker\n");
156
sprintf(temp, "This is a Genetic Marker\n");
159
sprintf(temp, "This is a Gene Marker\n");
162
sprintf(temp, "This is a EST Marker\n");
165
sprintf(temp, "This is a Misc Marker\n");
171
print_store_buf(temp, buf, buf_size, &len, fp);
176
if(StringCmp(oip->str, "MIT RH map") == 0)
182
if(oip && StringCmp(oip->str, "STS probability") == 0)
185
sprintf(temp, "STS probability is %s \n",
186
(CharPtr)(ufp->data.ptrvalue));
187
print_store_buf(temp, buf, buf_size, &len, fp);
193
if(StringCmp(oip->str, "Marker Category" ) == 0)
198
switch (ufp->data.intvalue)
201
sprintf(temp, "This is a YAC End\n");
204
sprintf(temp, "This is a Random Marker\n");
207
sprintf(temp, "This is a Genetic Marker\n");
210
sprintf(temp, "This is a Gene Marker\n");
213
sprintf(temp, "This is a EST Marker\n");
216
sprintf(temp, "This is a Misc Marker\n");
222
print_store_buf(temp, buf, buf_size, &len, fp);
227
SendTextToFile (fp, buf, &prt_par, &prt_col);
234
static Boolean PrintCommonFeature(SeqFeatPtr sfp, FILE *fp, CharPtr buf, Int4 buf_size)
238
sprintf(buf, "Title: %s\n", sfp->title);
239
SendTextToFile (fp, buf, &prt_par, &prt_col);
244
sprintf(buf, "Partial\n");
245
SendTextToFile (fp, buf, &prt_par, &prt_col);
250
sprintf(buf, "Exception\n");
251
SendTextToFile (fp, buf, &prt_par, &prt_col);
256
sprintf(buf, "Comment: %s\n", sfp->comment);
257
SendTextToFile (fp, buf, &prt_par, &prt_col);
261
PrintQual(sfp->qual, fp, buf, buf_size);
265
sprintf(buf, "Experimental Result\n");
266
SendTextToFile (fp, buf, &prt_par, &prt_col);
271
sprintf(buf, "Not-Experimental\n");
272
SendTextToFile (fp, buf, &prt_par, &prt_col);
280
static Boolean print_citation (SeqFeatPtr sfp, FILE *fp, CharPtr buf, Int4 buf_size, Boolean is_html)
299
muid = cit->data.intvalue;
304
StringCpy(buf, "MEDLINE: ");
306
len = StringLen(buf);
308
print_store_for_html(buf, NULL, &index, prt_col.width, fp);
312
sprintf(temp, "%ld", (long) muid);
313
sprintf(HTML_buffer, "<a href=\"http://www3.ncbi.nlm.nih.gov:80/htbin-post/Entrez/query?-guid=%ld&form=6&db=m&Dopt=r\">", (long) muid);
314
print_store_for_html(temp, HTML_buffer, &index, prt_col.width, fp);
315
print_store_for_html(" ", NULL, &index, prt_col.width, fp);
319
sprintf(temp, "%ld ", (long) muid);
320
print_store_buf(temp, buf, buf_size, &len, fp);
324
else if(cit->choice == 1)
326
pub = (ValNodePtr)(cit->data.ptrvalue);
329
if(pub->choice == PUB_Muid)
331
muid = pub->data.intvalue;
336
StringCpy(buf, "MEDLINE: ");
338
len = StringLen(buf);
340
print_store_for_html(buf, NULL, &index, prt_col.width, fp);
344
sprintf(temp, "%ld", (long) muid);
345
sprintf(HTML_buffer, "<a href=\"http://www3.ncbi.nlm.nih.gov:80/htbin-post/Entrez/query?-guid=%ld&form=6&db=m&Dopt=r\">", (long) muid);
346
print_store_for_html(temp, HTML_buffer, &index, prt_col.width, fp);
347
print_store_for_html(" ", NULL, &index, prt_col.width, fp);
351
sprintf(temp, "%ld ", (long) muid);
352
print_store_buf(temp, buf, buf_size, &len, fp);
371
StringCat(buf, "\n");
372
SendTextToFile (fp, buf, &prt_par, &prt_col);
379
/*************************************************************
381
* creating the html pages to the other genome mapping center
383
**************************************************************/
384
static CharPtr find_db_html_pointer (CharPtr db, CharPtr str)
388
if(db == NULL || str == NULL)
391
if(StringNCmp(db, "JAX", 3) == 0)
393
sprintf(HTML_buffer, "<a href=\"http://www.informatics.jax.org/bin/get_marker_by_symbol?%s\">", str);
397
if(StringCmp(db, "Stanford") == 0 || StringCmp(db, "SHGC") == 0)
399
if(StringNCmp(str, "SHGC", 4) == 0)
401
sprintf(HTML_buffer, "<a href=\"http://www-shgc.stanford.edu/cgi-bin/getSTSinfo?%s\">", str);
404
if(StringNCmp(str, "STSG-", 5) == 0)
405
{ /*old name format for the STSG*/
406
StringCpy(temp, "SHGC-");
407
StringCat(temp, str+5);
408
sprintf(HTML_buffer, "<a href=\"http://www-shgc.stanford.edu/cgi-bin/getSTSinfo?%s\">", temp);
415
if(StringCmp(db, "MIT") == 0 )
417
if(StringNCmp(str, "WI-", 3) == 0)
419
sprintf(HTML_buffer, "<a href=\"http://www-genome.wi.mit.edu/cgi-bin/"
420
"contig/sts_info?sts=%s&database=release\">", str);
426
if(StringCmp(db, "CHLC") == 0)
428
if(StringNCmp(str, "GATA", 4) == 0)
430
sprintf(HTML_buffer, "<a href=\"http://www.chlc.org/cgi-bin/"
431
"MarkerSearch?%s\">", str);
442
static Boolean print_gene_dblst(ValNodePtr db, FILE *fp, CharPtr buf, Int4 buf_size, Uint1 match_type, Boolean is_html)
458
StringCpy(buf, "Other Databases: ");
459
len = StringLen(buf);
462
fprintf(fp, "%s", buf);
467
for(curr = db; curr != NULL; curr = curr->next)
470
dbtag = curr->data.ptrvalue;
474
if(StringICmp(dbtag->db, "GDB") == 0 && oip->id > 0)
476
sprintf(HTML_buffer, "<a href=\"http://gdbwww.gdb.org/"
477
"gdb-bin/genera/genera/hgd/DBObject/"
478
"GDB:%ld\">", (long) oip->id);
480
html_buf = HTML_buffer;
482
else if(StringICmp(dbtag->db, "MIM") == 0 && oip->id > 0)
484
sprintf(HTML_buffer, "<a href=\"http://www3.ncbi.nlm.nih.gov/htbin-post/Omim/dispmim?"
485
"%ld\">",(long) oip->id);
486
html_buf = HTML_buffer;
488
else if(StringICmp(dbtag->db, "GenBank") == 0 && oip->str != NULL)
490
t_sip = gb_id_make(NULL, oip->str);
491
gi = GetGIForSeqId (t_sip);
494
sprintf(HTML_buffer, "<a href=\"http://www3.ncbi.nlm.nih.gov/"
495
"htbin-post/Entrez/query?form=6&dopt=g&db=n&"
496
"uid=%08ld\">",(long) gi);
497
html_buf = HTML_buffer;
501
else if(oip->str != NULL)
502
html_buf = find_db_html_pointer (dbtag->db, oip->str);
504
if(curr->next == NULL)
507
StringCpy(separator, " ");
510
if(StringICmp(dbtag->db, "GenBank") == 0 ||
511
match_type == MATCH_NONE)
512
sprintf(temp, "%s %s%s", dbtag->db, oip->str, separator);
515
if(match_type == MATCH_QUERY)
516
sprintf(temp, "%s [%s]%s", dbtag->db, oip->str, separator);
517
else if(match_type == MATCH_ALIGN)
518
sprintf(temp, "%s (%s)%s", dbtag->db, oip->str, separator);
522
sprintf(temp, "%s %ld%s", dbtag->db, (long) oip->id, separator);
525
if(curr->next == NULL)
526
StringCat(temp, "\n");
527
print_store_for_html(temp, html_buf, &index, prt_col.width, fp);
528
print_store_for_html(" ", NULL, &index, prt_col.width, fp);
531
print_store_buf(temp, buf, buf_size, &len, fp);
533
if(len > 0 && !is_html)
535
StringCat(buf, "\n");
536
SendTextToFile (fp, buf, &prt_par, &prt_col);
541
static Boolean print_gene_synonym(ValNodePtr syn, FILE *fp, CharPtr buf, Int4 buf_size, Uint1 match_type)
550
StringCpy(buf, "Synonym: ");
551
len = StringLen(buf);
552
for(curr = syn; curr != NULL; curr = curr->next)
554
str = curr->data.ptrvalue;
555
if(match_type == MATCH_QUERY)
556
sprintf(temp, "[%s] ", str);
557
else if(match_type == MATCH_ALIGN)
558
sprintf(temp, "(%s) ", str);
560
sprintf(temp, "%s ", str);
561
print_store_buf(temp, buf, buf_size, &len, fp);
565
StringCat(buf, "\n");
566
SendTextToFile(fp, buf, &prt_par, &prt_col);
572
/************************************************************
574
* PrintGeneRefToFile(sfp, fp, match_type, print_loc, np)
575
* print all the data associated with sfp to a file
576
* sfp: the Seqfeat of type Gene-ref
578
* match_type: the marker matches any query gene. If
579
* it matches directly (MATCH_QUERY), will be shown as [marker],
580
* if it matches via alignment (MATCH_ALIGN), will be shown
581
* as (marker). Otherwise,nothing will be shown
582
* print_loc: print the location of the marker. PRINT_LOC_BOGO
583
* directly print out the bogo base pair. PRINT_LOC_NUM,
584
* print out the location as the Numbering system
585
* np the numbering system
587
***********************************************************/
588
static Boolean PrintGeneRefToFile(SeqFeatPtr sfp, FILE *fp, Uint1 match_type, Uint1 print_loc, NumberingPtr np, Boolean is_html)
596
PrintCommonFeature(sfp, fp, buf, 1000);
597
grp = sfp->data.value.ptrvalue;
600
/* print out the locus name */
607
sip = SeqLocId(sfp->location);
608
if(sip->choice == SEQID_GENERAL)
610
db_tag = sip->data.ptrvalue;
611
if(db_tag->db != NULL)
612
html_buf = find_db_html_pointer (db_tag->db, grp->locus);
617
if(match_type == MATCH_QUERY)
622
fprintf(fp, "Locus: %s<B>%s</B></a>\n", html_buf, grp->locus);
624
fprintf(fp, "Locus: <B>%s</B>\n", grp->locus);
627
fprintf(fp, "Locus: [%s]\n", grp->locus);
631
if(is_html && html_buf != NULL)
632
fprintf(fp, "Locus: %s%s</a>\n", html_buf, grp->locus);
634
fprintf(fp, "Locus: %s\n", grp->locus);
639
sprintf(buf, "Description: %s\n", grp->desc);
640
SendTextToFile (fp, buf, &prt_par, &prt_col);
644
print_gene_synonym(grp->syn, fp, buf, 1000, match_type);
647
print_gene_dblst(grp->db, fp, buf, 1000, match_type, is_html);
649
fprintf(fp, "Allele: %s\n", grp->allele);
651
fprintf(fp, "MapLoc: %s\n", grp->maploc);
654
fprintf(fp, "Pseudo Gene\n");
657
print_citation (sfp, fp, buf, 1000, is_html);
658
print_sfp_ext (sfp, fp, buf, 1000);
660
if(print_loc == PRINT_LOC_BOGO || np == NULL)
662
fprintf(fp, "Region %ld-%ld\n", (long) SeqLocStart(sfp->location),
663
(long) SeqLocStop(sfp->location));
665
else if(print_loc == PRINT_LOC_NUM)
669
map_unit_label(SeqLocStart(sfp->location), np, buf, FALSE);
670
fprintf(fp, "Region %s\n", buf);
678
CharPtr WWW_PrintGeneRef(SeqFeatPtr sfp, Uint1 match_type, Uint1 print_loc, NumberingPtr np, Boolean is_html)
680
GeneRefPtr grp = NULL;
683
CharPtr html_buf, text = NULL;
688
if (sfp->data.choice == SEQFEAT_GENE) {
689
grp = sfp->data.value.ptrvalue;
700
sip = SeqLocId(sfp->location);
701
if(sip->choice == SEQID_GENERAL)
703
db_tag = sip->data.ptrvalue;
704
if(db_tag->db != NULL)
705
html_buf = find_db_html_pointer (db_tag->db, grp->locus);
710
if(match_type == MATCH_QUERY)
714
if(html_buf != NULL) {
715
text = MemNew(StringLen(html_buf) + StringLen(grp->locus) + 20);
716
sprintf(text, "Locus: %s<B>%s</B></a>\n", html_buf, grp->locus);
718
text = MemNew(StringLen(grp->locus) + 20);
719
sprintf(text, "Locus: <B>%s</B>", grp->locus);
722
text = MemNew(StringLen(grp->locus) + 20);
723
sprintf(text, "Locus: [%s]\n", grp->locus);
726
if(is_html && html_buf != NULL) {
727
text = MemNew(StringLen(html_buf) + StringLen(grp->locus) + 20);
728
sprintf(text, "Locus: %s%s</a>\n", html_buf, grp->locus);
730
text = MemNew(StringLen(grp->locus) + 20);
731
sprintf(text, "Locus: %s", grp->locus);
737
text = MemNew(StringLen(grp->desc) + 30);
738
sprintf(text, "Description: %s", grp->desc);
744
static void print_store_for_html(CharPtr temp, CharPtr html_buf, Int4Ptr c_pos, Int4 width, FILE *fp)
752
t_len = StringLen(temp);
753
if(t_len + (*c_pos) <= width)
756
fprintf(fp, "%s", html_buf);
757
fprintf(fp, "%s", temp);
772
fprintf(fp, "%s", html_buf);
777
for(str = temp; str != NULL && *str !='\0'; ++str)
783
if((to - from +1) + t_len + *c_pos > width)
785
StringNCpy(str_val, temp+from, to-from+1);
786
str_val[to-from+1] = '\0';
787
fprintf(fp, "%s\n", str_val);
794
StringNCpy(str_val, temp+from, to-from+1);
795
str_val[to-from+1] = '\0';
796
fprintf(fp, "%s", str_val);
816
*c_pos += to - from +1;
817
StringNCpy(str_val, temp+from, to-from+1);
818
str_val[to-from+1] = '\0';
819
fprintf(fp, "%s", str_val);
837
static void print_seqid PROTO((SeqIdPtr sip, CharPtr buf, Int2 buf_size));
839
static Boolean print_store_seqid(SeqIdPtr sip, CharPtr buf, Int4 buf_size, Int4Ptr len, FILE *fp, Boolean is_html, Int4Ptr index, Boolean first)
850
StringCpy(temp, " ");
852
print_store_for_html(temp, NULL, index, (Int4)(prt_col.width), fp);
854
print_store_buf(temp, buf, buf_size, len, fp);
858
if(sip->choice == SEQID_GI)
860
MuskSeqIdWrite(sip, temp, 100, PRINTID_TEXTID_ACCESSION, TRUE, TRUE);
863
sprintf(HTML_buffer, "<a href=\"http://www3.ncbi.nlm.nih.gov/"
864
"htbin-post/Entrez/query?form=6&dopt=g&db=n&"
865
"uid=%08ld\">", (long) sip->data.intvalue);
866
html_buf = HTML_buffer;
871
if(sip->choice == SEQID_GENERAL)
873
db_tag = sip->data.ptrvalue;
874
if(is_html && StringICmp(db_tag->db, "UNIGENE") == 0)
877
sprintf(HTML_buffer, "<a href=\"http://www.ncbi.nlm.nih.gov/"
878
"cgi-bin/Schuler/clust2html?Homo+sapiens+%ld\">",(long) oip->id);
879
html_buf = HTML_buffer;
881
print_seqid (sip, temp, 100);
884
MuskSeqIdWrite(sip, temp, 100, PRINTID_TEXTID_ACCESSION, FALSE, FALSE);
888
print_store_for_html(temp, html_buf, index, (Int4)(prt_col.width), fp);
890
print_store_buf(temp, buf, buf_size, len, fp);
894
static Boolean fetch_this_bioseq(SeqIdPtr sip)
899
if(sip->choice == SEQID_LOCAL)
901
oip = sip->data.ptrvalue;
903
return (StringNCmp(oip->str, "HGM", 3) == 0);
905
else if(sip->choice == SEQID_GENERAL)
907
db_tag = sip->data.ptrvalue;
908
if(StringCmp(db_tag->db, "HUMGEN") == 0)
911
return (oip->id > 0);
918
static Boolean PrintSequenceToFile(SeqLocPtr slp, FILE *fp, Uint1 print_loc, NumberingPtr np, GatherRangePtr grp, Boolean is_html)
925
Char temp_1[41], temp_2[41];
928
Int4 buf_size = 1000;
937
print_store_seqid(sip, buf, buf_size, &len, fp, is_html, &index, TRUE);
940
if(print_loc != PRINT_LOC_NONE)
941
{ /*print out the location on the genome */
942
if(print_loc == PRINT_LOC_BOGO || np == NULL)
943
sprintf(temp, ": %ld - %ld (bp)", (long) grp->left, (long) grp->right);
947
map_unit_label(grp->left, np, temp_1, FALSE);
948
map_unit_label(grp->right, np, temp_2, FALSE);
950
sprintf(temp, ": %s - %s (bp) on the genome", temp_1, temp_2);
954
StringCat(temp, "<br>");
955
StringCat(temp, "\n");
956
print_store_for_html(temp, NULL, &index, (Int4)prt_col.width, fp);
959
print_store_buf(temp, buf, buf_size, &len, fp);
963
StringCat(buf, "\n");
964
SendTextToFile (fp, buf, &prt_par, &prt_col);
967
if(fetch_this_bioseq(sip))
968
{ /* fetch the hum-gen record */
969
bsp = BioseqLockById(sip);
972
if(bsp->hist != NULL)
976
align = bsp->hist->assembly;
980
if(align->segtype == 2)
983
sip = dsp->ids->next;
984
print_store_seqid(sip, buf, buf_size, &len, fp, is_html, &index, first);
993
StringCat(buf, "\n");
994
SendTextToFile (fp, buf, &prt_par, &prt_col);
1002
else if(bsp->repr == Seq_repr_seg && bsp->seq_ext_type == 1)
1004
t_slp = bsp->seq_ext;
1010
if(SeqLocId(t_slp) != NULL)
1011
print_store_seqid(SeqLocId(t_slp), buf, buf_size, &len, fp, is_html, &index, first);
1013
t_slp = t_slp->next;
1020
StringCat(buf, "\n");
1021
SendTextToFile (fp, buf, &prt_par, &prt_col);
1024
else if(index > 0) {
1025
fprintf(fp, "<br>");
1033
fprintf(fp, "<br>");
1048
static Boolean is_sfp_query_gene (GeneDataPtr gdata, Uint2 itemID,
1049
Uint2 entityID, Uint2 itemType)
1053
if(gdata->entityID == entityID && gdata->itemID == itemID &&
1054
gdata->itemType == itemType)
1056
gdata = gdata->next;
1062
static Boolean is_loc_match_align (GeneDataPtr gdata, SeqFeatPtr sfp)
1069
if(gdata->align_seg != NULL)
1071
ssp = gdata->align_seg->data.ptrvalue;
1072
for(slp = ssp->loc; slp != NULL; slp = slp->next)
1074
if(SeqLocCompare (slp, sfp->location) == SLC_A_EQ_B)
1078
gdata = gdata->next;
1086
static void print_seqid (SeqIdPtr sip, CharPtr buf, Int2 buf_size)
1091
if(sip->choice == SEQID_GENERAL)
1093
db_tag = sip->data.ptrvalue;
1095
if(oip->str != NULL)
1096
sprintf(buf, "%s %s", db_tag->db, oip->str);
1098
sprintf(buf, "%s %ld", db_tag->db, (long) oip->id);
1101
SeqIdWrite(sip, buf, PRINTID_TEXTID_ACCESSION, buf_size);
1105
static void print_bioseq_descriptor (BioseqPtr bsp, SeqLocPtr slp, FILE *fp, Int2 line_len)
1111
for(i =0; i<line_len; ++i)
1114
print_seqid (bsp->id, buf, 1000);
1115
fprintf(fp, "%s\n", buf);
1117
for(descr = bsp->descr; descr != NULL; descr = descr->next)
1119
if(descr->choice == Seq_descr_title || descr->choice == Seq_descr_name)
1121
sprintf(buf, "%s\n", (CharPtr)(descr->data.ptrvalue));
1122
SendTextToFile(fp, buf, &prt_par, &prt_col);
1125
sprintf (buf, "Region: %ld-%ld(bp) on the Chromosome\n", (long) SeqLocStart(slp), (long) SeqLocStop(slp));
1126
SendTextToFile(fp, buf, &prt_par, &prt_col);
1127
for(i =0; i<line_len; ++i)
1134
static Boolean prtgenefunc(GatherContextPtr gcp)
1145
pgp = (PrintGenePtr)(gcp->userdata);
1149
switch(gcp->thistype)
1152
case OBJ_BIOSEQ_MAPFEAT:
1154
sfp = (SeqFeatPtr)(gcp->thisitem);
1155
if(sfp == NULL || sfp->data.choice != 1)
1158
match_type = MATCH_NONE;
1159
if(is_sfp_query_gene (pgp->g_data, gcp->itemID,
1160
gcp->entityID, gcp->thistype))
1161
match_type = MATCH_QUERY;
1162
else if (is_loc_match_align (pgp->g_data, sfp))
1163
match_type = MATCH_ALIGN;
1164
if(pgp->prev_type != GENE_MARKER)
1166
pgp->prev_type = GENE_MARKER;
1167
fprintf(pgp->fp, "\nSTS Markers\n\n");
1170
PrintGeneRefToFile(sfp, pgp->fp, match_type, pgp->print_loc, pgp->np, pgp->html);
1174
case OBJ_BIOSEQ_SEG: /*segments of a segmented sequence*/
1175
slp = (SeqLocPtr)(gcp->thisitem);
1176
if(!is_map_segment(slp))
1178
if(pgp->prev_type != SEQ_SEGMENT)
1180
pgp->prev_type = SEQ_SEGMENT;
1181
fprintf(pgp->fp, "\nSequence Data\n\n");
1184
PrintSequenceToFile(slp, pgp->fp, pgp->print_loc, pgp->np, &(gcp->extremes), pgp->html);
1195
/******************************************************************
1197
* print the everything in the interval slp to a text file
1199
* g_data: the query gene
1200
* is_html: make it a html page
1201
* line_len; the length of the file
1202
* fp: the output file
1204
********************************************************************/
1205
Boolean print_genome_interval(SeqLocPtr slp, GeneDataPtr g_data, Boolean is_html, Int2 line_len, FILE *fp)
1212
if(slp == NULL || fp == NULL)
1214
sep = SeqEntryFind(SeqLocId(slp));
1217
bsp = BioseqFind(SeqLocId(slp));
1225
pg.print_loc = PRINT_LOC_NUM;
1226
pg.np = getBioseqNumbering(bsp);
1229
prt_col.width = line_len;
1230
print_bioseq_descriptor (bsp, slp, fp, line_len);
1233
MemSet((Pointer)(&gs), 0, sizeof(GatherScope));
1234
MemSet((Pointer)(gs.ignore), (int)(TRUE), (size_t)OBJ_MAX * sizeof(Boolean));
1235
gs.ignore[OBJ_SEQFEAT] = FALSE;
1236
gs.ignore[OBJ_SEQANNOT] = FALSE;
1237
gs.ignore[OBJ_BIOSEQ_MAPFEAT] = FALSE;
1238
gs.ignore[OBJ_BIOSEQ] = FALSE;
1239
if(bsp->repr == Seq_repr_seg && bsp->seq_ext_type == 1)
1240
gs.ignore[OBJ_BIOSEQ_SEG] = FALSE;
1241
gs.nointervals = TRUE;
1243
gs.offset = SeqLocStart(slp);
1244
gs.get_feats_location = TRUE;
1245
GatherSeqEntry(sep, (Pointer)(&pg), prtgenefunc, &gs);
1247
if(pg.found == FALSE)
1248
fprintf(fp, "None\n");