(
const auto& desc : seq_set.
GetDescr().
Get()) {
75 if(desc->IsSource()) {
83 if(bioseq->IsSetDescr()) {
85 for(TSeqdescList::iterator desc = descrs.begin(); desc != descrs.end(); ++desc) {
86 if((*desc)->IsSource()) {
89seq_set.
SetDescr().Set().push_back(*desc);
112 if(! prot_ref.
IsSetName() || prot_ref.
GetName().empty() || (prot_ref.
GetName().size() == 1 && prot_ref.
GetName().front() ==
"unnamed")) {
114 for(TQualVector::iterator qual = feat.
SetQual().begin(); qual != feat.
SetQual().end(); ++qual) {
115 if((*qual)->IsSetQual() && (*qual)->GetQual() ==
"product"&& (*qual)->IsSetVal()) {
117prot_ref.
SetName().push_back((*qual)->GetVal());
153 size_tsz = ranges.size();
154 for(
size_t i= 1;
i< sz; ++
i) {
155 if(ranges[
i].
first!= ranges[
i- 1].second && ranges[
i].
first!= ranges[
i- 1].second + 1) {
173new_int->
SetTo(to);
176 if(
last->IsSetFuzz_from()) {
179 if(
last->IsSetFuzz_to()) {
193vector<pair<TSeqPos, TSeqPos>> ranges;
194 for(
const auto& cur_loc : locs) {
195 if(cur_loc->IsInt()) {
198ranges.push_back(make_pair(interval.
GetFrom(), interval.
GetTo()));
200 if(! first_interval) {
201first_interval = &interval;
203first_interval = &interval;
206 if(! last_interval) {
207last_interval = &interval;
209last_interval = &interval;
211}
else if(cur_loc->IsPnt()) {
220 if(! first_interval) {
224 sort(ranges.begin(), ranges.end());
227 SetNewInterval(first_interval, last_interval, ranges.front().first, ranges.back().second, loc);
235vector<pair<TSeqPos, TSeqPos>> ranges;
236 for(
const auto& interval : ints) {
237ranges.push_back(make_pair(interval->GetFrom(), interval->GetTo()));
240 sort(ranges.begin(), ranges.end());
251 auto& scope = entryHandle.
GetScope();
253 intprotein_id_counter = 99;
255 for(
CFeat_CIcds_it(entryHandle, sel); cds_it; ++cds_it) {
256 autopCds = cds_it->GetSeq_feat();
258 if(! pCds->IsSetProduct()) {
260pNewCds->Assign(*pCds);
263 edit::GetNewProtId(scope.GetBioseqHandle(pNewCds->GetLocation()), protein_id_counter, idLabel,
false);
264pNewCds->SetProduct().SetWhole().Assign(*pProteinId);
266pCdsEditHandle.
Replace(*pNewCds);
268}
else if(pCds->GetProduct().GetId() &&
269scope.Exists(*pCds->GetProduct().GetId())) {
274 autoprotHandle = scope.GetBioseqHandle(pCds->GetProduct());
280protName =
"hypothetical protein";
306 for(
auto& entry : seq_entries) {
316 cleanup.ExtendedCleanup(*entry);
328 boolgene_set =
false;
334 if(feat->IsSetData() && feat->GetData().IsGene()) {
343 if(feat->IsSetLocation()) {
345 CSeq_loc& loc = feat->SetLocation();
348}
else if(loc.
IsMix()) {
350 if(feat->IsSetData() && feat->GetData().IsProt()) {
362 if(! loc.
GetId()) {
371 CSeqdesc_CImol_info(bioseq_h, CSeqdesc::E_Choice::e_Molinfo);
378 const CSeq_id&
id= *ids.front();
379 if(
id.Which() == loc.
GetId()->
Which()) {
@ eExtreme_Biological
5' and 3'
CRef< objects::CSeq_id > GetNewProtId(objects::CBioseq_Handle bsh, int &offset, string &id_label, bool general_only)
static CRef< CSeq_entry > AddProtein(const CSeq_feat &cds, CScope &scope)
static const string & GetProteinName(const CProt_ref &prot)
const CSeq_interval * GetStopInt(ESeqLocExtremes ext) const
const CSeq_interval * GetStartInt(ESeqLocExtremes ext) const
CSeq_feat_EditHandle â.
namespace ncbi::objects::
TSeqPos GetStart(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
static void LookForProductName(CSeq_feat &feat)
static NCBI_UNUSED bool IsEmptyMolInfo(const CMolInfo &mol_info)
void g_InstantiateMissingProteins(CSeq_entry_Handle entryHandle)
static void MoveSourceDescrToTop(CSeq_entry &entry)
static bool IsConversionPossible(const vector< pair< TSeqPos, TSeqPos >> &ranges)
void FinalCleanup(TEntryList &seq_entries)
static void ConvertPackedIntToInterval(CSeq_loc &loc)
static void ConvertMixToInterval(CSeq_loc &loc)
static void SetNewInterval(const CSeq_interval *first, const CSeq_interval *last, const TSeqPos &from, TSeqPos &to, CSeq_loc &loc)
list< CRef< objects::CSeq_entry > > TEntryList
std::list< CRef< objects::CSeqdesc > > TSeqdescList
static void cleanup(void)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static TDSRET convert(TDSSOCKET *tds, TDSICONV *conv, TDS_ICONV_DIRECTION direction, const char *from, size_t from_len, char *dest, size_t *dest_len)
unsigned int TSeqPos
Type for sequence locations and lengths.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
CBeginInfo Begin(C &obj)
Get starting point of object hierarchy.
void AddProteinFeature(const CBioseq &seq, const string &protein_name, const CSeq_feat &cds, CScope &scope)
AddProteinFeature A function to create a protein feature with the specified protein name.
bool IsPseudo(const CSeq_feat &feat, CScope &scope)
Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CScope & GetScope(void) const
Get scope this handle belongs to.
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
const TName & GetName(void) const
Get the Name member data.
bool IsSetName(void) const
protein name Check if a value has been assigned to Name data member.
TName & SetName(void)
Assign a value to Name 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.
void SetLocation(TLocation &value)
Assign a value to Location data member.
const TQual & GetQual(void) const
Get the Qual member data.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
TQual & SetQual(void)
Assign a value to Qual data member.
void ResetQual(void)
Reset Qual data member.
bool IsSetLocation(void) const
feature made from Check if a value has been assigned to Location data member.
void SetTo(TTo value)
Assign a value to To data member.
bool IsMix(void) const
Check if variant Mix is selected.
list< CRef< CSeq_interval > > Tdata
TPoint GetPoint(void) const
Get the Point member data.
TFrom GetFrom(void) const
Get the From member data.
list< CRef< CSeq_loc > > Tdata
E_Choice Which(void) const
Which variant is currently selected.
void SetFrom(TFrom value)
Assign a value to From data member.
const Tdata & Get(void) const
Get the member data.
void SetFuzz_to(TFuzz_to &value)
Assign a value to Fuzz_to data member.
void SetFuzz_from(TFuzz_from &value)
Assign a value to Fuzz_from data member.
bool IsPacked_int(void) const
Check if variant Packed_int is selected.
TTo GetTo(void) const
Get the To member data.
const TMix & GetMix(void) const
Get the variant data.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
const TDescr & GetDescr(void) const
Get the Descr member data.
TSet & SetSet(void)
Select the variant.
bool IsSeq(void) const
Check if variant Seq is selected.
bool IsSetDescr(void) const
Check if a value has been assigned to Descr data member.
void SetDescr(TDescr &value)
Assign a value to Descr data member.
bool IsSetCompleteness(void) const
Check if a value has been assigned to Completeness data member.
bool IsSetTechexp(void) const
explanation if tech not enough
bool IsSetBiomol(void) const
Check if a value has been assigned to Biomol data member.
const Tdata & Get(void) const
Get the member data.
list< CRef< CSeq_id > > TId
TBiomol GetBiomol(void) const
Get the Biomol member data.
bool IsSetTech(void) const
Check if a value has been assigned to Tech data member.
const TMolinfo & GetMolinfo(void) const
Get the variant data.
bool IsSetGbmoltype(void) const
identifies particular ncRNA Check if a value has been assigned to Gbmoltype data member.
constexpr auto sort(_Init &&init)
const CharType(& source)[N]
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