560
600
} else if (batch == 3) {
562
aip = AsnIoOpen (path3, "w");
563
if (aip == NULL) return;
565
SeqEntryAsnWrite (sep, aip, NULL);
568
fsep = FindNthBioseq (sep, 1);
569
if (fsep == NULL || fsep->choice != 1) return;
570
bsp = (BioseqPtr) fsep->data.ptrvalue;
571
if (bsp == NULL) return;
572
SeqIdWrite (bsp->id, buf, PRINTID_FASTA_LONG, sizeof (buf));
602
SaveAsn2gnbk (sep, path1, format, mode, style, flags, locks, custom);
604
aip = AsnIoOpen (path3, "w");
605
if (aip == NULL) return;
607
SeqEntryAsnWrite (sep, aip, NULL);
610
fsep = FindNthBioseq (sep, 1);
611
if (fsep == NULL || fsep->choice != 1) return;
612
bsp = (BioseqPtr) fsep->data.ptrvalue;
613
if (bsp == NULL) return;
614
SeqIdWrite (bsp->id, buf, PRINTID_FASTA_LONG, sizeof (buf));
616
arguments [0] = '\0';
617
sprintf (arguments, "-format %s -mode %s -style %s -view %s",
618
fffmt [(int) format], ffmod [(int) mode], ffstl [(int) style], ffvew [(int) format]);
620
sprintf (cmmd, "%s %s -i %s -o %s", asn2flat, arguments, path3, path2);
624
sprintf (cmmd, "%s -o %s -n %s -d reports", ffdiff, path1, path2);
627
sprintf (cmmd, "rm %s; rm %s", path1, path2);
630
sprintf (cmmd, "sort %s | uniq -c > %s.suc; rm %s", path1, path1, path1);
633
sprintf (cmmd, "sort %s | uniq -c > %s.suc; rm %s", path2, path2, path2);
636
sprintf (cmmd, "diff %s.suc %s.suc > %s", path1, path2, path3);
639
sprintf (cmmd, "cat %s", path3);
640
fpo = popen (cmmd, "r");
642
while ((ct = fread (buf, 1, sizeof (buf), fpo)) > 0) {
643
fwrite (buf, 1, ct, fp);
649
sprintf (cmmd, "rm %s.suc; rm %s.suc", path1, path2);
653
} else if (batch == 4) {
655
aip = AsnIoOpen (path3, "w");
656
if (aip == NULL) return;
658
SeqEntryAsnWrite (sep, aip, NULL);
661
fsep = FindNthBioseq (sep, 1);
662
if (fsep == NULL || fsep->choice != 1) return;
663
bsp = (BioseqPtr) fsep->data.ptrvalue;
664
if (bsp == NULL) return;
665
SeqIdWrite (bsp->id, buf, PRINTID_FASTA_LONG, sizeof (buf));
667
arguments [0] = '\0';
668
sprintf (arguments, "-format %s -mode %s -style %s -view %s -nocleanup",
669
fffmt [(int) format], ffmod [(int) mode], ffstl [(int) style], ffvew [(int) format]);
671
sprintf (cmmd, "%s %s -i %s -o %s", asn2flat, arguments, path3, path1);
674
arguments [0] = '\0';
675
sprintf (arguments, "-format %s -mode %s -style %s -view %s",
676
fffmt [(int) format], ffmod [(int) mode], ffstl [(int) style], ffvew [(int) format]);
678
sprintf (cmmd, "%s %s -i %s -o %s", asn2flat, arguments, path3, path2);
682
sprintf (cmmd, "%s -o %s -n %s -d reports", ffdiff, path1, path2);
685
sprintf (cmmd, "rm %s; rm %s", path1, path2);
688
sprintf (cmmd, "sort %s | uniq -c > %s.suc; rm %s", path1, path1, path1);
691
sprintf (cmmd, "sort %s | uniq -c > %s.suc; rm %s", path2, path2, path2);
694
sprintf (cmmd, "diff %s.suc %s.suc > %s", path1, path2, path3);
697
sprintf (cmmd, "cat %s", path3);
698
fpo = popen (cmmd, "r");
700
while ((ct = fread (buf, 1, sizeof (buf), fpo)) > 0) {
701
fwrite (buf, 1, ct, fp);
707
sprintf (cmmd, "rm %s.suc; rm %s.suc", path1, path2);
711
} else if (batch == 5) {
713
aip = AsnIoOpen (path3, "w");
714
if (aip == NULL) return;
716
SeqEntryAsnWrite (sep, aip, NULL);
574
719
if (FindNucBioseq (sep) != NULL) {
953
1098
starttime = GetSecs ();
954
useGbdjoin = (Boolean) (format == GENBANK_FMT && (! hasRefSeq));
1099
useFfdiff = (Boolean) (format == GENBANK_FMT && (! hasRefSeq));
955
1100
CompareFlatFiles (path1, path2, path3, sep, ofp,
956
1101
format, altformat, mode, style, flags, locks,
957
custom, extra, batch, gbdjoin, useGbdjoin);
1102
custom, extra, batch, ffdiff, asn2flat, useFfdiff);
958
1103
stoptime = GetSecs ();
959
1104
if (stoptime - starttime > worsttime) {
960
1105
worsttime = stoptime - starttime;
1185
1331
FALSE, 'h', ARG_INT, 0.0, 0, NULL},
1186
1332
{"Custom Flags (2 HideMostImpFeats, 4 HideSnpFeats)", "0", NULL, NULL,
1187
1333
FALSE, 'u', ARG_INT, 0.0, 0, NULL},
1188
{"ASN.1 Type (a Any, e Seq-entry, b Bioseq, s Bioseq-set, m Seq-submit, t Batch Report)", "a", NULL, NULL,
1334
{"ASN.1 Type (a Any, e Seq-entry, b Bioseq, s Bioseq-set, m Seq-submit, t Batch Bioseq-set, u Batch Seq-submit)", "a", NULL, NULL,
1189
1335
TRUE, 'a', ARG_STRING, 0.0, 0, NULL},
1190
{"Batch (1 Report, 2 Sequin/Release)", "0", NULL, NULL,
1336
{"Batch (1 Report, 2 Sequin/Release, 3 asn2gb/asn2flat, 4 asn2flat BSEC/nocleanup, 5 oldasn2gb/newasn2gb)", "0", "0", "5",
1191
1337
FALSE, 't', ARG_INT, 0.0, 0, NULL},
1192
{"Bioseq-set is Binary", "F", NULL, NULL,
1338
{"Input File is Binary", "F", NULL, NULL,
1193
1339
TRUE, 'b', ARG_BOOLEAN, 0.0, 0, NULL},
1194
{"Bioseq-set is Compressed", "F", NULL, NULL,
1340
{"Batch File is Compressed", "F", NULL, NULL,
1195
1341
TRUE, 'c', ARG_BOOLEAN, 0.0, 0, NULL},
1196
1342
{"Propagate Top Descriptors", "F", NULL, NULL,
1197
1343
TRUE, 'p', ARG_BOOLEAN, 0.0, 0, NULL},
1203
1349
TRUE, 'A', ARG_STRING, 0.0, 0, NULL},
1205
1351
#ifdef PROC_I80X86
1206
{"Gbdjoin Executable", "gbdjoin", NULL, NULL,
1352
{"Ffdiff Executable", "ffdiff", NULL, NULL,
1207
1353
TRUE, 'q', ARG_FILE_IN, 0.0, 0, NULL},
1354
{"Asn2Flat Executable", "asn2flat", NULL, NULL,
1355
TRUE, 'n', ARG_FILE_IN, 0.0, 0, NULL},
1209
{"Gbdjoin Executable", "/netopt/genbank/subtool/bin/gbdjoin", NULL, NULL,
1357
{"Ffdiff Executable", "/netopt/genbank/subtool/bin/ffdiff", NULL, NULL,
1210
1358
TRUE, 'q', ARG_FILE_IN, 0.0, 0, NULL},
1359
{"Asn2Flat Executable", "asn2flat", NULL, NULL,
1360
TRUE, 'n', ARG_FILE_IN, 0.0, 0, NULL},
1212
1362
{"SeqLoc From", "0", NULL, NULL,
1213
1363
TRUE, 'j', ARG_INT, 0.0, 0, NULL},