--- ncbi_c--May_15_2009/demo/blastall.c-dist 2009-08-10 15:27:51.761716179 -0500 +++ ncbi_c--May_15_2009/demo/blastall.c 2009-08-10 15:25:50.651715636 -0500 @@ -717,6 +717,7 @@ #include #include #include +#include #include #include #include @@ -784,6 +785,19 @@ } #endif +static Int4 get_number_alignment(SeqAlignPtr align) +{ + Int4 num = 0; + + while(align) + { + ++num; + align = align->next; + } + + return num; +} + static Int2 BlastGetMaskingLoc(FILE *infp, FILE *outfp, CharPtr instructions) { @@ -993,8 +1007,8 @@ "stdin", NULL, NULL, FALSE, 'i', ARG_FILE_IN, 0.0, 0, NULL}, /* ARG_QUERY */ { "Expectation value (E)", "10.0", NULL, NULL, FALSE, 'e', ARG_FLOAT, 0.0, 0, NULL}, /* ARG_EVALUE */ - { "alignment view options:\n0 = pairwise,\n1 = query-anchored showing identities,\n2 = query-anchored no identities,\n3 = flat query-anchored, show identities,\n4 = flat query-anchored, no identities,\n5 = query-anchored no identities and blunt ends,\n6 = flat query-anchored, no identities and blunt ends,\n7 = XML Blast output,\n8 = tabular, \n9 tabular with comment lines\n10 ASN, text\n11 ASN, binary", /* 4 */ - "0", "0", "11", FALSE, 'm', ARG_INT, 0.0, 0, NULL}, /* ARG_FORMAT */ + { "alignment view options:\n0 = pairwise,\n1 = query-anchored showing identities,\n2 = query-anchored no identities,\n3 = flat query-anchored, show identities,\n4 = flat query-anchored, no identities,\n5 = query-anchored no identities and blunt ends,\n6 = flat query-anchored, no identities and blunt ends,\n7 = XML Blast output,\n8 = tabular, \n9=tabular with comment lines\n10=SeqAlign ASN, text\n11=SeqAlign ASN, binary\n12=Full ASN, text\n13=Full ASN, binary\n", /* 4 */ + "0", "0", "13", FALSE, 'm', ARG_INT, 0.0, 0, NULL}, /* ARG_FORMAT */ { "BLAST report Output File", "stdout", NULL, NULL, TRUE, 'o', ARG_FILE_OUT, 0.0, 0, NULL}, /* ARG_OUT */ { "Filter query sequence (DUST with blastn, SEG with others)", @@ -1841,8 +1855,9 @@ align_view = (Int1) myargs[ARG_FORMAT].intvalue; outfp = NULL; - if (align_view != 7 && align_view != 10 && align_view != 11 && blast_outputfile != NULL) { - if ((outfp = FileOpen(blast_outputfile, "w")) == NULL) { + if (align_view != 7 && align_view != 10 && align_view != 11 && + align_view != 12 && align_view != 13 && blast_outputfile != NULL) { + if ((outfp = FileOpen(blast_outputfile, "w")) == NULL) { ErrPostEx(SEV_FATAL, 1, 0, "blast: Unable to open output file %s\n", blast_outputfile); return (1); } @@ -2146,6 +2161,10 @@ } } else if (align_view == 7 ) { xml_aip = AsnIoOpen(blast_outputfile, "wx"); + } else if (align_view == 12) { + xml_aip = AsnIoOpen(blast_outputfile,"w"); + } else if (align_view == 13) { + xml_aip = AsnIoOpen(blast_outputfile, "wb"); } #ifndef BLAST_CS_API @@ -2667,7 +2686,7 @@ BioseqUnlock(bsp); } } - if((align_view == 7) && !options->is_ooframe) { + if((align_view == 7||align_view==12||align_view==13) && !options->is_ooframe) { if (options->is_megablast_search) { bsp = BioseqLockById(SeqLocId(tmp_slp)); BXMLPrintOutput(xml_aip, seqalign, @@ -2700,11 +2719,33 @@ seqannot->type = 2; AddAlignInfoToSeqAnnot(seqannot, align_type); seqannot->data = curr_seqalign; - if (aip) { + if(html) { + Char f_name[64], title[1024], href[64]; + Int4 align_num; + + sprintf(f_name, "%ld%ld.gif", (long)random(), (long)getpid()); + sprintf(href, "./TmpGifs/"); + + align_num = get_number_alignment(seqalign); + sprintf(title, + "

