: m_OldSeq(old_bsh), m_UpdSeq(upd_bsh), m_Align(0)
83 m_UpdSeq.GetTopLevelEntry().GetEditHandle().Remove();
106dense_seg->
SetIds().push_back(query_id);
107dense_seg->
SetIds().push_back(subject_id);
111dense_seg->
SetLens().push_back(
subject.GetBioseqLength() - 1);
116align->
SetSegs().SetDenseg(*dense_seg);
119annot->
SetData().SetAlign().push_back(align);
121desc->
SetName(
"Alignment generated between two identical sequences");
122annot->
SetDesc().Set().push_back(desc);
136sel_srv->GetActiveObjects(
objects);
192 boolaccept_atleast_one =
false;
194accept_atleast_one =
true;
197 if(align_vector.size() > 1) {
198 LOG_POST(
Info<<
"More than one alignment was found");
201 if(align_vector.empty()) {
202 LOG_POST(
Info<<
"Could not form alignment between old and update sequence");
208 size_tbest_align = 0;
209 for(
size_t i= 0;
i< align_vector.size(); ++
i) {
210 for(
size_tj =
i+ 1; j < align_vector.size(); ++j) {
214 _ASSERT(best_align < align_vector.size());
223 return(set_seqs && no_mismatch);
251 boolhas_feat =
false;
253 for(
CFeat_CIfeat_it(*bseq_it); feat_it && !has_feat; ++feat_it) {
254 autofeat = feat_it->GetOriginalSeq_feat();
255 if(feat->IsSetData() && feat->GetData().IsProt() && !feat->GetData().GetProt().IsSetProcessed())
276wxFileDialog openDlg(
NULL,
wxT(
"Open a file"), wxEmptyString, wxEmptyString, ext, wxFD_OPEN | wxFD_FILE_MUST_EXIST);
277 if(openDlg.ShowModal() != wxID_OK)
280wxString path = openDlg.GetPath();
306 "Failed to recognize the format of update sequence. Please try ASN.1 or Fasta.\n"+ e.
GetMsg());
333oi = objIstrm->ReadObject();
340 if(oi.
GetName() ==
"Bioseq") {
350 if(oi.
GetName() ==
"Seq-entry") {
352seq_entry =
Ref(entry);
354 else if(oi.
GetName() ==
"Seq-submit") {
395 if(msg_listener && msg_listener->
Count() > 0) {
425 unsigned int count= 0;
440 if(!
data.IsGap()){
466 if(!it->IsLiteral()) {
471 if(!
ok)
return false;
524bseq.
SetInst().SetRepr(objects::CSeq_inst::eRepr_raw);
525bseq.
SetInst().SetSeq_data().SetIupacna().Set(seqdata);
557seq_ids.push_back(*upd_id);
578old_ids.push_back(*upd_id);
591 if(seq_dlg.ShowModal() == wxID_OK) {
592 stringacc_id = seq_dlg.
GetData();
608 string msg=
"'"+ acc_id +
"' is not a valid accession";
616 string msg=
"Failed to load sequence for accession '"+ acc_id +
"'";
631 if((*id_iter)->Which() == feat_id_type){
644new_inst->
SetRepr(objects::CSeq_inst::eRepr_raw);
645new_inst->
SetSeq_data().SetIupacna().Set(seqdata);
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
TSeqPos GetLength(void) const
Base class for reading FASTA sequences.
static wxString GetDialogFilter(EFileType fileType)
CFormatHints & AddPreferredFormat(TFormat fmt)
Mark the format as preferred.
CFormatHints & DisableAllNonpreferred(void)
Disable all formats not marked as preferred.
Class implements different ad-hoc unreliable file format identifications.
CFormatHints & GetFormatHints(void)
Get format hints.
EFormat
The formats are checked in the same order as declared here.
@ eFasta
FASTA format sequence record, CFastaReader.
@ eUnknown
unknown format
EFormat GuessFormat(EMode)
Sequence update exception class.
void ReassignConflictingIds(void)
static TSeqPos Pack(CSeq_data *in_seq, TSeqPos uLength=ncbi::numeric_limits< TSeqPos >::max())
static CSimpleClipboard & Instance()
bool IsReadyForUpdate(void) const
bool x_ReadUpdateSeq_ASN(CNcbiIstream &istr)
bool SetOldBioseqAndScope(IWorkbench *workbench, const objects::CSeq_entry_Handle &tse)
bool SetUpdateBioseq(const objects::CBioseq_Handle &bsh)
unsigned int CountBioseqs()
void CalculateAlignmentForUnitTest(void)
Calculates the alignment between the old and the update sequence, sets m_Align member.
objects::CBioseq_Handle m_UpdSeq
bool OldSeqHasProteinFeats() const
static void s_FixCollidingIDs_Entry(objects::CSeq_entry &entry, const objects::CBioseq::TId &seq_ids)
When the old and the update sequences have the same ID, the ID of the update sequence is modified.
static void s_ConvertDeltaToRawEntry(objects::CSeq_entry &entry)
Converts delta literals to raw sequence, applies only to NA sequences.
bool x_ReadAccession(const string &acc_id)
bool ReadSingleAccession(void)
Reads single update sequence identified by an accession.
bool ReadSingleUpdateSequence(objects::ILineErrorListener *msg_listener)
Reads (ASN.1 or FASTA) single update sequence from a file.
bool x_ReadUpdateSeq_Fasta(CNcbiIstream &istr, objects::ILineErrorListener *msg_listener)
bool UpdateSeqHasFeatures(void) const
static bool s_IsDeltaWithFarPointers(const objects::CBioseq &bseq)
void x_FixCollidingIDs_Entry(objects::CSeq_entry &entry)
CRef< objects::CScope > m_Scope
objects::CBioseq_Handle m_OldSeq
void x_AddNewEntryToScope(CRef< objects::CSeq_entry > entry)
Function fixes colliding IDs, add the update entry to the scope and sets m_UpdSeq member.
bool HaveIdenticalResidues(void) const
static CRef< objects::CSeq_annot > s_Align2IdenticalSeq(const objects::CBioseq_Handle &subject, const objects::CBioseq_Handle &query)
static void s_ConvertDeltaToRawBioseq(objects::CBioseq &bseq)
void x_FixCollidingIDs_Bioseq(objects::CBioseq &bioseq)
bool ReadUpdateSequenceFromClipboard(objects::ILineErrorListener *msg_listener)
Reads single update sequence from the clipboard. It supports FASTA and text ASN formats.
CConstRef< objects::CSeq_align > m_Align
void ResetUpdateSequence()
bool OldSeqHasFeatures(void) const
static bool s_IsGoodLiteral(const objects::CSeq_literal &lit)
static bool s_IsDeltaWithNoGaps(const objects::CBioseq &bseq)
bool x_ReadFromStream(CNcbiIstream &istr, objects::ILineErrorListener *msg_listener)
virtual size_t Count() const =0
virtual const ILineError & GetError(size_t) const =0
0-based error retrieval.
virtual const string & ErrorMessage() const
IWorkbench is the central interface in the application framework.
static bool CompareAlignments(const objects::CSeq_align &align_first, const objects::CSeq_align &align_sec)
Returns true if the first alignment is 'better' than the second one Compares the Blast scores and in ...
static vector< CConstRef< objects::CSeq_align > > RunBlast2Seq(const objects::CBioseq_Handle &subject, const objects::CBioseq_Handle &query, bool accept_atleast_one, ICanceled *canceled=nullptr)
static bool HaveIdenticalResidues(const objects::CBioseq_Handle &bsh1, const objects::CBioseq_Handle &bsh2)
static void FixCollidingIDs_Bioseq(objects::CBioseq &bseq, const objects::CBioseq::TId &seq_ids)
Operators to edit gaps in sequences.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
@ eNoOwnership
No ownership is assumed.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
TErrCode GetErrCode(void) const
Get error code.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
void Info(CExceptionArgs_Base &args)
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
EDialogReturnValue NcbiMessageBox(const string &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const string &title="Error", EDialogTextMode text_mode=eRaw)
vector< SConstScopedObject > TConstScopedObjects
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
static const TObjectType * SafeCast(TTypeInfo type)
@ eSerial_AsnText
ASN.1 text.
CRef< CSeq_entry > ReadSet(int max_seqs=kMax_Int, ILineErrorListener *pMessageListener=nullptr)
Read multiple sequences (by default, as many as are available.)
long TFlags
binary OR of EFlags
@ fDLOptional
Don't require a leading defline.
@ fHyphensIgnoreAndWarn
When a hyphen is encountered in seq data, ignore it but warn.
@ fNoSplit
Don't split out ambiguous sequence regions.
@ fAssumeNuc
Assume nucs unless accns indicate otherwise.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CSeq_id & Set(const CTempString &the_id, TParseFlags flags=fParse_AnyRaw)
Reassign based on flat specifications; arguments interpreted as with constructors.
CSeq_id::E_Choice Which(void) const
TObjectPtr GetObjectPtr(void) const
Get pointer to object.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
const string & GetName(void) const
Get type name.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void SetInst(TInst &v) const
CScope & GetScope(void) const
Get scope this handle belongs to.
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
CSeq_id_Handle GetLocationId(void) const
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
void SetCoding(TCoding coding)
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
TObjectType * GetNCPointer(void) const THROWS_NONE
Get pointer,.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
TLens & SetLens(void)
Assign a value to Lens data member.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
void SetDim(TDim value)
Assign a value to Dim data member.
void SetDim(TDim value)
Assign a value to Dim data member.
void SetType(TType value)
Assign a value to Type data member.
TStarts & SetStarts(void)
Assign a value to Starts data member.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
TIds & SetIds(void)
Assign a value to Ids data member.
@ eType_partial
mapping pieces together
E_Choice
Choice variants.
@ e_not_set
No variant selected.
const TSeq & GetSeq(void) const
Get the variant data.
TSet & SetSet(void)
Select the variant.
const TSet & GetSet(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
bool IsSetSeq_set(void) const
Check if a value has been assigned to Seq_set data member.
bool IsSet(void) const
Check if variant Set is selected.
list< CRef< CSeq_entry > > TSeq_set
TSeq & SetSeq(void)
Select the variant.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
bool IsSetLinkage(void) const
Check if a value has been assigned to Linkage data member.
TRepr GetRepr(void) const
Get the Repr member data.
void SetData(TData &value)
Assign a value to Data data member.
const TInst & GetInst(void) const
Get the Inst member data.
void SetDesc(TDesc &value)
Assign a value to Desc data member.
bool IsSetRepr(void) const
Check if a value has been assigned to Repr data member.
TType GetType(void) const
Get the Type member data.
const TId & GetId(void) const
Get the Id member data.
TName & SetName(void)
Select the variant.
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
TLength GetLength(void) const
Get the Length member data.
list< CRef< CSeq_id > > TId
bool IsDelta(void) const
Check if variant Delta is selected.
void SetInst(TInst &value)
Assign a value to Inst data member.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
const TExt & GetExt(void) const
Get the Ext member data.
const TDelta & GetDelta(void) const
Get the variant data.
void SetRepr(TRepr value)
Assign a value to Repr data member.
const Tdata & Get(void) const
Get the member data.
bool IsSetSeq_data(void) const
may have the data Check if a value has been assigned to Seq_data data member.
void SetLength(TLength value)
Assign a value to Length data member.
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
void ResetExt(void)
Reset Ext data member.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
@ eRepr_delta
sequence made by changes (delta) to others
@ e_Iupacna
IUPAC 1 letter nuc acid code.
@ eMol_na
just a nucleic acid
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
void GetViewObjects(IWorkbench *workbench, TConstScopedObjects &objects)
bool FocusedOnAll(TConstScopedObjects &objects, const objects::CSeq_entry_Handle &tse)
CRef< CSeq_entry > SeqEntryFromSeqSubmit(const CSeq_submit &submit)
Create a Seq-entry from a Seq-submit.
Utility macros and typedefs for exploring NCBI objects from seq.asn.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static const char * kNASeqCouldNotRead
static void s_CollectCollidingIDs_Entry(CSeq_entry &entry, CBioseq::TId &seq_ids, CScope &scope)
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