本文整理了Java中org.broadinstitute.gatk.utils.sam.GATKSAMRecord.setFlags()
方法的一些代码示例,展示了GATKSAMRecord.setFlags()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GATKSAMRecord.setFlags()
方法的具体详情如下:
包路径:org.broadinstitute.gatk.utils.sam.GATKSAMRecord
类名称:GATKSAMRecord
方法名:setFlags
暂无
代码示例来源:origin: broadgsa/gatk
@Test
public void testSecondaryAlignmentsDoNotCauseAccidentalRemovalOfMate() {
final List<GATKSAMRecord> properReads = ArtificialSAMUtils.createPair(header, "foo", 1, 530, 1594, true, false);
final GATKSAMRecord read1 = properReads.get(0);
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
read2Primary.setAlignmentStart(1596); // move the read
final GATKSAMRecord read2NonPrimary = new GATKSAMRecord(read2Primary);
read2NonPrimary.setReadName("foo");
read2NonPrimary.setFlags(393); // second in proper pair, on reverse strand
read2NonPrimary.setAlignmentStart(451);
read2NonPrimary.setMateAlignmentStart(451);
final ConstrainedMateFixingManager manager = new ConstrainedMateFixingManager(null, genomeLocParser, 10000, 200, 10000);
manager.addRead(read2NonPrimary, false, false);
manager.addRead(read1, false, false);
for ( int i = 0; i < ConstrainedMateFixingManager.EMIT_FREQUENCY; i++ )
manager.addRead(ArtificialSAMUtils.createArtificialRead(header, "foo" + i, 0, 1500, 10), false, false);
Assert.assertTrue(manager.forMateMatching.containsKey("foo"));
}
代码示例来源: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
final List<GATKSAMRecord> properReads = ArtificialSAMUtils.createPair(header, "foo", 1, 1000, 2000, true, false);
final GATKSAMRecord read1 = properReads.get(0);
read1.setFlags(99); // first in pair, negative strand
read2.setFlags(161); // second in pair, mate negative strand
read2Supp.setFlags(2209); // second in pair, mate negative strand, supplementary
read2Supp.setAlignmentStart(100);
read2Supp.setMateAlignmentStart(1000);
代码示例来源:origin: broadgsa/gatk
emptyRead.setMappingQuality(0);
emptyRead.setFlags(read.getFlags());
emptyRead.setMateReferenceIndex(read.getMateReferenceIndex());
emptyRead.setMateAlignmentStart(read.getMateAlignmentStart());
代码示例来源:origin: broadgsa/gatk-protected
/**
* Write out a representation of this haplotype as a read
*
* @param haplotype a haplotype to write out. Cannot be null
* @param paddedRefLoc the reference location. Cannot be null
* @param isAmongBestHaplotypes true if among the best haplotypes, false if it was just one possible but not so good
*/
private void writeHaplotype(final Haplotype haplotype,
final GenomeLoc paddedRefLoc,
final boolean isAmongBestHaplotypes) {
final GATKSAMRecord record = new GATKSAMRecord(output.getHeader());
record.setReadBases(haplotype.getBases());
record.setAlignmentStart(paddedRefLoc.getStart() + haplotype.getAlignmentStartHapwrtRef());
record.setBaseQualities(Utils.dupBytes((byte) '!', haplotype.getBases().length));
record.setCigar(AlignmentUtils.consolidateCigar(haplotype.getCigar()));
record.setMappingQuality(isAmongBestHaplotypes ? 60 : 0);
record.setReadName("HC" + uniqueNameCounter++);
record.setAttribute(AlignmentUtils.HAPLOTYPE_TAG,haplotype.hashCode());
record.setReadUnmappedFlag(false);
record.setReferenceIndex(paddedRefLoc.getContigIndex());
record.setAttribute(SAMTag.RG.toString(), READ_GROUP_ID);
record.setFlags(16);
output.add(record);
}
内容来源于网络,如有侵权,请联系作者删除!