本文整理匯總了Java中org.broadinstitute.hellbender.utils.clipping.ReadClipper.clipRead方法的典型用法代碼示例。如果您正苦於以下問題:Java ReadClipper.clipRead方法的具體用法?Java ReadClipper.clipRead怎麽用?Java ReadClipper.clipRead使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.broadinstitute.hellbender.utils.clipping.ReadClipper
的用法示例。
在下文中一共展示了ReadClipper.clipRead方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: clipReadRightEnd
import org.broadinstitute.hellbender.utils.clipping.ReadClipper; //導入方法依賴的package包/類
private GATKRead clipReadRightEnd(GATKRead read) {
final byte[] quals = read.getBaseQualities();
final int clipPoint = getRightClipPoint(quals);
if (clipPoint != -1) {
final ReadClipper readClipper = new ReadClipper(read);
readClipper.addOp(new ClippingOp(clipPoint, read.getLength()));
return readClipper.clipRead(ClippingRepresentation.HARDCLIP_BASES);
} else {
return read;
}
}
示例2: clipReadLeftEnd
import org.broadinstitute.hellbender.utils.clipping.ReadClipper; //導入方法依賴的package包/類
private GATKRead clipReadLeftEnd(GATKRead read) {
final byte[] quals = read.getBaseQualities();
final int clipPoint = getLeftClipPoint(quals);
if (clipPoint != -1) {
final ReadClipper readClipper = new ReadClipper(read);
readClipper.addOp(new ClippingOp(0, clipPoint));
return readClipper.clipRead(ClippingRepresentation.HARDCLIP_BASES);
} else {
return read;
}
}
示例3: apply
import org.broadinstitute.hellbender.utils.clipping.ReadClipper; //導入方法依賴的package包/類
@Override
public GATKRead apply(final GATKRead read) {
if (read.getLength() < minClipLength) return read;
final byte[] bases = read.getBases();
//Be sure to find the best match in case one adapter ends with another adapter's sequence (within maxMismatches difference)
int bestNumMismatches = maxMismatches;
int bestAlignmentStart = bases.length;
boolean foundAdapter = false;
//Adapter list loop
for (final String adapterSequence : adapterSequences) {
//Start at the end of the read and walk backwards
int alignmentLength = minClipLength;
for (int alignmentStart = bases.length - minClipLength; alignmentStart >= 0; alignmentStart--) {
int numMismatches = 0;
//Check each base for mismatches
for (int j = 0; j < alignmentLength; j++) {
if (!SequenceUtil.isNoCall((byte) adapterSequence.charAt(j)) && bases[alignmentStart + j] != adapterSequence.charAt(j)) {
if (++numMismatches > maxMismatches) break;
}
}
if (numMismatches < bestNumMismatches || (numMismatches == bestNumMismatches && alignmentStart < bestAlignmentStart)) {
//We have a (better/earlier) match
bestNumMismatches = numMismatches;
bestAlignmentStart = alignmentStart;
foundAdapter = true;
}
alignmentLength = alignmentLength < adapterSequence.length() ? alignmentLength + 1 : alignmentLength;
}
}
if (foundAdapter) {
//Hard clip from the beginning of the adapter to the end of the read
final ReadClipper readClipper = new ReadClipper(read);
readClipper.addOp(new ClippingOp(bestAlignmentStart, read.getLength()));
return readClipper.clipRead(ClippingRepresentation.HARDCLIP_BASES);
}
return read;
}
示例4: maskRead
import org.broadinstitute.hellbender.utils.clipping.ReadClipper; //導入方法依賴的package包/類
private GATKRead maskRead(final GATKRead read, final int maskStart, final int maskEnd) {
final ReadClipper readClipper = new ReadClipper(read);
readClipper.addOp(new ClippingOp(maskStart, maskEnd - 1));
return readClipper.clipRead(ClippingRepresentation.WRITE_NS_Q0S);
}