7476
7556
if (gbp == NULL) return;
7478
7558
for (vnp = gbp->keywords; vnp; vnp = vnp->next) {
7479
if (StringCmp((CharPtr)vnp->data.ptrvalue, "GDS") == 0) {
7559
if (StringCmp((CharPtr)vnp->data.ptrvalue, scfp->keyword) == 0) {
7483
ValNodeAddPointer (&(gbp->keywords), 0, StringSave ("GDS"));
7563
ValNodeAddPointer (&(gbp->keywords), 0, StringSave (scfp->keyword));
7566
static void RemoveKeywordCallback (BioseqPtr bsp, Pointer userdata)
7569
ValNodePtr vnp, prev_keyword, next_keyword;
7570
KeywordFormPtr scfp;
7573
Boolean ok_to_remove = TRUE;
7575
sep = SeqMgrGetSeqEntryForData (bsp);
7581
scfp = (KeywordFormPtr) userdata;
7583
if (scfp->pfp != NULL && scfp->fsp != NULL)
7585
gsp = GetSampleForSeqEntry (sep, bsp->idx.entityID, scfp->pfp, scfp->fsp);
7586
if (gsp == NULL || gsp->num_found == 0)
7588
ok_to_remove = FALSE;
7590
gsp = GetSampleFree (gsp);
7598
vnp = GetDescrOnSeqEntry (sep, Seq_descr_genbank);
7599
/* no GenBank descriptor, no keywords to remove */
7600
if (vnp == NULL) return;
7602
gbp = (GBBlockPtr) vnp->data.ptrvalue;
7603
/* No GBBlock, no keywords to remove */
7604
if (gbp == NULL) return;
7606
prev_keyword = NULL;
7607
for (vnp = gbp->keywords; vnp; vnp = next_keyword) {
7608
next_keyword = vnp->next;
7609
if (StringICmp((CharPtr)vnp->data.ptrvalue, scfp->keyword) == 0) {
7610
if (prev_keyword == NULL)
7612
gbp->keywords = next_keyword;
7616
prev_keyword->next = next_keyword;
7619
ValNodeFreeData (vnp);
7628
static void ApplyKeyword (IteM i, CharPtr keyword)
7632
KeywordFormData kfd;
7635
bfp = currentFormDataPtr;
7637
bfp = GetObjectExtra (i);
7639
if (bfp == NULL) return;
7640
sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
7641
if (sep == NULL) return;
7645
kfd.keyword = keyword;
7647
VisitBioseqsInSep (sep, &kfd, ApplyKeywordCallback);
7649
ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
7650
ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
7486
7655
extern void ApplyGDSKeyword (IteM i)
7492
bfp = currentFormDataPtr;
7494
bfp = GetObjectExtra (i);
7496
if (bfp == NULL) return;
7497
sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
7498
if (sep == NULL) return;
7500
VisitBioseqsInSep (sep, NULL, ApplyGDSKeywordCallback);
7502
ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
7503
ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
7508
static void DoApplyGDSKeywords (ButtoN b)
7510
StringConstraintFormPtr scfp;
7513
scfp = (StringConstraintFormPtr) GetObjectExtra (b);
7519
scfp->pfp = (ParseFieldPtr) DialogToPointer (scfp->string_src_dlg);
7520
scfp->fsp = FilterSetNew ();
7521
scfp->fsp->scp = (StringConstraintPtr) DialogToPointer (scfp->string_constraint_dlg);
7523
sep = GetTopSeqEntryForEntityID (scfp->input_entityID);
7524
if (sep == NULL) return;
7526
VisitBioseqsInSep (sep, scfp, ApplyGDSKeywordCallback);
7528
scfp->fsp = FilterSetFree (scfp->fsp);
7529
scfp->pfp = ParseFieldFree (scfp->pfp);
7531
ObjMgrSetDirtyFlag (scfp->input_entityID, TRUE);
7532
ObjMgrSendMsg (OM_MSG_UPDATE, scfp->input_entityID, 0, 0);
7535
Remove (scfp->form);
7538
extern void ApplyGDSKeywordWithStringConstraint (IteM i)
7541
StringConstraintFormPtr scfp;
7548
bfp = currentFormDataPtr;
7550
bfp = GetObjectExtra (i);
7552
if (bfp == NULL) return;
7554
scfp = (StringConstraintFormPtr) MemNew (sizeof (StringConstraintFormData));
7555
if (scfp == NULL) return;
7557
w = FixedWindow (-50, -33, -10, -10, "Apply GDS Keywords", StdCloseWindowProc);
7558
SetObjectExtra (w, scfp, StdCleanupExtraProc);
7559
scfp->form = (ForM) w;
7560
scfp->input_entityID = bfp->input_entityID;
7562
h = HiddenGroup (w, -1, 0, NULL);
7563
SetGroupSpacing (h, 10, 10);
7565
ppt = StaticPrompt (h, "Where", 0, 0, programFont, 'l');
7566
scfp->string_src_dlg = ParseFieldDestDialog (h, NULL, NULL);
7568
scfp->string_constraint_dlg = StringConstraintDialog (h, NULL, FALSE);
7570
c = HiddenGroup (h, 2, 0, NULL);
7571
b = PushButton (c, "Accept", DoApplyGDSKeywords);
7572
SetObjectExtra (b, scfp, NULL);
7573
b = PushButton (c, "Cancel", StdCancelButtonProc);
7575
AlignObjects (ALIGN_CENTER, (HANDLE) ppt,
7576
(HANDLE) scfp->string_src_dlg,
7577
(HANDLE) scfp->string_constraint_dlg,
7657
ApplyKeyword (i, "GDS");
7660
extern void ApplyTPAInferentialKeyword (IteM i)
7662
ApplyKeyword (i, "TPA:inferential");
7665
extern void ApplyTPAExperimentalKeyword (IteM i)
7667
ApplyKeyword (i, "TPA:experimental");
7670
static void DoApplyKeywords (ButtoN b)
7672
KeywordFormPtr scfp;
7675
scfp = (KeywordFormPtr) GetObjectExtra (b);
7681
scfp->pfp = (ParseFieldPtr) DialogToPointer (scfp->string_src_dlg);
7682
scfp->fsp = FilterSetNew ();
7683
scfp->fsp->scp = (StringConstraintPtr) DialogToPointer (scfp->string_constraint_dlg);
7684
scfp->keyword = SaveStringFromText (scfp->keyword_txt);
7686
sep = GetTopSeqEntryForEntityID (scfp->input_entityID);
7687
if (sep == NULL) return;
7689
VisitBioseqsInSep (sep, scfp, ApplyKeywordCallback);
7691
scfp->fsp = FilterSetFree (scfp->fsp);
7692
scfp->pfp = ParseFieldFree (scfp->pfp);
7694
ObjMgrSetDirtyFlag (scfp->input_entityID, TRUE);
7695
ObjMgrSendMsg (OM_MSG_UPDATE, scfp->input_entityID, 0, 0);
7698
Remove (scfp->form);
7701
extern void ApplyKeywordWithStringConstraint (IteM i)
7704
KeywordFormPtr scfp;
7711
bfp = currentFormDataPtr;
7713
bfp = GetObjectExtra (i);
7715
if (bfp == NULL) return;
7717
scfp = (KeywordFormPtr) MemNew (sizeof (KeywordFormData));
7718
if (scfp == NULL) return;
7720
w = FixedWindow (-50, -33, -10, -10, "Apply Keywords", StdCloseWindowProc);
7721
SetObjectExtra (w, scfp, StdCleanupExtraProc);
7722
scfp->form = (ForM) w;
7723
scfp->input_entityID = bfp->input_entityID;
7725
h = HiddenGroup (w, -1, 0, NULL);
7726
SetGroupSpacing (h, 10, 10);
7728
g = HiddenGroup (h, 2, 0, NULL);
7729
SetGroupSpacing (g, 10, 10);
7730
StaticPrompt (g, "Apply Keyword", 0, 0, programFont, 'l');
7731
scfp->keyword_txt = DialogText (g, "", 30, NULL);
7733
ppt = StaticPrompt (h, "Where", 0, 0, programFont, 'l');
7734
scfp->string_src_dlg = ParseFieldDestDialog (h, NULL, NULL);
7736
scfp->string_constraint_dlg = StringConstraintDialog (h, NULL, FALSE);
7738
c = HiddenGroup (h, 2, 0, NULL);
7739
b = PushButton (c, "Accept", DoApplyKeywords);
7740
SetObjectExtra (b, scfp, NULL);
7741
b = PushButton (c, "Cancel", StdCancelButtonProc);
7743
AlignObjects (ALIGN_CENTER, (HANDLE) g,
7745
(HANDLE) scfp->string_src_dlg,
7746
(HANDLE) scfp->string_constraint_dlg,
7755
static void DoRemoveKeywords (ButtoN b)
7757
KeywordFormPtr scfp;
7760
scfp = (KeywordFormPtr) GetObjectExtra (b);
7766
scfp->pfp = (ParseFieldPtr) DialogToPointer (scfp->string_src_dlg);
7767
scfp->fsp = FilterSetNew ();
7768
scfp->fsp->scp = (StringConstraintPtr) DialogToPointer (scfp->string_constraint_dlg);
7769
scfp->keyword = SaveStringFromText (scfp->keyword_txt);
7771
sep = GetTopSeqEntryForEntityID (scfp->input_entityID);
7772
if (sep == NULL) return;
7774
VisitBioseqsInSep (sep, scfp, RemoveKeywordCallback);
7776
scfp->fsp = FilterSetFree (scfp->fsp);
7777
scfp->pfp = ParseFieldFree (scfp->pfp);
7779
ObjMgrSetDirtyFlag (scfp->input_entityID, TRUE);
7780
ObjMgrSendMsg (OM_MSG_UPDATE, scfp->input_entityID, 0, 0);
7783
Remove (scfp->form);
7786
extern void RemoveKeywordWithStringConstraint (IteM i)
7789
KeywordFormPtr scfp;
7796
bfp = currentFormDataPtr;
7798
bfp = GetObjectExtra (i);
7800
if (bfp == NULL) return;
7802
scfp = (KeywordFormPtr) MemNew (sizeof (KeywordFormData));
7803
if (scfp == NULL) return;
7805
w = FixedWindow (-50, -33, -10, -10, "Remove Keywords", StdCloseWindowProc);
7806
SetObjectExtra (w, scfp, StdCleanupExtraProc);
7807
scfp->form = (ForM) w;
7808
scfp->input_entityID = bfp->input_entityID;
7810
h = HiddenGroup (w, -1, 0, NULL);
7811
SetGroupSpacing (h, 10, 10);
7813
g = HiddenGroup (h, 2, 0, NULL);
7814
SetGroupSpacing (g, 10, 10);
7815
StaticPrompt (g, "Remove Keyword", 0, 0, programFont, 'l');
7816
scfp->keyword_txt = DialogText (g, "", 30, NULL);
7818
ppt = StaticPrompt (h, "Where", 0, 0, programFont, 'l');
7819
scfp->string_src_dlg = ParseFieldDestDialog (h, NULL, NULL);
7821
scfp->string_constraint_dlg = StringConstraintDialog (h, NULL, FALSE);
7823
c = HiddenGroup (h, 2, 0, NULL);
7824
b = PushButton (c, "Accept", DoRemoveKeywords);
7825
SetObjectExtra (b, scfp, NULL);
7826
b = PushButton (c, "Cancel", StdCancelButtonProc);
7828
AlignObjects (ALIGN_CENTER, (HANDLE) g,
7830
(HANDLE) scfp->string_src_dlg,
7831
(HANDLE) scfp->string_constraint_dlg,
7586
7841
#if defined(OS_UNIX) || defined(OS_MSWIN)
7637
7874
{ "Plus", "Minus", "Mixed", "No Hits", "Unexpected", "Parse Error", "In Progress" };
7640
/* Looks at a portion of the list of sequences for strand correction.
7641
* Returns the number of sequences examined.
7644
GetSubListForRNAStrandCorrection
7645
(ValNodePtr start_list,
7647
CharPtr RNAstrandcmd)
7649
Int4 seq_num, cmd_len = 0, k;
7652
CharPtr args = NULL, cp, cp2, cmmd;
7654
Char path [PATH_MAX];
7655
Char file_line [256];
7658
CharPtr cmd_format = "%s -a \'%s\' > %s";
7661
CharPtr cmd_format = "%s -a \"%s\" > %s";
7664
if (start_list == NULL || num_seqs < 1 || StringHasNoText (RNAstrandcmd))
7671
/* calculate length of string needed for command */
7672
for (vnp = start_list, seq_num = 0;
7673
vnp != NULL && seq_num < num_seqs;
7674
vnp = vnp->next, seq_num++)
7676
SeqIdWrite (vnp->data.ptrvalue, tmp_id, PRINTID_TEXTID_ACC_ONLY, sizeof (tmp_id) - 1);
7677
cmd_len += StringLen (tmp_id) + 2;
7680
args = (CharPtr) MemNew (cmd_len * sizeof (Char));
7683
Message (MSG_ERROR, "Unable to allocate memory for strand script argument list");
7688
for (vnp = start_list, seq_num = 0;
7689
vnp != NULL && seq_num < num_seqs;
7690
vnp = vnp->next, seq_num++)
7692
SeqIdWrite (vnp->data.ptrvalue, cp, PRINTID_TEXTID_ACC_ONLY, cmd_len - (cp - args) - 1);
7693
cp += StringLen (cp);
7694
if (vnp->next != NULL && seq_num < num_seqs - 1)
7697
StringCat (cp, ",");
7700
StringCat (cp, ", ");
7706
cmd_len += 3 + StringLen (cmd_format) + StringLen (RNAstrandcmd) + StringLen (path);
7707
cmmd = (CharPtr) MemNew (cmd_len * sizeof (Char));
7710
args = MemFree (args);
7711
Message (MSG_ERROR, "Unable to allocate memory for RNA strand script command");
7715
sprintf (cmmd, cmd_format, RNAstrandcmd, args, path);
7718
args = MemFree (args);
7719
cmmd = MemFree (cmmd);
7721
fp = FileOpen (path, "r");
7728
while (fgets (file_line, sizeof (file_line) - 1, fp) != NULL)
7730
/* find SeqId that matches file line */
7731
cp = StringChr (file_line, '\t');
7738
cp2 = StringChr (cp, '\n');
7744
for (vnp = start_list, seq_num = 0;
7745
vnp != NULL && seq_num < num_seqs;
7746
vnp = vnp->next, seq_num++)
7748
SeqIdWrite (vnp->data.ptrvalue, tmp_id, PRINTID_TEXTID_ACC_ONLY, sizeof (tmp_id) - 1);
7749
if (StringCmp (tmp_id, file_line) == 0)
7751
for (k = 1; k <= RNAstrand_IN_PROGRESS; k++)
7753
if (StringCmp (cp, RNAstrand_strings [k - 1]) == 0
7754
|| (k == RNAstrand_MIXED
7755
&& StringNCmp (cp, RNAstrand_strings [k - 1],
7756
StringLen (RNAstrand_strings[k - 1])) == 0))
7771
static ValNodePtr GetListForRNAStrandCorrection (SeqEntryPtr sep)
7773
Char file_line [256];
7774
ValNodePtr sequence_list = NULL, vnp;
7775
Int4 num_sequences = 0, num_inspected;
7877
static void LimitAlignmentResults (SeqAlignPtr salp, Int4 num_results)
7880
SeqAlignPtr tmp_salp, last_salp = NULL;
7882
while (salp != NULL && k < num_results)
7888
if (last_salp != NULL)
7890
last_salp->next = NULL;
7892
while (salp != NULL)
7894
tmp_salp = salp->next;
7896
salp = SeqAlignFree (salp);
7902
static SBlastOptions*
7903
RNABlastOptionNew(void)
7906
SBlastOptions* options;
7908
Blast_SummaryReturn *extra_returns;
7911
extra_returns = Blast_SummaryReturnNew();
7912
rval = SBlastOptionsNew("blastn", &options,
7915
if (options == NULL)
7919
* options->expect_value = 1;
7921
SBlastOptionsSetEvalue(options, 1);
7924
* options->filter_string = StringSave("m L");
7926
SBlastOptionsSetFilterString(options, "m L");
7928
/* This replaces the following:
7929
* options->mb_template_length = 18;
7930
* options->mb_disc_type = MB_WORD_CODING;
7931
* options->is_megablast_search = TRUE;
7932
* options->discontinuous = TRUE;
7934
SBlastOptionsSetDiscMbParams(options, 18, MB_WORD_CODING);
7937
* options->wordsize = 11; \
7939
SBlastOptionsSetWordSize (options, 11);
7942
* options->hitlist_size = 20;
7944
options->hit_options->hitlist_size = 20;
7946
/* This replaces the following:
7947
* options->multiple_hits_only = TRUE;
7948
* options->window_size = 40;
7950
options->word_options->window_size = 40;
7952
/* This replaces the following:
7953
* options->reward = 1;
7954
* options->penalty = -3;
7955
* options->gap_open = 5;
7956
* options->gap_extend = 2;
7958
SBlastOptionsSetRewardPenaltyAndGapCosts(options, 1, -3, 5, 2, FALSE);
7960
extra_returns = Blast_SummaryReturnFree(extra_returns);
7966
RNAScreenSequence(BioseqPtr bsp, CharPtr database, SeqAlignPtr PNTR seqalign_ptr)
7969
SBlastOptions *blast_options;
7971
SeqAlignPtr seqalign = NULL;
7973
SBlastSeqalignArray* seqalign_arr = NULL;
7974
Blast_SummaryReturn *extra_returns;
7980
*seqalign_ptr = NULL;
7982
blast_options = RNABlastOptionNew();
7983
if (blast_options == NULL)
7986
slp = SeqLocWholeNew(bsp);
7987
if (database == NULL)
7988
database = "16Score";
7990
extra_returns = Blast_SummaryReturnNew();
7992
retval = Blast_DatabaseSearch(slp, database, NULL, blast_options, NULL, &seqalign_arr, NULL, extra_returns);
7993
extra_returns = Blast_SummaryReturnFree(extra_returns);
7994
blast_options = SBlastOptionsFree(blast_options);
7996
if (retval == 0 && seqalign_arr != NULL && seqalign_arr->num_queries >0)
7998
seqalign = seqalign_arr->array[0];
7999
seqalign_arr->array[0] = NULL;
8002
seqalign_arr = SBlastSeqalignArrayFree(seqalign_arr);
8004
/* limit results to first 20 alignments, as SMART does */
8005
LimitAlignmentResults (seqalign, 20);
8010
*seqalign_ptr = seqalign;
8018
typedef struct rnastrandcollection
8020
ValNodePtr sequence_list;
8021
Char path [PATH_MAX];
8026
} RNAStrandCollectionData, PNTR RNAStrandCollectionPtr;
8028
static Uint1 GetStatusForAlignmentList (SeqAlignPtr salp)
8030
Uint1 status = RNAstrand_NO_HITS;
8033
while (salp != NULL)
8035
AlnMgr2IndexSingleChildSeqAlign(salp);
8036
strand = AlnMgr2GetNthStrand(salp, 1);
8037
if (status == RNAstrand_NO_HITS)
8039
if (strand == Seq_strand_plus)
8041
status = RNAstrand_PLUS;
8043
else if (strand == Seq_strand_minus)
8045
status = RNAstrand_MINUS;
8049
return RNAstrand_UNEXPECTED;
8052
else if (strand == Seq_strand_plus)
8054
if (status != RNAstrand_PLUS)
8056
return RNAstrand_MIXED;
8059
else if (strand == Seq_strand_minus)
8061
if (status != RNAstrand_MINUS)
8063
return RNAstrand_MIXED;
8068
return RNAstrand_UNEXPECTED;
8075
static void GetOneRNAStrandednessInfo (BioseqPtr bsp, Pointer userdata)
8077
RNAStrandCollectionPtr rscp;
8078
SeqAlignPtr salp = NULL;
8080
if (bsp == NULL || !ISA_na (bsp->mol) || userdata == NULL)
8085
rscp = (RNAStrandCollectionPtr) userdata;
8087
if (rscp->mon != NULL) {
8088
MonitorIntValue (rscp->mon, rscp->count);
8092
RNAScreenSequence(bsp, rscp->path, &salp);
8094
ValNodeAddPointer (&(rscp->sequence_list),
8095
GetStatusForAlignmentList(salp),
8096
SeqIdFindBest (bsp->id, SEQID_GENBANK));
8097
salp = SeqAlignFree (salp);
8100
static void CountRNASequences (BioseqPtr bsp, Pointer userdata)
8102
RNAStrandCollectionPtr rscp;
8104
if (bsp == NULL || !ISA_na (bsp->mol) || userdata == NULL)
8109
rscp = (RNAStrandCollectionPtr) userdata;
8114
static ValNodePtr GetRNAStrandednessFromLocalDatabase (SeqEntryPtr sep, CharPtr database)
8116
RNAStrandCollectionData rscd;
7777
8118
if (sep == NULL) return NULL;
7779
if (RNAstrandcmd == NULL) {
7780
if (GetAppParam ("SEQUIN", "RNACORRECT", "RNASTRAND", NULL, file_line, sizeof (file_line))) {
7781
RNAstrandcmd = StringSaveNoNull (file_line);
7784
if (RNAstrandcmd == NULL)
7786
Message (MSG_ERROR, "RNASTRAND not set in config file!");
7791
VisitBioseqsInSep (sep, &sequence_list, GetAccessionList);
7793
if (sequence_list == NULL)
7795
Message (MSG_ERROR, "No sequences with accession numbers found!\n");
7799
vnp = sequence_list;
7800
while ((num_inspected = GetSubListForRNAStrandCorrection (vnp, 150, RNAstrandcmd)) != 0)
7802
num_sequences += num_inspected;
7803
while (num_inspected > 0 && vnp != NULL)
7810
return sequence_list;
8120
rscd.path [0] = '\0';
8121
GetAppParam ("NCBI", "NCBI", "DATA", "", rscd.path, sizeof (rscd.path));
8122
FileBuildPath (rscd.path, NULL, database);
8124
rscd.database = database;
8125
rscd.sequence_list = NULL;
8130
VisitBioseqsInSep (sep, &rscd, CountRNASequences);
8133
rscd.mon = MonitorIntNewEx ("RNA Strand Progress", 0, rscd.total - 1, FALSE);
8136
VisitBioseqsInSep (sep, &rscd, GetOneRNAStrandednessInfo);
8138
if (rscd.mon != NULL) {
8139
rscd.mon = MonitorFree (rscd.mon);
8143
return rscd.sequence_list;
7813
8147
static void DoOneReverse (ValNodePtr vnp, Boolean rev_feats)
8888
9231
ParseCollectionDate (i, FALSE);
9235
static CharPtr GetIDStringForSeqEntry (SeqEntryPtr sep)
9238
BioseqPtr bsp = NULL;
9239
SeqIdPtr sip = NULL;
9242
if (sep == NULL || sep->data.ptrvalue == NULL)
9247
if (IS_Bioseq_set (sep))
9249
bssp = (BioseqSetPtr) sep->data.ptrvalue;
9250
if (bssp->_class == BioseqseqSet_class_nuc_prot
9251
|| bssp->_class == BioseqseqSet_class_segset)
9253
sep = bssp->seq_set;
9254
while (sep != NULL && (IS_Bioseq_set (sep) || sep->data.ptrvalue == NULL))
9260
bsp = (BioseqPtr) sep->data.ptrvalue;
9264
else if (IS_Bioseq(sep))
9266
bsp = (BioseqPtr) sep->data.ptrvalue;
9268
if (bsp == NULL) return NULL;
9269
sip = SeqIdFindBest (bsp->id, SEQID_GENBANK);
9270
if (sip == NULL) return NULL;
9272
SeqIdWrite (sip, id_txt, PRINTID_REPORT, sizeof (id_txt) - 1);
9273
return StringSave (id_txt);
9277
static int LIBCALLBACK SortSeqEntryByIDStr (VoidPtr ptr1, VoidPtr ptr2)
9286
if (ptr1 != NULL && ptr2 != NULL) {
9287
vnp1 = *((ValNodePtr PNTR) ptr1);
9288
vnp2 = *((ValNodePtr PNTR) ptr2);
9289
if (vnp1 != NULL && vnp2 != NULL) {
9290
str1 = GetIDStringForSeqEntry (vnp1);
9291
str2 = GetIDStringForSeqEntry (vnp2);
9292
if (str1 != NULL && str2 != NULL) {
9293
rval = StringICmp (str1, str2);
9295
str1 = MemFree (str1);
9296
str2 = MemFree (str2);
9303
extern Int2 LIBCALLBACK ReorderSetByAccession (Pointer data)
9306
OMProcControlPtr ompcp;
9307
ObjMgrDataPtr omdptop;
9313
/* Check parameters and get a pointer to the current data */
9315
ompcp = (OMProcControlPtr) data;
9317
return OM_MSG_RET_ERROR;
9319
if (ompcp->input_itemtype != OBJ_BIOSEQSET || ompcp->input_data == NULL) {
9320
Message (MSG_ERROR, "Must select Bioseq Set!");
9321
return OM_MSG_RET_ERROR;
9324
bssp = (BioseqSetPtr) ompcp->input_data;
9325
sep = SeqMgrGetSeqEntryForData (bssp);
9326
SaveSeqEntryObjMgrData (sep, &omdptop, &omdata);
9327
GetSeqEntryParent (sep, &parentptr, &parenttype);
9329
bssp->seq_set = ValNodeSort (bssp->seq_set, SortSeqEntryByIDStr);
9332
SeqMgrLinkSeqEntry (sep, parenttype, parentptr);
9333
RestoreSeqEntryObjMgrData (sep, omdptop, &omdata);
9334
ObjMgrSetDirtyFlag (ompcp->input_entityID, TRUE);
9335
ObjMgrSendMsg (OM_MSG_UPDATE, ompcp->input_entityID, 0, 0);