本文整理汇总了Java中htsjdk.samtools.SAMRecord.isSecondaryOrSupplementary方法的典型用法代码示例。如果您正苦于以下问题:Java SAMRecord.isSecondaryOrSupplementary方法的具体用法?Java SAMRecord.isSecondaryOrSupplementary怎么用?Java SAMRecord.isSecondaryOrSupplementary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMRecord
的用法示例。
在下文中一共展示了SAMRecord.isSecondaryOrSupplementary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadReads
import htsjdk.samtools.SAMRecord; //导入方法依赖的package包/类
public void loadReads(File[] bams) throws IOException{
int count = 0;
int numOp = 0;
for(File bam : bams){
HLA.log.appendln("Loading reads from:\t" + bam.getName());
Object2IntOpenHashMap<String> readLoadingSet = new Object2IntOpenHashMap<String>();
readLoadingSet.defaultReturnValue(0);
final SamReader reader = SamReaderFactory.makeDefault().open(bam);
//Kourami bam checker added
if(!checkHeader(reader.getFileHeader())){
HLA.log.appendln("Unexpected BAM :\t"+ bam.getName()
+"\nThe input BAM MUST be aligned to the set of IMGT/HLA alleles in " + HLA.MSAFILELOC + "\n"
+ "Please use the recommended preprocessing steps explained on the github page:\n"
+ "https://github.com/Kingsford-Group/kourami");
System.err.println("Unexpected BAM :\t"+ bam.getName()
+"\nThe input BAM MUST be aligned to the set of IMGT/HLA alleles in " + HLA.MSAFILELOC + "\n"
+ "Please use the recommended preprocessing steps explained on the github page:\n"
+ "https://github.com/Kingsford-Group/kourami");
HLA.log.outToFile();
System.exit(1);
}
for(final SAMRecord samRecord : reader){
if(count == 0){
HLA.READ_LENGTH = samRecord.getReadLength();
HLA.log.appendln("Setting HLA.READ_LEGNTH = " + HLA.READ_LENGTH);
}
//added checking to process reads matching to HLA-type sequences
//discarding decoy hits (DQB2, DQA2)
boolean qc = false;
if( (samRecord.getReferenceName().indexOf("*") > -1)
&& !samRecord.getReadUnmappedFlag()
&& !samRecord.isSecondaryOrSupplementary()
&& !this.startWIns(samRecord)){
count++;
if(samRecord.getReadPairedFlag())
numOp += processRecord(samRecord, readLoadingSet);
else
numOp += processRecordUnpaired(samRecord);
}
if(HLA.DEBUG && count%10000 == 0)
HLA.log.appendln("Processed 10000 reads...");
}
reader.close();
}
HLA.log.appendln("Loaded a total of " + count + " mapped reads.");
HLA.log.appendln("A total of " + numOp + " bases");
}