当前位置: 首页>>代码示例>>Java>>正文


Java SAMRecord.isSecondaryOrSupplementary方法代码示例

本文整理汇总了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");
   }
 
开发者ID:Kingsford-Group,项目名称:kourami,代码行数:54,代码来源:HLA.java


注:本文中的htsjdk.samtools.SAMRecord.isSecondaryOrSupplementary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。