org.broadinstitute.gatk.utils.sam.GATKSAMRecord.getInferredInsertSize()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(71)

本文整理了Java中org.broadinstitute.gatk.utils.sam.GATKSAMRecord.getInferredInsertSize()方法的一些代码示例,展示了GATKSAMRecord.getInferredInsertSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GATKSAMRecord.getInferredInsertSize()方法的具体详情如下:
包路径:org.broadinstitute.gatk.utils.sam.GATKSAMRecord
类名称:GATKSAMRecord
方法名:getInferredInsertSize

GATKSAMRecord.getInferredInsertSize介绍

暂无

代码示例

代码示例来源:origin: broadgsa/gatk-protected

@Override
  protected Double getElementForRead(final GATKSAMRecord read, final int refLoc) {
    return (double)Math.abs(read.getInferredInsertSize());
  }
}

代码示例来源:origin: broadgsa/gatk

/**
 * is this base inside the adaptor of the read?
 *
 * There are two cases to treat here:
 *
 * 1) Read is in the negative strand => Adaptor boundary is on the left tail
 * 2) Read is in the positive strand => Adaptor boundary is on the right tail
 *
 * Note: We return false to all reads that are UNMAPPED or have an weird big insert size (probably due to mismapping or bigger event)
 *
 * @param read the read to test
 * @param basePos base position in REFERENCE coordinates (not read coordinates)
 * @return whether or not the base is in the adaptor
 */
public static boolean isBaseInsideAdaptor(final GATKSAMRecord read, long basePos) {
  final int adaptorBoundary = read.getAdaptorBoundary();
  if (adaptorBoundary == CANNOT_COMPUTE_ADAPTOR_BOUNDARY || read.getInferredInsertSize() > DEFAULT_ADAPTOR_SIZE)
    return false;
  return read.getReadNegativeStrandFlag() ? basePos <= adaptorBoundary : basePos >= adaptorBoundary;
}

代码示例来源:origin: broadgsa/gatk

private static String insertLengthOutput(final ReadBackedPileup pileup) {
  Integer[] insertSizes=new Integer[pileup.depthOfCoverage()];
  int i=0;
  for ( PileupElement p : pileup ) {
    insertSizes[i]=p.getRead().getInferredInsertSize();
    ++i;
  }
  return Utils.join(",",insertSizes);
}

代码示例来源:origin: broadgsa/gatk

@Override
public Integer map(ReferenceContext referenceContext, GATKSAMRecord read, RefMetaDataTracker RefMetaDataTracker) {
  final String rgID = read.getReadGroup().getId();
  final PerReadGroupInfo info = readGroupInfo.get(rgID);
  if ( info.needsMoreData() ) {
    info.readLength.add(read.getReadLength());
    info.nReadsSeen++;
    if ( read.getReadPairedFlag() ) {
      info.nReadsPaired++;
      if ( read.getInferredInsertSize() != 0) {
        info.insertSize.add(Math.abs(read.getInferredInsertSize()));
      }
    }
  }
  return null;
}

代码示例来源:origin: broadgsa/gatk

@Test
public void testSecondaryAlignmentsDoNotInterfere() {
  final List<GATKSAMRecord> properReads = ArtificialSAMUtils.createPair(header, "foo", 1, 10, 30, true, false);
  final GATKSAMRecord read1 = properReads.get(0);
  read1.setAlignmentStart(8); // move the read
  read1.setFlags(99);   // first in proper pair, mate negative strand
  final GATKSAMRecord read2Primary = properReads.get(1);
  read2Primary.setFlags(147);   // second in pair, mate unmapped, not primary alignment
  Assert.assertEquals(read1.getInferredInsertSize(), 21);
  final GATKSAMRecord read2NonPrimary = new GATKSAMRecord(read2Primary);
  read2NonPrimary.setFlags(393);   // second in proper pair, on reverse strand
  final ConstrainedMateFixingManager manager = new ConstrainedMateFixingManager(null, genomeLocParser, 1000, 1000, 1000);
  manager.addRead(read1, true, false);
  manager.addRead(read2NonPrimary, false, false);
  manager.addRead(read2Primary, false, false);
  Assert.assertEquals(manager.getNReadsInQueue(), 3);
  for ( final SAMRecord read : manager.getReadsInQueueForTesting() ) {
    if ( read.getFirstOfPairFlag() ) {
      Assert.assertEquals(read.getFlags(), 99);
      Assert.assertEquals(read.getInferredInsertSize(), 23);
    } else if ( read.getNotPrimaryAlignmentFlag() ) {
      Assert.assertEquals(read.getFlags(), 393);
      Assert.assertEquals(read.getInferredInsertSize(), -21);
    } else {
      Assert.assertEquals(read.getFlags(), 147);
      Assert.assertEquals(read.getInferredInsertSize(), -23);
    }
  }
}

代码示例来源: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

emptyRead.setMateReferenceIndex(read.getMateReferenceIndex());
emptyRead.setMateAlignmentStart(read.getMateAlignmentStart());
emptyRead.setInferredInsertSize(read.getInferredInsertSize());

相关文章

微信公众号

最新文章

更多

GATKSAMRecord类方法