本文整理汇总了Java中htsjdk.samtools.SAMFileHeader.getSequence方法的典型用法代码示例。如果您正苦于以下问题:Java SAMFileHeader.getSequence方法的具体用法?Java SAMFileHeader.getSequence怎么用?Java SAMFileHeader.getSequence使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMFileHeader
的用法示例。
在下文中一共展示了SAMFileHeader.getSequence方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAlignmentDisagreesWithHeader
import htsjdk.samtools.SAMFileHeader; //导入方法依赖的package包/类
/**
* Check to ensure that the alignment makes sense based on the contents of
* the header.
*
* @param header
* The SAM file header.
* @param read
* The read to verify.
* @return true if alignment agrees with header, false othrewise.
*/
protected boolean checkAlignmentDisagreesWithHeader(
SAMFileHeader header, SAMRecord read) {
// Read is aligned to nonexistent contig
if (read.getReferenceIndex() == GaeaSamRecord.NO_ALIGNMENT_REFERENCE_INDEX
&& read.getAlignmentStart() != GaeaSamRecord.NO_ALIGNMENT_START)
return false;
SAMSequenceRecord contigHeader = header.getSequence(read
.getReferenceIndex());
// Read is aligned to a point after the end of the contig
if (!read.getReadUnmappedFlag()
&& read.getAlignmentStart() > contigHeader.getSequenceLength())
return false;
return true;
}
示例2: Window
import htsjdk.samtools.SAMFileHeader; //导入方法依赖的package包/类
public Window(SAMFileHeader mHeader, int chrIndex, int winNum, int WindowsSize) {
int winSize = WindowsSize;
int start = winNum * winSize;
if (mHeader.getSequence(chrIndex) == null)
throw new RuntimeException(String.format("chr index %d is not found in reference", chrIndex));
String chrName = mHeader.getSequence(chrIndex).getSequenceName();
int stop = (winNum + 1) * winSize - 1 < mHeader.getSequence(chrName).getSequenceLength()
? (winNum + 1) * winSize - 1 : mHeader.getSequence(chrName).getSequenceLength();
this.contigName=chrName;
this.chrIndex = chrIndex;
this.start=start;
this.stop=stop;
}