Exemple #1
0
void makePair(Alignment& a, Alignment& b, Alignment& x, Alignment& y)
{
    initMate(a, x);
    initMate(b, y);

    Feature spacer;
    getSpacer(a, b, spacer);
    int insert = a.Length + spacer.getLength() + b.Length;

    // Add in mate pair info
    x.MateRefID = b.RefID;
    x.matePosition(b.position());
    x.InsertSize = insert;

    y.MateRefID = a.RefID;
    y.matePosition(a.position());
    y.InsertSize = -1 * insert;

    // Update Mapping information appropriately
    x.SetIsReverseStrand(a.IsReverseStrand());
    x.SetIsMateReverseStrand(b.IsReverseStrand());

    y.SetIsReverseStrand(b.IsReverseStrand());
    y.SetIsMateReverseStrand(a.IsReverseStrand());
}
Exemple #2
0
bool isValidPair(Alignment& a, Alignment& b)
{
    Feature spacer;
    getSpacer(a, b, spacer);
    int gap = spacer.getLength();

    // Calculate the correct size of the insert
    // REMEMBER: negative gaps mean our values overlap

    // pair must be oriented correctly
    // (5'--------->3' 3'<---------5')
    return gap >= MIN_GAP && gap <= MAX_GAP 
           && !a.IsReverseStrand() && b.IsReverseStrand();
}