Ejemplo n.º 1
0
void kjm::appBar::setPos(int uEdge, SIZE size) {
	m_abd.uEdge = uEdge;
	m_abd.rc = queryPos(uEdge, size);

	SHAppBarMessage(ABM_SETPOS, &m_abd);

	MoveWindow(m_abd.hWnd, m_abd.rc.left, m_abd.rc.top, m_abd.rc.right - m_abd.rc.left, m_abd.rc.bottom - m_abd.rc.top, TRUE);
}
void MappingMergeScheme::generateMerge(size_t queryContig, size_t queryBase, 
    size_t referenceContig, size_t referenceBase, bool orientation) const {
	
    // Right now credit merging schemes are attempting to merge off-contig
    // positions but are otherwise behaving as expected. Throw warning and
    // don't merge rather than runtime error until this is worked out.
    
    /*if(referenceBase > index.getContigLength(referenceContig) || 
        referenceBase == 0) {
        
        // Complain that we're trying to talk about an off-the-contig position.
        throw std::runtime_error("Reference base " + 
            std::to_string(referenceBase) + 
            " on contig " + std::to_string(referenceContig) + 
            " is beyond 1-based bounds of length " + 
            std::to_string(index.getContigLength(referenceContig)));
    }
    
    if(queryBase > index.getContigLength(queryContig) || 
        queryBase == 0) {
        
        // Complain that we're trying to talk about an off-the-contig position.
        throw std::runtime_error("Query base " + std::to_string(queryBase) + 
            " on contig " + std::to_string(queryContig) + 
            " is beyond 1-based bounds of length " + 
            std::to_string(index.getContigLength(queryContig)));
    }*/
    
    // Where in the query do we want to come from? Always on the forward strand.
    // Correct offset to 0-based.
    TextPosition queryPos(queryContig * 2, queryBase - 1);
    
    // Where in the reference do we want to go to? May b e on the forward or
    // reverse strand. Correct text and offset for orientation, and correct
    // offset to 0-based (at the same time).
    TextPosition referencePos(referenceContig * 2 + orientation, 
        orientation ? (index.getContigLength(referenceContig) - referenceBase) :
        (referenceBase - 1));
    
    // Make a Merge between these positions.
    
    // Right now credit merging schemes are attempting to merge off-contig
    // positions but are otherwise behaving as expected. Throw warning and
    // don't merge rather than runtime error until this is worked out.

    
    if(queryBase > index.getContigLength(queryContig) || queryBase == 0 ||
	referenceBase > index.getContigLength(referenceContig) || referenceBase == 0) {
	
	Log::info() << "****WARNING: tried to merge (to) an off-contig position!****" << std::endl;
    
    } else {
    
    Merge merge(queryPos, referencePos);
        
    // Send that merge to the queue.
    // Lock the queue.
    auto lock = queue->lock();
    // Spend our lock to add something to it.
    queue->enqueue(merge, lock);
    
    }
    
}