// DEBUG void checkNode(Node* node) { PassageMarkerI marker1 = getMarker(node); if (marker1 == NULL_IDX) return; PassageMarkerI marker2 = getNextInNode(marker1); if (marker2 == NULL_IDX) return; if (getStartOffset(marker1) == getStartOffset(marker2)) abort(); if (getFinishOffset(marker1) == getFinishOffset(marker2)) abort(); printf(">>>> Node %li\n", (long) getNodeID(node)); printf("Marker1: %li - %li > %li (%li) \n", (long) getStartOffset(marker1), (long) getPassageMarkerLength(marker1), (long) (getNodeLength(node) - getFinishOffset(marker1)), (long) getFinishOffset(marker1)); printf("%s\n", readPassageMarker(marker1)); printf("Marker2: %li - %li > %li (%li) \n", (long) getStartOffset(marker2), (long) getPassageMarkerLength(marker2), (long) (getNodeLength(node) - getFinishOffset(marker2)), (long) getFinishOffset(marker2)); printf("%s\n", readPassageMarker(marker2)); if (getStartOffset(marker1) < getNodeLength(node) - getFinishOffset(marker2) && getStartOffset(marker2) < getNodeLength(node) - getFinishOffset(marker1)) { //abort(); ; } }
static TightString *readNegativePassageMarker(PassageMarkerI marker, TightString ** seqs) { Coordinate index; Nucleotide nucleotide; TightString *tString = seqs[getAbsolutePassMarkerSeqID(marker) - 1]; TightString *res = newTightString(getPassageMarkerLength(marker)); for (index = 0; index < getPassageMarkerLength(marker); index++) { nucleotide = getNucleotide(getPassageMarkerStart(marker) - index, tString); #ifndef COLOR writeNucleotideAtPosition(3 - nucleotide, index, res); #else writeNucleotideAtPosition(nucleotide, index, res); #endif } return res; }
static TightString *readPositivePassageMarker(PassageMarkerI marker, TightString ** seqs, int WORDLENGTH) { Coordinate index; Nucleotide nucleotide; TightString *tString = seqs[getPassageMarkerSequenceID(marker) - 1]; TightString *res = newTightString(getPassageMarkerLength(marker)); for (index = 0; index < getLength(tString); index++) { nucleotide = getNucleotide(getPassageMarkerStart(marker) + index + WORDLENGTH - 1, tString); writeNucleotideAtPosition(nucleotide, index, res); } return res; }
static void adjustShortReads(Node * target, PassageMarkerI pathMarker) { ShortReadMarker *targetArray, *marker; IDnum targetLength, index; Coordinate position, nodeLength; if (!readStartsAreActivated(graph)) return; targetArray = getNodeReads(getTwinNode(target), graph); targetLength = getNodeReadCount(getTwinNode(target), graph); nodeLength = getPassageMarkerLength(pathMarker); for (index = 0; index < targetLength; index++) { marker = getShortReadMarkerAtIndex(targetArray, index); position = getShortReadMarkerPosition(marker); position += nodeLength; setShortReadMarkerPosition(marker, position); } }