" + "Distribution of %ld Blast Hits on the Query Sequence " + "

\n", (long)align_num); + + + /* Open HTML form */ + fprintf(outfp, "
\n"); + fflush(outfp); + + PrintAlignmentOverview(seqannot, outfp, + "BLASTFORM", href, f_name, title); + } else { + if (aip) { SeqAnnotAsnWrite((SeqAnnotPtr) seqannot, aip, NULL); AsnIoReset(aip); - } - if (num_queries > 0) { + } + } + if (num_queries > 0) { *(seq_annot_arr + sap_iter) = seqannot; } } /* make seqannots over the sap_iters from concat, or the single seqalign */ @@ -2785,7 +2826,7 @@ } /* end of align_view not tabular case */ } else { /* seqalign is NULL */ - if((align_view == 7) && !options->is_ooframe) { + if((align_view == 7||align_view==12||align_view==13) && !options->is_ooframe) { BlastErrorMsgPtr error_msg; CharPtr message; @@ -2901,9 +2942,10 @@ if (html) { fprintf(outfp, "\n\n\n"); } - } else if (align_view == 7) + } else { + if (align_view == 7||align_view==12||align_view==13) xml_aip = AsnIoClose(xml_aip); - + } /* AM: query concatenation. */ mult_queries = BlastMultQueriesDestruct( mult_queries ); --- ncbi_c--May_15_2009/algo/blast/api/blast_format.c-dist 2009-08-10 15:53:57.400717505 -0500 +++ ncbi_c--May_15_2009/algo/blast/api/blast_format.c 2009-08-13 11:18:29.229334489 -0500 @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -52,7 +53,18 @@ * * @{ */ +static Int4 get_number_alignment(SeqAlignPtr align) +{ + Int4 num = 0; + while(align) + { + ++num; + align = align->next; + } + + return num; +} /** Allocate and initialize the formatting options structure. * @param program_number Number of the BLAST program [in] * @param align_view What kind of formatted output to show? [in] @@ -494,7 +506,8 @@ char* filename_copy = strdup(outfile_name); if (align_view == eAlignViewXml) strcpy(write_mode, "wx"); - else if (align_view == eAlignViewAsnText) + else if ((align_view == eAlignViewAsnText)|| + (align_view == eAlignViewFullAsnText)) strcpy(write_mode, "w"); else strcpy(write_mode, "wb"); @@ -750,16 +763,20 @@ BlastFormattingOptions* format_options; EAlignView align_view; Boolean ungapped; + Boolean html; ASSERT(format_info && format_info->format_options && format_info->search_options && query_slp); format_options = format_info->format_options; align_view = format_options->align_view; + html = format_options->html; ungapped = !format_info->search_options->score_options->gapped_calculation; - if (align_view == eAlignViewXml) { + if (align_view == eAlignViewXml || + align_view == eAlignViewFullAsnText || + align_view == eAlignViewFullAsnBinary) { const Int4 kXmlFlag = 0; /* Change to BXML_INCLUDE_QUERY if inclusion of query sequence is desired in the XML output header. */ @@ -868,7 +885,9 @@ format_options->number_of_alignments, format_info->program_name, ungapped, format_options->believe_query, 0, 0, outfp, (Boolean)(align_view == eAlignViewTabularWithComments)); - } else if(align_view == eAlignViewXml) { + } else if(align_view == eAlignViewXml || + align_view == eAlignViewFullAsnText|| + align_view == eAlignViewFullAsnBinary) { Iteration* iterp; ASSERT(xmlp && xmlp->aip); @@ -888,10 +907,32 @@ seqannot->type = 2; AddAlignInfoToSeqAnnot(seqannot, align_type); seqannot->data = seqalign; - if (aip) { - SeqAnnotAsnWrite((SeqAnnot*) seqannot, aip, NULL); - AsnIoReset(aip); - } + if(html) { + Char f_name[64], title[1024], href[64]; + Int4 align_num; + + sprintf(f_name, "%ld%ld.gif", (long)random(), (long)getpid()); + sprintf(href, "./TmpGifs/"); + + align_num = get_number_alignment(seqalign); + sprintf(title, + "

