2961
3050
Message (MSG_OK, "Some manual desktop manipulations remain");
3054
static void CollectBioseqsForConversion (BioseqPtr bsp, Pointer userdata)
3056
ValNodePtr PNTR list;
3058
if (bsp == NULL || bsp->repr != Seq_repr_raw || ISA_aa (bsp->mol)) return;
3059
if (userdata == NULL)
3063
list = (ValNodePtr PNTR) userdata;
3065
ValNodeAddPointer (list, 0, bsp);
3068
static ValNodePtr GetAnnotListForBspList (ValNodePtr bsp_list)
3072
ValNodePtr complete_annot_list = NULL, align_annot_list;
3073
ValNodePtr annot_vnp, vnp, bsp_vnp;
3076
for (bsp_vnp = bsp_list; bsp_vnp != NULL; bsp_vnp = bsp_vnp->next)
3078
bsp = (BioseqPtr)(bsp_vnp->data.ptrvalue);
3079
align_annot_list = FindAlignSeqAnnotsForBioseq (bsp);
3080
for (annot_vnp = align_annot_list; annot_vnp != NULL; annot_vnp = annot_vnp->next)
3082
sanp = (SeqAnnotPtr) annot_vnp->data.ptrvalue;
3083
if (sanp->type == 2 && sanp->data != NULL)
3085
for (vnp = complete_annot_list, found = FALSE;
3086
vnp != NULL && !found;
3089
if (vnp->data.ptrvalue == sanp)
3096
ValNodeAddPointer (&complete_annot_list, 0, sanp);
3100
align_annot_list = ValNodeFree (align_annot_list);
3102
return complete_annot_list;
3107
CleanupAlignmentsAfterConversion
3108
(ValNodePtr adjusted_bsp_list,
3111
ValNodePtr align_annot_list, annot_vnp;
3114
align_annot_list = GetAnnotListForBspList (adjusted_bsp_list);
3115
for (annot_vnp = align_annot_list;
3117
annot_vnp = annot_vnp->next)
3119
sanp = annot_vnp->data.ptrvalue;
3120
if (sanp != NULL && sanp->type == 2)
3122
ConsolidateSegmentsOverKnownLengthGaps (sanp->data);
3123
FixOneAlignmentOverGaps (sanp->data, entityID);
3126
align_annot_list = ValNodeFree (align_annot_list);
3127
DeleteMarkedObjects (entityID, 0, NULL);
3131
static void CorrectAlignmentsAfterNToGapConversion (SeqEntryPtr sep, Uint2 entityID)
3133
ValNodePtr adjusted_bsp_list = NULL;
3135
VisitBioseqsInSep (sep, &adjusted_bsp_list, CollectBioseqsForConversion);
3136
CleanupAlignmentsAfterConversion (adjusted_bsp_list, entityID);
3137
adjusted_bsp_list = ValNodeFree (adjusted_bsp_list);
3140
static void ConvertNsToGapsWithSizeList (Uint2 entityID, Int4Ptr gap_sizes, Boolean adjust_cds)
3142
ValNodePtr adjusted_bsp_list = NULL;
3145
sep = GetTopSeqEntryForEntityID (entityID);
3146
if (sep == NULL) return;
3147
VisitBioseqsInSep (sep, &adjusted_bsp_list, CollectBioseqsForConversion);
3151
/* remove the gap locations from the coding regions first */
3152
VisitBioseqsInSep (sep, gap_sizes, PrepareCodingRegionLocationsForDeltaConversionCallback);
3155
VisitBioseqsInSep (sep, gap_sizes, ConvertNsToGaps);
3156
CleanupAlignmentsAfterConversion (adjusted_bsp_list, entityID);
3157
adjusted_bsp_list = ValNodeFree (adjusted_bsp_list);
3158
ObjMgrSetDirtyFlag (entityID, TRUE);
3159
ObjMgrSendMsg (OM_MSG_UPDATE, entityID, 0, 0);
2964
3163
static void RawSeqToDeltaSeq (IteM i)
2967
3166
BaseFormPtr bfp;
2971
3169
bfp = currentFormDataPtr;
3549
3726
} DeltaConversionData, PNTR DeltaConversionPtr;
3730
AdjustOneAlignmentForOneBioseqBasedOnGapLocations
3731
(SeqAlignPtr salp_to_adjust,
3734
SeqAlignPtr gap_salp)
3742
Int4 cumulative_offset = 0;
3745
if (salp_to_adjust == NULL || salp_to_adjust->segtype != SAS_DENSEG
3746
|| bsp == NULL || gaps == NULL)
3748
return salp_to_adjust;
3751
dsp = (DenseSegPtr) salp_to_adjust->segs;
3753
return salp_to_adjust;
3757
while (sip != NULL && aln_index == 0)
3759
aln_index = SeqIdOrderInBioseqIdList (sip, dsp->ids);
3765
if (aln_index == 0) {
3766
/* bioseq not in alignment */
3767
return salp_to_adjust;
3770
for (gap_vnp = gaps; gap_vnp != NULL; gap_vnp = gap_vnp->next)
3772
glip = (GapLocInfoPtr) gap_vnp->data.ptrvalue;
3773
if (glip == NULL || glip->replace)
3777
gap_start = glip->start_pos;
3778
if (gap_salp != NULL)
3780
gap_start = AlnMgr2MapSeqAlignToBioseq(gap_salp, gap_start, aln_index);
3786
gap_start += cumulative_offset;
3787
if (gap_start > bsp->length)
3791
slp = SeqLocIntNew (gap_start, gap_start + glip->length - 1, Seq_strand_plus, sip);
3792
salp_to_adjust = SeqAlignInsertByLoc (slp, salp_to_adjust);
3793
cumulative_offset += glip->length;
3796
return salp_to_adjust;
3800
static void ShiftAlignmentForGapLocations (SeqAnnotPtr sanp, ValNodePtr gaps)
3804
Int4 alignment_position = 0, k;
3805
Int4 cumulative_offset = 0;
3806
BoolPtr shift_this_row;
3807
Int4 seg_num = 0, shift_seg;
3811
if (sanp == NULL || sanp->data == NULL || sanp->type != 2 || gaps == NULL)
3816
salp = (SeqAlignPtr) sanp->data;
3817
if (salp->segtype != SAS_DENSEG || salp->segs == NULL)
3822
dsp = (DenseSegPtr) salp->segs;
3824
shift_this_row = (BoolPtr) MemNew (sizeof (Boolean) * dsp->dim);
3826
for (gap_vnp = gaps; gap_vnp != NULL; gap_vnp = gap_vnp->next)
3828
glip = (GapLocInfoPtr) gap_vnp->data.ptrvalue;
3829
if (glip == NULL || glip->replace)
3833
while (seg_num < dsp->numseg
3834
&& alignment_position + dsp->lens [seg_num] < glip->start_pos + cumulative_offset)
3837
alignment_position += dsp->lens [seg_num];
3841
if (seg_num < dsp->numseg)
3843
dsp->lens [seg_num] += glip->length;
3844
for (k = 0; k < dsp->dim; k++)
3846
if (dsp->starts [seg_num * dsp->dim + k] == -1)
3848
shift_this_row[k] = FALSE;
3852
shift_this_row[k] = TRUE;
3856
/* shift the rows for which a gap was inserted */
3857
for (k = 0; k < dsp->dim; k++)
3859
if (!shift_this_row[k])
3863
/* shift start for minus strand rows for seg_num only */
3864
if (dsp->strands != NULL
3865
&& dsp->strands [seg_num * dsp->dim + k] == Seq_strand_minus
3866
&& dsp->starts [seg_num * dsp->dim + k] != -1)
3868
dsp->starts [seg_num * dsp->dim + k] -= glip->length;
3870
/* shift starts for rows after seg_num */
3871
for (shift_seg = seg_num + 1;
3872
shift_seg < dsp->numseg;
3875
if (dsp->starts [shift_seg * dsp->dim + k] != -1)
3877
if (dsp->strands == NULL
3878
|| dsp->strands [shift_seg * dsp->dim + k] != Seq_strand_minus)
3880
dsp->starts [shift_seg * dsp->dim + k] += glip->length;
3884
dsp->starts [shift_seg * dsp->dim + k] -= glip->length;
3890
cumulative_offset += glip->length;
3892
shift_this_row = MemFree (shift_this_row);
3896
AdjustAlignmentsBasedOnGapLocations
3897
(ValNodePtr adjusted_bsp_list,
3902
ValNodePtr align_annot_list, annot_vnp, bsp_vnp;
3903
SeqAnnotPtr sanp, adjustment_sanp = NULL;
3905
Int4 cumulative_offset = 0;
3907
for (bsp_vnp = adjusted_bsp_list; bsp_vnp != NULL; bsp_vnp = bsp_vnp->next)
3909
bsp = (BioseqPtr)(bsp_vnp->data.ptrvalue);
3910
align_annot_list = FindAlignSeqAnnotsForBioseq (bsp);
3911
for (annot_vnp = align_annot_list;
3913
annot_vnp = annot_vnp->next)
3915
sanp = annot_vnp->data.ptrvalue;
3916
if (sanp != NULL && sanp->type == 2)
3918
if (sanp->data == salp)
3920
adjustment_sanp = sanp;
3924
sanp->data = AdjustOneAlignmentForOneBioseqBasedOnGapLocations
3925
(sanp->data, bsp, gaps, salp);
3929
align_annot_list = ValNodeFree (align_annot_list);
3932
if (adjustment_sanp != NULL)
3934
ShiftAlignmentForGapLocations (adjustment_sanp, gaps);
3937
CleanupAlignmentsAfterConversion (adjusted_bsp_list, entityID);
3552
3942
ConvertRawBioseqToDelta
3553
3943
(BioseqPtr bsp,
4955
5399
ChangeGeneFeatureSelection (fgp);
4958
typedef struct genetocdsform
4962
PopuP gene_qual_popup;
4963
PopuP gene_qual_popup2;
4964
PopuP gene_qual_popup3;
4965
GrouP qual_caps_grp;
4967
ButtoN remove_qual_btn1;
4968
ButtoN remove_qual_btn2;
4969
ButtoN remove_qual_btn3;
4972
Int4 gene_qual_choice;
4973
Int4 gene_qual_choice2;
4974
Int4 gene_qual_choice3;
4975
CharPtr append_string;
4977
Boolean remove_gene_qual1;
4978
Boolean remove_gene_qual2;
4979
Boolean remove_gene_qual3;
4982
Boolean data_in_log;
4984
} GeneToCDSFormData, PNTR GeneToCDSFormPtr;
4986
static CharPtr GetQualStringForQualChoice (GeneRefPtr grp, SeqFeatPtr sfp, Int4 choice)
5004
static Int4 GetGeneQualChoice (GeneToCDSFormPtr gcfp, SeqFeatPtr sfp, GeneRefPtr grp)
5006
if (gcfp == NULL) return 0;
5008
if (gcfp->gene_qual_choice != 1
5009
&& StringHasNoText (GetQualStringForQualChoice (grp, sfp, gcfp->gene_qual_choice)))
5011
if (gcfp->gene_qual_choice2 != 1
5012
&& StringHasNoText (GetQualStringForQualChoice (grp, sfp, gcfp->gene_qual_choice2)))
5014
return gcfp->gene_qual_choice3;
5018
return gcfp->gene_qual_choice2;
5023
return gcfp->gene_qual_choice;
5027
static void LogGeneToCDSNoProtein (GeneToCDSFormPtr gcfp, CharPtr gene_label, SeqIdPtr sip)
5031
if (gcfp == NULL || gcfp->log_fp == NULL || sip == NULL) return;
5034
SeqIdWrite (SeqIdFindBest (sip, 0), id, PRINTID_FASTA_LONG, sizeof (id) - 1);
5036
if (StringHasNoText (gene_label))
5038
fprintf (gcfp->log_fp, "No protein added for unlabeled gene on sequence %s\n", id);
5042
fprintf (gcfp->log_fp, "No protein added for %s on sequence %s\n", gene_label, id);
5044
gcfp->data_in_log = TRUE;
5047
static void GeneToCDSCallback (SeqFeatPtr sfp, Pointer userdata)
5052
SeqMgrFeatContext context;
5057
SeqEntryPtr psep, nsep, old, topsep;
5063
Boolean partial5, partial3;
5067
CharPtr protName = NULL;
5068
GeneToCDSFormPtr gcfp;
5071
Int4 gene_qual_choice;
5072
CharPtr qual_val = NULL;
5074
if (sfp == NULL || sfp->data.choice != SEQFEAT_GENE || userdata == NULL)
5077
gcfp = (GeneToCDSFormPtr) userdata;
5079
CheckSeqLocForPartial (sfp->location, &partial5, &partial3);
5081
cds = SeqMgrGetOverlappingCDS (sfp->location, &context);
5087
if (SeqMgrGetDesiredFeature (sfp->idx.entityID, NULL,
5088
0, 0, sfp, &context) == NULL) return;
5090
grp = (GeneRefPtr) sfp->data.value.ptrvalue;
5092
/* use the controls to determine the protein name */
5095
gene_qual_choice = GetGeneQualChoice (gcfp, sfp, grp);
5096
qual_val = GetQualStringForQualChoice (grp, sfp, gene_qual_choice);
5099
if (gene_qual_choice == 1)
5101
if (StringHasNoText (gcfp->append_string))
5103
LogGeneToCDSNoProtein (gcfp, context.label, SeqLocId (sfp->location));
5109
if (StringHasNoText (qual_val))
5111
LogGeneToCDSNoProtein (gcfp, context.label, SeqLocId (sfp->location));
5114
prot_len += StringLen (qual_val);
5117
if (!StringHasNoText (gcfp->append_string))
5123
prot_len += StringLen (gcfp->append_string);
5127
LogGeneToCDSNoProtein (gcfp, context.label, SeqLocId (sfp->location));
5131
/* add one to length for terminating null */
5133
protName = (CharPtr) MemNew (prot_len * sizeof (Char));
5134
if (protName == NULL) return;
5136
if (gene_qual_choice != 1 && !StringHasNoText (qual_val))
5138
StringCpy (protName, qual_val);
5139
/* apply capitalization */
5140
switch (gcfp->caps_choice)
5143
/* do nothing, leave capitalization as is */
5146
/* capitalize first letter */
5147
protName [0] = toupper (protName[0]);
5150
/* capitalize all letters */
5151
for (cp = protName; *cp != 0; cp++)
5153
*cp = toupper (*cp);
5157
if (!StringHasNoText (gcfp->append_string))
5159
StringCat (protName, " ");
5162
if (!StringHasNoText (gcfp->append_string))
5164
StringCat (protName, gcfp->append_string);
5167
if ((gcfp->gene_qual_choice == gene_qual_choice && gcfp->remove_gene_qual1)
5168
|| (gcfp->gene_qual_choice2 == gene_qual_choice && gcfp->remove_gene_qual2)
5169
|| (gcfp->gene_qual_choice3 == gene_qual_choice && gcfp->remove_gene_qual3))
5171
switch (gene_qual_choice)
5174
/* do nothing - not using a gene qualifier */
5177
grp->locus = MemFree (grp->locus);
5180
grp->desc = MemFree (grp->desc);
5183
sfp->comment= MemFree (sfp->comment);
5188
cds = SeqFeatNew ();
5189
if (cds == NULL) return;
5190
cds->data.choice = SEQFEAT_CDREGION;
5192
genCode = SeqEntryToGeneticCode (gcfp->sep, NULL, NULL, 0);
5193
crp = CreateNewCdRgn (1, FALSE, genCode);
5198
cds->data.value.ptrvalue = (Pointer) crp;
5199
cds->location = SeqLocFree (cds->location);
5200
cds->location = AsnIoMemCopy ((Pointer) sfp->location,
5201
(AsnReadFunc) SeqLocAsnRead,
5202
(AsnWriteFunc) SeqLocAsnWrite);
5203
cds->partial = sfp->partial;
5204
cds->next = sfp->next;
5207
bs = ProteinFromCdRegionEx (cds, TRUE, FALSE);
5209
prot = BSMerge (bs, NULL);
5214
while (ch != '\0') {
5215
*ptr = TO_UPPER (ch);
5219
i = (Int2) StringLen (prot);
5220
if (i > 0 && prot [i - 1] == '*') {
5221
prot [i - 1] = '\0';
5226
BSWrite (bs, (VoidPtr) ptr, (Int4) StringLen (ptr));
5231
if (bsp == NULL) return;
5232
bsp->repr = Seq_repr_raw;
5233
bsp->mol = Seq_mol_aa;
5234
bsp->seq_data_type = Seq_code_ncbieaa;
5236
bsp->length = BSLen (bs);
5238
old = SeqEntrySetScope (NULL);
5239
bsp->id = MakeNewProteinSeqId (cds->location, NULL);
5240
SeqMgrAddToBioseqIndex (bsp);
5241
SeqEntrySetScope (old);
5242
psep = SeqEntryNew ();
5245
psep->data.ptrvalue = (Pointer) bsp;
5246
SeqMgrSeqEntry (SM_BIOSEQ, (Pointer) bsp, psep);
5247
mip = MolInfoNew ();
5251
if (partial5 && partial3) {
5252
mip->completeness = 5;
5253
} else if (partial5) {
5254
mip->completeness = 3;
5255
} else if (partial3) {
5256
mip->completeness = 4;
5258
vnp = CreateNewDescriptor (psep, Seq_descr_molinfo);
5260
vnp->data.ptrvalue = (Pointer) mip;
5263
descr = ExtractBioSourceAndPubs (gcfp->sep);
5264
if (IS_Bioseq_set (gcfp->sep))
5270
topsep = GetBestTopParentForData (gcfp->input_entityID, gcfp->sep->data.ptrvalue);
5272
AddSeqEntryToSeqEntry (topsep, psep, TRUE);
5273
nsep = FindNucSeqEntry (gcfp->sep);
5274
ReplaceBioSourceAndPubs (gcfp->sep, descr);
5275
SetSeqFeatProduct (cds, bsp);
5276
prp = CreateNewProtRef (protName, NULL, NULL, NULL);
5278
sfp = CreateNewFeature (psep, NULL, SEQFEAT_PROT, NULL);
5280
sfp->data.value.ptrvalue = (Pointer) prp;
5285
static void GeneToCDSBioseqCallback (BioseqPtr bsp, Pointer userdata)
5288
GeneToCDSFormPtr gcfp;
5290
if (bsp == NULL || userdata == NULL) return;
5291
gcfp = (GeneToCDSFormPtr) userdata;
5292
gcfp->sep = SeqMgrGetSeqEntryForData (bsp);
5293
VisitFeaturesOnBsp (bsp, (Pointer) gcfp, GeneToCDSCallback);
5296
static void GeneToCdsAccept (ButtoN b)
5298
GeneToCDSFormPtr gcfp;
5299
Char path [PATH_MAX];
5301
gcfp = (GeneToCDSFormPtr) GetObjectExtra (b);
5302
if (gcfp == NULL) return;
5304
gcfp->log_fp = FileOpen (path, "wb");
5305
if (gcfp->log_fp == NULL) return;
5311
gcfp->sep = GetTopSeqEntryForEntityID (gcfp->input_entityID);
5312
if (gcfp->sep == NULL) return;
5314
gcfp->gene_qual_choice = GetValue (gcfp->gene_qual_popup);
5315
gcfp->gene_qual_choice2 = GetValue (gcfp->gene_qual_popup2);
5316
gcfp->gene_qual_choice3 = GetValue (gcfp->gene_qual_popup3);
5317
gcfp->append_string = SaveStringFromText (gcfp->append_text);
5318
gcfp->caps_choice = GetValue (gcfp->qual_caps_grp);
5319
gcfp->remove_gene_qual1 = GetStatus (gcfp->remove_qual_btn1);
5320
gcfp->remove_gene_qual2 = GetStatus (gcfp->remove_qual_btn2);
5321
gcfp->remove_gene_qual3 = GetStatus (gcfp->remove_qual_btn3);
5323
VisitBioseqsInSep (gcfp->sep, (Pointer) gcfp, GeneToCDSBioseqCallback);
5327
Remove (gcfp->form);
5328
FileClose (gcfp->log_fp);
5329
if (gcfp->data_in_log)
5331
LaunchGeneralTextViewer (path, "Genes without Proteins");
5335
ObjMgrSetDirtyFlag (gcfp->input_entityID, TRUE);
5336
ObjMgrSendMsg (OM_MSG_UPDATE, gcfp->input_entityID, 0, 0);
5339
static void CleanupGeneToCDSPage (GraphiC g, VoidPtr data)
5341
GeneToCDSFormPtr gcfp;
5343
gcfp = (GeneToCDSFormPtr) data;
5346
gcfp->append_string = MemFree (gcfp->append_string);
5352
static void EnableGeneToCdsControls (GeneToCDSFormPtr gcfp)
5356
if (gcfp == NULL) return;
5358
if (GetValue (gcfp->gene_qual_popup) == 1)
5360
Disable (gcfp->remove_qual_btn1);
5361
SetStatus (gcfp->remove_qual_btn1, FALSE);
5362
Disable (gcfp->qual_caps_grp);
5363
SetValue (gcfp->gene_qual_popup2, 1);
5364
Disable (gcfp->remove_qual_btn2);
5365
SetStatus (gcfp->remove_qual_btn2, FALSE);
5366
Disable (gcfp->gene_qual_popup2);
5367
SetValue (gcfp->gene_qual_popup3, 1);
5368
Disable (gcfp->gene_qual_popup3);
5369
Disable (gcfp->remove_qual_btn3);
5370
SetStatus (gcfp->remove_qual_btn3, FALSE);
5371
cp = SaveStringFromText (gcfp->append_text);
5372
if (StringHasNoText (cp))
5374
Disable (gcfp->accept_btn);
5378
Enable (gcfp->accept_btn);
5384
Enable (gcfp->remove_qual_btn1);
5385
Enable (gcfp->qual_caps_grp);
5386
Enable (gcfp->gene_qual_popup2);
5387
Enable (gcfp->accept_btn);
5388
if (GetValue (gcfp->gene_qual_popup2) == 1)
5390
Disable (gcfp->remove_qual_btn2);
5391
SetStatus (gcfp->remove_qual_btn2, FALSE);
5392
SetValue (gcfp->gene_qual_popup3, 1);
5393
Disable (gcfp->gene_qual_popup3);
5394
Disable (gcfp->remove_qual_btn3);
5395
SetStatus (gcfp->remove_qual_btn3, FALSE);
5399
Enable (gcfp->gene_qual_popup3);
5400
Enable (gcfp->remove_qual_btn2);
5401
if (GetValue (gcfp->gene_qual_popup3) == 1)
5403
Disable (gcfp->remove_qual_btn3);
5404
SetStatus (gcfp->remove_qual_btn3, FALSE);
5408
Enable (gcfp->remove_qual_btn3);
5414
static void EnableGeneToCdsControlsPopup (PopuP p)
5416
GeneToCDSFormPtr gcfp;
5418
gcfp = (GeneToCDSFormPtr) GetObjectExtra (p);
5419
EnableGeneToCdsControls (gcfp);
5422
static void EnableGeneToCdsControlsText (TexT t)
5424
GeneToCDSFormPtr gcfp;
5426
gcfp = (GeneToCDSFormPtr) GetObjectExtra (t);
5427
EnableGeneToCdsControls (gcfp);
5430
static void GeneToCds (IteM i)
5434
GeneToCDSFormPtr gcfp;
5436
GrouP h, g, k, m, c;
5439
bfp = currentFormDataPtr;
5441
bfp = GetObjectExtra (i);
5444
Message (MSG_ERROR, "GeneToCDS error");
5448
gcfp = (GeneToCDSFormPtr) MemNew (sizeof (GeneToCDSFormData));
5449
if (gcfp == NULL) return;
5450
gcfp->input_entityID = bfp->input_entityID;
5451
gcfp->input_itemID = bfp->input_itemID;
5452
gcfp->input_itemtype = bfp->input_itemtype;
5454
w = FixedWindow (-50, -33, -10, -10, "Gene to CDS", StdCloseWindowProc);
5455
SetObjectExtra (w, gcfp, CleanupGeneToCDSPage);
5456
gcfp->form = (ForM) w;
5458
h = HiddenGroup (w, -1, 0, NULL);
5459
SetGroupSpacing (h, 10, 10);
5461
g = HiddenGroup (h, 0, 6, NULL);
5463
k = NormalGroup (g, 3, 0, "Select gene qualifier to use in protein name", NULL, NULL);
5464
StaticPrompt (k, "1st Choice", 0, 0, programFont, 'c');
5465
gcfp->gene_qual_popup = PopupList (k, TRUE, EnableGeneToCdsControlsPopup);
5466
SetObjectExtra (gcfp->gene_qual_popup, gcfp, NULL);
5467
PopupItem (gcfp->gene_qual_popup, "None");
5468
PopupItem (gcfp->gene_qual_popup, "locus");
5469
PopupItem (gcfp->gene_qual_popup, "description");
5470
PopupItem (gcfp->gene_qual_popup, "comment");
5471
SetValue (gcfp->gene_qual_popup, 1);
5472
gcfp->remove_qual_btn1 = CheckBox (k, "Remove if used", NULL);
5473
StaticPrompt (k, "2nd Choice", 0, 0, programFont, 'c');
5474
gcfp->gene_qual_popup2 = PopupList (k, TRUE, EnableGeneToCdsControlsPopup);
5475
SetObjectExtra (gcfp->gene_qual_popup2, gcfp, NULL);
5476
PopupItem (gcfp->gene_qual_popup2, "None");
5477
PopupItem (gcfp->gene_qual_popup2, "locus");
5478
PopupItem (gcfp->gene_qual_popup2, "description");
5479
PopupItem (gcfp->gene_qual_popup2, "comment");
5480
SetValue (gcfp->gene_qual_popup2, 1);
5481
gcfp->remove_qual_btn2 = CheckBox (k, "Remove if used", NULL);
5482
StaticPrompt (k, "3rd Choice", 0, 0, programFont, 'c');
5483
gcfp->gene_qual_popup3 = PopupList (k, TRUE, EnableGeneToCdsControlsPopup);
5484
SetObjectExtra (gcfp->gene_qual_popup3, gcfp, NULL);
5485
PopupItem (gcfp->gene_qual_popup3, "None");
5486
PopupItem (gcfp->gene_qual_popup3, "locus");
5487
PopupItem (gcfp->gene_qual_popup3, "description");
5488
PopupItem (gcfp->gene_qual_popup3, "comment");
5489
SetValue (gcfp->gene_qual_popup3, 1);
5490
gcfp->remove_qual_btn3 = CheckBox (k, "Remove if used", NULL);
5492
gcfp->qual_caps_grp = NormalGroup (g, 3, 0,
5493
"Capitalization for gene qualifier in protein name", NULL, NULL);
5494
RadioButton (gcfp->qual_caps_grp, "As is");
5495
RadioButton (gcfp->qual_caps_grp, "Capitalize first initial");
5496
RadioButton (gcfp->qual_caps_grp, "Capitalize all");
5497
SetValue (gcfp->qual_caps_grp, 1);
5499
m = HiddenGroup (g, 0, 2, NULL);
5500
StaticPrompt (m, "Append text to protein name", 0, 0, programFont, 'c');
5501
gcfp->append_text = DialogText (m, "", 14, EnableGeneToCdsControlsText);
5502
SetObjectExtra (gcfp->append_text, gcfp, NULL);
5504
c = HiddenGroup (g, 4, 0, NULL);
5505
gcfp->accept_btn = PushButton (c, "Accept", GeneToCdsAccept);
5506
SetObjectExtra (gcfp->accept_btn, gcfp, NULL);
5507
EnableGeneToCdsControls (gcfp);
5509
PushButton (c, "Cancel", StdCancelButtonProc);
5512
AlignObjects (ALIGN_CENTER, (HANDLE) k, (HANDLE) gcfp->qual_caps_grp,
5513
(HANDLE) m, (HANDLE) c, NULL);
5521
5403
typedef struct featuretocdsform
8541
8526
rbsLeft = GetOffsetInBioseq (rbsSlp , bsp,
8542
8527
SEQLOC_LEFT_END);
8543
8528
if (rbsLeft <= cdsLeft)
8546
geneSfp = SeqMgrGetOverlappingGene (cdsSlp, NULL);
8547
if (geneSfp != NULL) {
8548
geneGrp = (GeneRefPtr) geneSfp->data.value.ptrvalue;
8549
rbsGrp = CopyGeneRef (geneGrp);
8552
xref = SeqFeatXrefNew ();
8553
xref->data.choice = SEQFEAT_GENE;
8554
xref->data.value.ptrvalue = rbsGrp;
8555
xref->next = rbsSfp->xref;
8556
rbsSfp->xref = xref;
8531
geneSfp = SeqMgrGetOverlappingGene (cdsSlp, &geneContext);
8532
if (geneSfp != NULL) {
8533
geneGrp = (GeneRefPtr) geneSfp->data.value.ptrvalue;
8534
rbsGrp = CopyGeneRef (geneGrp);
8537
xref = SeqFeatXrefNew ();
8538
xref->data.choice = SEQFEAT_GENE;
8539
xref->data.value.ptrvalue = rbsGrp;
8540
xref->next = rbsSfp->xref;
8541
rbsSfp->xref = xref;
8544
/* enlarge gene to cover RBS */
8545
if (geneContext.left > rbsContext.left)
8547
ExtendSeqLocToPosition (geneSfp->location, TRUE, rbsContext.left);
8566
prevCdsSfp = cdsSfp;
8567
cdsSfp = SeqMgrGetNextFeature (bsp, cdsSfp, 0,
8558
prevCdsSfp = cdsSfp;
8559
cdsSfp = SeqMgrGetNextFeature (bsp, cdsSfp, 0,
8574
else if (strand == Seq_strand_minus)
8577
while ((cdsSfp != NULL) && (!found))
8579
cdsSlp = cdsSfp->location;
8580
cdsRight = GetOffsetInBioseq (cdsSlp, bsp,
8582
rbsRight = GetOffsetInBioseq (rbsSlp , bsp,
8584
if (cdsRight > rbsRight)
8587
if (prevCdsSfp != NULL)
8590
geneSfp = SeqMgrGetOverlappingGene (prevCdsSfp->location,
8592
if (geneSfp != NULL) {
8593
geneGrp = (GeneRefPtr) geneSfp->data.value.ptrvalue;
8594
rbsGrp = CopyGeneRef (geneGrp);
8597
xref = SeqFeatXrefNew ();
8598
xref->data.choice = SEQFEAT_GENE;
8599
xref->data.value.ptrvalue = rbsGrp;
8600
xref->next = rbsSfp->xref;
8601
rbsSfp->xref = xref;
8566
else if (strand == Seq_strand_minus)
8569
while ((cdsSfp != NULL) && (!found))
8571
cdsSlp = cdsSfp->location;
8572
cdsRight = GetOffsetInBioseq (cdsSlp, bsp,
8574
rbsRight = GetOffsetInBioseq (rbsSlp , bsp,
8576
if (cdsRight > rbsRight)
8579
if (prevCdsSfp != NULL)
8582
geneSfp = SeqMgrGetOverlappingGene (prevCdsSfp->location,
8584
if (geneSfp != NULL) {
8585
geneGrp = (GeneRefPtr) geneSfp->data.value.ptrvalue;
8586
rbsGrp = CopyGeneRef (geneGrp);
8589
xref = SeqFeatXrefNew ();
8590
xref->data.choice = SEQFEAT_GENE;
8591
xref->data.value.ptrvalue = rbsGrp;
8592
xref->next = rbsSfp->xref;
8593
rbsSfp->xref = xref;
8596
/* enlarge gene to cover RBS */
8597
if (geneContext.right < rbsContext.right)
8599
ExtendSeqLocToPosition (geneSfp->location, TRUE, rbsContext.right);
8613
prevCdsSfp = cdsSfp;
8614
cdsSfp = SeqMgrGetNextFeature (bsp, cdsSfp, 0,
8612
prevCdsSfp = cdsSfp;
8613
cdsSfp = SeqMgrGetNextFeature (bsp, cdsSfp, 0,
8623
rbsSfp = SeqMgrGetNextFeature (bsp, rbsSfp, 0, FEATDEF_RBS, &rbsContext);
8622
rbsSfp = SeqMgrGetNextFeature (bsp, rbsSfp, 0, FEATDEF_RBS, &rbsContext);
8626
8625
/* Force an update and redraw */
8939
8938
mibp->strand_values = NULL;
8942
typedef struct sequenceconstraint
8947
Int4 other_constraint_type;
8948
StringConstraintPtr string_constraint;
8949
ChoiceConstraintPtr source_constraint;
8950
ValNodePtr feature_list;
8952
} SequenceConstraintData, PNTR SequenceConstraintPtr;
8955
static SequenceConstraintPtr SequenceConstraintFree (SequenceConstraintPtr scp)
8959
scp->string_constraint = StringConstraintFree (scp->string_constraint);
8960
scp->source_constraint = ChoiceConstraintFree (scp->source_constraint);
8961
scp->feature_list = ValNodeFree (scp->feature_list);
8962
scp = MemFree (scp);
8968
typedef struct sequenceconstraintdlg
8970
DIALOG_MESSAGE_BLOCK
8971
GrouP seq_type_constraint;
8972
GrouP other_constraint_type;
8973
DialoG source_constraint;
8974
DialoG feature_list;
8975
DialoG feature_string_constraint;
8976
DialoG id_string_constraint;
8978
} SequenceConstraintDlgData, PNTR SequenceConstraintDlgPtr;
8981
enum sequenceconstraintothertype
8983
SEQ_CONSTRAINT_ANY = 0,
8984
SEQ_CONSTRAINT_SOURCE,
8985
SEQ_CONSTRAINT_FEATURE_TEXT,
8990
static void ChangeSequenceConstraintType (GrouP g)
8992
SequenceConstraintDlgPtr scdp;
8993
Int4 other_constraint_type;
8995
scdp = (SequenceConstraintDlgPtr) GetObjectExtra (g);
9000
other_constraint_type = (GetValue (scdp->other_constraint_type) - 1) / 2;
9001
Disable (scdp->source_constraint);
9002
Disable (scdp->feature_string_constraint);
9003
Disable (scdp->id_string_constraint);
9004
if (other_constraint_type == SEQ_CONSTRAINT_SOURCE)
9006
Enable (scdp->source_constraint);
9008
else if (other_constraint_type == SEQ_CONSTRAINT_FEATURE_TEXT)
9010
Enable (scdp->feature_string_constraint);
9012
else if (other_constraint_type == SEQ_CONSTRAINT_ID)
9014
Enable (scdp->id_string_constraint);
9018
static void ResetSequenceConstraintDialog (DialoG d)
9020
SequenceConstraintDlgPtr scdp;
9022
scdp = (SequenceConstraintDlgPtr) GetObjectExtra (d);
9028
SetValue (scdp->seq_type_constraint, 1);
9029
SetValue (scdp->other_constraint_type, SEQ_CONSTRAINT_ANY + 1);
9030
ChangeSequenceConstraintType (scdp->other_constraint_type);
9033
static void SequenceConstraintToDialog (DialoG d, Pointer data)
9035
SequenceConstraintPtr scp;
9036
SequenceConstraintDlgPtr scdp;
9038
scdp = (SequenceConstraintDlgPtr) GetObjectExtra (d);
9044
scp = (SequenceConstraintPtr) data;
9048
ResetSequenceConstraintDialog (d);
9052
if (scp->nucs_ok && scp->prots_ok)
9054
SetValue (scdp->seq_type_constraint, 1);
9056
else if (scp->nucs_ok)
9058
SetValue (scdp->seq_type_constraint, 2);
9062
SetValue (scdp->seq_type_constraint, 3);
9064
SetValue (scdp->other_constraint_type, scp->other_constraint_type + 1);
9065
switch (scp->other_constraint_type)
9067
case SEQ_CONSTRAINT_SOURCE:
9068
PointerToDialog (scdp->source_constraint, scp->source_constraint);
9070
case SEQ_CONSTRAINT_FEATURE_TEXT:
9071
PointerToDialog (scdp->feature_string_constraint, scp->string_constraint);
9072
PointerToDialog (scdp->feature_list, scp->feature_list);
9074
case SEQ_CONSTRAINT_ID:
9075
PointerToDialog (scdp->id_string_constraint, scp->string_constraint);
9078
ChangeSequenceConstraintType (scdp->other_constraint_type);
9083
static Pointer DialogToSequenceConstraint (DialoG d)
9085
SequenceConstraintPtr scp;
9086
SequenceConstraintDlgPtr scdp;
9088
scdp = (SequenceConstraintDlgPtr) GetObjectExtra (d);
9094
scp = (SequenceConstraintPtr) MemNew (sizeof (SequenceConstraintData));
9097
switch (GetValue (scdp->seq_type_constraint))
9100
scp->nucs_ok = TRUE;
9101
scp->prots_ok = TRUE;
9104
scp->nucs_ok = TRUE;
9107
scp->prots_ok = TRUE;
9111
scp->other_constraint_type = (GetValue (scdp->other_constraint_type) - 1)/2;
9112
switch (scp->other_constraint_type)
9114
case SEQ_CONSTRAINT_SOURCE:
9115
scp->source_constraint = DialogToPointer (scdp->source_constraint);
9117
case SEQ_CONSTRAINT_FEATURE_TEXT:
9118
scp->string_constraint = DialogToPointer (scdp->feature_string_constraint);
9119
scp->feature_list = DialogToPointer (scdp->feature_list);
9121
case SEQ_CONSTRAINT_ID:
9122
scp->string_constraint = DialogToPointer (scdp->id_string_constraint);
9130
static void SequenceConstraintMessage (DialoG d, Int2 mssg)
9133
SequenceConstraintDlgPtr scdp;
9135
scdp = (SequenceConstraintDlgPtr) GetObjectExtra (d);
9139
ResetSequenceConstraintDialog (d);
9141
case VIB_MSG_ENTER :
9142
Select (scdp->other_constraint_type);
9150
static ValNodePtr TestSequenceConstraintDialog (DialoG d)
9157
static DialoG SequenceConstraintDialog (GrouP g)
9159
SequenceConstraintDlgPtr dlg;
9162
dlg = (SequenceConstraintDlgPtr) MemNew (sizeof (SequenceConstraintDlgData));
9163
if (dlg == NULL) return NULL;
9165
p = HiddenGroup (g, -1, 0, NULL);
9166
SetObjectExtra (p, dlg, StdCleanupExtraProc);
9167
SetGroupSpacing (p, 10, 10);
9169
dlg->dialog = (DialoG) p;
9170
dlg->todialog = SequenceConstraintToDialog;
9171
dlg->fromdialog = DialogToSequenceConstraint;
9172
dlg->dialogmessage = SequenceConstraintMessage;
9173
dlg->testdialog = TestSequenceConstraintDialog;
9175
dlg->seq_type_constraint = HiddenGroup (p, 4, 0, NULL);
9176
RadioButton (dlg->seq_type_constraint, "All Sequences");
9177
RadioButton (dlg->seq_type_constraint, "Nucleotides");
9178
RadioButton (dlg->seq_type_constraint, "Proteins");
9179
SetValue (dlg->seq_type_constraint, 2);
9181
dlg->other_constraint_type = HiddenGroup (p, 2, 0, ChangeSequenceConstraintType);
9182
RadioButton (dlg->other_constraint_type, "Any sequence");
9183
StaticPrompt (dlg->other_constraint_type, "", 0, dialogTextHeight, systemFont, 'l');
9185
RadioButton (dlg->other_constraint_type, "Where sequence source");
9186
dlg->source_constraint = SourceConstraintDialog (dlg->other_constraint_type, FALSE);
9188
RadioButton (dlg->other_constraint_type, "Where feature text");
9189
k = HiddenGroup (dlg->other_constraint_type, 2, 0, NULL);
9190
SetGroupSpacing (k, 10, 10);
9191
dlg->feature_list = FeatureSelectionDialog (k, TRUE, NULL, NULL);
9192
dlg->feature_string_constraint = StringConstraintDialog (k, NULL, FALSE);
9194
RadioButton (dlg->other_constraint_type, "Where sequence ID");
9195
dlg->id_string_constraint = StringConstraintDialog (dlg->other_constraint_type, NULL, FALSE);
9197
SetValue (dlg->other_constraint_type, CHOICE_CONSTRAINT_ANY);
9198
SetObjectExtra (dlg->other_constraint_type, dlg, NULL);
9200
Disable (dlg->source_constraint);
9201
Disable (dlg->feature_string_constraint);
9202
Disable (dlg->id_string_constraint);
9204
AlignObjects (ALIGN_CENTER, (HANDLE) dlg->seq_type_constraint,
9205
(HANDLE) dlg->other_constraint_type, NULL);
9212
static Boolean DoesIDListMeetStringConstraint (SeqIdPtr sip, StringConstraintPtr string_constraint)
9221
if (string_constraint == NULL)
9231
SeqIdWrite (sip, id, PRINTID_FASTA_LONG, sizeof (id) - 1);
9233
if (DoesStringMatchConstraint (id, string_constraint))
9235
if (string_constraint->not_present)
9246
if (string_constraint->not_present)
9257
static Boolean DoesSequenceMatchSequenceConstraint (BioseqPtr bsp, SequenceConstraintPtr scp)
9260
SeqMgrDescContext dcontext;
9262
if (bsp == NULL) return FALSE;
9263
if (scp == NULL) return TRUE;
9264
if (!scp->nucs_ok && ISA_na (bsp->mol)) return FALSE;
9265
if (!scp->prots_ok && ISA_aa (bsp->mol)) return FALSE;
9266
switch (scp->other_constraint_type)
9268
case SEQ_CONSTRAINT_ANY:
9271
case SEQ_CONSTRAINT_SOURCE:
9272
sdp = SeqMgrGetNextDescriptor (bsp, NULL, Seq_descr_source, &dcontext);
9275
return DoesOneSourceMatchConstraint(sdp->data.ptrvalue, scp->source_constraint);
9278
case SEQ_CONSTRAINT_FEATURE_TEXT:
9279
return DoBioseqFeaturesMatchSequenceConstraint (bsp, scp->feature_list, scp->string_constraint);
9281
case SEQ_CONSTRAINT_ID:
9282
return DoesIDListMeetStringConstraint(bsp->id, scp->string_constraint);
8942
9288
typedef struct molinfoedit {
8943
9289
DESCRIPTOR_FORM_BLOCK
8944
9290
SeqEntryPtr sep;
8945
9291
MolInfoBlock from;
8946
9292
MolInfoBlock to;
9293
DialoG sequence_constraint;
9294
SequenceConstraintPtr scp;
8950
9295
} MolInfoEdit, PNTR MolInfoEditPtr;
8952
9297
static CharPtr labels [] = {
17800
static void InstantiateGapFeatCallback (BioseqPtr bsp, Pointer userdata)
17813
if (bsp == NULL || bsp->repr != Seq_repr_delta || bsp->seq_ext_type != 4) return;
17814
sip = SeqIdFindBest (bsp->id, 0);
17815
if (sip == NULL) return;
17816
/* suppress on far delta contigs for now */
17817
if (! DeltaLitOnly (bsp)) return;
17819
for (vnp = (ValNodePtr)(bsp->seq_ext); vnp != NULL; vnp = vnp->next) {
17820
if (vnp->choice == 1) {
17821
slp = (SeqLocPtr) vnp->data.ptrvalue;
17822
if (slp == NULL) continue;
17823
currpos += SeqLocLen (slp);
17825
if (vnp->choice == 2) {
17826
litp = (SeqLitPtr) vnp->data.ptrvalue;
17827
if (litp == NULL) continue;
17828
if (litp->seq_data == NULL && litp->length > 0) {
17829
ifp = ImpFeatNew ();
17830
if (ifp == NULL) continue;
17831
ifp->key = StringSave ("gap");
17833
sfp = CreateNewFeatureOnBioseq (bsp, SEQFEAT_IMP, NULL);
17834
if (sfp == NULL) continue;
17835
sfp->data.choice = SEQFEAT_IMP;
17836
sfp->data.value.ptrvalue = (Pointer) ifp;
17837
if (fuzz != NULL && fuzz->choice == 4 && fuzz->a == 0) {
17838
AddQualifierToFeature (sfp, "estimated_length", "unknown");
17839
sfp->location = SeqLocFree (sfp->location);
17840
sfp->location = AddIntervalToLocation (NULL, sip, currpos, currpos + litp->length - 1, FALSE, FALSE);
17842
sprintf (buf, "%ld", (long) litp->length);
17843
AddQualifierToFeature (sfp, "estimated_length", buf);
17844
sfp->location = SeqLocFree (sfp->location);
17845
sfp->location = AddIntervalToLocation (NULL, sip, currpos, currpos + litp->length - 1, FALSE, FALSE);
17848
currpos += litp->length;
17853
static void InstantiateGapFeatures (IteM i)
17860
bfp = currentFormDataPtr;
17862
bfp = GetObjectExtra (i);
17864
if (bfp == NULL) return;
17866
sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
17867
VisitBioseqsInSep (sep, NULL, InstantiateGapFeatCallback);
17868
ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
17869
ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
17873
static void RemoveGapFeatCallback (SeqFeatPtr sfp, Pointer userdata)
17878
if (sfp == NULL) return;
17879
if (sfp->idx.subtype != FEATDEF_gap) return;
17880
if (StringDoesHaveText (sfp->comment)) return;
17881
for (gbq = sfp->qual; gbq != NULL; gbq = gbq->next) {
17882
if (StringICmp (gbq->qual, "estimated_length") != 0) return;
17884
sfp->idx.deleteme = TRUE;
17887
static void RemoveUnnecessaryGapFeatures (IteM i)
17894
bfp = currentFormDataPtr;
17896
bfp = GetObjectExtra (i);
17898
if (bfp == NULL) return;
17900
sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
17901
VisitFeaturesInSep (sep, NULL, RemoveGapFeatCallback);
17903
ObjMgrSelect (0, 0, 0, 0, NULL);
17905
DeleteMarkedObjects (bfp->input_entityID, 0, NULL);
17907
ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
17908
ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
17913
static void RenormalizeNucProtSetsMenuItem (IteM i)
17918
/* Get the current data */
17921
bfp = currentFormDataPtr;
17923
bfp = GetObjectExtra (i);
17929
sep = GetTopSeqEntryForEntityID (bfp->input_entityID);
17930
if (sep == NULL) return;
17933
RenormalizeNucProtSets (sep, TRUE);
17935
ObjMgrSetDirtyFlag (bfp->input_entityID, TRUE);
17936
ObjMgrSendMsg (OM_MSG_UPDATE, bfp->input_entityID, 0, 0);
17940
/* Return successfully */
17403
17946
extern void LookupAllPubs (IteM i);
17404
17947
extern void ResolveExistingLocalIDs (IteM i);
17405
17948
extern void PromoteAlignsToBestIDProc (IteM i);
17590
18211
s = SubMenu (m, "Organism/ G");
17591
18212
i = CommandItem (s, "Parse Text", ParseDefLineToSourceQual);
17592
18213
SetObjectExtra (i, bfp, NULL);
17593
i = CommandItem (s, "Parse File to Source", ParseFileToSource);
17594
SetObjectExtra (i, bfp, NULL);
17595
18214
SeparatorItem (s);
17596
18215
i = CommandItem (s, "Parse ATCC Strain to Xref", AtccStrainToXref);
17597
18216
SetObjectExtra (i, bfp, NULL);
17598
18217
SeparatorItem (s);
17599
i = CommandItem (s, "Append Modifier to Organism", AddModToOrg);
17600
SetObjectExtra (i, bfp, NULL);
17602
18218
i = CommandItem (s, "Trim Organism Name", TrimOrganismName);
17603
18219
SetObjectExtra (i, bfp, NULL);
18220
i = CommandItem (s, "Genus-Species Fixup", GenSpecTaxonFixup);
18221
SetObjectExtra (i, bfp, NULL);
17604
18222
SeparatorItem (s);
17605
18223
i = CommandItem (s, "Prefix Authority with Organism", PrefixAuthorityWithOrganism);
17606
18224
SetObjectExtra (i, bfp, NULL);
18225
i = CommandItem (s, "Append Modifier to Organism", AddModToOrg);
18226
SetObjectExtra (i, bfp, NULL);
17607
18227
i = CommandItem (s, "Parse Trinomial into Subspecies", ParseTrinomial);
17608
18228
SetObjectExtra (i, bfp, NULL);
17609
18229
SeparatorItem (s);
17610
i = CommandItem (s, "Genus-Species Fixup", GenSpecTaxonFixup);
17611
SetObjectExtra (i, bfp, NULL);
17613
i = CommandItem (s, "Country Fixup", CountryLookup);
17614
SetObjectExtra (i, bfp, NULL);
17616
i = CommandItem (s, "Set Source Focus", SetSourceFocus);
17617
SetObjectExtra (i, bfp, NULL);
17618
i = CommandItem (s, "Clear Source Focus", ClearSourceFocus);
18230
x = SubMenu (s, "Country Fixup");
18231
i = CommandItem (x, "Do Not Fix Capitalization After Colon", CountryLookupWithoutCapFix);
18232
SetObjectExtra (i, bfp, NULL);
18233
i = CommandItem (x, "Fix Capitalization After Colon", CountryLookupWithCapFix);
18234
SetObjectExtra (i, bfp, NULL);
18236
x = SubMenu (s, "Parse CollectionDate formats");
18237
i = CommandItem (x, "Month First", ParseCollectionDateMonthFirst);
18238
SetObjectExtra (i, bfp, NULL);
18239
i = CommandItem (x, "Day First", ParseCollectionDateDayFirst);
18240
SetObjectExtra (i, bfp, NULL);
18242
x = SubMenu (s, "Source Focus");
18243
i = CommandItem (x, "Set", SetSourceFocus);
18244
SetObjectExtra (i, bfp, NULL);
18245
i = CommandItem (x, "Clear", ClearSourceFocus);
17619
18246
SetObjectExtra (i, bfp, NULL);
17620
18247
SeparatorItem (s);
17621
18248
i = CommandItem (s, "Consolidate Organism Notes", ConsolidateOrganismNotes);
18214
18856
SeparatorItem (s);
18215
18857
i = CommandItem (s, "Package Features on Parts", PackageOnParts);
18216
18858
SetObjectExtra (i, bfp, NULL);
18859
i = CommandItem (s, "Force Features into one SeqAnnot", ForceRepackage);
18860
SetObjectExtra (i, bfp, NULL);
18217
18861
SeparatorItem (s);
18218
18862
i = CommandItem (s, "Package Proteins on Nucleotides", PackageOnNucs);
18219
18863
SetObjectExtra (i, bfp, NULL);
18220
18864
SeparatorItem (s);
18221
i = CommandItem (s, "Delta or Segmented Sequence to Raw Sequence", SegSeqToRawSeq);
18222
SetObjectExtra (i, bfp, NULL);
18223
i = CommandItem (s, "Raw Sequence with Ns to Delta Sequence",
18866
i = CommandItem (s, "Map Features to Protein Sequences", MapFeaturesToProteinSequence);
18867
SetObjectExtra (i, bfp, NULL);
18870
x = SubMenu (s, "Gap Functions");
18871
y = SubMenu (x, "Create");
18872
i = CommandItem (y, "Delta or Segmented Sequence to Raw Sequence", SegSeqToRawSeq);
18873
SetObjectExtra (i, bfp, NULL);
18874
i = CommandItem (y, "Raw Sequence with Ns to Delta Sequence",
18224
18875
RawSeqToDeltaSeqUnknownWithUnknownLengthGaps);
18225
18876
SetObjectExtra (i, bfp, NULL);
18226
i = CommandItem (s, "Convert Raw Sequences To Delta Sequences with Known Gap Locations",
18877
i = CommandItem (y, "Raw Sequences To Delta Sequences with Known Gap Locations",
18227
18878
ConvertRawToDeltaWithGapLocations);
18228
18879
SetObjectExtra (i, bfp, NULL);
18880
y = SubMenu (x, "Convert");
18881
i = CommandItem (y, "Convert Selected Gaps to Known Length", ConvertSelectedGapFeaturesToKnown);
18882
SetObjectExtra (i, bfp, NULL);
18883
i = CommandItem (y, "Convert Selected Gaps to Unknown Length", ConvertSelectedGapFeaturesToUnknown);
18884
SetObjectExtra (i, bfp, NULL);
18885
i = CommandItem (y, "Convert Known-length Gaps to Unknown Length by Size", ConvertGapFeaturesToUnknown);
18886
SetObjectExtra (i, bfp, NULL);
18887
i = CommandItem (y, "Change Length of Selected Known-length Gaps", ChangeKnownGapLength);
18888
SetObjectExtra (i, bfp, NULL);
18889
i = CommandItem (y, "Expand Known-length Gaps to Include Flanking Ns", AddFlankingNsToKnownLengthGaps);
18890
SetObjectExtra (i, bfp, NULL);
18891
i = CommandItem (y, "Combine Adjacent Gaps", CombineAdjacentGaps);
18892
SetObjectExtra (i, bfp, NULL);
18894
z = SubMenu (y, "Adjust CDS Locations for Gaps");
18895
i = CommandItem (z, "Unknown Length Gaps Only", AdjustCDSLocationsForGaps);
18896
SetObjectExtra (i, bfp, NULL);
18897
i = CommandItem (z, "Known and Unknown Length Gaps", AdjustCDSLocationsForGapsKnownAndUnknown);
18898
SetObjectExtra (i, bfp, NULL);
18899
i = CommandItem (y, "Trim Coding Regions and mRNAs for Known Gaps", AdjustCodingRegionsEndingInGap);
18900
SetObjectExtra (i, bfp, NULL);
18901
i = CommandItem (y, "Convert Coding Regions with Internal Gaps to Misc_feat", ConvertCodingRegionsWithInternalKnownGapToMiscFeat);
18902
SetObjectExtra (i, bfp, NULL);
18904
i = CommandItem (y, "Fix Delta SeqDataLen", FixDeltaSeqDataLen);
18905
SetObjectExtra (i, bfp, NULL);
18908
x = SubMenu (s, "Gap Features");
18909
i = CommandItem (x, "Instantiate from Delta Instructions", InstantiateGapFeatures);
18910
SetObjectExtra (i, bfp, NULL);
18912
i = CommandItem (x, "Remove Unnecessary Gap Features", RemoveUnnecessaryGapFeatures);
18913
SetObjectExtra (i, bfp, NULL);
18229
18915
SeparatorItem (s);
18230
18916
x = SubMenu (s, "Generate GenProdSet Redundancy");
18231
18917
i = CommandItem (x, "With Descriptor Propagation", MakeRedundantGPSwithProp);