A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/macro__fn__aecr_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/objutils/macro_fn_aecr.cpp Source File

75

void CMacroFunction_SwapRelatedFeaturesQual_Depr::TheFunction()

79  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

80  if

(!src_feat || !scope)

94

src_objs = m_Args[0]->GetObjects();

97

x_GetObjectsFromRef(src_objs, 0);

100  if

(src_objs.empty()) {

108  if

(feat_list.empty()) {

114

new_feat->Assign(*orig_feat);

115  CObjectInfo

objInfo(new_feat.GetPointer(), new_feat.GetPointer()->GetTypeInfo());

118  const string

& dest_field = m_Args[2]->GetString();

119  if

(!

GetFieldsByName

(&dest_objs, objInfo, dest_field) || dest_objs.empty()) {

123

CMQueryNodeValue::TObs::iterator src_it = src_objs.begin();

124

CMQueryNodeValue::TObs::iterator dest_it = dest_objs.begin();

126  while

(src_it != src_objs.end() && dest_it != dest_objs.end()) {

130

m_QualsChangedCount += 2;

136  if

(m_QualsChangedCount) {

137

m_DataIter->SetModified();

141

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

144

report[

"swapping qualifiers"

] = m_QualsChangedCount;

146

x_LogChangedQuals(fnc_log);

150 bool

CMacroFunction_SwapRelatedFeaturesQual_Depr::x_ValidArguments()

const 152  if

(m_Args.size() != 3) {

156  if

(!(m_Args[0]->IsString() || m_Args[0]->AreObjects() || m_Args[0]->IsRef()))

159  for

(

size_t

index = 1; index < m_Args.size(); ++index) {

185  const string

& field_name = m_Args[0]->GetString();

190

res_oi = m_Args[0]->GetObjects();

193

x_GetObjectsFromRef(res_oi, 0);

196  if

(res_oi.empty()) {

200

m_QualsChangedCount = s_RemoveFields(m_DataIter, res_oi);

202  if

(m_QualsChangedCount) {

204

report[

"removal of qualifiers"

] = m_QualsChangedCount;

206

x_LogChangedQuals(fnc_log);

212  if

(

m_Args

.empty())

return false

;

213  bool

first_ok = (

m_Args

[0]->IsString() ||

m_Args

[0]->AreObjects() ||

m_Args

[0]->IsRef());

214  return

(

m_Args

.size() == 1 && first_ok);

222  Int4

quals_changed = 0;

226  bool

is_gene_suppressed_before =

false

;

227  bool

is_gene_suppressed_after =

false

;

232

is_gene_suppressed_before = gene_xref && gene_xref->

IsSuppressed

();

267

dataiter->SetToDelete(

true

);

284

dataiter->SetToDelete(

true

);

294  cleanup

.BasicCleanup(*seq_feat);

299  if

(!is_gene_suppressed_before && is_gene_suppressed_after)

308

bsrc->

SetOrg

().ResetDb();

313

dataiter->SetModified();

315  return

quals_changed;

324

bsrc.

SetOrg

().SetOrgname().ResetMod();

342

void CMacroFunction_RemoveModifier::TheFunction()

346

x_GetObjectsFromRef(res_oi, 0);

347  if

(res_oi.empty()) {

361

m_QualsChangedCount++;

365  if

(m_QualsChangedCount) {

369

m_DataIter->SetModified();

372

report[

"removing source modifiers"

] = m_QualsChangedCount;

374

x_LogChangedQuals(fnc_log);

378 bool

CMacroFunction_RemoveModifier::x_ValidArguments()

const 403

res_oi = m_Args[0]->GetObjects();

406

x_GetObjectsFromRef(res_oi, 0);

410  if

(res_oi.empty()) {

416

x_RmvOutsideFields(res_oi, *options);

418  if

(m_QualsChangedCount) {

420

m_DataIter->SetModified();

423  log

<< m_DataIter->GetBestDescr() <<

": removed text outside string in "

<< m_QualsChangedCount <<

" qualifiers"

;

425  bool

update_mrna = (m_Args.size() == 10) ? m_Args[9]->GetBool() :

false

;

431  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

436

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

437  log

<<

", applied "

+ prot_product +

" to mRNA product name "

;

440

x_LogFunction(

log

);

447  string

left_del =

m_Args

[start_index + 1]->GetString();

448  bool

remove_before_match =

false

;

449  if

(

m_Args

[start_index]->GetBool()) {

461

remove_before_match =

m_Args

[start_index + 2]->GetBool();

466  string

right_del =

m_Args

[start_index + 4]->GetString();

467  bool

remove_after_match =

false

;

468  if

(

m_Args

[start_index + 3]->GetBool()) {

480

remove_after_match =

m_Args

[start_index + 5]->GetBool();

483  bool

case_insensitive =

m_Args

[start_index + 6]->GetBool();

484  bool

whole_word =

m_Args

[start_index + 7]->GetBool();

487

after_match, right_del, remove_after_match,

488

case_insensitive, whole_word));

494  for

(

auto

& it : resolved_objs) {

497  for

(

auto

& iter : objs) {

559  for

(

size_t i

= index;

i

<

m_Args

.size(); ++

i

) {

580  const string

& action_type = m_Args[++index]->GetString();

582  bool

remove_field =

false

;

583

x_GetOptionalArgs(

delimiter

, remove_field, index);

590  if

(remove_field && newValue.empty()) {

594  else if

(!newValue.empty() && !

SetFieldsByName

(&res_oi, oi, m_Args[0]->GetString())) {

599

res_oi = m_Args[0]->GetObjects();

602

x_GetObjectsFromRef(res_oi, 0);

605  if

(res_oi.empty()) {

609  if

(!newValue.empty()) {

610

vector<string> new_values;

612

x_SetFields(res_oi, newValue, existing_text, new_values);

614

m_Result->SetBool(

false

);

615  if

(m_QualsChangedCount) {

617

m_DataIter->SetModified();

618

m_Result->SetBool(

true

);

621  for

(

size_t i

= 0;

i

< new_values.size(); ++

i

) {

622  log

<< m_DataIter->GetBestDescr() <<

": set '"

<< new_values[

i

] <<

"' as a new value\n"

;

624

x_LogFunction(

log

);

627  else if

(remove_field) {

629  if

(m_QualsChangedCount) {

631  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" qualifiers"

;

632

x_LogFunction(

log

);

640  size_t

arg_nr =

m_Args

.size();

641  if

(arg_nr < 3 && arg_nr > 5) {

646  bool

first_ok =

m_Args

[index]->IsString() ||

m_Args

[index]->AreObjects() ||

m_Args

[index]->IsRef();

647  if

(!first_ok)

return false

;

651  bool

second_ok =

m_Args

[index]->IsString() ||

m_Args

[index]->IsInt() ||

m_Args

[index]->IsDouble();

652  if

(!second_ok)

return false

;

654  if

(!

m_Args

[++index]->IsString())

return false

;

656  if

(arg_nr > 3 && (!

m_Args

[++index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

658  if

(arg_nr > 4 && !

m_Args

[++index]->IsBool())

return false

;

666  for

(

auto

& it : objs) {

677

new_values.push_back(newValue);

694

new_values.push_back(newValue);

699

new_values.push_back(newValue);

704  if

(objs.size() > 1) {

716

new_values.push_back(newValue);

744

new_values.push_back(orig_value);

751

new_values.push_back(newValue);

760

void CMacroFunction_SetRnaProduct::TheFunction()

763  const CSeq_feat

* seq_feat =

dynamic_cast<const CSeq_feat

*

>

(

object

.GetPointer());

764  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

765  if

(!seq_feat || !seq_feat->

GetData

().

IsRna

() || !scope)

770  const string

& action_type = m_Args[++index]->GetString();

772  bool

remove_field =

false

;

773

x_GetOptionalArgs(

delimiter

, remove_field, index);

782  if

(!newValue.empty()) {

786

m_QualsChangedCount++;

787  if

(!remainder.empty()) {

795  else if

(remove_field) {

798

m_QualsChangedCount++;

801  if

(m_QualsChangedCount) {

802

m_DataIter->SetModified();

805  log

<< m_DataIter->GetBestDescr();

806  if

(newValue.empty() && remove_field) {

807  log

<<

": removed rna product"

;

810  log

<<

": set '"

<< orig_value <<

"' as new rna product value"

;

816 bool

CMacroFunction_SetRnaProduct::x_ValidArguments()

const 819  size_t

arg_nr = m_Args.size();

820  if

(arg_nr < 2 && arg_nr > 4) {

826  bool

first_ok = m_Args[index]->IsString() || m_Args[index]->IsInt() || m_Args[index]->IsDouble();

827  if

(!first_ok)

return false

;

829  if

(!m_Args[++index]->IsString())

return false

;

830  if

(arg_nr > 2 && (!m_Args[++index]->IsString() && !m_Args[index]->IsBool()))

return false

;

831  if

(arg_nr > 3 && !m_Args[++index]->IsBool())

return false

;

843

void CMacroFunction_GetRnaProduct::TheFunction()

847  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

848

m_Result->SetNotSet();

855  if

(m_Nested == eNotNested) {

856

m_Result->SetString(

value

);

861

new_node->SetString(

value

);

862

m_Result->SetRef(new_node);

866 bool

CMacroFunction_GetRnaProduct::x_ValidArguments()

const 868  return

(m_Args.empty());

875

void CMacroFunction_RemoveRnaProduct::TheFunction()

879  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

880  if

(!edit_feat || !edit_feat->

GetData

().

IsRna

() || !scope)

887

m_DataIter->SetModified();

888

m_QualsChangedCount++;

891

report[

"removing RNA product"

] = m_QualsChangedCount;

893

x_LogChangedQuals(fnc_log);

896 bool

CMacroFunction_RemoveRnaProduct::x_ValidArguments()

const 898  return

(m_Args.empty());

913  const string

&

location

= m_Args[++index]->GetString();

914  bool

case_sensitive = m_Args[++index]->GetBool();

915  bool

is_regex = (++index < m_Args.size()) ? m_Args[index]->GetBool() :

false

;

917

m_Result->SetBool(

false

);

928

res_oi = m_Args[0]->GetObjects();

931

x_GetObjectsFromRef(res_oi, 0);

935  if

(res_oi.empty()) {

939

x_EditFields(res_oi, find_txt, repl_txt, s_GetLocFromName(

location

), case_sensitive, is_regex);

940  if

(m_QualsChangedCount) {

943

m_DataIter->SetModified();

944

m_Result->SetBool(

true

);

947  log

<< m_DataIter->GetBestDescr() <<

": edited "

<< m_QualsChangedCount <<

" qualifiers, replaced "

<< find_txt;

949

repl_txt.assign(

"''"

);

951  log

<<

" with "

<< repl_txt;

952

x_LogFunction(

log

);

957  const string

& replace,

ESearchLoc

loc,

bool

case_sensitive,

bool

is_regex)

981  while

(pos !=

NPOS

) {

982  str

=

str

.substr(0, pos) + replace +

str

.substr(pos + find.length());

983  if

(case_sensitive) {

999  else if

(loc ==

eEnd

) {

1001

pos =

str

.length() - find.length();

1005  str

=

str

.substr(0, pos) + replace +

str

.substr(pos + find.length());

1017  const string

& find_txt,

1018  const string

& repl_txt,

1020  bool

case_sensitive,

1023  for

(

auto

& it : resolved_objs) {

1026  for

(

auto

& iter : objs) {

1030  if

(

s_EditText

(

value

, find_txt, repl_txt, loc, case_sensitive, is_regex)) {

1048  if

(

s_EditText

(orig_val, find_txt, repl_txt, loc, case_sensitive, is_regex)) {

1063  if

(

s_EditText

(

value

, find_txt, repl_txt, loc, case_sensitive, is_regex)) {

1099  bool

first_ok =

m_Args

[0]->IsString() ||

m_Args

[0]->AreObjects() ||

m_Args

[0]->IsRef();

1104  for

(

size_t

index = 1; index < 3; index++) {

1105  if

(!

m_Args

[index]->IsString() && !

m_Args

[index]->IsInt()) {

1109  if

(

m_Args

.size() == 6) {

1110  if

(!

m_Args

.back()->IsBool())

1113  return

(

m_Args

[3]->IsString() &&

m_Args

[4]->IsBool());

1120

vector<string>

kSatelliteTypes

= {

"satellite"

,

"microsatellite"

,

"minisatellite"

};

1121

vector<string> kMobileETypeTypes = {

1122  "insertion sequence"

,

1126  "non-LTR retrotransposon"

,

1132  "transposable element"

,

1139  bool

IstRNAProductField(

const CSeq_feat

& feat,

const string

& field_name);

1144  const CSeq_feat

* seq_feat =

dynamic_cast<const CSeq_feat

*

>

(

object

.GetPointer());

1146  return

GetBioSourceDestObjects(oi, field_name,

result

);

1150  return

SetFeatDestinationField(

Ref

(feat), field_name,

result

);

1158  if

(field_name.empty())

1161  size_t

orig_size = dest_objs.size();

1174  if

((*subsrc)->IsSetSubtype() && (*subsrc)->GetSubtype() ==

st

) {

1175  CObjectInfo

subsrc_oi((*subsrc).GetPointer(), (*subsrc)->GetTypeInfo());

1181  if

(dest_objs.empty()) {

1183

sub_src->SetSubtype(

st

);

1185  CObjectInfo

subsrc_oi(sub_src.GetPointer(), sub_src->GetTypeInfo());

1195  if

((*orgmod)->IsSetSubtype() && (*orgmod)->GetSubtype() ==

st

) {

1196  CObjectInfo

orgmod_oi((*orgmod).GetPointer(), (*orgmod)->GetTypeInfo());

1202  if

(dest_objs.empty()) {

1204

orgmod->SetSubtype(

st

);

1208

orgname->SetMod().push_back(orgmod);

1209

bsrc->

SetOrg

().SetOrgname(*orgname);

1212

bsrc->

SetOrg

().SetOrgname().SetMod().push_back(orgmod);

1214  CObjectInfo

orgmod_oi(orgmod.GetPointer(), orgmod->GetTypeInfo());

1224  return

dest_objs.size() - orig_size > 0;

1230  if

(feat.

IsNull

() || field_name.empty())

1238  size_t

orig_size =

result

.size();

1239  string

field = field_name;

1241

field =

"satellite"

;

1244

field =

"mobile-element-type"

;

1249  if

((*gbq_it)->IsSetQual() &&

NStr::EqualNocase

((*gbq_it)->GetQual(), field)) {

1250  CObjectInfo

gbqual_oi((*gbq_it).GetPointer(), (*gbq_it)->GetTypeInfo());

1261

feat->

SetQual

().push_back(new_gbqual);

1262  CObjectInfo

gbqual_oi(new_gbqual.GetPointer(), new_gbqual->GetTypeInfo());

1267  return result

.size() - orig_size > 0;

1272  if

(field_name.empty())

1280  string

field = field_name;

1282

field =

"satellite"

;

1285

field =

"mobile-element-type"

;

1290  if

((*gbq_it)->IsSetQual() &&

NStr::EqualNocase

((*gbq_it)->GetQual(), field)) {

1291  CObjectInfo

gbqual_oi((*gbq_it).GetPointer(), (*gbq_it)->GetTypeInfo());

1296  return

(!

result

.empty());

1299  bool

IstRNAProductField(

const CSeq_feat

& feat,

const string

& field_name)

1313  return

CreateNewGene(src_feat, scope);

1318  return

CreateNewProtein(src_feat, scope);

1353

new_gene->SetLocation(*gene_loc);

1382

list<CMappedFeat> cds_feats;

1384  for

(

auto

& it : cds_feats) {

1385  if

(it.IsSetProduct()) {

1423  if

(!x_GetSourceFields(oi, index, src_objs))

1427  if

(!x_GetDestFields(oi, ++index, dest_objs))

1430  const string

& action_type = m_Args[++index]->GetString();

1431  string delimiter

= (++index < m_Args.size()) ? m_Args[index]->GetString() :

kEmptyStr

;

1436  if

(src_feat && m_Args[1]->IsString() &&

NStr::EndsWith

(m_Args[1]->GetString(),

"::product"

)) {

1438  for

(

auto

&& it : src_objs) {

1443  string

src_val = x_GetSourceString(src);

1446

edit_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

1447

m_QualsChangedCount++;

1451

ChangeFields(src_objs, dest_objs);

1454  if

(m_QualsChangedCount) {

1455  if

(!dest_objs.empty()) {

1458

m_DataIter->SetModified();

1460  log

<< m_DataIter->GetBestDescr() <<

": copied "

<< m_QualsChangedCount <<

" qualifiers"

;

1461

x_LogFunction(

log

);

1467  size_t

arg_size =

m_Args

.size();

1468  if

(arg_size != 3 && arg_size != 4) {

1472  for

(

size_t i

= 0;

i

< 2; ++

i

) {

1481  for

(

size_t i

= 2;

i

< arg_size; ++

i

) {

1514  if

(!src_feat || !scope)

1517  const string

& dest_field =

m_Args

[2]->GetString();

1518  if

(dest_field.empty())

1530  bool

changed =

false

,

created

=

false

;

1533  if

(!feat_list.empty() && feat_list.size() == 1) {

1535

dest_feat->

Assign

(*feat_list.front());

1536  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

1544

dest_feat = CreateNewRelatedFeature(*src_feat, dest_field, *scope);

1545  if

(!dest_feat)

return

;

1546  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

1553  if

((*it)->IsSetData() && (*it)->GetData().IsProt()) {

1554

dest_feat->

SetData

().SetProt().Assign((*it)->GetData().GetProt());

1555

edit_feat->

SetXref

().erase(it);

1559  if

(edit_feat->

GetXref

().empty()) {

1566  bool

update_mrna =

m_Args

[index]->GetBool();

1567  const string

& action_type =

m_Args

[++index]->GetString();

1572  if

(IstRNAProductField(*dest_feat, dest_field)) {

1573  for

(

auto

&& it : src_objs) {

1581

dest_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

1595  if

(changed && fh) {

1610  cmd

->AddCommand(*upd_cmd);

1611  log

<<

", "

<< message;

1619  cmd

->AddCommand(*upd_cmd);

1620  log

<<

", applied "

+ prot_product +

" to mRNA product name "

;

1638  for

(

size_t

index = 1; index <

m_Args

.size(); ++index) {

1661  if

(!rna_feat || !scope)

1667  const string

& src_feat =

m_Args

[0]->GetString();

1668  const string

& dest_feat =

m_Args

[2]->GetString();

1669  if

(src_feat ==

"rna"

&& src_feat == dest_feat)

1672  if

((src_feat !=

"rna"

&& src_feat !=

"gene"

) || (dest_feat !=

"rna"

&& dest_feat !=

"gene"

))

1676  const string

& action_type =

m_Args

[index]->GetString();

1680  if

(src_feat ==

"rna"

&& dest_feat ==

"gene"

) {

1686  const string

dest_field =

m_Args

[3]->GetString();

1690  bool

changed =

false

,

created

=

false

;

1693  if

(!feat_list.empty() && feat_list.size() == 1) {

1695

dest_feat->

Assign

(*feat_list.front());

1696  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

1704

dest_feat = CreateNewRelatedFeature(*rna_feat, dest_field, *scope);

1705  if

(!dest_feat)

return

;

1706  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

1716  if

(changed && fh) {

1732  else if

(src_feat ==

"gene"

&& dest_feat ==

"gene"

) {

1738  if

(!feat_list.empty() && feat_list.size() == 1) {

1740

gene_feat->

Assign

(*feat_list.front());

1771  else if

(src_feat ==

"gene"

&& dest_feat ==

"rna"

) {

1776  if

(!feat_list.empty() && feat_list.size() == 1) {

1778

gene_feat->

Assign

(*feat_list.front());

1795  for

(

auto

&& it : src_objs) {

1803

edit_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

1825  if

(!

m_Args

[0]->IsString() || !

m_Args

[2]->IsString() || !

m_Args

[4]->IsString())

1828  for

(

size_t

index = 1; index < 4; index += 2) {

1829  if

(!(

m_Args

[index]->IsString() ||

m_Args

[index]->AreObjects() ||

m_Args

[index]->IsRef()))

1847  if

(!src_feat || !scope)

1851  const string

& field_name =

m_Args

[1]->GetString();

1857  const string

& action_type =

m_Args

[++index]->GetString();

1859  bool

remove_field =

false

;

1860  bool

update_mrna =

false

;

1861  size_t

arg_nr =

m_Args

.size();

1863  if

(++index < arg_nr) {

1864  if

(

m_Args

[index]->IsString()) {

1866  if

(++index < arg_nr) {

1867

remove_field =

m_Args

[index]->GetBool();

1868  if

(++index < arg_nr)

1869

update_mrna =

m_Args

[index]->GetBool();

1872  else if

(

m_Args

[index]->IsBool()) {

1873

remove_field =

m_Args

[index]->GetBool();

1874  if

(++index < arg_nr)

1875

update_mrna =

m_Args

[index]->GetBool();

1880  if

(!newValue.empty()) {

1882  bool

changed =

false

,

created

=

false

;

1885  if

(!feat_list.empty() && feat_list.size() == 1) {

1887

dest_feat->

Assign

(*feat_list.front());

1888  if

(!SetFeatDestinationField(dest_feat, field_name, objs)) {

1897

dest_feat = CreateNewRelatedFeature(*src_feat, field_name, *scope);

1898  if

(!dest_feat)

return

;

1899  if

(!SetFeatDestinationField(dest_feat, field_name, objs)) {

1906  if

((*it)->IsSetData() && (*it)->GetData().IsProt()) {

1907

dest_feat->

SetData

().SetProt().Assign((*it)->GetData().GetProt());

1908

edit_feat->

SetXref

().erase(it);

1913  if

(edit_feat->

GetXref

().empty()) {

1919

vector<string> new_values;

1920  x_SetFields

(objs, newValue, existing_text, new_values);

1926  for

(

size_t i

= 0;

i

< new_values.size(); ++

i

) {

1927  log

<<

": set '"

<< new_values[

i

] <<

"' as a new value"

;

1930  if

(changed && fh) {

1937  cmd

->AddCommand(*upd_cmd);

1938  log

<<

", applied "

+ prot_product +

" to mRNA product name "

;

1951  cmd

->AddCommand(*upd_cmd);

1952  log

<<

", "

<< message;

1961  else if

(remove_field) {

1965  if

(!feat_list.empty() && feat_list.size() == 1) {

1967

dest_feat->

Assign

(*feat_list.front());

1968  if

(!GetFeatDestinationField(dest_feat, field_name, objs)) {

1974  for

(

auto

& it : objs) {

1984  cleanup

.BasicCleanup(*dest_feat);

1994  cmd

->AddCommand(*upd_cmd);

1995  log

<<

", "

<< message;

2008  size_t

arg_nr =

m_Args

.size();

2009  if

(arg_nr < 4 && arg_nr > 7) {

2015  for

(; index < 4; ++index) {

2016  if

(!

m_Args

[index]->IsString())

2020  if

(index < arg_nr && (!

m_Args

[index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

2021  if

(++index < arg_nr && !

m_Args

[index]->IsBool())

return false

;

2022  if

(++index < arg_nr && !

m_Args

[index]->IsBool())

return false

;

2037  if

(!src_feat || !scope)

2044  bool

case_sensitive =

m_Args

[++index]->GetBool();

2045  bool

is_regex = (++index <

m_Args

.size()) ?

m_Args

[index]->GetBool() :

false

;

2048  const string

& field_name =

m_Args

[1]->GetString();

2055  if

(!feat_list.empty() && feat_list.size() == 1) {

2057

dest_feat->

Assign

(*feat_list.front());

2058  if

(!GetFeatDestinationField(dest_feat, field_name, objs)) {

2075

repl_txt.assign(

"''"

);

2077  log

<<

" with "

<< repl_txt;

2087  for

(

size_t

index = 2; index < 4; index++) {

2093  if

(

m_Args

.size() == 7) {

2108

void CMacroFunction_RmvRelFeatQual::TheFunction()

2112  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

2113  if

(!src_feat || !scope)

2117  const string

& field_name = m_Args[1]->GetString();

2124  if

(!feat_list.empty() && feat_list.size() == 1) {

2126

dest_feat->

Assign

(*feat_list.front());

2127  if

(!GetFeatDestinationField(dest_feat, field_name, objs)) {

2133  for

(

auto

& it : objs) {

2135

m_QualsChangedCount++;

2140  if

(m_QualsChangedCount) {

2143  cleanup

.BasicCleanup(*dest_feat);

2147

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

2150  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" qualifiers"

;

2155 bool

CMacroFunction_RmvRelFeatQual::x_ValidArguments()

const 2157  if

(m_Args.size() != 2)

2161  return

(m_Args[0]->IsString() && m_Args[1]->IsString());

2176  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

2177  if

(!src_feat || !scope)

2181  const string

& field_name = m_Args[1]->GetString();

2189  if

(!feat_list.empty() && feat_list.size() == 1) {

2191

dest_feat->

Assign

(*feat_list.front());

2192  if

(!GetFeatDestinationField(dest_feat, field_name, objs)) {

2199

x_RmvOutsideFields(objs, *options);

2200  if

(m_QualsChangedCount) {

2204

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

2208  log

<< m_DataIter->GetBestDescr() <<

": removed text outside string in "

<< m_QualsChangedCount <<

" qualifiers"

;

2210  bool

update_mrna = (m_Args.size() == 11) ? m_Args[10]->GetBool() :

false

;

2213  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

2217

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

2218  log

<<

", applied "

+ prot_product +

" to mRNA product name "

;

2222

x_LogFunction(

log

);

2241  _ASSERT

(!src_objs.empty() && !dest_objs.empty());

2242

CMQueryNodeValue::TObs::iterator src_it = src_objs.begin();

2243

CMQueryNodeValue::TObs::iterator dest_it = dest_objs.begin();

2245  while

(src_it != src_objs.end()) {

2252  CObjectInfo

new_oi(dest_it->field.AddNewElement());

2255  for

(

auto

& it : src_prim_objs) {

2261  if

(dest_it == dest_objs.end()) {

2269  if

(index >=

m_Args

.size())

2287  return

(!

result

.empty());

2296  const string

& dest_field =

m_Args

[index]->GetString();

2298  bool

valid = GetDestinationObjects(

object

, oi, dest_field,

result

);

2299  if

(valid &&

result

.empty())

2308  return

!

result

.empty();

2337  if

(src.

GetName

() ==

"Dbtag"

) {

2340  tag

->GetLabel(&src_val);

2362  if

(!x_GetSourceFields(oi, index, src_objs))

2366  if

(!x_GetDestFields(oi, ++index, dest_objs))

2369  const string

& capitalization = m_Args[++index]->GetString();

2373  const string

& action_type = m_Args[++index]->GetString();

2374  string delimiter

= (++index < m_Args.size()) ? m_Args[index]->GetString() :

kEmptyStr

;

2380  if

(src_feat && m_Args[1]->IsString() &&

NStr::EndsWith

(m_Args[1]->GetString(),

"::product"

)) {

2382  for

(

auto

&& it : src_objs) {

2387  string

src_val = x_GetSourceString(src);

2390

edit_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

2391

m_QualsChangedCount++;

2395

ChangeFields(src_objs, dest_objs);

2398  if

(m_QualsChangedCount) {

2399  if

(!dest_objs.empty()) {

2402

m_DataIter->SetModified();

2404  log

<< m_DataIter->GetBestDescr() <<

": converted "

<< m_QualsChangedCount <<

" qualifiers"

;

2405

x_LogFunction(

log

);

2436  size_t

as =

m_Args

.size();

2437  if

(!(as == 5 || as == 6)) {

2441  for

(

size_t i

= 0;

i

< 2; ++

i

) {

2478  size_t

src_index = 0, dest_index = 1;

2481

|| m_Args.size() == 4) {

2486  bool

src_set = x_DoFieldsExist(oi, src_objs, src_index);

2487  bool

dest_set = x_DoFieldsExist(oi, dest_objs, dest_index);

2489  if

(!src_set && !dest_set)

2493  bool

is_gene_suppressed_before =

false

;

2494  bool

is_gene_suppressed_after =

false

;

2499

is_gene_suppressed_before = gene_xref && gene_xref->

IsSuppressed

();

2503

x_SetFields(oi, src_objs, src_index);

2506

x_SetFields(oi, dest_objs, dest_index);

2509  if

(src_set && dest_set) {

2510

CMQueryNodeValue::TObs::iterator src_it = src_objs.begin();

2511

CMQueryNodeValue::TObs::iterator dest_it = dest_objs.begin();

2513  while

(src_it != src_objs.end() && dest_it != dest_objs.end()) {

2520  CObjectInfo

new_oi(dest_it->field.AddNewElement());

2523

x_SwapFields(src_prim_objs.front().field, dest_prim_objs.front().field);

2531  else if

(!src_set) {

2533

x_CopyFields(dest_objs, src_objs);

2544  else if

(!dest_set) {

2546

x_CopyFields(src_objs, dest_objs);

2561  cleanup

.BasicCleanup(*seq_feat);

2564

is_gene_suppressed_after = gene_xref->

IsSuppressed

();

2565  if

(!is_gene_suppressed_before && is_gene_suppressed_after)

2573

bsrc->

SetOrg

().ResetDb();

2577  if

(m_QualsChangedCount) {

2578

m_DataIter->SetModified();

2580  log

<< m_DataIter->GetBestDescr() <<

": swapped "

<< m_QualsChangedCount <<

" qualifiers"

;

2581

x_LogFunction(

log

);

2587  if

(

m_Args

.size() < 2) {

2591  for

(

auto

& it :

m_Args

) {

2603  if

(index >=

m_Args

.size())

2617  return

(!

result

.empty());

2622  if

(index >=

m_Args

.size())

2634  return

(!

result

.empty());

2639  if

(field_name.empty())

2665

orgname->

SetMod

().push_back(orgmod);

2666

bsrc->

SetOrg

().SetOrgname(*orgname);

2669

orgname =

Ref

(&(bsrc->

SetOrg

().SetOrgname()));

2670

orgname->

SetMod

().push_back(orgmod);

2684  if

(field_name.empty())

2692

feat->

SetQual

().push_back(new_gbqual);

2753  bool

swapped =

false

;

2830

CMQueryNodeValue::TObs::iterator src_it = src_objs.begin();

2831

CMQueryNodeValue::TObs::iterator dest_it = dest_objs.begin();

2833  while

(src_it != src_objs.end() && dest_it != dest_objs.end()) {

2841  CObjectInfo

new_oi(dest_it->field.AddNewElement());

2844  x_CopyFields

(src_prim_objs.front().field, dest_prim_objs.front().field);

2882  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

2883  if

(!src_feat || !scope)

2886  size_t

src_index = 0, dest_index = 1;

2887  if

(m_Args.size() == 5) {

2890  if

(m_Args[dest_index]->GetString().empty() || m_Args[dest_index + 1]->GetString().empty())

2893  const string

& dest_feattype = m_Args[dest_index]->GetString();

2894  const string

& dest_field = m_Args[dest_index + 1]->GetString();

2896

m_Args[src_index]->GetString() :

kEmptyStr

;

2899

m_ConstDestFeat.Reset(

nullptr

);

2900

m_EditDestFeat.Reset(

nullptr

);

2901

m_CreatedFeat.Reset(

nullptr

);

2909  bool

src_set = x_DoFieldsExist(oi, src_objs, src_index);

2910  if

(IstRNAProductField(*src_feat, src_field)) {

2913  bool

dest_set = x_DoDestFeatFieldsExist(*src_feat, dest_objs, dest_feattype, dest_field);

2915  if

(!src_set && !dest_set)

2919

x_SetFields(oi, src_objs, src_index);

2922

x_SetOrCreateDestFeatFields(*src_feat, dest_objs, dest_index + 1);

2925  if

(src_set && dest_set) {

2926

CMQueryNodeValue::TObs::iterator src_it = src_objs.begin();

2927

CMQueryNodeValue::TObs::iterator dest_it = dest_objs.begin();

2929  while

(src_it != src_objs.end() && dest_it != dest_objs.end()) {

2936  CObjectInfo

new_oi(dest_it->field.AddNewElement());

2939

x_SwapFields(src_prim_objs.front().field, dest_prim_objs.front().field);

2945  if

(m_EditDestFeat && IstRNAProductField(*m_EditDestFeat, dest_field)) {

2946  while

(src_it != src_objs.end()) {

2950  string

dest_str = m_EditDestFeat->GetData().GetRna().GetRnaProductName();

2957

m_EditDestFeat->SetData().SetRna().SetRnaProductName(

tmp

, remainder);

2958

m_QualsChangedCount++;

2963  else if

(IstRNAProductField(*src_feat, src_field)) {

2964  while

(dest_it != dest_objs.end()) {

2969  CObjectInfo

new_oi(dest_it->field.AddNewElement());

2980

seq_feat->

SetData

().SetRna().SetRnaProductName(

tmp

, remainder);

2981

m_QualsChangedCount++;

2987  else if

(!src_set) {

2989

x_CopyFields(dest_objs, src_objs);

2991  if

(IstRNAProductField(*seq_feat, src_field)) {

2992

CMQueryNodeValue::TObs::iterator dest_it = dest_objs.begin();

2994  while

(dest_it != dest_objs.end()) {

3008

seq_feat->

SetData

().SetRna().SetRnaProductName(dest_val, remainder);

3009

m_QualsChangedCount++;

3014  if

(m_EditDestFeat && IstRNAProductField(*m_EditDestFeat, dest_field)) {

3015

CMQueryNodeValue::TObs::iterator src_it = src_objs.begin();

3017  while

(src_it != src_objs.end()) {

3021  string

rna_str = m_EditDestFeat->GetData().GetRna().GetRnaProductName();

3024

m_QualsChangedCount++;

3030  if

(m_EditDestFeat && IstRNAProductField(*m_EditDestFeat, dest_field)) {

3032

m_EditDestFeat->SetData().SetRna().SetRnaProductName(

kEmptyStr

, remainder);

3036  if

(it->parent.GetName() ==

"Gb-qual"

&& m_EditDestFeat) {

3037  const string

& qual_name = m_Args[m_Args.size() - 2]->GetString();

3038

m_EditDestFeat->RemoveQualifier(qual_name);

3045  else if

(!dest_set) {

3047

x_CopyFields(src_objs, dest_objs);

3049  if

(m_EditDestFeat && IstRNAProductField(*m_EditDestFeat, dest_field)) {

3050

CMQueryNodeValue::TObs::iterator src_it = src_objs.begin();

3052  while

(src_it != src_objs.end()) {

3066

m_EditDestFeat->SetData().SetRna().SetRnaProductName(src_val, remainder);

3067

m_QualsChangedCount++;

3072  if

(IstRNAProductField(*seq_feat, src_field)) {

3073

CMQueryNodeValue::TObs::iterator dest_it = dest_objs.begin();

3075  while

(dest_it != dest_objs.end()) {

3082

m_QualsChangedCount++;

3088  if

(IstRNAProductField(*seq_feat, src_field)) {

3097  bool

update_mrna = (m_Args.back()->GetDataType() ==

CMQueryNodeValue::eBool

) ? m_Args.back()->GetBool() :

false

;

3100  cleanup

.BasicCleanup(*seq_feat);

3101  if

(m_EditDestFeat) {

3102  cleanup

.BasicCleanup(*m_EditDestFeat);

3104  else if

(m_CreatedFeat) {

3105  cleanup

.BasicCleanup(*m_CreatedFeat);

3108  if

(m_QualsChangedCount) {

3109

m_DataIter->SetModified();

3111  log

<< m_DataIter->GetBestDescr() <<

": swapped "

<< m_QualsChangedCount <<

" qualifiers"

;

3114  if

(m_ConstDestFeat && m_EditDestFeat) {

3122  cmd

->AddCommand(*upd_cmd);

3123  log

<<

", "

<< message;

3127  else if

(m_CreatedFeat) {

3135  cmd

->AddCommand(*upd_cmd);

3136  log

<<

", "

<< message;

3141

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

3149

m_DataIter->RunCommand(upd_cmd, m_CmdComposite);

3150  log

<<

", applied "

+ prot_product +

" to mRNA product name "

;

3153

x_LogFunction(

log

);

3163  if

(!feat_list.empty() && feat_list.size() == 1) {

3170  return

(!

m_EditDestFeat

->GetData().GetRna().GetRnaProductName().empty());

3174  return

(!

result

.empty());

3179  if

(index >=

m_Args

.size())

3181  const string

& dest_field =

m_Args

[index]->GetString();

3199  if

((*it)->IsSetData() && (*it)->GetData().IsProt()) {

3200  m_CreatedFeat

->SetData().SetProt().Assign((*it)->GetData().GetProt());

3201

edit_feat->

SetXref

().erase(it);

3205  if

(edit_feat->

GetXref

().empty()) {

3218  bool

first_ok = (

m_Args

[0]->IsString() ||

m_Args

[0]->AreObjects() ||

m_Args

[0]->IsRef());

3222  for

(

size_t

index = 1; index <

m_Args

.size() - 1; ++index) {

3223  if

(!

m_Args

[index]->IsString()) {

3227  return

(

m_Args

.back()->IsBool());

3245  if

(!src_feat || !scope)

3248  const string

& dest_field =

m_Args

[2]->GetString();

3249  if

(dest_field.empty())

3261  bool

changed =

false

,

created

=

false

;

3264  if

(!feat_list.empty() && feat_list.size() == 1) {

3266

dest_feat->

Assign

(*feat_list.front());

3267  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3275

dest_feat = CreateNewRelatedFeature(*src_feat, dest_field, *scope);

3276  if

(!dest_feat)

return

;

3277  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3284  if

((*it)->IsSetData() && (*it)->GetData().IsProt()) {

3285

dest_feat->

SetData

().SetProt().Assign((*it)->GetData().GetProt());

3286

edit_feat->

SetXref

().erase(it);

3290  if

(edit_feat->

GetXref

().empty()) {

3297  const string

& capitalization =

m_Args

[index]->GetString();

3301  bool

update_mrna =

m_Args

[++index]->GetBool();

3302  const string

& action_type =

m_Args

[++index]->GetString();

3308  if

(IstRNAProductField(*dest_feat, dest_field)) {

3309  for

(

auto

&& it : src_objs) {

3317

dest_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

3331  if

(changed && fh) {

3346  cmd

->AddCommand(*upd_cmd);

3347  log

<<

", "

<< message;

3355  cmd

->AddCommand(*upd_cmd);

3356  log

<<

", applied "

+ prot_product +

" to mRNA product name "

;

3373  for

(

size_t

index = 1; index <

m_Args

.size(); ++index) {

3395  if

(!rna_feat || !scope)

3401  const string

& src_feat =

m_Args

[0]->GetString();

3402  const string

& dest_feat =

m_Args

[2]->GetString();

3403  if

(src_feat ==

"rna"

&& src_feat == dest_feat)

3406  if

((src_feat !=

"rna"

&& src_feat !=

"gene"

) || (dest_feat !=

"rna"

&& dest_feat !=

"gene"

))

3410  const string

& capitalization =

m_Args

[index]->GetString();

3414  const string

& action_type =

m_Args

[++index]->GetString();

3419  if

(src_feat ==

"rna"

&& dest_feat ==

"gene"

) {

3425  const string

dest_field =

m_Args

[3]->GetString();

3429  bool

changed =

false

,

created

=

false

;

3432  if

(!feat_list.empty() && feat_list.size() == 1) {

3434

dest_feat->

Assign

(*feat_list.front());

3435  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3443

dest_feat = CreateNewRelatedFeature(*rna_feat, dest_field, *scope);

3444  if

(!dest_feat)

return

;

3445  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3455  if

(changed && fh) {

3471  else if

(src_feat ==

"gene"

&& dest_feat ==

"gene"

) {

3477  if

(!feat_list.empty() && feat_list.size() == 1) {

3479

gene_feat->

Assign

(*feat_list.front());

3510  else if

(src_feat ==

"gene"

&& dest_feat ==

"rna"

) {

3515  if

(!feat_list.empty() && feat_list.size() == 1) {

3517

gene_feat->

Assign

(*feat_list.front());

3534  for

(

auto

&& it : src_objs) {

3542

edit_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

3561  auto

nr_args =

m_Args

.size();

3562  if

(nr_args < 7 || nr_args > 8)

3565  if

(!

m_Args

[0]->IsString() || !

m_Args

[2]->IsString())

3568  for

(

size_t

index = 1; index < 4; index += 2) {

3569  if

(!(

m_Args

[index]->IsString() ||

m_Args

[index]->AreObjects() ||

m_Args

[index]->IsRef()))

3573  for

(

size_t

index = 4; index < nr_args; ++index) {

3574  if

(index != 5 && !

m_Args

[index]->IsString())

3577  return

(

m_Args

[5]->IsBool());

3598  const string

& capitalization =

m_Args

[++index]->GetString();

3599  const string

& action_type =

m_Args

[++index]->GetString();

3609  for

(

auto

&& it : src_objs) {

3617

edit_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

3625  if

(!dest_objs.empty()) {

3662  size_t

as =

m_Args

.size();

3663  if

(as < 1 || as > 5) {

3666  for

(

size_t i

= 0;

i

< 2; ++

i

) {

3670  for

(

size_t

index = 2; index < as; ++index) {

3671  if

(!

m_Args

[index]->IsString()) {

3691  if

(!src_feat || !scope)

3694  const string

& dest_field =

m_Args

[2]->GetString();

3695  if

(dest_field.empty())

3707  bool

changed =

false

,

created

=

false

;

3710  if

(!feat_list.empty() && feat_list.size() == 1) {

3712

dest_feat->

Assign

(*feat_list.front());

3713  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3721

dest_feat = CreateNewRelatedFeature(*src_feat, dest_field, *scope);

3722  if

(!dest_feat)

return

;

3723  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3730  if

((*it)->IsSetData() && (*it)->GetData().IsProt()) {

3731

dest_feat->

SetData

().SetProt().Assign((*it)->GetData().GetProt());

3732

edit_feat->

SetXref

().erase(it);

3736  if

(edit_feat->

GetXref

().empty()) {

3743  const string

& capitalization =

m_Args

[index]->GetString();

3744  bool

update_mrna =

m_Args

[++index]->GetBool();

3745  const string

& action_type =

m_Args

[++index]->GetString();

3751  if

(IstRNAProductField(*dest_feat, dest_field)) {

3752  for

(

auto

&& it : src_objs) {

3760

dest_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

3774  if

(changed && fh) {

3789  cmd

->AddCommand(*upd_cmd);

3790  log

<<

", "

<< message;

3798  cmd

->AddCommand(*upd_cmd);

3799  log

<<

", applied "

+ prot_product +

" to mRNA product name "

;

3820  for

(

size_t

index = 1; index <

m_Args

.size(); ++index) {

3842  if

(!rna_feat || !scope)

3848  const string

& src_feat =

m_Args

[0]->GetString();

3849  const string

& dest_feat =

m_Args

[2]->GetString();

3850  if

(src_feat ==

"rna"

&& src_feat == dest_feat)

3853  if

((src_feat !=

"rna"

&& src_feat !=

"gene"

) || (dest_feat !=

"rna"

&& dest_feat !=

"gene"

))

3857  const string

& capitalization =

m_Args

[index]->GetString();

3858  const string

& action_type =

m_Args

[++index]->GetString();

3863  if

(src_feat ==

"rna"

&& dest_feat ==

"gene"

) {

3869  const string

dest_field =

m_Args

[3]->GetString();

3873  bool

changed =

false

,

created

=

false

;

3876  if

(!feat_list.empty() && feat_list.size() == 1) {

3878

dest_feat->

Assign

(*feat_list.front());

3879  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3887

dest_feat = CreateNewRelatedFeature(*rna_feat, dest_field, *scope);

3888  if

(!dest_feat)

return

;

3889  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

3899  if

(changed && fh) {

3915  else if

(src_feat ==

"gene"

&& dest_feat ==

"gene"

) {

3921  if

(!feat_list.empty() && feat_list.size() == 1) {

3923

gene_feat->

Assign

(*feat_list.front());

3954  else if

(src_feat ==

"gene"

&& dest_feat ==

"rna"

) {

3958  if

(!feat_list.empty() && feat_list.size() == 1) {

3960

gene_feat->

Assign

(*feat_list.front());

3977  for

(

auto

&& it : src_objs) {

3985

edit_feat->

SetData

().SetRna().SetRnaProductName(src_val, remainder);

4007  if

(!

m_Args

[0]->IsString() || !

m_Args

[2]->IsString())

4010  for

(

size_t

index = 1; index < 4; index += 2) {

4011  if

(!(

m_Args

[index]->IsString() ||

m_Args

[index]->AreObjects() ||

m_Args

[index]->IsRef()))

4014  for

(

size_t

index = 4; index <

m_Args

.size(); ++index) {

4015  if

(!

m_Args

[index]->IsString())

4040  string

text_portion = parsed_obj.

GetString

();

4041  if

(text_portion.empty()) {

4050  const string

& dest_field =

m_Args

[index]->GetString();

4052

GetDestinationObjects(obj, oi, dest_field, dest_objs);

4055

dest_objs =

m_Args

[index]->GetObjects();

4061  const string

& capitalization =

m_Args

[++index]->GetString();

4062  const string

& action_type =

m_Args

[++index]->GetString();

4077

edit_feat->

SetData

().SetRna().SetRnaProductName(text_portion, remainder);

4081  if

(dest_objs.empty())

4106  CObjectInfo

new_oi(dest_objs.front().field.AddNewElement());

4124  size_t

as =

m_Args

.size();

4125  if

(as != 4 && as != 5) {

4140  for

(

size_t

index = 2; index < as; ++index) {

4159  if

(!src_feat || !scope)

4170  string

text_portion = parsed_obj.

GetString

();

4171  if

(text_portion.empty()) {

4175  const string

& dest_field =

m_Args

[2]->GetString();

4176  if

(dest_field.empty())

4183  bool

changed =

false

,

created

=

false

;

4187  if

(!feat_list.empty() && feat_list.size() == 1) {

4189

dest_feat->

Assign

(*feat_list.front());

4190  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

4198

dest_feat = CreateNewRelatedFeature(*src_feat, dest_field, *scope);

4199  if

(!dest_feat)

return

;

4200  if

(!SetFeatDestinationField(dest_feat, dest_field, dest_objs)) {

4207  if

((*it)->IsSetData() && (*it)->GetData().IsProt()) {

4208

dest_feat->

SetData

().SetProt().Assign((*it)->GetData().GetProt());

4209

edit_feat->

SetXref

().erase(it);

4213  if

(edit_feat->

GetXref

().empty()) {

4220  const string

& capitalization =

m_Args

[index]->GetString();

4221  bool

update_mrna =

m_Args

[++index]->GetBool();

4222  const string

& action_type =

m_Args

[++index]->GetString();

4230  if

(IstRNAProductField(*dest_feat, dest_field)) {

4232

dest_feat->

SetData

().SetRna().SetRnaProductName(text_portion, remainder);

4244  if

(changed && fh) {

4261  log

<<

", "

<< message;

4277  for

(

size_t

index = 1; index <

m_Args

.size(); ++index) {

4296  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

4297  if

(!scope || !

object

)

4304  string

text_portion;

4309  const string

& field = m_Args[0]->GetString();

4314

res_oi = m_Args[index]->GetObjects();

4315  if

(!res_oi.empty()) {

4325  if

(!res_oi.empty()) {

4335

text_portion = text_holder.

GetString

();

4338  if

(text_portion.empty())

4341

x_SetFieldType(m_Args[++index]->GetString());

4342  string

fieldname = (m_Type == eFieldValue) ? m_Args[++index]->GetString() :

kEmptyStr

;

4343  if

(m_Type == eFieldError) {

4344  NCBI_THROW

(

CMacroExecException

, eWrongArguments,

"Wrong structured comment fieldname is given (consider replacing it with either 'fieldvalue', 'dbname' or 'fieldname'"

);

4347  string

capitalization, action_type;

4348  if

(++index < m_Args.size()) {

4349

capitalization = m_Args[index]->GetString();

4351  if

(++index < m_Args.size()) {

4352

action_type = m_Args[index]->GetString();

4354  if

(capitalization.empty() || action_type.empty()) {

4358  string delimiter

= (++index < m_Args.size()) ? m_Args[index]->GetString() :

kEmptyStr

;

4372  for

( ; strcomm_it; ++strcomm_it) {

4377  const string kPrefix

=

"StructuredCommentPrefix"

;

4378  const string kSuffix

=

"StructuredCommentSuffix"

;

4382

new_desc->

Assign

(*strcomm_it);

4387  if

(m_Type == eFieldValue) {

4388

user_object.

AddField

(fieldname, text_portion);

4389

m_QualsChangedCount++;

4393  if

(m_Type == eFieldValue) {

4394  if

(user_object.

HasField

(fieldname)) {

4399

user_field.

SetData

().SetStr(orig_val);

4400

m_QualsChangedCount++;

4406

user_object.

AddField

(fieldname, text_portion);

4407

m_QualsChangedCount++;

4410  else if

(m_Type == eDbName) {

4414  else if

(m_Type == eFieldName) {

4422

user_field.

SetLabel

().SetStr(orig_val);

4423

m_QualsChangedCount++;

4429  if

(m_QualsChangedCount) {

4435  cmd

->AddCommand(*ecmd);

4451

user_object.

AddField

(fieldname, text_portion);

4452

m_QualsChangedCount++;

4457

m_QualsChangedCount++;

4461

m_QualsChangedCount++;

4467  if

(m_QualsChangedCount) {

4474

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

4477  string msg

=

"parsing text to structured comment "

;

4480  msg

+=

"field '"

+ fieldname +

"'"

;

4483  msg

+=

"database name"

;

4486  msg

+=

"fieldname"

;

4491

report[

msg

] = m_QualsChangedCount;

4493

x_LogChangedQuals(fnc_log);

4505  for

(

size_t

index = 1; index <

m_Args

.size(); ++index) {

4546  const string

& field =

m_Args

[0]->GetString();

4557

res_oi =

m_Args

[0]->GetObjects();

4564  if

(res_oi.empty())

return

;

4575  string

parsed_text = options->GetSelectedText(full_text);

4578  if

(options->ShouldRemoveFromParsed()) {

4581  if

(

CSeqdesc

* desc =

dynamic_cast<CSeqdesc

*

>

(it->second.GetNCPointer())) {

4582  if

(desc->IsTitle()) {

4583  string

orig_val = desc->GetTitle();

4584

options->RemoveSelectedText(orig_val);

4585  if

(!orig_val.empty()) {

4586

desc->SetTitle() = orig_val;

4590  cmd

->AddCommand(*chg_cmd);

4597  else if

(!res_oi.empty()) {

4605

options->RemoveSelectedText(orig_val);

4606  if

(orig_val.empty()) {

4626  size_t

as =

m_Args

.size();

4627  if

(as < 7 || as > 10) {

4633  if

(!

m_Args

[1]->IsString() || !

m_Args

[2]->IsBool() || !

m_Args

[3]->IsString()) {

4637  for

(

size_t i

= 4;

i

< as; ++

i

) {

4647  if

(bsh && bsh.

IsAa

()) {

4653  if

(!bsh)

return false

;

4657  if

(title_ci && !title_ci->

GetTitle

().empty()) {

4659

new_desc->

Assign

(*title_ci);

4673  if

(!user.

GetData

().empty()) {

4704  const string

& left_del =

m_Args

[start_index]->GetString();

4706

options->SetStartDigits();

4709

options->SetStartLetters();

4712

options->SetStartText(left_del);

4714

options->SetIncludeStart(

m_Args

[++start_index]->GetBool());

4716  const string

& right_del =

m_Args

[++start_index]->GetString();

4718

options->SetStopDigits();

4721

options->SetStopLetters();

4724

options->SetStopText(right_del);

4726

options->SetIncludeStop(

m_Args

[++start_index]->GetBool());

4728

options->SetCaseInsensitive(!

m_Args

[++start_index]->GetBool());

4729

options->SetWholeWord(

m_Args

[++start_index]->GetBool());

4731  auto

nr_args =

m_Args

.size();

4732  if

(++start_index < nr_args) {

4733

options->SetShouldRemove(

m_Args

[start_index]->GetBool());

4735  if

(++start_index < nr_args) {

4736

options->SetShouldRmvBeforePattern(

m_Args

[start_index]->GetBool());

4738  if

(++start_index < nr_args) {

4739

options->SetShouldRmvAfterPattern(

m_Args

[start_index]->GetBool());

4761  if

(!rna_feat || !scope)

4767  const string

& src_feat =

m_Args

[0]->GetString();

4768  if

(src_feat !=

"gene"

)

4775  if

(!feat_list.empty() && feat_list.size() == 1) {

4777

gene_feat->

Assign

(*feat_list.front());

4781  if

(

m_Args

[index]->IsString()) {

4785  else if

(

m_Args

[index]->AreObjects()) {

4786

res_oi =

m_Args

[index]->GetObjects();

4788  else if

(

m_Args

[index]->IsRef()) {

4808  string

parsed_text = options->GetSelectedText(full_text);

4811  if

(!parsed_text.empty() && options->ShouldRemoveFromParsed()) {

4819

options->RemoveSelectedText(orig_val);

4820  if

(orig_val.empty()) {

4839  size_t

as =

m_Args

.size();

4840  if

(as < 8 || as > 11) {

4846  if

(!

m_Args

[2]->IsString() || !

m_Args

[3]->IsBool() || !

m_Args

[4]->IsString()) {

4850  for

(

size_t i

= 5;

i

< as; ++

i

) {

4862

void CMacroFunction_LocalID::TheFunction()

4870  if

(!user.

GetData

().empty()) {

4887  if

(m_Result->IsNotSet()) {

4891  if

(m_Result->IsNotSet()) {

4898 bool

CMacroFunction_LocalID::x_ValidArguments()

const 4900  return

(m_Args.empty());

4923

res_oi = m_Args[0]->GetObjects();

4926

x_GetObjectsFromRef(res_oi, 0);

4929  if

(res_oi.empty()) {

4935

m_QualsChangedCount++;

4939  if

(m_QualsChangedCount) {

4941

m_DataIter->SetModified();

4943  log

<< m_DataIter->GetBestDescr() <<

": set new value to "

<< m_QualsChangedCount <<

" qualifiers"

;

4944

x_LogFunction(

log

);

4953  if

(

m_Args

.size() != 2 || !first_ok)

4956  if

(!

m_Args

[1]->IsSimpleType()) {

4980  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

4981  if

(!scope || !bseq || bseq->

IsAa

())

4985  const string

& dblink = m_Args[index]->GetString();

4987  const string

& existing_text_option = m_Args[++index]->GetString();

4989  bool

remove_field =

false

;

4990

x_GetOptionalArgs(

delimiter

, remove_field, index);

4995  if

(!newValue.empty()) {

4996

vector<pair<CSeqdesc_CI, CRef<CSeqdesc>>> changed_descs;

5002  if

(desc_it->GetUser().GetType().IsStr() && desc_it->GetUser().GetType().GetStr() ==

"DBLink"

) {

5004

new_desc->

Assign

(*desc_it);

5006  bool

found_user_field =

false

;

5010

found_user_field =

true

;

5014

m_QualsChangedCount++;

5022

m_QualsChangedCount++;

5026  for

(

auto

& it : field.

SetData

().SetStrs()) {

5027  string

orig_value = it;

5030

m_QualsChangedCount++;

5039

m_QualsChangedCount++;

5041

changed_descs.push_back(make_pair(desc_it, new_desc));

5045  if

(changed_descs.empty()) {

5049

m_QualsChangedCount++;

5054  else if

(!changed_descs.empty()) {

5056  for

(

auto

& it : changed_descs) {

5058  cmd

->AddCommand(*chg_cmd);

5062  if

(m_QualsChangedCount) {

5064

report[

"setting new value to "

+ dblink] = m_QualsChangedCount;

5066

x_LogChangedQuals(fnc_log);

5069  else if

(remove_field) {

5075  if

(desc_it->GetUser().GetType().IsStr() && desc_it->GetUser().GetType().GetStr() ==

"DBLink"

) {

5077

new_desc->

Assign

(*desc_it);

5083

m_QualsChangedCount++;

5091  cmd

->AddCommand(*(

new CCmdDelDesc

(desc_it.GetSeq_entry_Handle(), *desc_it)));

5098  cmd

->AddCommand(*chg_cmd);

5102  if

(m_QualsChangedCount) {

5104

report[

"removal of "

+ dblink +

" value"

] = m_QualsChangedCount;

5106

x_LogChangedQuals(fnc_log);

5110  if

(m_QualsChangedCount) {

5111

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

5117  if

(!user_object_desc || dblink.empty())

5121

new_field->

SetLabel

().SetStr(dblink);

5123  string

del = (newValue.find(

','

) !=

NPOS

) ?

","

:

kEmptyStr

;

5124  if

(del.empty() && newValue.find(

';'

) !=

NPOS

) {

5130

new_field->

SetData

().SetStrs().push_back(newValue);

5146

vector<string> values;

5148  for

(

auto

&& it : values)

5158  if

(!tmp_values.empty()) {

5159

tmp_values += del +

" "

;

5164  if

(!tmp_values.empty()) {

5165

tmp_values += del +

" "

;

5167

tmp_values += newValue;

5173  string

del = (newValue.find(

','

) !=

NPOS

) ?

","

:

kEmptyStr

;

5174  if

(del.empty() && newValue.find(

';'

) !=

NPOS

) {

5179

user_field.

SetData

().SetStrs().push_back(newValue);

5192  auto

arg_nr =

m_Args

.size();

5193  if

(arg_nr < 3 || arg_nr > 5) {

5198  if

(!

m_Args

[index]->IsString())

return false

;

5200  if

(!

m_Args

[index]->IsString() && !

m_Args

[index]->IsInt())

5203  if

(!

m_Args

[++index]->IsString())

return false

;

5204  if

(arg_nr > 3 && (!

m_Args

[++index]->IsString() && !

m_Args

[index]->IsBool()))

return false

;

5205  if

(arg_nr > 4 && !

m_Args

[++index]->IsBool())

return false

;

5217 void

CMacroFunction_AddUnverified::TheFunction()

5221  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

5222  if

(!scope || !bseq || bseq->

IsAa

())

5229

vector<pair<CSeqdesc_CI, CRef<CSeqdesc>>> changed_descs;

5233  if

(desc_it->GetUser().IsUnverified()) {

5234  const auto

& present_user = desc_it->GetUser();

5245

new_desc->Assign(*desc_it);

5247

changed_descs.push_back(make_pair(desc_it, new_desc));

5251  if

(changed_descs.empty()) {

5254

m_QualsChangedCount++;

5258

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

5262  for

(

auto

& it : changed_descs) {

5264  cmd

->AddCommand(*chg_cmd);

5265

m_QualsChangedCount++;

5267

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

5270  if

(m_QualsChangedCount) {

5272  log

<< m_QualsChangedCount <<

";adding new Unverified user object "

;

5300 bool

CMacroFunction_AddUnverified::x_ValidArguments()

const 5302  return

(m_Args.size() == 1 && m_Args[0]->IsString());

5311

void CMacroFunction_ParseToDBLink::TheFunction()

5315  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

5316  if

(!scope || !bseq || bseq->

IsAa

())

5323  string

text_portion;

5326  if

(m_Args[index]->IsString()) {

5327  const string

& field = m_Args[index]->

GetString

();

5331  else if

(m_Args[index]->AreObjects()) {

5332

res_oi = m_Args[index]->GetObjects();

5333  if

(!res_oi.empty()) {

5337  else if

(m_Args[index]->IsRef()) {

5343  if

(!res_oi.empty()) {

5353

text_portion = text_holder.

GetString

();

5356  if

(text_portion.empty())

5361  if

(m_Args[++index]->IsString()) {

5362

dblink = m_Args[index]->GetString();

5368  string

capitalization = m_Args[++index]->GetString();

5369  string

action_type = m_Args[++index]->GetString();

5370  string delimiter

= (++index < m_Args.size()) ? m_Args[index]->GetString() :

kEmptyStr

;

5379

vector<pair<CSeqdesc_CI, CRef<CSeqdesc>>> changed_descs;

5385  if

(desc_it->GetUser().GetType().IsStr() && desc_it->GetUser().GetType().GetStr() ==

"DBLink"

) {

5387

new_desc->Assign(*desc_it);

5389  bool

found_user_field =

false

;

5393

found_user_field =

true

;

5397

m_QualsChangedCount++;

5405

m_QualsChangedCount++;

5410  for

(

auto

& it : field.

SetData

().SetStrs()) {

5411  string

orig_value = it;

5414

m_QualsChangedCount++;

5423

m_QualsChangedCount++;

5425

changed_descs.push_back(make_pair(desc_it, new_desc));

5429  if

(changed_descs.empty()) {

5431

new_desc->SetUser().SetType().SetStr(

"DBLink"

);

5433

m_QualsChangedCount++;

5438  else if

(!changed_descs.empty()) {

5440  for

(

auto

& it : changed_descs) {

5442  cmd

->AddCommand(*chg_cmd);

5446  if

(m_QualsChangedCount) {

5447

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

5450

report[

"parsing text to "

+ dblink] = m_QualsChangedCount;

5452

x_LogChangedQuals(fnc_log);

5456 bool

CMacroFunction_ParseToDBLink::x_ValidArguments()

const 5458  if

(m_Args.size() > 5 || m_Args.size() < 4) {

5461  if

(!(m_Args[0]->IsString() || m_Args[0]->AreObjects() || m_Args[0]->IsRef()))

5464  for

(

size_t

index = 1; index < m_Args.size(); ++index) {

5486  const string

& subtype_name = m_Args[index]->GetString();

5488  const string

& action_type = m_Args[++index]->GetString();

5490  bool

remove_field =

false

;

5491

x_GetOptionalArgs(

delimiter

, remove_field, index);

5497  if

(!newValue.empty()) {

5498

vector<string> new_values;

5503  const CSeq_feat

* const_feat =

dynamic_cast<const CSeq_feat

*

>

(

object

.GetPointer());

5504  if

(const_bsrc && m_IsBiosrc) {

5505

x_AddBioSrcModifier(subtype_name, newValue);

5507  else if

(const_feat && !m_IsBiosrc) {

5509

m_QualsChangedCount += s_AddGBQualifier(*seqfeat, subtype_name, newValue);

5511

new_values.push_back(newValue);

5519  for

(

auto

&& it : res_oi) {

5534

SetQualStringValue(value_oi, sat_value);

5535

new_values.push_back(sat_value);

5538  string

orig_sat_type = sat_type;

5541  bool

good_type = (found_it !=

kSatelliteTypes

.end()) ?

true

:

false

;

5548  if

(!sat_name.empty()) {

5549

sat_name = sat_type +

":"

+ sat_name;

5552

sat_name = sat_type;

5556

SetQualStringValue(value_oi, sat_value);

5557

new_values.push_back(sat_value);

5572

SetQualStringValue(value_oi, met_value);

5573

new_values.push_back(met_value);

5577  string

orig_met_type = met_type;

5579  auto

found_it = find(kMobileETypeTypes.begin(), kMobileETypeTypes.end(), met_type);

5580  bool

good_type = (found_it != kMobileETypeTypes.end()) ?

true

:

false

;

5590

SetQualStringValue(value_oi, met_value);

5591

new_values.push_back(met_value);

5602

m_QualsChangedCount++;

5606

new_values.push_back(new_val.

GetString

());

5612  if

(m_QualsChangedCount) {

5613

m_DataIter->SetModified();

5615  log

<< m_DataIter->GetBestDescr();

5616  for

(

size_t i

= 0;

i

< new_values.size(); ++

i

) {

5617  log

<<

" '"

<< new_values[

i

] <<

"' has been set as a new value"

;

5619

x_LogFunction(

log

);

5622  else if

(remove_field) {

5623  if

(!res_oi.empty()) {

5625  for

(

auto

&& it : res_oi) {

5639  if

(!newValue.empty()) {

5640

SetQualStringValue(value_oi, newValue);

5645

m_QualsChangedCount++;

5651  for

(

auto

&& it : res_oi) {

5665  if

(!newValue.empty()) {

5666

SetQualStringValue(value_oi, newValue);

5671

m_QualsChangedCount++;

5677  for

(

auto

&& it : res_oi) {

5679

m_QualsChangedCount++;

5685  if

(m_QualsChangedCount) {

5691  cleanup

.BasicCleanup(*seq_feat);

5698

m_DataIter->SetModified();

5700  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" modifiers"

;

5701

x_LogFunction(

log

);

5715  size_t

arg_size =

m_Args

.size();

5716  if

(arg_size < 5 || arg_size > 7)

5724  if

(!

m_Args

[1]->IsString() || !

m_Args

[2]->IsString())

return false

;

5727  bool

type_ok =

m_Args

[3]->IsString() ||

m_Args

[3]->IsInt() ||

m_Args

[3]->IsDouble();

5728  if

(!type_ok)

return false

;

5730  if

(!

m_Args

[4]->IsString())

return false

;

5732  if

(arg_size > 5 && (!

m_Args

[5]->IsString() && !

m_Args

[5]->IsBool()))

return false

;

5734  if

(arg_size > 6 && !

m_Args

[6]->IsBool())

return false

;

5771  string

qualifier = qual_name;

5772  string

apply_value = newValue;

5776

qualifier =

"satellite"

;

5780

qualifier =

"satellite"

;

5791  if

(!apply_value.empty()) {

5801  bool

added =

false

;

5807

orgname->

SetMod

().push_back(orgmod);

5808

bsrc.

SetOrg

().SetOrgname(*orgname);

5812

bsrc.

SetOrg

().SetOrgname().SetMod().push_back(orgmod);

5820  bool

added =

false

;

5842  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

5843

m_Result->SetNotSet();

5844  if

(!feat || !scope || !feat->

IsSetQual

())

5847  const string

& qual_value = feat->

GetNamedQual

(

"satellite"

);

5848  if

(!qual_value.empty()) {

5850  switch

(m_FieldType) {

5851  case

eSatelliteType:

5852  value

= s_GetSatelliteType(qual_value);

5854  case

eSatelliteName:

5855  value

= s_GetSatelliteName(qual_value);

5859  if

(m_Nested == eNotNested) {

5860

m_Result->SetString(

value

);

5866

m_Result->SetRef(new_node);

5875  return value

.substr(0, pos);

5895  string

new_type =

type

;

5897  if

(!name.empty()) {

5898

new_name =

":"

+ name;

5900  if

(

type

.empty()) {

5905  bool

good_type = (found_it !=

kSatelliteTypes

.end()) ?

true

:

false

;

5909

new_name =

":"

+

type

+ new_name;

5912  return

new_type + new_name;

5917  return

(

m_Args

.empty());

5932  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

5933

m_Result->SetNotSet();

5934  if

(!feat || !scope || !feat->

IsSetQual

())

5938  if

(!qual_value.empty()) {

5940  switch

(m_FieldType) {

5941  case

eMobileElemTType:

5942  value

= s_GetMobileElemTType(qual_value);

5944  case

eMobileElemTName:

5945  value

= s_GetMobileElemTName(qual_value);

5949  if

(m_Nested == eNotNested) {

5950

m_Result->SetString(

value

);

5956

m_Result->SetRef(new_node);

5966  auto

it = find(kMobileETypeTypes.begin(), kMobileETypeTypes.end(),

type

);

5970  auto

it = find(kMobileETypeTypes.begin(), kMobileETypeTypes.end(),

value

);

5979  string

name =

value

.substr(pos + 1,

NPOS

);

5980  auto

it = find(kMobileETypeTypes.begin(), kMobileETypeTypes.end(),

type

);

5981  return

(it != kMobileETypeTypes.end()) ? name :

value

;

5984  auto

it = find(kMobileETypeTypes.begin(), kMobileETypeTypes.end(),

value

);

5992  if

(!

type

.empty()) {

5993  auto

found_it = find(kMobileETypeTypes.begin(), kMobileETypeTypes.end(),

type

);

5994  bool

good_type = (found_it != kMobileETypeTypes.end()) ?

true

:

false

;

5997  if

(!name.empty()) {

6013  return

(

m_Args

.empty());

6021

void CMacroFunction_EditSubfield::TheFunction()

6024  const string

& subfield = m_Args[1]->GetString();

6025  if

(subfield.empty())

6030  const string

&

location

= m_Args[++index]->GetString();

6031  bool

case_sensitive = m_Args[++index]->GetBool();

6032  bool

is_regex = (++index < m_Args.size()) ? m_Args[index]->GetBool() :

false

;

6035  if

(m_Args[0]->AreObjects()) {

6038  else if

(m_Args[0]->IsRef()) {

6039

x_GetObjectsFromRef(objs, 0);

6046  for

(

auto

&& it : objs) {

6058

SetQualStringValue(value_oi, newValue);

6062  string

orig_sat_type = sat_type;

6065  bool

good_type = (found_it !=

kSatelliteTypes

.end()) ?

true

:

false

;

6071  if

(!sat_name.empty())

6072

sat_name = sat_type +

":"

+ sat_name;

6075

SetQualStringValue(value_oi, newValue);

6085

SetQualStringValue(value_oi, newValue);

6089  string

orig_met_type = met_type;

6091  auto

found_it = find(kMobileETypeTypes.begin(), kMobileETypeTypes.end(), met_type);

6092  bool

good_type = (found_it != kMobileETypeTypes.end()) ?

true

:

false

;

6100

SetQualStringValue(value_oi, newValue);

6106  string

inst, coll, id;

6122

SetQualStringValue(value_oi, newValue);

6127  if

(m_QualsChangedCount) {

6128

m_DataIter->SetModified();

6130  log

<< m_DataIter->GetBestDescr() <<

": edited "

<< m_QualsChangedCount <<

" qualifiers, replaced "

<< find_txt;

6132

repl_txt.assign(

"''"

);

6134  log

<<

" with "

<< repl_txt;

6139 bool

CMacroFunction_EditSubfield::x_ValidArguments()

const 6141  if

(m_Args.size() != 7)

6144  bool

first_ok = m_Args[0]->AreObjects() || m_Args[0]->IsRef();

6145  if

(!first_ok || !m_Args[1]->IsString()) {

6149  for

(

size_t

index = 2; index < 4; index++) {

6150  if

(!m_Args[index]->IsString() && !m_Args[index]->IsInt()) {

6154  return

(m_Args[4]->IsString() && m_Args[5]->IsBool() && m_Args[6]->IsBool());

6163

void CMacroFunction_RemoveSubfield::TheFunction()

6165  const string

& subfield = m_Args[1]->GetString();

6166  if

(subfield.empty())

6170  if

(m_Args[0]->AreObjects()) {

6171

objs = m_Args[0]->GetObjects();

6173  else if

(m_Args[0]->IsRef()) {

6174

x_GetObjectsFromRef(objs, 0);

6180  for

(

auto

&& it : objs) {

6204  string

inst, coll, id;

6217  if

(!newValue.empty()) {

6218

SetQualStringValue(value_oi, newValue);

6223

m_QualsChangedCount++;

6228  if

(m_QualsChangedCount) {

6230  CRef<CScope>

scope = m_DataIter->GetScopedObject().scope;

6235  cleanup

.BasicCleanup(*seq_feat);

6242

m_DataIter->SetModified();

6244  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" qualifiers"

;

6250 bool

CMacroFunction_RemoveSubfield::x_ValidArguments()

const 6252  return

m_Args.size() == 2 && (m_Args[0]->AreObjects() || m_Args[0]->IsRef()) && m_Args[1]->IsString();

6263  if

(ch ==

'A'

|| ch ==

'T'

|| ch ==

'G'

|| ch ==

'C'

|| ch ==

'U'

) {

6274  "AC"

,

"AG"

,

"CG"

,

"ACG"

,

"AT"

,

"CT"

,

"ACT"

,

"GT"

,

"AGT"

,

"CGT"

,

"ACGT"

};

6279  if

(pos != string::npos) {

6290

vector<string> replacements;

6292  if

(codon.length() == 3 &&

s_IsATGC

(codon.c_str()[0])) {

6293  string

this_codon = codon.substr(0, 1);

6294

replacements.push_back(this_codon);

6296  for

(

int i

= 1;

i

< 3;

i

++) {

6298  size_t

num_now = replacements.size();

6300  for

(

unsigned int

j = 1; j < ch.length(); j++) {

6301  for

(

unsigned int

k = 0; k < num_now; k++) {

6302  string

cpy = replacements[k];

6303

replacements.push_back(cpy);

6306  for

(

unsigned int

k = 0; k < num_now; k++) {

6307  for

(

unsigned int

j = 0; j < ch.length(); j++) {

6308

replacements[j * num_now + k].append(ch.substr(j, 1));

6314

replacements.push_back(codon);

6316  return

replacements;

6320

void CMacroFunction_SetCodonsRecognized::TheFunction()

6329  if

(m_Args[0]->IsRef()) {

6337  else if

(m_Args[0]->IsString()) {

6338  value

= m_Args[0]->GetString();

6341  if

(

value

.empty()) {

6349

edit_feat->

SetData

().SetRna().SetExt().SetTRNA().ResetCodon();

6353  if

(

value

.empty())

6357  for

(

unsigned int

j = 0; j <

codons

.size(); j++)

6362

edit_feat->

SetData

().SetRna().SetExt().SetTRNA().SetCodon().push_back(val);

6366

m_DataIter->SetModified();

6369  log

<< m_DataIter->GetBestDescr() <<

": set codons-recognized"

;

6374 bool

CMacroFunction_SetCodonsRecognized::x_ValidArguments()

const 6376  return

(m_Args.size() == 1 && (m_Args[0]->IsRef() || m_Args[0]->IsString()));

6386

void CMacroFunction_SetStructCommField::TheFunction()

6389  const CBioseq

* bioseq =

dynamic_cast<const CBioseq

*

>

(

object

.GetPointer());

6391  if

(!(bioseq && bioseq->

IsNa

()) &&

6401  const string

& field_name = m_Args[index]->GetString();

6402  const string

& field_value = m_Args[++index]->GetString();

6403  const string

& existing_text_option = m_Args[++index]->GetString();

6405  bool

remove_field =

false

;

6406

x_GetOptionalArgs(

delimiter

, remove_field, index);

6409  if

(!field_value.empty()) {

6415

user_object->

AddField

(field_name, field_value);

6416

m_QualsChangedCount++;

6419  if

(user_object->

HasField

(field_name)) {

6424

user_field.

SetData

().SetStr(orig_val);

6425

m_QualsChangedCount++;

6431

user_object->

AddField

(field_name, field_value);

6432

m_QualsChangedCount++;

6436  if

(m_QualsChangedCount) {

6450  if

(!edit_bseq)

return

;

6453  if

(!seqdesc)

return

;

6461

user_field.

SetData

().SetStr(orig_val);

6462

m_QualsChangedCount++;

6466

user_field.

SetData

().SetStr(field_value);

6467

m_QualsChangedCount++;

6473

m_QualsChangedCount++;

6476  if

(m_QualsChangedCount) {

6482  if

(m_QualsChangedCount) {

6483

m_DataIter->SetModified();

6485  log

<< m_DataIter->GetBestDescr() <<

": applied ('"

<< field_name <<

"', '"

<< field_value <<

"') field-value pair"

;

6489  else if

(remove_field) {

6494

m_QualsChangedCount++;

6505  if

(!edit_bseq)

return

;

6509  if

(!seqdesc)

return

;

6512

m_QualsChangedCount++;

6516  if

(m_QualsChangedCount) {

6517

m_DataIter->SetModified();

6519  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" structured comment fields"

;

6525 bool

CMacroFunction_SetStructCommField::x_ValidArguments()

const 6527  if

(m_Args.size() < 3 || m_Args.size() > 6)

6530  if

(m_Args[0]->IsRef()) {

6536  else if

(!m_Args[0]->IsString()) {

6541  for

(

size_t i

= 1;

i

< m_Args.size(); ++

i

) {

6542  if

(!m_Args[

i

]->IsString() && !m_Args[

i

]->IsBool()) {

6559  const CBioseq

* bioseq =

dynamic_cast<const CBioseq

*

>

(

object

.GetPointer());

6561  if

(!(bioseq && bioseq->

IsNa

()) &&

6567  const string

& db_name = m_Args[index]->GetString();

6568  const string kPrefix

=

"StructuredCommentPrefix"

;

6569  const string kSuffix

=

"StructuredCommentSuffix"

;

6570  const string

& existing_text_option = m_Args[++index]->GetString();

6572  bool

remove_field =

false

;

6573

x_GetOptionalArgs(

delimiter

, remove_field, index);

6576  if

(!db_name.empty()) {

6582

m_DataIter->SetModified();

6586  bool

found_user =

false

;

6590

new_seqdesc->

Assign

(*desc_it);

6591

m_QualsChangedCount += s_UpdateStructCommentDb(*new_seqdesc,

kPrefix

, db_name, existing_text);

6592

m_QualsChangedCount += s_UpdateStructCommentDb(*new_seqdesc,

kSuffix

, db_name, existing_text);

6594  if

(m_QualsChangedCount) {

6598  cmd

->AddCommand(*ecmd);

6599

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

6605

m_DataIter->SetModified();

6613

m_QualsChangedCount += s_UpdateStructCommentDb(*user_object,

kPrefix

, db_name, existing_text);

6614

m_QualsChangedCount += s_UpdateStructCommentDb(*user_object,

kSuffix

, db_name, existing_text);

6615

m_DataIter->SetModified();

6617  if

(m_QualsChangedCount) {

6618  log

<< m_DataIter->GetBestDescr() <<

": applied structured comment database name '"

<< db_name <<

"'"

;

6620

x_LogFunction(

log

);

6622  else if

(remove_field) {

6628

m_QualsChangedCount++;

6629

m_DataIter->SetModified();

6632

m_QualsChangedCount++;

6633

m_DataIter->SetModified();

6647

new_seqdesc->

Assign

(*desc_it);

6649

m_QualsChangedCount++;

6651

m_QualsChangedCount++;

6653  if

(m_QualsChangedCount) {

6656  cmd

->AddCommand(*ecmd);

6657

m_DataIter->RunCommand(

cmd

, m_CmdComposite);

6663  if

(m_QualsChangedCount) {

6665  log

<< m_DataIter->GetBestDescr() <<

": removed "

<< m_QualsChangedCount <<

" structured comment fields"

;

6666

x_LogFunction(

log

);

6678

seqdesc->

SetUser

(*user_obj);

6682  if

(!edit_bseq)

return false

;

6684  auto

& descriptors = edit_bseq->

SetDescr

().Set();

6685

descriptors.push_back(seqdesc);

6702  if

(!

m_Args

[0]->IsString() || !

m_Args

[1]->IsString()) {

6706  if

(

m_Args

.size() > 2 && (!

m_Args

[index]->IsString() && !

m_Args

[index]->IsBool()))

6708  if

(

m_Args

.size() > 3 && !

m_Args

[++index]->IsBool())

6716  if

(!seqdesc.

IsUser

()) {

6737

user_field.

SetData

().SetStr(orig_val);

6742

user_field.

SetData

().SetStr(root);

6756  if

(!user_object.

IsSetData

())

return

;

6757  auto

& user_fields = user_object.

SetData

();

6759  for

(CUser_object::TData::iterator it = user_fields.begin(); it != user_fields.end(); ++it) {

6763  swap

(*it, *(user_fields.end() - 1));

6776 void

CMacroFunction_ValueFromTable::TheFunction()

6778  const string

&

table_name

= m_Args[0]->GetString();

6779  int

col = (

int

)m_Args[1]->GetInt();

6784

m_Result->SetNotSet();

6786  string value

= m_DataIter->GetValueFromTable(col - 1);

6787

m_Result->SetString(

value

);

6791 bool

CMacroFunction_ValueFromTable::x_ValidArguments()

const 6793  if

(m_Args.size() != 2)

6796  return

(m_Args[0]->IsString() && m_Args[1]->IsInt());

6805 void

CMacroFunction_GeneQual::TheFunction()

6813  string

field_name = m_Args[0]->GetString();

6819

field_name =

"data.gene."

+ field_name;

6829  bool

found_qual =

false

;

6841  for

(

auto

&& it : tmp_result.

SetObjects

()) {

6845

m_Result->SetObjects().push_back(it);

6851  if

(!found_qual && feat->

IsSetXref

()) {

6853  for

(

auto

&& it : feat->

SetXref

()) {

6854  if

(it->IsSetData() && it->GetData().IsGene()) {

6855

gene_xref = &(it->SetData().SetGene());

6868

m_Result->GetObjects().empty()) {

6869

m_Result->SetNotSet();

6873 bool

CMacroFunction_GeneQual::x_ValidArguments()

const 6895  string

voucher_type;

6896  string

voucher_part = m_Args[index]->GetString();

6898  const string

& action_type = m_Args[++index]->GetString();

6900  bool

remove_field =

false

;

6901

x_GetOptionalArgs(

delimiter

, remove_field, index);

6906  if

(m_Args[0]->IsString()) {

6907

voucher_type = m_Args[0]->

GetString

();

6909  else if

(m_Args[0]->AreObjects()) {

6910

objs = m_Args[0]->GetObjects();

6912  else if

(m_Args[0]->IsRef()) {

6913

x_GetObjectsFromRef(objs, 0);

6916  if

(voucher_type.empty() && objs.empty()) {

6926  if

(!voucher_type.empty()) {

6933  if

(!newValue.empty()) {

6935  bool

has_voucher =

false

;

6937  auto

orgmod = *mod_it;

6938  if

(orgmod->IsSetSubtype() && orgmod->GetSubtype() == subtype) {

6939

x_ApplyPart(*orgmod, part, newValue, existing_text);

6940

has_voucher =

true

;

6945  auto

new_mod = x_AddNewQual(subtype, part, newValue);

6946

bsrc->

SetOrg

().SetOrgname().SetMod().push_back(new_mod);

6947

m_QualsChangedCount++;

6951  auto

new_mod = x_AddNewQual(subtype, part, newValue);

6952

bsrc->

SetOrg

().SetOrgname().SetMod().push_back(new_mod);

6953

m_QualsChangedCount++;

6956  else if

(remove_field) {

6958  auto

orgmod = *mod_it;

6959  if

(orgmod->IsSetSubtype() && orgmod->GetSubtype() == subtype) {

6960

x_RemovePart(*orgmod, part);

6961

m_QualsChangedCount++;

6962  if

(orgmod->GetSubname().empty())

6967

bsrc->

SetOrg

().SetOrgname().ResetMod();

6972  for

(

auto

&& it : objs) {

6977  if

(!

mod

)

continue

;

6979  if

(!newValue.empty()) {

6981

x_ApplyPart(*

mod

, part, newValue, existing_text);

6984  auto

new_mod = x_AddNewQual(

mod

->GetSubtype(), part, newValue);

6985

bsrc->

SetOrg

().SetOrgname().SetMod().push_back(new_mod);

6986

m_QualsChangedCount++;

6989  else if

(remove_field) {

6990

x_RemovePart(*

mod

, part);

6992

m_QualsChangedCount++;

6999  if

(m_QualsChangedCount) {

7000

m_DataIter->SetModified();

7003  if

(!newValue.empty()) {

7004

report[

"setting new value to structured voucher "

+ voucher_part] = m_QualsChangedCount;

7006  else if

(remove_field) {

7007

report[

"removal of structured voucher "

+ voucher_part] = m_QualsChangedCount;

7010

x_LogChangedQuals(fnc_log);

7018  auto

arg_nr =

m_Args

.size();

7019  if

(arg_nr < 4 || arg_nr > 6)

7022  bool

first_ok =

m_Args

[0]->IsString() ||

m_Args

[0]->AreObjects() ||

m_Args

[0]->IsRef();

7023  if

(!first_ok)

return false

;

7025  if

(!

m_Args

[1]->IsString())

return false

;

7028  bool

third_ok =

m_Args

[2]->IsString() ||

m_Args

[2]->IsInt() ||

m_Args

[2]->IsDouble();

7029  if

(!third_ok)

return false

;

7031  if

(!

m_Args

[3]->IsString())

return false

;

7033  if

(arg_nr > 4 && (!

m_Args

[4]->IsString() && !

m_Args

[4]->IsBool()))

return false

;

7035  if

(arg_nr > 5 && !

m_Args

[5]->IsBool())

return false

;

7044  string

orig_inst, orig_coll, orig_id;

7049  auto

update = [&newValue, existing_text,

this

](

string

&

value

,

const string

& orig_value)

7056  string

inst{ orig_inst }, coll{ orig_coll },

id

{ orig_id };

7069  string

inst, coll, id;

7088  string

inst, coll, id;

7104

void CMacroFunction_SetAutodefOption::TheFunction()

7113  string

field_name = m_Args[index]->GetString();

7115  const string

& field_value = m_Args[++index]->GetString();

7116  const string

& existing_text_option = m_Args[++index]->GetString();

7118  bool

remove_field =

false

;

7119

x_GetOptionalArgs(

delimiter

, remove_field, index);

7127

user_object->

AddField

(field_name, field_value);

7128

m_QualsChangedCount++;

7131  if

(user_object->

HasField

(field_name)) {

7136

user_field.

SetData

().SetStr(orig_val);

7137

m_QualsChangedCount++;

7143

user_object->

AddField

(field_name, field_value);

7144

m_QualsChangedCount++;

7148  if

(m_QualsChangedCount) {

7149

m_DataIter->SetModified();

7151  log

<< m_DataIter->GetBestDescr() <<

": applied ('"

<< field_name <<

"', '"

<< field_value <<

"') field-value pair"

;

7157 bool

CMacroFunction_SetAutodefOption::x_ValidArguments()

const 7159  if

(m_Args.size() < 3 || m_Args.size() > 4)

7162  for

(

size_t i

= 0;

i

< m_Args.size(); ++

i

) {

7163  if

(!m_Args[

i

]->IsString()) {

User-defined methods of the data storage class.

@ eExtreme_Biological

5' and 3'

bool IsSetOrgMod(void) const

bool IsSetOrgname(void) const

static bool CleanupUserObject(CUser_object &object)

@Gb_qual.hpp User-defined methods of the data storage class.

static int CodonToIndex(char base1, char base2, char base3)

bool IsSuppressed(void) const

Subclass of the IQueryParseUserObject which is held as the user-defined object in each CQueryParseNod...

class CMacroExecException

@Name_std.hpp User-defined methods of the data storage class.

@OrgMod.hpp User-defined methods of the data storage class.

static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)

static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)

static string MakeStructuredVoucher(const string &inst, const string &coll, const string &id)

static bool ParseStructuredVoucher(const string &str, string &inst, string &coll, string &id)

@RNA_ref.hpp User-defined methods of the data storage class.

string GetRnaProductName(void) const

void SetRnaProductName(const string &product, string &remainder)

ESubtype GetSubtype(void) const

@ eSubtype_mat_peptide_aa

namespace ncbi::objects::

const string & GetNamedQual(const CTempString &qual_name) const

Return a named qualifier.

void AddQualifier(const string &qual_name, const string &qual_val)

Add a qualifier to this feature.

const CGene_ref * GetGeneXref(void) const

See related function in util/feature.hpp.

static TSubtype GetSubtypeValue(const string &str, EVocabulary vocabulary=eVocabulary_raw)

static bool IsValidSubtypeName(const string &str, EVocabulary vocabulary=eVocabulary_raw)

CUser_field & SetValue(int value)

set a data field to a given value Int8 and TGi values can be stored into 'str' field if the value doe...

void SetObjectType(EObjectType obj_type)

void AddUnverifiedOrganism()

void AddUnverifiedContaminant()

bool RemoveNamedField(const string &field_name, NStr::ECase ecase=NStr::eCase)

@ eObjectType_StructuredComment

bool HasField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const

Verify that a named field exists.

bool IsAutodefOptions() const

CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)

add a data field to the user object that holds a given value

void AddUnverifiedMisassembled()

CUser_field & SetField(const string &str, const string &delim=".", const string &obj_subtype=kEmptyStr, NStr::ECase use_case=NStr::eCase)

Access a named field in this user object.

EObjectType GetObjectType() const

void AddUnverifiedFeature()

static auto & FixCapitalizationInString

static const string kSatelliteTypes[]

static void cleanup(void)

static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)

static const char table_name[]

static const char * str(char *buf, int n)

static const char location[]

Utility macros and typedefs for exploring NCBI objects from general.asn.

#define EDIT_EACH_USERFIELD_ON_USEROBJECT(Itr, Var)

#define ERASE_USERFIELD_ON_USEROBJECT(Itr, Var)

ERASE_USERFIELD_ON_USEROBJECT.

const TResidue codons[4][4]

#define NON_CONST_ITERATE(Type, Var, Cont)

Non constant version of ITERATE macro.

void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

const CMemberId & GetId(void) const

const string & GetName(void) const

objects::ECapChange ConvertStringtoCapitalOption(const string &cap_name)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

virtual bool x_ChangeFields(CObjectInfo &src, CObjectInfo &dest)

virtual void TheFunction()

class CMacroFunction_EditStringQual Usage: EditStringQual(field_name|rt_obj, find_text,...

bool StringsAreEquivalent(const string &name1, const string &name2)

bool RemoveFirstName(objects::CName_std &std_name)

static bool s_EditText(string &str, const string &find, const string &repl, ESearchLoc loc, bool case_sensitive, bool is_regex=false)

bool SetQualStringValue(CObjectInfo &oi, const string &value)

Functions make the action and collect statistics.

void CleanupForTaxnameChange(CObjectInfo oi)

void SetString(const string &data)

Set/get underlying data type.

void x_RemovePart(objects::COrgMod &orgmod, NMacroUtil::EStructVoucherPart part)

static void s_MoveSuffixToTheEnd(objects::CUser_object &user_object)

virtual void TheFunction()

Function implementation.

static bool s_IsATGC(char ch)

CMacroFunction_SetCodonsRecognized SetCodonsRecognized(field_name) The field_name specifies one of th...

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_SetOrCreateDestFeatFields(const objects::CSeq_feat &src_feat, CMQueryNodeValue::TObs &result, size_t index)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

objects::CSeqFeatData::ESubtype GetFeatSubtype(const string &feat_type)

void x_SetFields(CMQueryNodeValue::TObs &objs, const string &newValue, objects::edit::EExistingText existing_text, vector< string > &new_values)

CRef< CMacroCmdComposite > m_CmdComposite

static void s_ResetModSubsrcQuals(CBioSource &bsrc)

static bool s_AddSrcSubSource(objects::CBioSource &bsrc, int subtype, const string &value)

const char * kMobileElementTType

static string s_GetMobileElemTType(const string &value)

static vector< string > ParseDegenerateCodons(string codon)

bool x_GetSourceFields(CObjectInfo oi, size_t index, CMQueryNodeValue::TObs &result)

virtual bool x_ChangeFields(CObjectInfo &src, CObjectInfo &dest)=0

virtual void TheFunction()

Function implementation.

static bool s_SetEnumValue(CObjectInfo &obj, const string &str)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

bool x_GetSpecialField(const string &field, CMQueryNodeValue::TObs &objs, objects::CScope &scope)

CMQueryNodeValue::EType GetPrimitiveFromRef(CMQueryNodeValue &node)

void x_SetNewPrimitiveValue(CObjectInfo &oi, const string &newValue, objects::edit::EExistingText existing_text, vector< string > &new_values)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

static void s_AddNewDBlinkValue(CUser_field &user_field, const string &newValue)

AddDBLink(dblink_type, newValue, existing_text, delimiter, remove_blank) The last parameter is option...

static string s_GetMobileElemTName(const string &value)

virtual void TheFunction()

class CMacroFunction_ConvertStringQual ConvertStringQual(src_field, dst_field, capitalization,...

bool ResolveAndSetSimpleTypeValue(CObjectInfo &oi, const string &field_name, const CMQueryNodeValue &value, objects::edit::EExistingText existing_text=objects::edit::eExistingText_replace_old)

Resolve dot qualified ASN.1 node_name using the object information instance provided as a parameter (...

bool RemoveFieldByName(CMQueryNodeValue::SResolvedField &res_field)

Remove the object information instance corresponding to field, using information about its parent nod...

list< SResolvedField > TObs

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

virtual void TheFunction()

Function implementation.

static string s_GetEnumValue(CObjectInfo &obj)

bool GetSimpleTypeValue(CObjectInfo &oi, const string &field_name, CMQueryNodeValue &value)

Get single node data from the node specified by parameter of type CObjectInfo and additionally field ...

virtual void TheFunction()

class CMacroFunction_SetStringQual Expected Syntax: SetStringQual(field_name, newValue,...

bool x_CheckArguments(size_t index) const

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

void Dereference()

If it is a reference it is resolved to the first non reference type in the hierarchy.

const TObs & GetObjects() const

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

bool x_SetFields(CObjectInfo oi, CMQueryNodeValue::TObs &result, size_t index)

void GetPrimitiveObjInfosWithContainers(CMQueryNodeValue::TObs &objs, const CMQueryNodeValue::SResolvedField &info)

bool ResolveIdentToObjects(const CObjectInfo &oi, const string &identifier, CMQueryNodeValue &v)

Resolve name to the list of objects.

static void s_SetFeatField(CRef< CSeq_feat > feat, CObjectInfo &oi, const string &field_name, CMQueryNodeValue::TObs &result)

const char * kStrCommFieldValue

bool SetSimpleTypeValue(CObjectInfo &oi, const CMQueryNodeValue &value, objects::edit::EExistingText existing_text=objects::edit::eExistingText_replace_old)

Set single node data to the node specified by parameter of type CObjectInfo.

static const string s_GetExpansion(const string &ch)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

CConstRef< objects::CSeq_feat > m_ConstDestFeat

void RemoveGeneXref(objects::CSeq_feat &feat)

void ChangeFields(CMQueryNodeValue::TObs &src_objs, CMQueryNodeValue::TObs &dest_objs)

void SetDataType(EType dt)

bool x_MakeNewStructuredComment(const string &db_name, const string &kPrefix, const string &kSuffix)

string GetStringValue(CRef< CMQueryNodeValue > &value)

converts ints and doubles into string, by changing the type of the value

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

void x_AddBioSrcModifier(const string &subtype, const string &newValue)

void x_ParseFields(CMQueryNodeValue::TObs &dest_objs, const string &text_portion, objects::edit::EExistingText existing_text)

string x_GetSourceString(CObjectInfo &src)

static bool s_AddNewUserField(CRef< CSeqdesc > &user_object_desc, const string &dblink, const string &newValue)

const char * kSatelliteType

const char * kSatelliteName

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_RmvOutsideFields(CMQueryNodeValue::TObs &resolved_objs, const CRemoveTextOptions &options)

CObjectInfo GetPrimitiveObjInfo(const CObjectInfo &info)

bool x_GetDestFields(CObjectInfo oi, size_t index, CMQueryNodeValue::TObs &result)

const string & GetString() const

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

EType GetDataType() const

CRef< CRemoveTextOptions > x_GetRemoveTextOptions(size_t start_index) const

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

CRef< objects::CSeq_feat > m_EditDestFeat

const char * kStrCommFieldName

bool x_DoFieldsExist(CObjectInfo oi, CMQueryNodeValue::TObs &result, size_t index)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

void GetPrimitiveObjectInfos(CMQueryNodeValue::TObs &objs, const CMQueryNodeValue::SResolvedField &info)

virtual void TheFunction()

class CMacroFunction_ConvertStringQual ConvertStringQual(src_field, dst_field, capitalization,...

EStructVoucherPart GetSVPartFromString(const string voucher_part)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

virtual void TheFunction()

Function implementation.

static string s_MakeSatellite(const string &type, const string &name)

Int4 m_QualsChangedCount

Number of changed qualifiers during the function call.

bool GetFieldsByName(CMQueryNodeValue::TObs *results, const CObjectInfo &oi_i, const string &field_name)

Resolve existing dot qualified ASN.1 name (field_name) starting from the object information instance ...

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

bool x_DoDestFeatFieldsExist(const objects::CSeq_feat &src_feat, CMQueryNodeValue::TObs &result, const string &dest_feattype, const string &dest_field)

bool IsTaxname(CMQueryNodeValue::SResolvedField &res)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

virtual void TheFunction()

class CMacroFunction_CopyStringQual Expected syntax: CopyStringQual( src_field, dest_field,...

CRef< objects::edit::CParseTextOptions > x_GetParseOptions(size_t start_index)

static string s_GetSatelliteName(const string &value)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

static const string kAmbiguities

static int s_AddGBQualifier(objects::CSeq_feat &feat, const string &qual_name, const string &newValue)

static void s_SetVectorValue(CUser_field &user_field, const string &newValue, const string &del)

virtual void TheFunction()

Function implementation.

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

CRef< objects::COrgMod > x_AddNewQual(objects::COrgMod::TSubtype subtype, NMacroUtil::EStructVoucherPart part, const string &newValue)

bool ResolveIdentToSimple(const CObjectInfo &oi, const string &identifier, CMQueryNodeValue &v)

Resolve name to simple types value.

bool SetFieldsByName(CMQueryNodeValue::TObs *results, CObjectInfo &oi_i, const string &field_name)

Resolve not necessarily existing dot qualified ASN.1 name (field_name) starting from the object infor...

void x_CopyFields(CMQueryNodeValue::TObs &src_objs, CMQueryNodeValue::TObs &dest_objs)

virtual void TheFunction()

Function implementation.

static string s_GatherExistingValues(CUser_field &user_field, const string &newValue, const string &del)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

void x_GetObjectsFromRef(CMQueryNodeValue::TObs &objects, const size_t &index)

objects::edit::EExistingText ActionTypeToExistingTextOption(const string &action_type, const string &delimiter)

CRef< CMQueryNodeValue > m_Result

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

static Int4 s_RemoveFields(CIRef< IMacroBioDataIter > &dataiter, CMQueryNodeValue::TObs &objs)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

void x_SetFieldType(const string &strcomm_field)

bool IsSatelliteSubfield(const string &field)

static int s_UpdateStructCommentDb(objects::CSeqdesc &seqdesc, const string &field, const string &db_name, objects::edit::EExistingText existing_text)

objects::ECapChange m_CapChange

static ESearchLoc s_GetLocFromName(const string &name)

bool IsMobileElementTSubfield(const string &field)

const char * kMobileElementTQual

static string s_MakeMobileElementT(const string &type, const string &name)

virtual void TheFunction()

class CMacroFunction_CopyStringQual Expected syntax: CopyStringQual( src_field, dest_field,...

static const string kReplacements[]

bool x_SwapFields(CObjectInfo &src, CObjectInfo &dest)

static void s_AddUnverifiedType(CUser_object &user, NMacroUtil::EUnverifiedType type)

class CMacroFunction_AddUnverified AddUnverified("Features"); The user object will be added only to n...

string x_GetSourceString(CObjectInfo &src)

void x_LogFunction(CNcbiOstrstream &logstr)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

bool ApplyFirstName(objects::CName_std &std_name, const string &newValue, objects::edit::EExistingText existing_text)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

bool IsBiosourceModifier(const string &field)

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

virtual bool x_ChangeFields(CObjectInfo &src, CObjectInfo &dest)

static void s_SetBioSourceField(CRef< CBioSource > bsrc, CObjectInfo &oi, const string &field_name, CMQueryNodeValue::TObs &dest_objs)

bool EditText(string &str) const

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

CRef< objects::CSeq_feat > m_CreatedFeat

void x_SetField(CConstRef< CObject > &obj, const string &fieldname, CMQueryNodeValue::TObs &result)

void SwapGbQualWithValues(CMQueryNodeValue::TObs &objs)

void SetObjects(const TObs &obs)

static const char * sm_FunctionName

EditRelatedFeatureQual(feat_type, field_name, find_text, repl_text, location, case_sensitive,...

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

string x_GetSourceString(CObjectInfo &src)

const char * kMobileElementTName

DEFINE_MACRO_FUNCNAME(CMacroFunction_CopyFeatQual, "CopyFeatureQual")

CopyFeatureQual(src_field, dest_feature_type, dest_feature_field, update_mrna, existing_text_opt,...

virtual bool x_ChangeFields(CObjectInfo &src, CObjectInfo &dest)

void x_ApplyPart(objects::COrgMod &orgmod, NMacroUtil::EStructVoucherPart part, const string &newValue, objects::edit::EExistingText existing_text)

static bool s_AddSrcOrgMod(objects::CBioSource &bsrc, int subtype, const string &value)

EUnverifiedType GetUnverifiedType(const string &value)

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

CIRef< IMacroBioDataIter > m_DataIter

static bool s_SwapFields(CObjectInfo &src, CObjectInfo &dest)

vector< CConstRef< objects::CSeq_feat > > TVecFeatList

virtual bool x_ValidArguments(void) const

Tests the number and the type of function arguments.

vector< pair< objects::CSeqdesc_CI, CRef< objects::CSeqdesc > > > m_ChangedDescriptors

virtual void TheFunction()

Function implementation.

objects::edit::EExistingText m_ExistingText

void RemoveEmptyDescriptors(objects::CBioseq &bseq)

const char * kStrCommDbname

virtual bool x_ValidArguments() const

Tests the number and the type of function arguments.

void x_EditFields(CMQueryNodeValue::TObs &resolved_objs, const string &find_txt, const string &repl_txt, ESearchLoc loc, bool case_sensitive, bool is_regex)

static string s_GetSatelliteType(const string &value)

size_t TMemberIndex

Type used for indexing class members and choice variants.

virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)

Set object to copy of another one.

virtual const CTypeInfo * GetThisTypeInfo(void) const =0

static const TObjectType * SafeCast(TTypeInfo type)

@ ePrimitiveValueString

string|char*|const char*

@ ePrimitiveValueInteger

(signed|unsigned) (char|short|int|long)

@ ePrimitiveValueChar

char

@ ePrimitiveValueBool

bool

@ ePrimitiveValueEnum

enum

@ ePrimitiveValueReal

float|double

CElementIterator BeginElements(void) const

Create container elements iterator.

CObjectInfo AddNewPointedElement(void) const

add new pointer element, create new pointed object and return it

CObjectInfo GetPointedObject(void) const

Get data and type information of object to which this type refers.

bool GetPrimitiveValueBool(void) const

Get boolean data.

const CMemberInfo * GetMemberInfo(void) const

TObjectPtr GetObjectPtr(void) const

Get pointer to object.

CObjectInfo GetMember(void) const

Get class member data.

void SetPrimitiveValueString(const string &value)

void SetPrimitiveValueBool(bool value)

Set boolean data.

int GetPrimitiveValueInt(void) const

Get data as int.

void SetPrimitiveValueInt8(Int8 value)

void SetPrimitiveValueInt4(Int4 value)

CObjectInfo AddNewElement(void) const

Add and return new element object.

CMemberIterator GetClassMemberIterator(TMemberIndex index) const

Create class member iterator that initially points to specified member.

ETypeFamily GetTypeFamily(void) const

Get data type family.

void GetPrimitiveValueString(string &value) const

Get string data.

double GetPrimitiveValueDouble(void) const

Get data as double.

CMemberIterator FindClassMember(const string &memberName) const

Find class member by its name.

Int4 GetPrimitiveValueInt4(void) const

Get data as Int4.

void SetPrimitiveValueDouble(double value)

const string & GetName(void) const

Get type name.

void SetPrimitiveValueInt(int value)

EPrimitiveValueType GetPrimitiveValueType(void) const

Get type of primitive value.

Int8 GetPrimitiveValueInt8(void) const

Get data as Int8.

bool IsSet(void) const

Is member assigned a value.

CObjectTypeInfo GetElementType(void) const

Get type information of an element of container.

void GetCdssForGene(const CMappedFeat &gene_feat, list< CMappedFeat > &cds_feats, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)

CMappedFeat GetBestMrnaForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)

CMappedFeat GetBestCdsForMrna(const CMappedFeat &mrna_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0)

CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)

Merge ranges in the seq-loc.

const CSeq_feat * GetCDSForProduct(const CBioseq &product, CScope *scope)

Get the encoding CDS feature of a given protein sequence.

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)

CConstRef< CBioseq > GetCompleteBioseq(void) const

Get the complete bioseq.

CSeq_entry_Handle GetSeq_entry_Handle(void) const

Get parent Seq-entry handle.

virtual const CSeq_loc & GetProduct(void) const

bool IsSetProduct(void) const

virtual const CSeq_loc & GetLocation(void) const

CConstRef< CSeq_feat > GetOriginalSeq_feat(void) const

CSeq_entry_Handle GetSeq_entry_Handle(void) const

TObjectType * GetPointer(void) const THROWS_NONE

Get pointer,.

TObjectType * GetNCPointer(void) const THROWS_NONE

Get pointer,.

CConstRef< C > ConstRef(const C *object)

Template function for conversion of const object pointer to CConstRef.

CRef< C > Ref(C *object)

Helper functions to get CRef<> and CConstRef<> objects.

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

void Reset(void)

Reset reference object.

bool IsNull(void) const THROWS_NONE

Check if pointer is null – same effect as Empty().

TObjectType & GetObject(void) const

Get object.

int32_t Int4

4-byte (32-bit) signed integer

int64_t Int8

8-byte (64-bit) signed integer

size_t Replace(CTempStringEx search, CTempString replace, CRegexp::TCompile compile_flags=CRegexp::fCompile_default, CRegexp::TMatch match_flags=CRegexp::fMatch_default, size_t max_replace=0)

Replace occurrences of a substring within a string by pattern.

unsigned int TCompile

Type definitions used for code clarity.

string GetResult(void)

Get result string.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define USING_SCOPE(ns)

Use the specified namespace.

#define END_SCOPE(ns)

End the previously defined scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

#define BEGIN_SCOPE(ns)

Define a new scope.

static bool StringToBool(const CTempString str)

Convert string to bool.

NCBI_NS_STD::string::size_type SIZE_TYPE

static string Int8ToString(Int8 value, TNumToStringFlags flags=0, int base=10)

Convert Int8 to string.

static string DoubleToString(double value, int precision=-1, TNumToStringFlags flags=0)

Convert double to string.

static Int8 StringToInt8(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to Int8.

static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)

Split a string using specified delimiters.

static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)

Find the pattern in the specified range of a string using a case insensitive search.

static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)

Check if a string ends with a specified suffix value.

static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)

Check if a string is blank (has no text).

static const string BoolToString(bool value)

Convert bool to string.

static void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string (in-place)

static string IntToString(int value, TNumToStringFlags flags=0, int base=10)

Convert int to string.

static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)

Find the pattern in the string.

static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-sensitive equality of a substring with another string.

static SIZE_TYPE FindCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)

Find the pattern in the specified range of a string using a case sensitive search.

static long StringToLong(const CTempString str, TStringToNumFlags flags=0, int base=10)

Convert string to long.

static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)

Check if a string starts with a specified prefix value.

static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)

Case-insensitive equality of a substring with another string.

static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)

Convert numeric value to string.

static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)

Test for equality of a substring with another string.

static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)

Replace occurrences of a substring within a string.

static string & ToUpper(string &str)

Convert string to upper case – string& version.

@ fConvErr_NoThrow

Do not throw an exception on error.

@ eNocase

Case insensitive compare.

@ eCase

Case sensitive compare.

const TSubtype & GetSubtype(void) const

Get the Subtype member data.

void SetSubtype(TSubtype value)

Assign a value to Subtype data member.

bool IsSetOrg(void) const

Check if a value has been assigned to Org data member.

bool IsSetSubtype(void) const

Check if a value has been assigned to Subtype data member.

const TOrg & GetOrg(void) const

Get the Org member data.

void SetOrg(TOrg &value)

Assign a value to Org data member.

void SetName(const TName &value)

Assign a value to Name data member.

TSubtype & SetSubtype(void)

Assign a value to Subtype data member.

void ResetSubtype(void)

Reset Subtype data member.

const TStr & GetStr(void) const

Get the variant data.

bool IsSetData(void) const

the object itself Check if a value has been assigned to Data data member.

bool IsStr(void) const

Check if variant Str is selected.

bool IsStrs(void) const

Check if variant Strs is selected.

const TStrs & GetStrs(void) const

Get the variant data.

const TData & GetData(void) const

Get the Data member data.

bool IsStr(void) const

Check if variant Str is selected.

bool IsSetLabel(void) const

field label Check if a value has been assigned to Label data member.

TData & SetData(void)

Assign a value to Data data member.

void SetNum(TNum value)

Assign a value to Num data member.

const TStr & GetStr(void) const

Get the variant data.

void SetLabel(TLabel &value)

Assign a value to Label data member.

const TData & GetData(void) const

Get the Data member data.

void SetType(TType &value)

Assign a value to Type data member.

void ResetNum(void)

Reset Num data member.

void SetData(TData &value)

Assign a value to Data data member.

const TLabel & GetLabel(void) const

Get the Label member data.

const TType & GetType(void) const

Get the Type member data.

bool IsSetData(void) const

Check if a value has been assigned to Data data member.

E_Choice Which(void) const

Which variant is currently selected.

@ e_not_set

No variant selected.

const TMod & GetMod(void) const

Get the Mod member data.

bool IsSetDb(void) const

ids in taxonomic or culture dbases Check if a value has been assigned to Db data member.

const TSubname & GetSubname(void) const

Get the Subname member data.

void SetSubtype(TSubtype value)

Assign a value to Subtype data member.

const TDb & GetDb(void) const

Get the Db member data.

bool IsSetSubname(void) const

Check if a value has been assigned to Subname data member.

TMod & SetMod(void)

Assign a value to Mod data member.

void SetSubname(const TSubname &value)

Assign a value to Subname data member.

const TOrgname & GetOrgname(void) const

Get the Orgname member data.

@ eSubtype_specimen_voucher

@ eSubtype_culture_collection

const TName & GetName(void) const

Get the Name member data.

TType GetType(void) const

Get the Type member data.

bool IsSetType(void) const

Check if a value has been assigned to Type data member.

TXref & SetXref(void)

Assign a value to Xref data member.

bool IsSetComment(void) const

Check if a value has been assigned to Comment data member.

bool IsSetData(void) const

the specific data Check if a value has been assigned to Data data member.

bool IsSetQual(void) const

qualifiers Check if a value has been assigned to Qual data member.

bool IsProt(void) const

Check if variant Prot is selected.

bool IsCdregion(void) const

Check if variant Cdregion is selected.

void SetComment(const TComment &value)

Assign a value to Comment data member.

bool IsSetXref(void) const

cite other relevant features Check if a value has been assigned to Xref data member.

const TLocation & GetLocation(void) const

Get the Location member data.

bool IsGene(void) const

Check if variant Gene is selected.

const TData & GetData(void) const

Get the Data member data.

void SetData(TData &value)

Assign a value to Data data member.

const TProduct & GetProduct(void) const

Get the Product member data.

const TProt & GetProt(void) const

Get the variant data.

const TXref & GetXref(void) const

Get the Xref member data.

vector< CRef< CSeqFeatXref > > TXref

void ResetXref(void)

Reset Xref data member.

const TRna & GetRna(void) const

Get the variant data.

TQual & SetQual(void)

Assign a value to Qual data member.

bool IsSetProduct(void) const

product of process Check if a value has been assigned to Product data member.

bool IsRna(void) const

Check if variant Rna is selected.

bool IsSetLocation(void) const

feature made from Check if a value has been assigned to Location data member.

bool IsGenbank(void) const

Check if variant Genbank is selected.

const TUser & GetUser(void) const

Get the variant data.

const TTitle & GetTitle(void) const

Get the variant data.

const TGenbank & GetGenbank(void) const

Get the variant data.

void SetDescr(TDescr &value)

Assign a value to Descr data member.

TUser & SetUser(void)

Select the variant.

bool IsUser(void) const

Check if variant User is selected.

@ e_User

user defined object

@ e_Title

a title for this sequence

unsigned int

A callback function used to compare two keys in a database.

Functions that resolve field names described in asn format.

const struct ncbi::grid::netcache::search::fields::CREATED created

const GenericPointer< typename T::ValueType > T2 value

static const char delimiter[]

Utility macros and typedefs for exploring NCBI objects from seqfeat.asn.

#define ERASE_ORGMOD_ON_BIOSOURCE(Itr, Var)

ERASE_ORGMOD_ON_BIOSOURCE.

#define EDIT_EACH_ORGMOD_ON_BIOSOURCE(Itr, Var)

#define EDIT_EACH_SUBSOURCE_ON_BIOSOURCE(Itr, Var)

#define EDIT_EACH_GBQUAL_ON_SEQFEAT(Itr, Var)

static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

@ eExistingText_append_semi

@ eExistingText_leave_old

@ eExistingText_replace_old

bool AddValueToString(string &str, const string &value, EExistingText existing_text)

Add text to an existing string, using the "existing_text" directive to combine new text with existing...

C++ wrappers for the Perl-compatible regular expression (PCRE) library.

CRef< CCmdComposite > UpdatemRNAProduct(const objects::CSeq_feat &protein, objects::CScope &scope, string &message)

void SetProteinFeature(objects::CSeq_feat &prot, objects::CBioseq_Handle product, const objects::CSeq_feat &cds)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4