" + "Distribution of %ld Blast Hits on the Query Sequence " + "

\n", (long)align_num); + + + /* Open HTML form */ + fprintf(outfp, "\n"); + fflush(outfp); + + PrintAlignmentOverview(seqannot, outfp, + "BLASTFORM", href, f_name, title); + } else { + if (aip) { + SeqAnnotAsnWrite((SeqAnnot*) seqannot, aip, NULL); + AsnIoReset(aip); + } + } if (outfp) { BlastPruneSapStruct* prune; Int4** matrix = s_LoadMatrix(sum_returns->search_params->matrix); @@ -941,7 +982,10 @@ } /* End loop on seqaligns for different queries */ /* close BlastOutput_iterations openned in s_MBXmlInit; Rt ticket # 15135151 */ - if((format_info->is_seqalign_null==TRUE) && (align_view == eAlignViewXml)) { + if((format_info->is_seqalign_null==TRUE) && + (align_view == eAlignViewXml || + align_view == eAlignViewFullAsnText || + align_view == eAlignViewFullAsnBinary)) { /* extra output only if no hits at all, otherwise "for loop" logic should take care*/ Iteration* iterp; iterp = IterationNew(); --- ncbi_c--May_15_2009/algo/blast/api/blast_format.h-dist 2009-08-10 15:41:33.956716101 -0500 +++ ncbi_c--May_15_2009/algo/blast/api/blast_format.h 2009-08-10 15:40:55.468716920 -0500 @@ -81,10 +81,14 @@ eAlignViewTabular = 8, /** Tabular with per-query comments. */ eAlignViewTabularWithComments = 9, - /** ASN.1 in text form. */ + /** SeqAlign ASN.1 in text form. */ eAlignViewAsnText = 10, - /** ASN.1 in binary form. */ + /** SeqAlign ASN.1 in binary form. */ eAlignViewAsnBinary = 11, + /** Full ASN.1 text form */ + eAlignViewFullAsnText = 12, + /** Full ASN.1 in binary form */ + eAlignViewFullAsnBinary = 13, /** Sentinel value, binding the allowed range. */ eAlignViewMax } EAlignView; --- ncbi_c--May_15_2009/desktop/glbpic.c-dist 2001-06-26 11:43:00.000000000 -0500 +++ ncbi_c--May_15_2009/desktop/glbpic.c 2009-08-10 12:24:54.591717846 -0500 @@ -1580,9 +1580,9 @@ SelectFont(font); font_height = FontHeight(); if(add_to_bottom) - pen_width = MAX(1, GetMuskCParam(MSM_SEQUENCE, MSM_SEG_BORD, MSM_PENWIDTH)); + pen_width = MAX(3, GetMuskCParam(MSM_SEQUENCE, MSM_SEG_BORD, MSM_PENWIDTH)); else - pen_width = 1; + pen_width = 3; p_val = 1; color = BLACK_COLOR; --- ncbi_c--May_15_2009/make/makeall.unx-dist 2009-04-21 10:23:53.000000000 -0500 +++ ncbi_c--May_15_2009/make/makeall.unx 2009-08-10 12:26:51.399714208 -0500 @@ -56,17 +56,17 @@ # default flags for compiling and loading .KEEP_STATE: - +LCL=lnx RM_LIB = rm -f SUFFIXLCL = $(LCL) CFLAGS1 = -c -O -LDFLAGS1 = -O -CC = cc +LDFLAGS1 = -O -v +CC = cc -g RAN = ls -l AR=ar OTHERLIBS = -lm -VIBLIBS = -VIBFLAG = +VIBLIBS = -lXm -lXmu -lXt -lX11 +VIBFLAG =-DWIN_MOTIF LIBCOPY = cp -p SRCCOPY = ./ln-if-absent BINCOPY = cp -p @@ -79,7 +79,6 @@ LIB3 = libncbicdr.a ULIB4 = libvibrant.a LIB4 = $(ULIB4) -LIB4 = ULIB400 = libvibrantOGL.a LIB400 = $(ULIB400) LIB400 = @@ -93,22 +92,17 @@ # LIB20 is for the NCBI desktop utilities ULIB20 = libncbidesk.a LIB20 = $(ULIB20) -LIB20 = ULIB45 = libddvlib.a LIB45 = $(ULIB45) -LIB45 = LIB22 = libncbimmdb.a LIB23 = libncbitool.a LIBCOMPADJ = libblastcompadj.a ULIB28 = libvibgif.a LIB28 = $(ULIB28) -LIB28 = ULIB30 = libncbicn3d.a LIB30 = $(ULIB30) -LIB30 = ULIB3000 = libncbicn3dOGL.a LIB3000 = $(ULIB3000) -LIB3000 = ULIB34 = libncbiindx.a LIB34= $(ULIB34) LIB34 = @@ -166,7 +160,7 @@ # sources needed for versions of asntool and entrez THR_SRC = ncbithr.c -# NCBI_LBSM_SRC = ncbi_lbsmd_stub.c +NCBI_LBSM_SRC = ncbi_lbsmd_stub.c SRC1e = ncbibs.c wwwutils.c ncbierr.c ncbienv.c ncbifile.c \ ncbiprop.c ncbimath.c ncbimem.c ncbimisc.c \ @@ -310,7 +304,7 @@ # objects needed for versions of asntool and entrez THR_OBJ = ncbithr.o -# NCBI_LBSM_OBJ = ncbi_lbsmd_stub.o +NCBI_LBSM_OBJ = ncbi_lbsmd_stub.o OBJ1e = ncbibs.o wwwutils.o ncbierr.o ncbienv.o ncbifile.o \ ncbiprop.o ncbimath.o ncbimem.o ncbimisc.o \ @@ -685,7 +679,7 @@ $(SRCCOPY) ../corelib/morefile/*.h ../include $(SRCCOPY) ../corelib/morefile/*.c . $(SRCCOPY) ../link/macmet/MoreCarbonAccessors.h ../include - $(SRCCOPY) ../corelib/ncbilcl.$(SUFFIXLCL) ../include/ncbilcl.h + $(SRCCOPY) ../corelib/ncbilcl.lnx ../include/ncbilcl.h $(SRCCOPY) ../corelib/*.c . $(SRCCOPY) ../corelib/core*.h . $(SRCCOPY) ../asnlib/*.h . --- ncbi_c--May_15_2009/make/makedemo.unx-dist 2008-07-29 14:42:43.000000000 -0500 +++ ncbi_c--May_15_2009/make/makedemo.unx 2009-08-11 14:21:02.495975870 -0500 @@ -42,20 +42,19 @@ # default flags for compiling and loading - +LCL=lnx SUFFIXLCL = $(LCL) -CFLAGS1 = -c -O -LDFLAGS1 = -O -CC = cc +CFLAGS1 = -c -O -g +LDFLAGS1 = -O -v +CC = cc RAN = ls -l OTHERLIBS = -lm -THREAD_OTHERLIBS = -lthread -THREAD_OTHERLIBS = +THREAD_OTHERLIBS = -lpthread THREAD_OBJ = ncbithr.o -THREAD_OBJ = -VIBLIBS = -VIBFLAG = -VIB = +GIF_OBJ = salogif.o +PIC_OBJ = pictogif.o +VIBLIBS = -lXm -lXmu -lXt -lX11 +VIBFLAG = -DWIN_MOTIF LIBCOPY = cp -p SRCCOPY = ./ln-if-absent BINCOPY = cp -p @@ -66,10 +65,8 @@ LIB2 = -lncbiobj LIB3 = -lncbicdr LIB4 = -lvibrant -LIB4 = LIB5 = -lncbiacc LIB20 = -lncbidesk -LIB20 = LIB22 = -lncbimmdb LIB23 = -lncbitool LIBCOMPADJ = -lblastcompadj @@ -111,9 +108,9 @@ ncbisort.c fa2htgs.c fastacmd.c formatdb.c formatrpsdb.c \ blast_driver.c blastall.c blastpgp.c testval.c seedtop.c \ makemat.c copymat.c profiles.c \ - megablast.c vecscreen.c gil2bin.c blastclust.c rpsblast.c \ - asn2xml.c debruijn.c asn2idx.c sortbyquote.c subfuse.c \ - pcretest.c pcredemo.c pcregrep.c + megablast.c vecscreen.c gil2bin.c blastclust.c rpsblast.c \ + asn2xml.c debruijn.c asn2idx.c sortbyquote.c subfuse.c \ + pcretest.c pcredemo.c pcregrep.c INTERNAL = testgen @@ -281,8 +278,8 @@ blastall : blastall.c $(THREAD_OBJ) $(CC) -o blastall $(LDFLAGS) blastall.c $(THREAD_OBJ) $(LIB61) \ - $(LIB60) $(LIB23) $(LIBCOMPADJ) $(LIB2) $(LIB1) \ - $(OTHERLIBS) $(THREAD_OTHERLIBS) + $(LIB60) $(PIC_OBJ) $(GIF_OBJ) -lvibgif $(LIB23) $(LIBCOMPADJ) $(LIB20) $(LIB2) $(LIB1) \ + $(OTHERLIBS) $(THREAD_OTHERLIBS) # blastpgp @@ -333,7 +330,7 @@ megablast : megablast.c $(THREAD_OBJ) $(CC) -o megablast $(LDFLAGS) megablast.c $(THREAD_OBJ) $(LIB61) \ - $(LIB60) $(LIB23) $(LIBCOMPADJ) $(LIB2) $(LIB1) $(OTHERLIBS) \ + $(LIB60) $(PIC_OBJ) $(GIF_OBJ) -lvibgif $(LIB23) $(LIBCOMPADJ) $(LIB20) $(LIB2) $(LIB1) $(OTHERLIBS) \ $(THREAD_OTHERLIBS) # vecscreen @@ -374,7 +371,7 @@ rpsblast : rpsblast.c $(THREAD_OBJ) $(CC) -o rpsblast $(LDFLAGS) rpsblast.c $(THREAD_OBJ) $(LIB61) \ - $(LIB60) $(LIB23) $(LIBCOMPADJ) $(LIB2) $(LIB1) $(OTHERLIBS) \ + $(LIB60) $(PIC_OBJ) $(GIF_OBJ) -lvibgif $(LIB23) $(LIBCOMPADJ) $(LIB20) $(LIB2) $(LIB1) $(OTHERLIBS) \ $(THREAD_OTHERLIBS) --- ncbi_c--May_15_2009/make/makenet.unx-dist 2008-12-10 15:23:29.000000000 -0600 +++ ncbi_c--May_15_2009/make/makenet.unx 2009-08-11 13:50:57.132973659 -0500 @@ -48,25 +48,21 @@ # default flags for compiling and loading - +LCL=lnx SUFFIXLCL = $(LCL) -CFLAGS1 = -c -O -LDFLAGS1 = -O -CC = cc +CFLAGS1 = -c -O -g +LDFLAGS1 = -O -v +CC = cc RAN = ls -l AR = ar OTHERLIBS = -lm -THREAD_OTHERLIBS = -lthread -THREAD_OTHERLIBS = +THREAD_OTHERLIBS = -lpthread THREAD_OBJ = ncbithr.o -THREAD_OBJ = -VIBLIBS = -VIBFLAG = -I/am/Motif/include -DWIN_MOTIF -VIBFLAG = -VIB = Nentrez ddv udv -VIB = -VIBLIBS= -lXm -lXmu -lXt -lX11 -VIBLIBS= +GIF_OBJ = salogif.o +PIC_OBJ = pictogif.o +VIBLIBS = -lXm -lXmu -lXt -lX11 +VIBFLAG = -DWIN_MOTIF +VIB = Nentrez ddv udv blast.REAL SEQUIN_OPTS = LIBCOPY = cp -p SRCCOPY = ./ln-if-absent @@ -95,7 +91,6 @@ BLIB3000 = libncbicn3dOGL.a ULIB31 = libvibnet.a BLIB31 = $(ULIB31) -BLIB31 = ULIB33 = libsmartnet.a BLIB33 = $(ULIB33) BLIB33 = @@ -920,25 +915,31 @@ ddv : $(OBJDDV) - $(CC) -o ddv $(LDFLAGS) $(OBJDDV) $(LIB41) $(LIB31) $(LIB20) $(LIB61) $(LIB60) $(LIB22) $(LIB45) \ + $(CC) -o ddv $(LDFLAGS) $(OBJDDV) $(LIB41) $(LIB31) $(LIB20) $(LIB61) \ + $(LIB60) $(PIC_OBJ) $(GIF_OBJ) $(LIB22) $(LIB45) \ $(LIB8) $(LIB7) $(NETCLILIB) $(LIB3) $(LIB4) $(LIB23) \ $(LIBCOMPADJ) $(LIB2) $(LIB1) \ $(VIBLIBS) $(OTHERLIBS) udv : $(OBJUDV) - $(CC) -o udv $(LDFLAGS) $(OBJUDV) $(LIB41) $(LIB31) $(LIB20) $(LIB61) $(LIB60) $(LIB22) $(LIB45) \ - $(LIB8) $(LIB7) $(NETCLILIB) $(LIB3) $(LIB4) \ + $(CC) -o udv $(LDFLAGS) $(OBJUDV) $(LIB41) $(LIB31) $(LIB20) $(LIB61) \ + $(LIB60) $(PIC_OBJ) $(GIF_OBJ) $(LIB22) $(LIB45) \ + $(LIB8) $(LIB7) $(NETCLILIB) $(LIB3) $(LIB4) \ $(LIB23) $(LIBCOMPADJ) $(LIB2) \ $(LIB1) $(VIBLIBS) $(OTHERLIBS) Nentrez : entrez.c $(ULIB31) - $(CC) -o Nentrez $(LDFLAGS) entrez.c $(LIB41) $(LIB31) $(LIB30) $(LIB20) $(LIB61) $(LIB60) $(LIB22) $(LIB45) \ - $(LIB36) $(LIB23) $(LIBCOMPADJ) $(LIB8) $(LIB7) $(NETCLILIB) $(LIB5) $(LIB4) $(LIB3) $(LIB2) $(LIB1) $(VIBLIBS) $(OTHERLIBS) + $(CC) -o Nentrez $(LDFLAGS) entrez.c $(LIB41) $(LIB31) $(LIB30) $(LIB20) $(LIB61) \ + $(LIB60) $(PIC_OBJ) $(GIF_OBJ) $(LIB22) $(LIB45) \ + $(LIB36) $(LIB23) $(LIBCOMPADJ) $(LIB8) $(LIB7) $(NETCLILIB) \ + $(LIB5) $(LIB4) $(LIB3) $(LIB2) $(LIB1) $(VIBLIBS) $(OTHERLIBS) # left this in (Tentrez) for script backwards compatibility Tentrez : entrez.c $(ULIB31) - $(CC) -o Tentrez $(LDFLAGS) entrez.c $(LIB41) $(LIB31) $(LIB30) $(LIB20) $(LIB61) $(LIB60) $(LIB22) $(LIB45) \ - $(LIB36) $(LIB23) $(LIBCOMPADJ) $(LIB8) $(LIB7) $(NETCLILIB) $(LIB5) $(LIB4) $(LIB3) $(LIB2) $(LIB1) $(VIBLIBS) $(OTHERLIBS) + $(CC) -o Tentrez $(LDFLAGS) entrez.c $(LIB41) $(LIB31) $(LIB30) $(LIB20) $(LIB61) \ + $(LIB60) $(PIC_OBJ) $(GIF_OBJ) $(LIB22) $(LIB45) \ + $(LIB36) $(LIB23) $(LIBCOMPADJ) $(LIB8) $(LIB7) $(NETCLILIB) \ + $(LIB5) $(LIB4) $(LIB3) $(LIB2) $(LIB1) $(VIBLIBS) $(OTHERLIBS) # demo program (network version of "seqget")