InsertionSort insertionSort; BubbleSort bubbleSort; void setup() { String url = sketchPath("numbers/512/"); insertion = new Insertion(); String[] stringData = null; int[] intData = null; runTest(stringData, intData, url, insertionSort); runTest(stringData, intData, url, bubbleSort); } void runTest(String[] text, int[] number, String url, SortingAlgorithm algorithm) { File directory = new File(url); File[] listOfFiles = directory.listFiles(); for (File file : listOfFiles) { //println(file.getName()); text = loadStrings(file); number = int(text); algorithm.sort(number); } }
void calculateAlignmentBoundaries() { if (isSegmentUnmapped()) { alignmentSpan = 0; alignmentEnd = SAMRecord.NO_ALIGNMENT_START; } else if (readFeatures == null || readFeatures.isEmpty()) { alignmentSpan = readLength; alignmentEnd = alignmentStart + alignmentSpan - 1; } else { alignmentSpan = readLength; for (final ReadFeature readFeature : readFeatures) { switch (readFeature.getOperator()) { case InsertBase.operator: alignmentSpan--; break; case Insertion.operator: alignmentSpan -= ((Insertion) readFeature).getSequence().length; break; case SoftClip.operator: alignmentSpan -= ((SoftClip) readFeature).getSequence().length; break; case Deletion.operator: alignmentSpan += ((Deletion) readFeature).getLength(); break; default: break; } } alignmentEnd = alignmentStart + alignmentSpan - 1; } }
void calculateAlignmentBoundaries() { if (isSegmentUnmapped()) { alignmentSpan = 0; alignmentEnd = SAMRecord.NO_ALIGNMENT_START; } else if (readFeatures == null || readFeatures.isEmpty()) { alignmentSpan = readLength; alignmentEnd = alignmentStart + alignmentSpan - 1; } else { alignmentSpan = readLength; for (final ReadFeature readFeature : readFeatures) { switch (readFeature.getOperator()) { case InsertBase.operator: alignmentSpan--; break; case Insertion.operator: alignmentSpan -= ((Insertion) readFeature).getSequence().length; break; case SoftClip.operator: alignmentSpan -= ((SoftClip) readFeature).getSequence().length; break; case Deletion.operator: alignmentSpan += ((Deletion) readFeature).getLength(); break; default: break; } } alignmentEnd = alignmentStart + alignmentSpan - 1; } }
r.readFeatures = new ArrayList<>(); String insertion = "CCCCCCCCCC"; r.readFeatures.add(new Insertion(1, insertion.getBytes())); Assert.assertEquals(r.getAlignmentEnd(), r.readLength + r.alignmentStart - 1 - insertion.length());
case Insertion.operator: final Insertion insertion = (Insertion) variation; for (int i = 0; i < insertion.getSequence().length; i++) bases[posInRead++ - 1] = insertion.getSequence()[i]; break; case SoftClip.operator:
break; case Insertion.operator: final Insertion insertion = new Insertion(pos, insertionCodec.readData()); readFeatures.add(insertion); break;
case Insertion.operator: cigarOperator = CigarOperator.INSERTION; readFeatureLength = ((Insertion) feature).getSequence().length; break; case SoftClip.operator:
break; case Insertion.operator: final Insertion insertion = new Insertion(pos, insertionCodec.readData()); readFeatures.add(insertion); break;
case Insertion.operator: cigarOperator = CigarOperator.INSERTION; readFeatureLength = ((Insertion) feature).getSequence().length; break; case SoftClip.operator:
case Insertion.operator: final Insertion insertion = (Insertion) variation; for (int i = 0; i < insertion.getSequence().length; i++) bases[posInRead++ - 1] = insertion.getSequence()[i]; break; case SoftClip.operator:
case Insertion.operator: final Insertion insertion = (Insertion) variation; for (int i = 0; i < insertion.getSequence().length; i++) bases[posInRead++ - 1] = insertion.getSequence()[i]; break; case SoftClip.operator:
case Insertion.operator: final Insertion iv = (Insertion) f; insertionCodec.writeData(iv.getSequence()); break; case SoftClip.operator:
case Insertion.operator: final Insertion iv = (Insertion) f; insertionCodec.writeData(iv.getSequence()); break; case SoftClip.operator: