本文整理汇总了Java中htsjdk.samtools.SAMRecord.getMateNegativeStrandFlag方法的典型用法代码示例。如果您正苦于以下问题:Java SAMRecord.getMateNegativeStrandFlag方法的具体用法?Java SAMRecord.getMateNegativeStrandFlag怎么用?Java SAMRecord.getMateNegativeStrandFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMRecord
的用法示例。
在下文中一共展示了SAMRecord.getMateNegativeStrandFlag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasWellDefinedFragmentSize
import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
/**
* Can the adaptor sequence of read be reliably removed from the read based on the alignment of
* read and its mate?
*
* @param read the read to check
* @return true if it can, false otherwise
*/
public static boolean hasWellDefinedFragmentSize(final SAMRecord read) {
if ( read.getInferredInsertSize() == 0 )
// no adaptors in reads with mates in another chromosome or unmapped pairs
return false;
if ( ! read.getReadPairedFlag() )
// only reads that are paired can be adaptor trimmed
return false;
if ( read.getReadUnmappedFlag() || read.getMateUnmappedFlag() )
// only reads when both reads are mapped can be trimmed
return false;
// if ( ! read.getProperPairFlag() )
// // note this flag isn't always set properly in BAMs, can will stop us from eliminating some proper pairs
// // reads that aren't part of a proper pair (i.e., have strange alignments) can't be trimmed
// return false;
if ( read.getReadNegativeStrandFlag() == read.getMateNegativeStrandFlag() )
// sanity check on getProperPairFlag to ensure that read1 and read2 aren't on the same strand
return false;
if ( read.getReadNegativeStrandFlag() ) {
// we're on the negative strand, so our read runs right to left
return read.getAlignmentEnd() > read.getMateAlignmentStart();
} else {
// we're on the positive strand, so our mate should be to our right (his start + insert size should be past our start)
return read.getAlignmentStart() <= read.getMateAlignmentStart() + read.getInferredInsertSize();
}
}