(
size_t i= 0;
i< msg_listener.
Count(); ++
i) {
64message += (
"Hyphens in the update sequence have been ignored.\n");
71message += (
"Invalid character was found (and ignored):");
86 boolinput_ok =
false;
127 unsigned intcount_bioseqs = updseq_in.
CountBioseqs();
128 if(count_bioseqs > 1) {
129 string msg(
"You selected update single sequence but the update file contains " 130+
NStr::UIntToString(count_bioseqs) +
" bioseqs. Do you want to continue and use the first record only?");
135 if(!warn_message.empty()) {
150 if(!input_ok)
return;
168 if(!input_ok)
return;
182 if(count_bioseqs > 1) {
183 string msg(
"You selected update single sequence but the update file contains " 184+
NStr::UIntToString(count_bioseqs) +
" bioseqs. Do you want to continue and use the first record only?");
189warn_message.clear();
193}
while(res ==
eNo);
195 if(!warn_message.empty()) {
212 string msg(
"You are about to update a delta sequence with a raw sequence, which\n will convert the delta sequence to raw. Do you want to continue?");
218 string msg(
"The update sequence is a delta sequence with far pointers. Do you want to continue?");
228 if(dlg.ShowModal() == wxID_OK) {
240 if(!citsub_msg.empty()) {
249report.append(
"\n");
253 if(!report.empty()) {
255reportdlg->SetTitle(
"Update Sequence Log");
257reportdlg->Show(
true);
275 boolinput_ok =
false;
315 intretcode = dlg.ShowModal();
316 if(retcode == wxOK || retcode == wxCLOSE) {
319cmdProcessor->
Execute(update_cmd);
322 if(!
msg.empty()) {
324report->SetTitle(
"Update Sequence Log");
326report->Show(
true);
343 stringinvalidRes_msg;
344 stringduplicateids_msg;
346 for(
size_t i= 0;
i< msg_listener.
Count(); ++
i) {
355 if(!hyphens_msg.empty()) {
356hyphens_msg +=
", ";
358hyphens_msg += line_err.
SeqId();
366 if(!invalidRes_msg.empty()) {
367invalidRes_msg +=
"\n";
369invalidRes_msg += line_err.
SeqId();
370invalidRes_msg +=
msg.substr(pos + 2,
NPOS);
375 if(
msg.find(
"Seq-id") !=
NPOS&&
msg.find(
"is a duplicate") !=
NPOS) {
376 if(duplicateids_msg.find(line_err.
SeqId()) ==
NPOS) {
377 if(!duplicateids_msg.empty()) {
378duplicateids_msg +=
"\n";
380duplicateids_msg += line_err.
SeqId();
387 if(!hyphens_msg.empty()) {
388message +=
"Hyphens have been ignored in the following update sequences:\n";
389message += hyphens_msg;
392 if(!invalidRes_msg.empty()) {
393 if(!message.empty()) {
396message +=
"Invalid residues were found and ignored in the following update sequences:\n";
397message += invalidRes_msg;
400 if(!message.empty()) {
404 if(!duplicateids_msg.empty()) {
405duplicateids_msg =
"Duplicate sequence ids were found in the update sequence file:\n"+ duplicateids_msg;
407reportdlg->SetTitle(
"Duplicate seq-ids");
409reportdlg->Show(
true);
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
void SetText(const wxString &text)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Sequence update exception class.
void UpdateSingleSequence_Ext(IWorkbench *workbench, const objects::CSeq_entry_Handle &tse, ICommandProccessor *cmdProcessor) const
void x_LaunchSingleUpdateSequence(CUpdateSeq_Input &updseq_in, SUpdateSeqParams ¶ms, const objects::CSeq_entry_Handle &tse, ICommandProccessor *cmdProcessor) const
void UpdateMultipleSequences(IWorkbench *workbench, const objects::CSeq_entry_Handle &tse, ICommandProccessor *cmdProcessor)
void UpdateSingleSequence(IWorkbench *workbench, const objects::CSeq_entry_Handle &tse, ICommandProccessor *cmdProcessor) const
void x_GetSeqsWithIgnoredResidues(objects::ILineErrorListener &msg_listener)
Class responsible for executing the sequence update for one old-update sequence pair.
string GetRevCompReport() const
const string & GetCitSubMessage() const
void GetNotImportedFeatsReport(CNcbiOstream &out) const
CRef< CCmdComposite > Update(bool create_general_only)
Main function responsible to update the old sequence with the update sequence.
const string & GetRevCompReport() const
bool ReadUpdSeqs_FromClipboard(objects::ILineErrorListener *msg_listener)
bool SetOldEntryAndScope(const objects::CSeq_entry_Handle &tse)
bool ReadUpdSeqs_FromFile(objects::ILineErrorListener *msg_listener)
void SetData(const SUpdateSeqParams ¶ms)
SUpdateSeqParams GetData() const
Sets up the old and the update sequences, and generates the alignment between them.
bool SetOldBioseqAndScope(IWorkbench *workbench, const objects::CSeq_entry_Handle &tse)
unsigned int CountBioseqs()
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.
static bool s_IsDeltaWithFarPointers(const objects::CBioseq &bseq)
const objects::CBioseq_Handle & GetUpdateBioseq(void) const
bool ReadUpdateSequenceFromClipboard(objects::ILineErrorListener *msg_listener)
Reads single update sequence from the clipboard. It supports FASTA and text ASN formats.
void ResetUpdateSequence()
const objects::CBioseq_Handle & GetOldBioseq(void) const
static bool s_IsDeltaWithNoGaps(const objects::CBioseq &bseq)
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
virtual size_t Count() const =0
virtual const ILineError & GetError(size_t) const =0
0-based error retrieval.
@ eProblem_InvalidResidue
@ eProblem_IgnoredResidue
@ eProblem_GeneralParsingError
virtual EProblem Problem(void) const =0
virtual const string & SeqId(void) const =0
virtual const string & ErrorMessage() const
virtual EDiagSev GetSeverity(void) const
IWorkbench is the central interface in the application framework.
Stores parameters regarding the type of sequence update, on how to handle existing features and on ho...
ESequenceUpdateType m_SeqUpdateOption
bool AreUpdateParamsValid(void)
@ eSeqUpdateReplace
do not change the old sequence
#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...
@ eDiag_Warning
Warning message.
void Error(CExceptionArgs_Base &args)
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
EDialogReturnValue NcbiInfoBox(const string &message, const string &title="Info")
specialized Message Box function for reporting general information messages
void NcbiWarningBox(const string &message, const string &title="Warning")
specialized Message Box function for reporting non-critical errors
EDialogReturnValue NcbiMessageBox(const string &message, TDialogType type=eDialog_Ok, EDialogIcon icon=eIcon_Exclamation, const string &title="Error", EDialogTextMode text_mode=eRaw)
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
bool IsSetInst_Repr(void) const
TInst_Repr GetInst_Repr(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
bool IsOssEmpty(CNcbiOstrstream &oss)
NCBI_NS_STD::string::size_type SIZE_TYPE
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 string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
@ eRepr_raw
continuous sequence
EDialogReturnValue
enumerated return values for dialog boxes, starting from 1 to undermine attempts to cast it "bool"
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static string s_WarnAboutIgnoredResidues(ILineErrorListener &msg_listener)
wxString ToWxString(const string &s)
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