539
#define DO_NOT_SUPPRESS_BLAST_OP
542
728
#define NUMARG (sizeof(myargs)/sizeof(myargs[0]))
544
static Args myargs [] = {
545
{ "Program Name", /* 0 */
546
NULL, NULL, NULL, FALSE, 'p', ARG_STRING, 0.0, 0, NULL},
547
{ "Database", /* 1 */
548
"nr", NULL, NULL, FALSE, 'd', ARG_STRING, 0.0, 0, NULL},
549
{ "Query File", /* 2 */
550
"stdin", NULL, NULL, FALSE, 'i', ARG_FILE_IN, 0.0, 0, NULL},
551
{ "Expectation value (E)", /* 3 */
552
"10.0", NULL, NULL, FALSE, 'e', ARG_FLOAT, 0.0, 0, NULL},
553
{ "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", /* 4 */
554
"0", NULL, NULL, FALSE, 'm', ARG_INT, 0.0, 0, NULL},
555
{ "BLAST report Output File", /* 5 */
556
"stdout", NULL, NULL, TRUE, 'o', ARG_FILE_OUT, 0.0, 0, NULL},
557
{ "Filter query sequence (DUST with blastn, SEG with others)", /* 6 */
558
"T", NULL, NULL, FALSE, 'F', ARG_STRING, 0.0, 0, NULL},
559
{ "Cost to open a gap (zero invokes default behavior)", /* 7 */
560
"0", NULL, NULL, FALSE, 'G', ARG_INT, 0.0, 0, NULL},
561
{ "Cost to extend a gap (zero invokes default behavior)", /* 8 */
562
"0", NULL, NULL, FALSE, 'E', ARG_INT, 0.0, 0, NULL},
563
{ "X dropoff value for gapped alignment (in bits) (zero invokes default behavior)", /* 9 */
564
"0", NULL, NULL, FALSE, 'X', ARG_INT, 0.0, 0, NULL},
730
static Args myargs[] = {
732
NULL, NULL, NULL, FALSE, 'p', ARG_STRING, 0.0, 0, NULL}, /* ARG_PROGRAM */
734
"nr", NULL, NULL, FALSE, 'd', ARG_STRING, 0.0, 0, NULL}, /* ARG_DB */
736
"stdin", NULL, NULL, FALSE, 'i', ARG_FILE_IN, 0.0, 0, NULL}, /* ARG_QUERY */
737
{ "Expectation value (E)",
738
"10.0", NULL, NULL, FALSE, 'e', ARG_FLOAT, 0.0, 0, NULL}, /* ARG_EVALUE */
739
{ "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 */
740
"0", NULL, NULL, FALSE, 'm', ARG_INT, 0.0, 0, NULL}, /* ARG_FORMAT */
741
{ "BLAST report Output File",
742
"stdout", NULL, NULL, TRUE, 'o', ARG_FILE_OUT, 0.0, 0, NULL}, /* ARG_OUT */
743
{ "Filter query sequence (DUST with blastn, SEG with others)",
744
"T", NULL, NULL, FALSE, 'F', ARG_STRING, 0.0, 0, NULL}, /* ARG_FILTER */
745
{ "Cost to open a gap (zero invokes default behavior)",
746
"0", NULL, NULL, FALSE, 'G', ARG_INT, 0.0, 0, NULL}, /* ARG_GAPOPEN */
747
{ "Cost to extend a gap (zero invokes default behavior)",
748
"0", NULL, NULL, FALSE, 'E', ARG_INT, 0.0, 0, NULL}, /* ARG_GAPEXT */
749
{ "X dropoff value for gapped alignment (in bits) (zero invokes default "
750
"behavior)\n blastn 30, megablast 20, tblastx 0, all others 15",
751
"0", NULL, NULL, FALSE, 'X', ARG_INT, 0.0, 0, NULL}, /* ARG_XDROP */
565
752
{ "Show GI's in deflines", /* 10 */
566
"F", NULL, NULL, FALSE, 'I', ARG_BOOLEAN, 0.0, 0, NULL},
567
{ "Penalty for a nucleotide mismatch (blastn only)", /* 11 */
568
"-3", NULL, NULL, FALSE, 'q', ARG_INT, 0.0, 0, NULL},
569
{ "Reward for a nucleotide match (blastn only)", /* 12 */
570
"1", NULL, NULL, FALSE, 'r', ARG_INT, 0.0, 0, NULL},
571
{ "Number of database sequences to show one-line descriptions for (V)", /* 13 */
572
"500", NULL, NULL, FALSE, 'v', ARG_INT, 0.0, 0, NULL},
573
{ "Number of database sequence to show alignments for (B)", /* 14 */
574
"250", NULL, NULL, FALSE, 'b', ARG_INT, 0.0, 0, NULL},
575
{ "Threshold for extending hits, default if zero", /* 15 */
576
"0", NULL, NULL, FALSE, 'f', ARG_INT, 0.0, 0, NULL},
577
{ "Perfom gapped alignment (not available with tblastx)", /* 16 */
578
"T", NULL, NULL, FALSE, 'g', ARG_BOOLEAN, 0.0, 0, NULL},
753
"F", NULL, NULL, FALSE, 'I', ARG_BOOLEAN, 0.0, 0, NULL}, /* ARG_SHOWGIS */
754
{ "Penalty for a nucleotide mismatch (blastn only)",
755
"-3", NULL, NULL, FALSE, 'q', ARG_INT, 0.0, 0, NULL}, /* ARG_MISMATCH */
756
{ "Reward for a nucleotide match (blastn only)",
757
"1", NULL, NULL, FALSE, 'r', ARG_INT, 0.0, 0, NULL}, /* ARG_MATCH */
758
{ "Number of database sequences to show one-line descriptions for (V)",
759
"500", NULL, NULL, FALSE, 'v', ARG_INT, 0.0, 0, NULL}, /* ARG_DESCRIPTIONS */
760
{ "Number of database sequence to show alignments for (B)",
761
"250", NULL, NULL, FALSE, 'b', ARG_INT, 0.0, 0, NULL}, /* ARG_ALIGNMENTS */
762
{ "Threshold for extending hits, default if zero\n"
763
" blastp 11, blastn 0, blastx 12, tblastn 13\n"
764
" tblastx 13, megablast 0",
765
"0", NULL, NULL, FALSE, 'f', ARG_INT, 0.0, 0, NULL}, /* ARG_THRESHOLD */
766
{ "Perform gapped alignment (not available with tblastx)",
767
"T", NULL, NULL, FALSE, 'g', ARG_BOOLEAN, 0.0, 0, NULL}, /* ARG_GAPPED */
579
768
{ "Query Genetic code to use", /* 17 */
580
"1", NULL, NULL, FALSE, 'Q', ARG_INT, 0.0, 0, NULL},
769
"1", NULL, NULL, FALSE, 'Q', ARG_INT, 0.0, 0, NULL}, /* ARG_QGENETIC_CODE */
581
770
{ "DB Genetic code (for tblast[nx] only)", /* 18 */
582
"1", NULL, NULL, FALSE, 'D', ARG_INT, 0.0, 0, NULL},
771
"1", NULL, NULL, FALSE, 'D', ARG_INT, 0.0, 0, NULL}, /* ARG_DBGENETIC_CODE */
583
772
{ "Number of processors to use", /* 19 */
584
"1", NULL, NULL, FALSE, 'a', ARG_INT, 0.0, 0, NULL},
773
"1", NULL, NULL, FALSE, 'a', ARG_INT, 0.0, 0, NULL}, /* ARG_THREADS */
585
774
{ "SeqAlign file", /* 20 */
586
NULL, NULL, NULL, TRUE, 'O', ARG_FILE_OUT, 0.0, 0, NULL},
775
NULL, NULL, NULL, TRUE, 'O', ARG_FILE_OUT, 0.0, 0, NULL}, /* ARG_ASNOUT */
587
776
{ "Believe the query defline", /* 21 */
588
"F", NULL, NULL, FALSE, 'J', ARG_BOOLEAN, 0.0, 0, NULL},
777
"F", NULL, NULL, FALSE, 'J', ARG_BOOLEAN, 0.0, 0, NULL}, /* ARG_BELIEVEQUERY */
589
778
{ "Matrix", /* 22 */
590
"BLOSUM62", NULL, NULL, FALSE, 'M', ARG_STRING, 0.0, 0, NULL},
591
{ "Word size, default if zero", /* 23 */
592
"0", NULL, NULL, FALSE, 'W', ARG_INT, 0.0, 0, NULL},
593
{ "Effective length of the database (use zero for the real size)", /* 24 */
594
"0", NULL, NULL, FALSE, 'z', ARG_STRING, 0.0, 0, NULL},
595
{ "Number of best hits from a region to keep (off by default, if used a value of 100 is recommended)", /* 25 */
596
"0", NULL, NULL, FALSE, 'K', ARG_INT, 0.0, 0, NULL},
597
{ "0 for multiple hits 1-pass, 1 for single hit 1-pass, 2 for 2-pass", /* 26 */
598
"0", NULL, NULL, FALSE, 'P', ARG_INT, 0.0, 0, NULL},
599
{ "Effective length of the search space (use zero for the real size)", /* 27 */
600
"0", NULL, NULL, FALSE, 'Y', ARG_FLOAT, 0.0, 0, NULL},
601
{ "Query strands to search against database (for blast[nx], and tblastx). 3 is both, 1 is top, 2 is bottom", /* 28 */
602
"3", NULL, NULL, FALSE, 'S', ARG_INT, 0.0, 0, NULL},
779
"BLOSUM62", NULL, NULL, FALSE, 'M', ARG_STRING, 0.0, 0, NULL}, /* ARG_MATRIX */
780
{ "Word size, default if zero (blastn 11, megablast 28, "
781
"all others 3)", /* 23 */
782
"0", NULL, NULL, FALSE, 'W', ARG_INT, 0.0, 0, NULL}, /* ARG_WORDSIZE */
783
{ "Effective length of the database (use zero for the real size)",
784
"0", NULL, NULL, FALSE, 'z', ARG_FLOAT, 0.0, 0, NULL}, /* ARG_DBSIZE */
785
{ "Number of best hits from a region to keep (off by default, if used a value of 100 is recommended)",
786
"0", NULL, NULL, FALSE, 'K', ARG_INT, 0.0, 0, NULL}, /* ARG_BESTHITS */
787
{ "0 for multiple hit, 1 for single hit (does not apply to blastn)",
788
"0", NULL, NULL, FALSE, 'P', ARG_INT, 0.0, 0, NULL}, /* ARG_MULTIPLEHITS */
789
{ "Effective length of the search space (use zero for the real size)",
790
"0", NULL, NULL, FALSE, 'Y', ARG_FLOAT, 0.0, 0, NULL}, /* ARG_SEARCHSP */
791
{ "Query strands to search against database (for blast[nx], and tblastx)\n"
792
" 3 is both, 1 is top, 2 is bottom",
793
"3", NULL, NULL, FALSE, 'S', ARG_INT, 0.0, 0, NULL}, /* ARG_STRAND */
603
794
{ "Produce HTML output", /* 29 */
604
"F", NULL, NULL, FALSE, 'T', ARG_BOOLEAN, 0.0, 0, NULL},
795
"F", NULL, NULL, FALSE, 'T', ARG_BOOLEAN, 0.0, 0, NULL}, /* ARG_HTML */
605
796
#ifdef BLAST_CS_API
606
{ "Restrict search of database to results of Entrez2 lookup", /* 30 */
607
NULL, NULL, NULL, TRUE, 'u', ARG_STRING, 0.0, 0, NULL},
797
{ "Restrict search of database to results of Entrez2 lookup",
798
NULL, NULL, NULL, TRUE, 'u', ARG_STRING, 0.0, 0, NULL}, /* ARG_ENTREZQ */
609
{ "Restrict search of database to list of GI's", /* 30 */
610
NULL, NULL, NULL, TRUE, 'l', ARG_STRING, 0.0, 0, NULL},
800
{ "Restrict search of database to list of GI's",
801
NULL, NULL, NULL, TRUE, 'l', ARG_STRING, 0.0, 0, NULL}, /* ARG_GILIST */
612
{"Use lower case filtering of FASTA sequence", /* 31 */
613
"F", NULL,NULL,TRUE,'U',ARG_BOOLEAN, 0.0,0,NULL},
614
{ "Dropoff (X) for blast extensions in bits (0.0 invokes default behavior)", /* 32 */
615
"0.0", NULL, NULL, FALSE, 'y', ARG_FLOAT, 0.0, 0, NULL},
616
{ "X dropoff value for final gapped alignment (in bits)", /* 33 */
617
"0", NULL, NULL, FALSE, 'Z', ARG_INT, 0.0, 0, NULL},
803
{"Use lower case filtering of FASTA sequence",
804
NULL, NULL, NULL, TRUE, 'U', ARG_BOOLEAN, 0.0, 0, NULL}, /* ARG_LCASE */
805
{ "X dropoff value for ungapped extensions in bits (0.0 invokes default "
806
"behavior)\n blastn 20, megablast 10, all others 7",
807
"0.0", NULL, NULL, FALSE, 'y', ARG_FLOAT, 0.0, 0, NULL}, /* ARG_XDROP_UNGAPPED */
808
{ "X dropoff value for final gapped alignment in bits "
809
"(0.0 invokes default behavior)\n"
810
" blastn/megablast 50, tblastx 0, all others 25",
811
"0", NULL, NULL, FALSE, 'Z', ARG_INT, 0.0, 0, NULL}, /* ARG_XDROP_FINAL */
618
812
#ifdef BLAST_CS_API
619
813
{ "RPS Blast search", /* 34 */
620
"F", NULL, NULL, FALSE, 'R', ARG_BOOLEAN, 0.0, 0, NULL},
814
"F", NULL, NULL, FALSE, 'R', ARG_BOOLEAN, 0.0, 0, NULL}, /* ARG_RPSBLAST */
622
816
{ "PSI-TBLASTN checkpoint file", /* 34 */
623
NULL, NULL, NULL, TRUE, 'R', ARG_FILE_IN, 0.0, 0, NULL},
817
NULL, NULL, NULL, TRUE, 'R', ARG_FILE_IN, 0.0, 0, NULL}, /* ARG_PSITCHKPNT */
625
819
{ "MegaBlast search", /* 35 */
626
"F", NULL, NULL, FALSE, 'n', ARG_BOOLEAN, 0.0, 0, NULL},
820
"F", NULL, NULL, FALSE, 'n', ARG_BOOLEAN, 0.0, 0, NULL}, /* ARG_USEMEGABLAST */
627
821
{ "Location on query sequence",/* 36 */
628
NULL, NULL, NULL, TRUE, 'L', ARG_STRING, 0.0, 0, NULL},
629
{ "Multiple Hits window size (zero for single hit algorithm)", /* 37 */
630
"40", NULL, NULL, FALSE, 'A', ARG_INT, 0.0, 0, NULL},
631
#ifdef DO_NOT_SUPPRESS_BLAST_OP
632
{ "Frame shift penalty (OOF algorithm for blastx)", /* 38 */
633
"0", NULL, NULL, FALSE, 'w', ARG_INT, 0.0, 0, NULL},
634
{ "Length of the largest intron allowed in tblastn for linking HSPs (0 disables linking)", /* 39 */
635
"0", NULL, NULL, FALSE, 't', ARG_INT, 0.0, 0, NULL}
822
NULL, NULL, NULL, TRUE, 'L', ARG_STRING, 0.0, 0, NULL}, /* ARG_QUERYLOC */
823
{ "Multiple Hits window size, default if zero (blastn/megablast 0, "
824
"all others 40", /* 37 */
825
"0", NULL, NULL, FALSE, 'A', ARG_INT, 0.0, 0, NULL}, /* ARG_WINDOW */
826
{ "Frame shift penalty (OOF algorithm for blastx)",
827
"0", NULL, NULL, FALSE, 'w', ARG_INT, 0.0, 0, NULL}, /* ARG_FRAMESHIFT */
828
{ "Length of the largest intron allowed in a translated nucleotide "
830
"linking multiple distinct alignments. (0 invokes default behavior; a "
831
"negative value disables linking.)",
832
"0", NULL, NULL, FALSE, 't', ARG_INT, 0.0, 0, NULL}, /* ARG_INTRON */
834
seems ok to add another param b/c NUMARG is defined based on
835
sizeof(myargs) itself
836
made optional=TRUE but this may change?
839
{ "Number of concatenated queries, for blastn and tblastn",
840
"0", NULL, NULL, TRUE, 'B', ARG_INT, 0.0, 0, NULL} /* ARG_NUMQUERIES */
639
844
#ifdef BLAST_CS_API
640
BlastNet3Hptr BNETInitializeBlast(CharPtr database, CharPtr program,
845
static BlastNet3Hptr BNETInitializeBlast(CharPtr database, CharPtr program,
641
846
FILE *outfp, Boolean db_is_na,
642
Boolean is_rps_blast, Boolean html)
847
Boolean is_rps_blast, Boolean html, Boolean header)
644
849
BlastNet3Hptr bl3hp;
645
850
BlastResponsePtr response = NULL;
646
851
BlastVersionPtr blast_version;
648
853
if (! BlastInit("blastcl3", &bl3hp, &response)) {
649
ErrPostEx(SEV_FATAL, 0, 0, "Unable to initialize BLAST service");
854
ErrPostEx(SEV_FATAL, 1, 0, "Unable to initialize BLAST service");
652
857
if (response && response->choice == BlastResponse_init) {
653
858
blast_version = response->data.ptrvalue;
655
ErrPostEx(SEV_FATAL, 0, 0, "Unable to connect to the BLAST service");
860
ErrPostEx(SEV_FATAL, 1, 0, "Unable to connect to the BLAST service");
659
864
BlastNetBioseqFetchEnable(bl3hp, database, db_is_na, TRUE);
661
if(is_rps_blast == TRUE)
866
if(is_rps_blast == TRUE && header)
662
868
BlastPrintVersionInfoEx("RPS-BLAST", html, blast_version->version,
663
869
blast_version->date, outfp);
666
873
init_buff_ex(90);
667
874
BlastPrintVersionInfoEx(program, html, blast_version->version,
668
875
blast_version->date, outfp);
822
1046
handle_results = NULL;
824
BLASTOptionSetGapParams(options, myargs[22].strvalue, 0, 0);
825
options->expect_value = (Nlm_FloatHi) myargs [3].floatvalue;
826
number_of_descriptions = myargs[13].intvalue;
827
number_of_alignments = myargs[14].intvalue;
1048
BLASTOptionSetGapParams(options, myargs[ARG_MATRIX].strvalue, 0, 0);
1049
options->expect_value = (Nlm_FloatHi) myargs[ARG_EVALUE].floatvalue;
1050
number_of_descriptions = myargs[ARG_DESCRIPTIONS].intvalue;
1051
number_of_alignments = myargs[ARG_ALIGNMENTS].intvalue;
828
1052
options->hitlist_size = MAX(number_of_descriptions, number_of_alignments);
829
if (myargs[7].intvalue != 0)
830
options->gap_open = myargs[7].intvalue;
831
if (myargs[8].intvalue != 0)
832
options->gap_extend = myargs[8].intvalue;
833
if (myargs[9].intvalue != 0)
834
options->gap_x_dropoff = myargs[9].intvalue;
836
/* Multiple hits does not apply to blastn. */
837
if (StringICmp("blastn", blast_program)) {
838
if (myargs[26].intvalue == 0) {
839
options->two_pass_method = FALSE;
840
options->multiple_hits_only = TRUE;
841
} else if (myargs[26].intvalue == 1) {
842
options->two_pass_method = FALSE;
843
options->multiple_hits_only = FALSE;
845
options->two_pass_method = TRUE;
846
options->multiple_hits_only = FALSE;
1054
if (StringICmp("blastn", blast_program) == 0) {
1055
options->penalty = myargs[ARG_MISMATCH].intvalue;
1056
options->reward = myargs[ARG_MATCH].intvalue;
1057
if (options->reward > 1) {
1058
/* Scale the default values for gap costs; will be overridden
1059
later, if command line values are non-zero */
1060
options->gap_open *= options->reward;
1061
options->gap_extend *= options->reward;
1064
if (myargs[ARG_THRESHOLD].intvalue != 0) {
1065
options->threshold_second = myargs[ARG_THRESHOLD].intvalue;
1069
if (myargs[ARG_GAPOPEN].intvalue != 0)
1070
options->gap_open = myargs[ARG_GAPOPEN].intvalue;
1071
if (myargs[ARG_GAPEXT].intvalue != 0)
1072
options->gap_extend = myargs[ARG_GAPEXT].intvalue;
1073
if (myargs[ARG_XDROP].intvalue != 0)
1074
options->gap_x_dropoff = myargs[ARG_XDROP].intvalue;
1076
/* use one-hit if specified or it's a blastn search */
1077
if ( (myargs[ARG_MULTIPLEHITS].intvalue == 1) || (StringICmp("blastn", blast_program) == 0 ) )
1079
options->two_pass_method = FALSE;
1080
options->multiple_hits_only = FALSE;
1082
/* otherwise, use two-hit */
850
{ /* Reverse these for blastn for now. */
851
if (myargs[26].intvalue == 1) {
852
options->two_pass_method = FALSE;
853
options->multiple_hits_only = TRUE;
854
} else if (myargs[26].intvalue == 0) {
855
options->two_pass_method = FALSE;
856
options->multiple_hits_only = FALSE;
860
if(myargs[33].intvalue != 0)
861
options->gap_x_dropoff_final = myargs[33].intvalue;
863
if (StringICmp(myargs[6].strvalue, "T") == 0) {
1085
/* all other inputs, including the default 0 use 2-hit method */
1086
options->two_pass_method = FALSE;
1087
options->multiple_hits_only = TRUE;
1090
if(myargs[ARG_XDROP_FINAL].intvalue != 0)
1091
options->gap_x_dropoff_final = myargs[ARG_XDROP_FINAL].intvalue;
1093
if (StringICmp(myargs[ARG_FILTER].strvalue, "T") == 0) {
864
1094
if (StringICmp("blastn", blast_program) == 0)
865
1095
options->filter_string = StringSave("D");
867
1097
options->filter_string = StringSave("S");
869
options->filter_string = StringSave(myargs[6].strvalue);
872
show_gi = (Boolean) myargs[10].intvalue;
873
if (StringICmp("blastn", blast_program) == 0) {
874
options->penalty = myargs[11].intvalue;
875
options->reward = myargs[12].intvalue;
877
if (myargs[15].intvalue != 0) {
878
options->threshold_second = myargs[15].intvalue;
882
options->genetic_code = myargs[17].intvalue;
883
options->db_genetic_code = myargs[18].intvalue;
884
options->number_of_cpus = myargs[19].intvalue;
885
if (myargs[23].intvalue != 0) {
886
options->wordsize = myargs[23].intvalue;
1099
options->filter_string = StringSave(myargs[ARG_FILTER].strvalue);
1102
show_gi = (Boolean) myargs[ARG_SHOWGIS].intvalue;
1104
options->genetic_code = myargs[ARG_QGENETIC_CODE].intvalue;
1105
options->db_genetic_code = myargs[ARG_DBGENETIC_CODE].intvalue;
1106
options->number_of_cpus = myargs[ARG_THREADS].intvalue;
1107
if (myargs[ARG_WORDSIZE].intvalue != 0) {
1108
options->wordsize = myargs[ARG_WORDSIZE].intvalue;
889
1111
if (options->is_megablast_search) {
890
options->cutoff_s2 = options->wordsize;
891
options->wordsize += 4;
892
options->cutoff_s = options->wordsize;
1112
options->cutoff_s2 = options->wordsize*options->reward;
895
options->db_length = StringToInt8(myargs[24].strvalue, &dummystr);
1115
options->db_length = (Int8) myargs[ARG_DBSIZE].floatvalue;
897
options->hsp_range_max = myargs[25].intvalue;
1117
options->hsp_range_max = myargs[ARG_BESTHITS].intvalue;
898
1118
if (options->hsp_range_max != 0)
899
1119
options->perform_culling = TRUE;
900
if (myargs[27].floatvalue)
901
options->searchsp_eff = (Nlm_FloatHi) myargs[27].floatvalue;
1120
if (myargs[ARG_SEARCHSP].floatvalue)
1121
options->searchsp_eff = (Nlm_FloatHi) myargs[ARG_SEARCHSP].floatvalue;
903
options->strand_option = myargs[28].intvalue;
1123
options->strand_option = myargs[ARG_STRAND].intvalue;
905
if(myargs [32].floatvalue != 0.0) {
906
options->dropoff_2nd_pass = myargs [32].floatvalue;
1125
if(myargs[ARG_XDROP_UNGAPPED].floatvalue != 0.0) {
1126
options->dropoff_2nd_pass = myargs[ARG_XDROP_UNGAPPED].floatvalue;
907
1127
if(options->dropoff_1st_pass > options->dropoff_2nd_pass)
908
1128
options->dropoff_1st_pass = options->dropoff_2nd_pass;
911
options->window_size = myargs [37].intvalue;
1131
if (myargs[ARG_WINDOW].intvalue != 0)
1132
options->window_size = myargs[ARG_WINDOW].intvalue;
913
1134
print_options = 0;
914
1135
align_options = 0;
1338
1708
sap = sap->next;
1341
dsp = (DenseSegPtr) (seqalign->segs);
1342
while (tmp_slp && SeqIdComp(dsp->ids, SeqLocId(tmp_slp)) != SIC_YES)
1711
while (tmp_slp && SeqIdComp(sip, SeqLocId(tmp_slp)) != SIC_YES)
1343
1712
tmp_slp = tmp_slp->next;
1344
1713
if (tmp_slp == NULL) /* Should never happen */
1346
bsp = BioseqLockById(SeqLocId(tmp_slp));
1348
fprintf(outfp, "\n");
1349
AcknowledgeBlastQuery(bsp, 70, outfp, believe_query, html);
1715
/* Separate the mask locations list for this query */
1716
if (!mask_loc && next_mask_loc) {
1717
mask_loc = next_mask_loc;
1718
next_mask_loc = NULL;
1721
if (next_mask_loc) {
1722
mask_loc->next = next_mask_loc;
1723
mask_loc = next_mask_loc;
1725
mask_slp = (SeqLocPtr) mask_loc->data.ptrvalue;
1726
next_mask_loc = mask_loc;
1727
while (SeqIdComp(SeqLocId(mask_slp), sip) != SIC_YES) {
1728
mask_loc = mask_loc->next;
1731
mask_slp = (SeqLocPtr) mask_loc->data.ptrvalue;
1734
next_mask_loc = mask_loc->next;
1735
mask_loc->next = NULL;
1738
if (align_view < 7) {
1739
bsp = BioseqLockById(SeqLocId(tmp_slp));
1741
fprintf(outfp, "\n");
1742
AcknowledgeBlastQuery(bsp, 70, outfp, believe_query,
1353
if(align_view == 7 && !options->is_ooframe) {
1354
BXMLPrintOutput(xml_aip, seqalign,
1355
options, blast_program, blast_database,
1356
fake_bsp, other_returns, 0, NULL);
1357
AsnIoReset(xml_aip);
1358
SeqAlignSetFree(seqalign);
1748
if((align_view == 7) && !options->is_ooframe) {
1749
if (options->is_megablast_search) {
1750
bsp = BioseqLockById(SeqLocId(tmp_slp));
1751
BXMLPrintOutput(xml_aip, seqalign,
1752
options, blast_program, blast_database,
1753
bsp, other_returns, 0, NULL, mask_loc);
1755
AsnIoReset(xml_aip);
1756
SeqAlignSetFree(seqalign);
1758
num_iters = (num_queries>0) ? num_queries : 1;
1759
for (sap_iter=0; sap_iter < num_iters; sap_iter++) {
1760
curr_seqalign = (num_queries > 0) ? *(sap_array + sap_iter) : seqalign;
1761
BXMLPrintOutput(xml_aip, curr_seqalign,
1762
options, blast_program, blast_database,
1763
fake_bsp, other_returns, 0, NULL, mask_loc);
1764
AsnIoReset(xml_aip);
1765
SeqAlignSetFree(curr_seqalign);
1766
} /* for loop over sap-array (concat) */
1767
} /* not MBlast case */
1360
seqannot = SeqAnnotNew();
1362
AddAlignInfoToSeqAnnot(seqannot, align_type);
1363
seqannot->data = seqalign;
1365
SeqAnnotAsnWrite((SeqAnnotPtr) seqannot, aip, NULL);
1769
/* create the array of SeqAnnotPtrs, if necessary */
1771
num_iters = (num_queries > 0) ? num_queries : 1;
1772
for (sap_iter=0; sap_iter < num_iters; sap_iter++) {
1773
curr_seqalign = (num_queries > 0) ? *(sap_array + sap_iter) : seqalign;
1774
if ( (num_queries > 0) && (sap_iter == 0) ) {
1775
seq_annot_arr = (SeqAnnotPtrArray) MemNew(sizeof(SeqAnnotPtr)*num_queries);
1777
seqannot = SeqAnnotNew();
1779
AddAlignInfoToSeqAnnot(seqannot, align_type);
1780
seqannot->data = curr_seqalign;
1782
SeqAnnotAsnWrite((SeqAnnotPtr) seqannot, aip, NULL);
1785
if (num_queries > 0) {
1786
*(seq_annot_arr + sap_iter) = seqannot;
1788
} /* make seqannots over the sap_iters from concat, or the single seqalign */
1368
1790
if (outfp) { /* Uncacheing causes problems with ordinal nos. vs. gi's. */
1369
1791
ObjMgrSetHold();
1371
PrintDefLinesFromSeqAlignEx2(seqalign, 80, outfp, print_options, FIRST_PASS,
1372
NULL, number_of_descriptions, NULL, NULL);
1375
prune = BlastPruneHitsFromSeqAlign(seqalign, number_of_alignments, NULL);
1376
seqannot->data = prune->sap;
1378
if(options->is_ooframe) {
1379
OOFShowBlastAlignment(seqalign, /*mask*/ NULL,
1380
outfp, align_options, txmatrix);
1382
if (align_view != 0)
1383
ShowTextAlignFromAnnot(seqannot, 60, outfp, NULL, NULL, align_options, txmatrix, mask_loc, NULL);
1385
ShowTextAlignFromAnnot(seqannot, 60, outfp, NULL, NULL, align_options, txmatrix, mask_loc, FormatScoreFunc);
1388
seqannot->data = seqalign;
1389
prune = BlastPruneSapStructDestruct(prune);
1792
/* print deflines */
1793
for (sap_iter=0; sap_iter < num_iters; sap_iter++) {
1794
curr_seqalign = (num_queries > 0) ? *(sap_array + sap_iter) : seqalign;
1798
PrintDefLinesFromSeqAlignEx2(curr_seqalign, 80, outfp,
1799
print_options, FIRST_PASS, NULL,
1800
number_of_descriptions, NULL, NULL);
1802
} /* print deflines, looped if concat */
1804
for (sap_iter=0; sap_iter < num_iters; sap_iter++) {
1805
/* AM: Query concatenation. */
1806
if( mult_queries && mask_loc )
1808
orig_mask_loc = mask_loc;
1810
if( !mask_loc->data.ptrvalue ) mask_loc = NULL;
1813
curr_seqalign = (num_queries > 0) ? *(sap_array + sap_iter) : seqalign;
1814
curr_seqannot = (num_queries > 0) ? *(seq_annot_arr + sap_iter) : seqannot;
1816
prune = BlastPruneHitsFromSeqAlign(curr_seqalign,
1817
number_of_alignments, NULL);
1818
curr_seqannot->data = prune->sap;
1820
if(options->is_ooframe) {
1821
OOFShowBlastAlignment(curr_seqalign, /*mask*/ NULL,
1822
outfp, align_options, txmatrix);
1824
if (align_view != 0)
1825
ShowTextAlignFromAnnot(curr_seqannot, 60, outfp, NULL, NULL,
1826
align_options, txmatrix, mask_loc, NULL);
1828
ShowTextAlignFromAnnot(curr_seqannot, 60, outfp, NULL, NULL,
1829
align_options, txmatrix, mask_loc,
1833
curr_seqannot->data = curr_seqalign;
1834
prune = BlastPruneSapStructDestruct(prune);
1836
/* AM: Query concatenation. */
1837
if( mult_queries && orig_mask_loc )
1839
mask_loc = orig_mask_loc;
1840
mask_loc = mask_loc->next;
1842
} /* show text align, loop over seqalign/seqannots for concat */
1390
1843
ObjMgrClearHold();
1392
1845
ObjMgrFreeCache(0);
1847
for (sap_iter=0; sap_iter < num_queries; sap_iter++) {
1848
/* upper bound is num_queries, take care not to do this unless concat */
1849
*(seq_annot_arr + sap_iter) = SeqAnnotFree(*(seq_annot_arr + sap_iter));
1395
seqannot = SeqAnnotFree(seqannot);
1396
} /* if XML Printing */
1851
/*--KM free seqalign array and all seqaligns?? */
1853
} /* end of else (not XML Printing) */
1397
1854
if (options->is_megablast_search)
1398
1855
tmp_slp = tmp_slp->next;
1856
/* --KM watch for memory leaks */
1857
if (seqannot && num_queries == 0)
1400
1858
seqannot = SeqAnnotFree(seqannot);
1401
1859
seqalign = next_seqalign;
1860
} /* End of loop on all seqaligns */
1861
if (mask_loc && next_mask_loc)
1862
mask_loc->next = next_mask_loc;
1864
} /* end of align_view not tabular case */
1404
1865
} else { /* seqalign is NULL */
1405
if(align_view == 7 && !options->is_ooframe) {
1866
if((align_view == 7) && !options->is_ooframe) {
1406
1867
BlastErrorMsgPtr error_msg;
1407
1868
CharPtr message;