(!cd->AlignAnnotsValid()) {
96list< CRef< CCdd_descr > >& cdDescrList = cd->
SetDescription().Set();
97list< CRef< CCdd_descr > >::iterator lit = cdDescrList.begin();
98 while(lit != cdDescrList.end())
100 if((*lit)->IsRepeats())
101lit = cdDescrList.erase(lit);
111 if(!pCD->
IsSeqAligns() || positions.size() == 0)
115list< CRef< CSeq_align > >& alignments = pCD->
GetSeqAligns();
116 if(alignments.size() != positions.size())
119vector<CRef< CSeq_align > > temp(alignments.size());
120list<CRef< CSeq_align > >::iterator lit = alignments.begin();
123 for(;lit != alignments.end(); lit++)
126 if(positions[
row] >= (
int) temp.size())
128temp[positions[
row]] = *lit;
138 for(
unsigned int i= 0;
i< temp.size();
i++)
140alignments.push_back(temp[
i]);
152TStructureAlignments::iterator saListIt, saListEnd;
156TSAMap::iterator saMapIt, saMapEnd;
162 if(
nRows-1 != positions.size())
169TStructureAlignments& saList = pCD->
SetFeatures().SetFeatures().front()->SetFeatures();
170saListIt = saList.begin();
171saListEnd = saList.end();
178 for(
i= 0;
i< (
nRows- 1) && saListIt != saListEnd; ++
i) {
190 if(nPDBs == n3DAlign) {
192saMapIt = saMapTmp.begin();
193saMapEnd = saMapTmp.end();
194 for(; saMapIt != saMapEnd; ++saMapIt) {
195saList.push_back(saMapIt->second);
208list< CRef< CCdd_descr > > & descList = cd->
SetDescription().Set();
209list< CRef< CCdd_descr > >::iterator it = descList.begin();
210 for(; it != descList.end(); it++)
212 if((*it)->IsCreate_date())
222dateDesc->SetCreate_date(*curDate);
223descList.push_back(dateDesc);
235list< CRef< CCdd_descr > > & descList = cd->
SetDescription().Set();
236list< CRef< CCdd_descr > >::iterator it = descList.begin();
237 for(; it != descList.end(); it++)
239 if((*it)->IsUpdate_date())
249dateDesc->SetUpdate_date(*curDate);
250descList.push_back(dateDesc);
300 intLower, Upper, Lower2, Upper2;
320 for(
intj=0; j<NumMatches; j++) {
324 if(((Lower2 >= Lower) && (Lower2 <= Upper)) ||
325((Upper2 >= Lower) && (Upper2 <= Upper)) ||
326((Lower2 <= Lower) && (Upper2 >= Upper)) ||
327((Lower2 >= Lower) && (Upper2 <= Upper))) {
328rows2.push_back(matches[j]);
330}
else if(cd1AsChild) {
331 if((Lower2 >= Lower) && (Upper2 <= Upper)) {
332rows2.push_back(matches[j]);
335 if((Lower2 <= Lower) && (Upper2 >= Upper)) {
336rows2.push_back(matches[j]);
360 boolsameCD = (cd1 == cd2 || !cd2) ?
true:
false;
365 if(cd1 ==
NULL&& cd2 ==
NULL)
return0;
366 if(sameCD && !cd2) {
371 for(RowIndex1=0; RowIndex1<NumRows; RowIndex1++) {
373NumMatches =
GetMappedRowIds(cd1, RowIndex1, cd2, matches,
true,
true);
376 if(sameCD && NumMatches == 1) {
381 for(
intj=0; j<NumMatches; j++) {
383 if(sameCD && matches[j] == RowIndex1) {
387rowsOfCD1.push_back(RowIndex1);
388rowsOfCD2.push_back(matches[j]);
392 returnrowsOfCD1.size();
401vector<int> rows1, rows2;
407 if(!cd || (convertedSequences.size() > 0 && !forceRecompute)) {
413convertedSequences.clear();
414 for(
int i= 0;
i< numSeq; ++
i) {
432 if(ppAlignedResidues ==
NULL) {
433ppAlignedResidues =
new char*[numRows];
434 for(
int i=0;
i<numRows;
i++) {
435ppAlignedResidues[
i] =
new char[numAligned]{ 0 };
440}
else if(!forceRecompute) {
444 for(
int i= 0;
i< numRows;
i++) {
448isMaster = (
i== 0);
457 boolisOK =
true, useRefRow =
true;
459 unsigned int i, col,
row, pos, mapIndex,
nRows, nCols, nBlocks;
460 char** alignedResidues =
NULL;
461 stringrowString, colString;
465vector<int> starts, lengths;
477 ERR_POST(
"Creation of MultipleAlignment object failed for CD "<< cd->
GetAccession() <<
".");
481 ERR_POST(
"CD "<< cd->
GetAccession() <<
" must have a consistent block structure for column extraction.");
495 if(referenceRow >=
nRows) {
507nBlocks = starts.size();
508 if(nBlocks == lengths.size()) {
509 for(
i= 0, col = 0;
i< nBlocks; ++
i) {
510pos = (useRefRow) ? starts[
i] : col;
511 for(j = 0; j < lengths[
i]; ++j, ++col, ++pos) {
527 if(isOK && alignedResidues) {
528 for(col = 0; col < nCols; ++col) {
531colString += alignedResidues[
row][col];
533mapIndex = colToPos[col];
534 columns[mapIndex] = colString;
539 if(alignedResidues) {
541 delete[] alignedResidues[
row];
543 delete[] alignedResidues;
561masterBioseq->
Assign(*bioseq);
563list< CRef< CSeq_id > >& idList = masterBioseq->
SetId();
565idList.push_back(seqIdRef);
567list< CRef< CSeq_annot > >& seqAnnots = masterBioseq->
SetAnnot();
569list< CRef< CSeq_loc > >& seqlocs = seqAnnot->
SetData().SetLocs();
571seqlocs.push_back(seqLoc);
572seqAnnots.push_back(seqAnnot);
598+
"th row, because CD has only " 600BioseqForNthRow->
Assign(*bioseq);
601 return(BioseqForNthRow);
605BioseqForNthRow->
Assign(*bioseq);
607list< CRef< CSeq_id > >& idList = BioseqForNthRow->
SetId();
609idList.push_back(seqIdRef);
611list< CRef< CSeq_annot > >& seqAnnots = BioseqForNthRow->
SetAnnot();
613list< CRef< CSeq_loc > >& seqlocs = seqAnnot->
SetData().SetLocs();
615seqlocs.push_back(seqLoc);
616seqAnnots.push_back(seqAnnot);
617 returnBioseqForNthRow;
628 for(
int i=0;
i<
N;
i++) {
630 if(!errstr.empty())
return(
false);
641 if(!taxServer.
Init())
649 for(
int i= 0;
i< num;
i++)
652cd->
GetGI(
i,gi,
false);
671 TTaxIdjoined = taxServer.
Join(comTax, taxid);
674 LOG_POST(
"Failed to join two taxids:"<<comTax<<
" and "<<taxid<<
". The latter one is ignored.");
691orgRef->
Assign(*taxServer.
GetOrgRef(comTax, is_species, is_uncultured, blast_name));
701 intnAncestors, nClassical = 0;
708 if(
result&& isAncestors) {
709list< CRef< CDomain_parent > >::const_iterator pit = pCD->
GetAncestors().begin(), pit_end = pCD->
GetAncestors().end();
710 while(pit != pit_end) {
717 result= ((nClassical == 1 && nAncestors == 1) ||
718(nClassical == 0 && nAncestors > 0));
727 static const char* msgHeader =
"Remastering CD to ";
731 if(seqId->
IsPdb())
736 for(;
i< nrows;
i++)
739 if(seqId->
IsPdb())
758list<CRef< CSeq_align > >& seqAlignList = cd->
GetSeqAligns();
762list<CRef< CSeq_align > >::iterator lit = seqAlignList.begin();
763list<CRef< CSeq_align > >::iterator guideIt;
764 for(; lit != seqAlignList.end(); lit++)
769 bmp.remaster(guideBmp);
770*lit =
bmp.toSeqAlign();
786 if(SeqID->
IsPdb()) {
803 if((
int)oldMasterRow >= cd.
GetNumRows() || oldMasterRow == 0)
return false;
806 intFrom, To, NewFrom, NewTo;
807CAlign_annot_set::Tdata::iterator alignAnnotIt, alignAnnotEnd;
808CPacked_seqint::Tdata::iterator intervalIt, intervalEnd;
817 for(alignAnnotIt = cd.
SetAlignannot().Set().begin(); alignAnnotIt != alignAnnotEnd; alignAnnotIt++) {
819 if((*alignAnnotIt)->SetLocation().IsInt()) {
821From = (
int) (*alignAnnotIt)->SetLocation().GetInt().GetFrom();
822To = (
int) (*alignAnnotIt)->SetLocation().GetInt().GetTo();
826 if(!seqIdOldMaster->
Match((*alignAnnotIt)->SetLocation().SetInt().GetId()) || NewFrom < 0 || NewTo < 0)
832 if(seqIdMaster->
Match((*alignAnnotIt)->SetLocation().SetInt().GetId()) && !seqIdMaster->
Match(*seqIdOldMaster)) {
838(*alignAnnotIt)->SetLocation().SetInt().SetFrom(NewFrom);
839(*alignAnnotIt)->SetLocation().SetInt().SetTo(NewTo);
840(*alignAnnotIt)->SetLocation().SetInt().SetId(*seqIdMaster);
843 else if((*alignAnnotIt)->SetLocation().IsPacked_int()) {
845intervalIt = (*alignAnnotIt)->SetLocation().SetPacked_int().Set().begin();
846intervalEnd = (*alignAnnotIt)->SetLocation().SetPacked_int().Set().end();
847 for(; intervalIt != intervalEnd; ++intervalIt) {
849From = (
int) (*intervalIt)->GetFrom();
850To = (
int) (*intervalIt)->GetTo();
853 if(!seqIdOldMaster->
Match((*intervalIt)->GetId()) || NewFrom < 0 || NewTo < 0)
859 if(seqIdMaster->
Match((*intervalIt)->GetId()) && !seqIdMaster->
Match(*seqIdOldMaster)) {
865(*intervalIt)->SetFrom(NewFrom);
866(*intervalIt)->SetTo(NewTo);
867(*intervalIt)->SetId(*seqIdMaster);
878vector<int> consensusRows, consensusSeqListIds;
892 for(
int i= consensusSeqListIds.size() - 1;
i>= 0 ; --
i) {
907 if(masterLen == 0)
return result;
911 unsigned int i, j, nBlocks;
927vector<BlockModelPair*> blockModelPairs;
928 set<int>forcedCTerminiInIntersection;
930list< CRef< CSeq_align > >& cdSeqAligns = ccd->
GetSeqAligns();
931list< CRef< CSeq_align > >::iterator cdSeqAlignIt = cdSeqAligns.begin(), cdSeqAlignEnd = cdSeqAligns.end();
933 for(
i= 0; cdSeqAlignIt != cdSeqAlignEnd; ++cdSeqAlignIt, ++
i) {
937 if(
bmp&&
bmp->isValid()) {
939blockModelPairs.push_back(
bmp);
946 for(j = 0; j < nBlocks - 1; ++j) {
948forcedCTerminiInIntersection.
insert(
bmp->getMaster().getBlock(j).getEnd());
956 if(blockModelPairs.size() != cdSeqAligns.size()) {
962nAlignedIBM = (intersectedBlockModel) ? intersectedBlockModel->
getTotalBlockLength() : 0;
963 if(nAlignedIBM == 0) {
978nBlocks = intersectedBlockModel->
getBlocks().size();
979 for(
i= 0, cdSeqAlignIt = cdSeqAligns.begin();
i<
nRows- 1 ; ++
i, ++cdSeqAlignIt) {
981 bmp= blockModelPairs[
i];
985 for(j = 0; j < nBlocks; ++j) {
986 const Block& jthMasterBlock = intersectedBlockModel->
getBlock(j);
987slaveStart =
bmp->mapToMaster(jthMasterBlock.
getStart());
990 assert(slaveStart != -1);
993intersectedSeqAlignSlave->
addBlock(
b);
995*cdSeqAlignIt = intersectedSeqAlignSlave->
toSeqAlign(*intersectedBlockModel);
1001blockModelPairs.clear();
1004 deleteintersectedBlockModel;
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
bool GetSeqIDForRow(int row, CRef< CSeq_id > &SeqID) const
void addOneAlignment(const BlockModel &bm)
BlockModel * getIntersectedAlignment(double rowFraction=1.0)
CRef< CSeq_align > toSeqAlign() const
int mapToMaster(int slavePos) const
int getTotalBlockLength() const
CRef< CSeq_id > getSeqId() const
CRef< CSeq_align > toSeqAlign(const BlockModel &master) const
void addBlock(Block &block)
int getGapToCTerminal(int bn, int len=-1) const
vector< Block > & getBlocks()
bool EraseTheseRows(const std::vector< int > &TossRows)
void EraseSequence(int SeqIndex)
int GetUpperBound(int Row) const
string GetSequenceStringByRow(int rowId)
bool GetSeqAlign(int Row, CRef< CSeq_align > &seqAlign)
int GetRowsWithConsensus(vector< int > &consensusRows) const
bool GetSeqIDFromAlignment(int RowIndex, CRef< CSeq_id > &SeqID) const
bool FindConsensusInSequenceList(vector< int > *indices=NULL) const
int Num3DAlignments() const
string GetSequenceStringByIndex(int SeqIndex)
int GetAllRowIndicesForSeqId(const CRef< CSeq_id > &SeqID, list< int > &rows) const
int GetAlignmentLength() const
int GetLowerBound(int Row) const
const list< CRef< CSeq_align > > & GetSeqAligns() const
bool UsesConsensusSequenceAsMaster() const
bool GetGI(int Row, TGi &GI, bool ignorePDBs=true)
bool GetBioseqForRow(int rowId, CRef< CBioseq > &bioseq)
string GetAccession(int &Version) const
int GetNumSequences() const
bool GetSeqIDForRow(int Pair, int DenDiagRow, CRef< CSeq_id > &SeqID) const
bool GetPDB(int Row, const CPDB_seq_id *&pPDB)
bool GetTaxId4GI(TGi gi, TTaxId &tax_id_out)
CConstRef< COrg_ref > GetOrgRef(TTaxId tax_id, bool &is_species, bool &is_uncultured, string &blast_name, bool *is_specified=NULL)
TTaxId Join(TTaxId taxid1, TTaxId taxid2)
bool isBlockAligned() const
iterator_bool insert(const value_type &val)
void SetAlignedResiduesOnSequence(const CRef< CSeq_align > &align, const string &sequenceString, char *&pAlignedRes, bool isMaster=false)
int GetBlockLengths(const CRef< CSeq_align > &seqAlign, vector< int > &lengths)
int GetBlockStarts(const CRef< CSeq_align > &seqAlign, vector< int > &starts, bool onMaster)
bool SetCreationDate(CCdCore *cd)
bool ReMasterCdWithoutUnifiedBlocks(CCdCore *cd, int Row, bool resetFields)
int NumberOfOverlappedRows(CCdCore *cd1, CCdCore *cd2)
bool RemasterWithStructure(CCdCore *cd, string *msg)
void ResetFields(CCdCore *cd)
CCdCore * CopyCD(const CCdCore *cd)
bool obeysParentTypeConstraints(const CCdCore *pCD)
int GetOverlappedRows(CCdCore *cd1, CCdCore *cd2, vector< int > &rowsOfCD1, vector< int > &rowsOfCD2)
int PurgeConsensusSequences(CCdCore *pCD, bool resetFields)
string GetVerboseNameStr(const CCdCore *cd)
void SetAlignedResiduesForCD(CCdCore *cd, char **&ppAlignedResidues, bool forceRecompute)
bool Reorder(CCdCore *pCD, const vector< int > positions)
CRef< COrg_ref > GetCommonTax(CCdCore *cd, bool useRootWhenNoTaxInfo)
CCdCore * ExtractCDFromMime(CNcbi_mime_asn1 *ncbiMime)
bool remasterAlignannot(CCdCore &cd, unsigned int oldMasterRow)
void GetAlignmentColumnsForCD(CCdCore *cd, map< unsigned int, string > &columns, unsigned int referenceRow)
CRef< CBioseq > GetMasterBioseqWithFootprintOld(CCdCore *cd)
bool ReorderStructureAlignments(CCdCore *pCD, const vector< int > &positions)
bool SetUpdateDate(CCdCore *cd)
bool GetBioseqWithFootprintForNRows(CCdCore *cd, int N, vector< CRef< CBioseq > > &bioseqs, string &errstr)
int GetMappedRowIds(CCdCore *cd1, int row1, CCdCore *cd2, vector< int > &rows2, bool cd1AsChild, bool overlapMode)
void SetConvertedSequencesForCD(CCdCore *cd, vector< string > &convertedSequences, bool forceRecompute)
int IntersectByMaster(CCdCore *ccd, double rowFraction)
CRef< CBioseq > GetBioseqWithFootprintForNthRow(CCdCore *cd, int N, string &errstr)
CRef< CBioseq > GetMasterBioseqWithFootprint(CCdCore *cd)
int GetReMasterFailureCode(const CCdCore *cd)
const int ALIGN_ANNOTS_VALID_FAILURE
static ASNClass * CopyASNObject(const ASNClass &originalObject, std::string *err)
TTaxId GetTaxIdInBioseq(const CBioseq &bioseq)
static const char si[8][64]
thread_local unique_ptr< FtaMsgPost > bmp
static const column_t columns[]
SStrictId_Tax::TId TTaxId
Taxon id type.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
const string AsFastaString(void) const
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#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 string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
@ eCurrent
Use current time. See also CCurrentTime.
list< CRef< CBiostruc_feature > > TFeatures
const TFeatures & GetFeatures(void) const
Get the Features member data.
void ResetTrunc_master(void)
Reset Trunc_master data member.
void ResetFeatures(void)
Reset Features data member.
TMaster3d & SetMaster3d(void)
Assign a value to Master3d data member.
void ResetScoremat(void)
Reset Scoremat data member.
bool IsSetAlignannot(void) const
alignment annotation Check if a value has been assigned to Alignannot data member.
void ResetProfile_range(void)
Reset Profile_range data member.
void SetFeatures(TFeatures &value)
Assign a value to Features data member.
void SetDescription(TDescription &value)
Assign a value to Description data member.
const TAncestors & GetAncestors(void) const
Get the Ancestors member data.
void ResetDistance(void)
Reset Distance data member.
bool IsSetMaster3d(void) const
record if CD has a 3D representative Check if a value has been assigned to Master3d data member.
bool IsSetAncestors(void) const
list of parents Check if a value has been assigned to Ancestors data member.
void SetAlignannot(TAlignannot &value)
Assign a value to Alignannot data member.
void ResetPosfreq(void)
Reset Posfreq data member.
const TName & GetName(void) const
Get the Name member data.
bool IsSetParent(void) const
this CD is the result of a split Check if a value has been assigned to Parent data member.
bool IsSetFeatures(void) const
contains structure alignment data or "core" definitions Check if a value has been assigned to Feature...
const TFeatures & GetFeatures(void) const
Get the Features member data.
@ eParent_type_classical
the classification of parent child relations
bool IsGeneral(void) const
Check if variant General is selected.
const TCdd & GetCdd(void) const
Get the variant data.
const TGeneral & GetGeneral(void) const
Get the variant data.
bool IsCdd(void) const
Check if variant Cdd is selected.
const TSeq_align_data & GetSeq_align_data(void) const
Get the Seq_align_data member data.
bool IsPdb(void) const
Check if variant Pdb is selected.
void SetData(TData &value)
Assign a value to Data data member.
TId & SetId(void)
Assign a value to Id data member.
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
unsigned int
A callback function used to compare two keys in a database.
double value_type
The numeric datatype used by the parser.
Defines: CTimeFormat - storage class for time format.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
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