66 "Combine alignments using many possible strategies",
67 "Create a pseudo-multiple alignment using many possible strategies",
68 "https://www.ncbi.nlm.nih.gov/tools/gbench/",
69 "Alignment Creation"),
77 return "merge_alignments_tool_manager";
83 return "Merge Alignments Tool";
123 string err =
"Please select at least one alignment!";
182 m_Descr =
"Merging alignments";
198 }
else if (scope != &*iter->scope) {
201 "All alignments must be within the same project");
216 int count_invalid = 0;
233 aln_container.
insert(*aln);
237 <<
"CMergeAlignmentsJob::x_CreateProjectItems(): "
238 <<
"failed to validate: " << e.
GetMsg());
248 msg +=
" alignments failed validation.";
249 if (count_invalid == count) {
262 size_t count_accepted = 0;
270 <<
"CMergeAlignmentsJob::x_CreateProjectItems(): "
271 <<
"failed to extract IDs: " << e.GetMsg());
275 if (count_accepted != aln_container.
size()) {
276 if (count_accepted == 0) {
278 "No valid alignments found");
283 << count_accepted <<
"/" << aln_container.
size()
284 <<
" alignments had no IDs to extract.");
333 BuildAln(anchored_aln_vec, out_anchored_aln, opts);
335 vector< CRef<CSeq_align> > ds_aligns;
340 typedef list< CRef<CSeq_align> > TAligns;
345 aligns_out.push_back(*it);
352 (*align_iter)->SetSegs().SetDenseg(*ds);
356 if (aligns_out.size() == 0)
359 string annot_base_name(
"Merged Alignment: ");
379 string name(
"Merged Alignment: ");
381 if ( !name.empty() ) {
382 annot->SetNameDesc(name);
383 annot->SetTitleDesc(name);
388 pitem->
SetItem().SetAnnot(*annot);
User-defined methods of the data storage class.
void BuildAln(TAnchoredAlnVec &in_alns, CAnchoredAln &out_aln, const CAlnUserOptions &options, TAlnSeqIdIRef pseudo_seqid=TAlnSeqIdIRef())
Build anchored alignment from a set of alignmnets.
void CreateAnchoredAlnVec(_TAlnStats &aln_stats, TAnchoredAlnVec &out_vec, const CAlnUserOptions &options)
Create anchored alignment from each seq-align in the stats.
void CreateSeqAlignFromEachPairwiseAln(const CAnchoredAln::TPairwiseAlnVector pairwises, CAnchoredAln::TDim anchor, vector< CRef< CSeq_align > > &out_seqaligns, CSeq_align::TSegs::E_Choice choice, CScope *scope=NULL)
Create seq-align from each of the pairwise alignments vs the selected anchor row.
void GroupByStrand(const TAlignList &aligns, TAnnotList &align_groups, const string &annot_base_name, objects::CScope &scope)
Group alignments into bins for each set of strands.
list< CRef< objects::CSeq_annot > > TAnnotList
const_iterator insert(const CSeq_align &seq_align)
Insert new CSeq_align into the list.
size_type size(void) const
Container mapping seq-aligns to vectors of participating seq-ids.
void push_back(const CSeq_align &aln)
Adding an alignment.
Helper class which collects seq-align statistics: seq-ids participating in alignments and rows,...
_TAlnIdVec::TIdVec TIdVec
Vector of ids used in all alignments.
const TIdVec & GetIdVec(void) const
Get vector of all ids from all alignments.
Options for different alignment manager operations.
@ eMergeAllSeqs
Merge all sequences (greedy algo).
@ eQuerySeqMergeOnly
Only put the query seq on same row (input order is not significant).
@ eBothDirections
No filtering: use both direct and reverse sequences.
@ eReverse
Use only sequences whose strand is opposite to that of the anchor.
void SetMergeFlags(TMergeFlags flags, bool set)
Set/clear merge flags.
Query-anchored alignment can be 2 or multi-dimentional.
const TPairwiseAlnVector & GetPairwiseAlns(void) const
The vector of pairwise alns.
TDim GetAnchorRow(void) const
Which is the anchor row?
CDataLoadingAppJob - a base class for Jobs loading data into projects.
void AddProjectItem(objects::CProjectItem &item)
CRef< CDense_seg > FillUnaligned() const
Create a new dense-seg with added all unaligned pieces (implicit inserts), if any,...
CMergeAlignmentsParamsPanel.
CProjectService - a service providing API for operations with Workspaces and Projects.
void Validate(bool full_test=false) const
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
iterator_bool insert(const value_type &val)
#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.
#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)
#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 Warning(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.
bool Create(wxWindow *parent, wxWindowID id=ID_CBLASTSEARCHOPTIONSPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
virtual CDataLoadingAppJob * x_CreateLoadingJob()
factory method for creating the job that executes the tool algorithm override in derived classes
virtual bool x_CreateParamsPanelIfNeeded()
returns / creates Parameters panel, override in derived classes see cpp file for example
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual void LoadSettings()
virtual void x_CreateProjectItems()
override this function in derived classes and populate m_Items.
virtual void x_InitProjectParams()
init m_ProjectParams, in particular can select target project based on the tool input
virtual void SetRegistryPath(const string &path)
CAlgoToolManagerParamsPanel.
void SetParams(SMergeAlignmentsParams *params, TConstScopedObjects *objects)
TConstScopedObjects m_Alignments
virtual void CleanUI()
override this function in a derived class and clean extra members
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
TConstScopedObjects m_Alignments
virtual IRegSettings * x_GetParamsAsRegSetting()
return a pointer to Parameters object as IRegSettings interface
CMergeAlignmentsJob(const SMergeAlignmentsParams ¶ms)
CMergeAlignmentsJob.
CMergeAlignmentsToolManager()
CMergeAlignmentsToolManager.
CMergeAlignmentsParamsPanel * m_ParamsPanel
virtual bool x_ValidateParams()
validates user input in Parameters panel, report errors if any
void x_SelectCompatibleInputObjects()
select only Seq-aligns
virtual CAlgoToolManagerParamsPanel * x_GetParamsPanel()
returns a pointer to the parameters panel, override in derived classes
virtual void InitUI()
override this function in a derived class and initialize extra members
SMergeAlignmentsParams m_Params
SMergeAlignmentsParams m_Params
static void GetLabel(const CObject &obj, string *label, ELabelType type=eDefault)
string m_Descr
mutex to sync our internals
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
virtual const string & GetLabel() const
vector< SConstScopedObject > TConstScopedObjects
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
@ eCurrent
Use current time. See also CCurrentTime.
void SetLabel(const TLabel &value)
Assign a value to Label data member.
void SetItem(TItem &value)
Assign a value to Item data member.
@ eType_partial
mapping pieces together
vector< CRef< CAnchoredAln > > TAnchoredAlnVec
Collection of anchored alignments.
void SelectProjectByObjects(TConstScopedObjects &objects, CProjectService *srv)
is all objects belong to the same project - selects the project