本文整理了Java中org.broadinstitute.gatk.utils.sam.GATKSAMRecord.getBaseDeletionQualities()
方法的一些代码示例,展示了GATKSAMRecord.getBaseDeletionQualities()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GATKSAMRecord.getBaseDeletionQualities()
方法的具体详情如下:
包路径:org.broadinstitute.gatk.utils.sam.GATKSAMRecord
类名称:GATKSAMRecord
方法名:getBaseDeletionQualities
[英]Default utility to query the base deletion quality of a read. If the read doesn't have one, it creates an array of default qualities (currently Q45) and assigns it to the read.
[中]用于查询读取的基本删除质量的默认实用程序。如果读取没有,它将创建一个默认质量数组(当前为Q45)并将其分配给读取。
代码示例来源:origin: broadgsa/gatk
/**
* Get the Base Deletion quality at this pileup position
* @return a phred-scaled quality score as a byte
*/
public byte getBaseDeletionQual() {
return isDeletion() ? DELETION_QUAL : read.getBaseDeletionQualities()[offset];
}
代码示例来源:origin: broadgsa/gatk-protected
private void performBatchAdditions(final List<GATKSAMRecord> reads, final List<Haplotype> haplotypes, Map<GATKSAMRecord,byte[]> gcp) {
for(final GATKSAMRecord read : reads){
final byte[] readBases = read.getReadBases();
final byte[] readQuals = read.getBaseQualities();
final byte[] readInsQuals = read.getBaseInsertionQualities();
final byte[] readDelQuals = read.getBaseDeletionQualities();
final byte[] overallGCP = gcp.get(read);
batchAdd(haplotypes, readBases, readQuals, readInsQuals, readDelQuals, overallGCP);
}
}
代码示例来源:origin: broadgsa/gatk
@Override
public void recordValues(final GATKSAMRecord read, final ReadCovariates values) {
final byte[] baseQualities = read.getBaseQualities();
final byte[] baseInsertionQualities = read.getBaseInsertionQualities();
final byte[] baseDeletionQualities = read.getBaseDeletionQualities();
for (int i = 0; i < baseQualities.length; i++) {
values.addCovariate((int)baseQualities[i], (int)baseInsertionQualities[i], (int)baseDeletionQualities[i], i);
}
}
代码示例来源:origin: broadgsa/gatk
public byte[] getBaseQualities( final EventType errorModel ) {
switch( errorModel ) {
case BASE_SUBSTITUTION:
return getBaseQualities();
case BASE_INSERTION:
return getBaseInsertionQualities();
case BASE_DELETION:
return getBaseDeletionQualities();
default:
throw new ReviewedGATKException("Unrecognized Base Recalibration type: " + errorModel );
}
}
代码示例来源:origin: broadgsa/gatk-protected
private void writeDebugLikelihoods(final GATKSAMRecord processedRead, final Haplotype haplotype, final double log10l){
likelihoodsStream.printf("%s %s %s %s %s %s %f%n",
haplotype.getBaseString(),
new String(processedRead.getReadBases() ),
SAMUtils.phredToFastq(processedRead.getBaseQualities()),
SAMUtils.phredToFastq(processedRead.getBaseInsertionQualities() ),
SAMUtils.phredToFastq(processedRead.getBaseDeletionQualities() ),
SAMUtils.phredToFastq(constantGCP),
log10l);
}
代码示例来源:origin: broadgsa/gatk-protected
/**
* Loads the read that is going to be evaluated in following calls to {@link #calculateLocalLikelihoods}.
*
* @param read the target read.
* @throws NullPointerException if {@code read} is null.
*/
@Override
public void loadRead(final GATKSAMRecord read) {
loadRead(read.getReadBases(),read.getBaseQualities(),read.getBaseInsertionQualities(),read.getBaseDeletionQualities(),read.getMappingQuality());
}
代码示例来源:origin: broadgsa/gatk-protected
readDataArray[idx].readQuals = read.getBaseQualities();
readDataArray[idx].insertionGOP = read.getBaseInsertionQualities();
readDataArray[idx].deletionGOP = read.getBaseDeletionQualities();
readDataArray[idx].overallGCP = gcp.get(read);
++idx;
代码示例来源:origin: broadgsa/gatk
final byte[] readQuals = read.getBaseQualities();
final byte[] readInsQuals = read.getBaseInsertionQualities();
final byte[] readDelQuals = read.getBaseDeletionQualities();
final byte[] overallGCP = gcp.get(read);
代码示例来源:origin: broadgsa/gatk-protected
/**
* Pre-processing of the reads to be evaluated at the current location from the current sample.
* We apply the PCR Error Model, and cap the minimum base, insertion, and deletion qualities of each read.
* Modified copies of reads are packed into a new list, while original reads are retained for downstream use
*
* @param reads The original list of unmodified reads
* @return processedReads. A new list of reads, in the same order, whose qualities have been altered by PCR error model and minimal quality thresholding
*/
private List<GATKSAMRecord> modifyReadQualities(final List<GATKSAMRecord> reads) {
final List<GATKSAMRecord> result = new ArrayList<>(reads.size());
for (final GATKSAMRecord read : reads) {
final byte[] readBases = read.getReadBases();
// NOTE -- must clone anything that gets modified here so we don't screw up future uses of the read
final byte[] readQuals = read.getBaseQualities().clone();
final byte[] readInsQuals = read.getBaseInsertionQualities().clone();
final byte[] readDelQuals = read.getBaseDeletionQualities().clone();
applyPCRErrorModel(readBases, readInsQuals, readDelQuals);
capMinimumReadQualities(read, readQuals, readInsQuals, readDelQuals);
// Create a new copy of the read and sets its base qualities to the modified versions.
// Pack this into a new list for return
result.add(GATKSAMRecord.createQualityModifiedRead(read, readBases, readQuals, readInsQuals, readDelQuals));
}
return result;
}
代码示例来源:origin: broadgsa/gatk
/**
* Clears all attributes except ReadGroup of the read.
*/
public GATKSAMRecord simplify () {
GATKSAMReadGroupRecord rg = getReadGroup(); // save the read group information
byte[] insQuals = (this.getAttribute(BQSR_BASE_INSERTION_QUALITIES) == null) ? null : getBaseInsertionQualities();
byte[] delQuals = (this.getAttribute(BQSR_BASE_DELETION_QUALITIES) == null) ? null : getBaseDeletionQualities();
this.clearAttributes(); // clear all attributes from the read
this.setReadGroup(rg); // restore read group
if (insQuals != null)
this.setBaseQualities(insQuals, EventType.BASE_INSERTION); // restore base insertion if we had any
if (delQuals != null)
this.setBaseQualities(delQuals, EventType.BASE_DELETION); // restore base deletion if we had any
return this;
}
代码示例来源:origin: broadgsa/gatk-protected
debugDump("reads_java.txt",String.format("%d\n",(int)read.getBaseQualities()[i]),true);
debugDump("reads_java.txt",String.format("%d\n",(int)read.getBaseInsertionQualities()[i]),true);
debugDump("reads_java.txt",String.format("%d\n",(int)read.getBaseDeletionQualities()[i]),true);
debugDump("reads_java.txt",String.format("%d\n",(int)overallGCP[i]),true);
debugDump("debug_dump.txt",new String(tmpByteArray)+" ",true);
for(int k=0;k<read.getReadBases().length;++k)
tmpByteArray[k] = (byte)((int)((read.getBaseDeletionQualities())[k]) + 33);
debugDump("debug_dump.txt",new String(tmpByteArray)+" ",true);
for(int k=0;k<read.getReadBases().length;++k)
代码示例来源:origin: broadgsa/gatk
final byte[] newBaseDeletionQuals = new byte[newLength];
System.arraycopy(read.getBaseInsertionQualities(), copyStart, newBaseInsertionQuals, 0, newLength);
System.arraycopy(read.getBaseDeletionQualities(), copyStart, newBaseDeletionQuals, 0, newLength);
hardClippedRead.setBaseQualities(newBaseInsertionQuals, EventType.BASE_INSERTION);
hardClippedRead.setBaseQualities(newBaseDeletionQuals, EventType.BASE_DELETION);
代码示例来源:origin: broadgsa/gatk-protected
/**
* Creates a hard-clipped view on a existing read record.
* @param read the underlying unclipped read.
* @param start inclusive first position in {@code read} included in the clipped view.
* @param end inclusive last position in {@code read} included in the clipped view.
*/
public ClippedGATKSAMRecord(final GATKSAMRecord read, int start, int end) {
super(read.getHeader());
this.setReferenceIndex(read.getReferenceIndex());
this.setAlignmentStart(read.getAlignmentStart() + start);
this.setMappingQuality(100);
// setting read indexing bin below
this.setFlags(read.getFlags());
this.setMateReferenceIndex(read.getMateReferenceIndex());
this.setMateAlignmentStart(read.getMateAlignmentStart());
this.setInferredInsertSize(read.getInferredInsertSize());
this.setReadBases(Arrays.copyOfRange(read.getReadBases(), start, end));
this.setBaseQualities(Arrays.copyOfRange(read.getBaseQualities(),start,end));
this.setReadName(read.getReadName());
insertionQuals = Arrays.copyOfRange(read.getBaseInsertionQualities(),start,end);
deletionQuals = Arrays.copyOfRange(read.getBaseDeletionQualities(),start,end);
// Set these to null in order to mark them as being candidates for lazy initialization.
// If this is not done, they will have non-null defaults.
super.setReadName(null);
super.setCigarString(null);
super.setReadBases(null);
super.setBaseQualities(null);
// Do this after the above because setCigarString will clear it.
GATKBin.setReadIndexingBin(this, -1);
}
代码示例来源:origin: broadgsa/gatk-protected
if ( read.hasBaseIndelQualities() ) {
baseInsertionQualities = Arrays.copyOfRange(read.getBaseInsertionQualities(), numStartSoftClippedBases, endOfCopy);
baseDeletionQualities = Arrays.copyOfRange(read.getBaseDeletionQualities(), numStartSoftClippedBases, endOfCopy);
} else {
baseInsertionQualities = contextLogGapOpenProbabilities;
代码示例来源:origin: broadgsa/gatk
final byte[] firstReadDeletionQuals = firstRead.getBaseDeletionQualities();
final byte[] secondReadInsertionQuals = secondRead.getBaseInsertionQualities();
final byte[] secondReadDeletionQuals = secondRead.getBaseDeletionQualities();
for(int iii = 0; iii < firstReadStop; iii++) {
insertionQuals[iii] = firstReadInsertionQuals[iii];
代码示例来源:origin: broadgsa/gatk-protected
final byte[] bq = r.getBaseQualities();
final byte[] iq = r.getBaseInsertionQualities();
final byte[] dq = r.getBaseDeletionQualities();
int refOffset = r.getAlignmentStart() - 1;
int readOffset = 0;
内容来源于网络,如有侵权,请联系作者删除!