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


Java SAMSequenceDictionary.isEmpty方法代码示例

本文整理汇总了Java中htsjdk.samtools.SAMSequenceDictionary.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java SAMSequenceDictionary.isEmpty方法的具体用法?Java SAMSequenceDictionary.isEmpty怎么用?Java SAMSequenceDictionary.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在htsjdk.samtools.SAMSequenceDictionary的用法示例。


在下文中一共展示了SAMSequenceDictionary.isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setSamSeqDictFromBam

import htsjdk.samtools.SAMSequenceDictionary; //导入方法依赖的package包/类
private boolean setSamSeqDictFromBam(String bamfile) {

		/*  ------------------------------------------------------ */
		/* This chunk prepares SamReader from local bam            */
		SamReaderFactory srf=SamReaderFactory.make();
		srf.validationStringency(ValidationStringency.SILENT);
		SamReader samReader;
		samReader= srf.open(new File(bamfile));
		/*  ------------------------------------------------------ */
		
		SAMSequenceDictionary seqDict = samReader.getFileHeader().getSequenceDictionary();
		if(seqDict != null && !seqDict.isEmpty()){
			this.setSamSeqDictSource(new File(bamfile).getAbsolutePath());
			this.setSamSeqDict(seqDict);
			return true;
		}
		return false;
	}
 
开发者ID:dariober,项目名称:ASCIIGenome,代码行数:19,代码来源:GenomicCoords.java

示例2: collectFileReadersAndHeaders

import htsjdk.samtools.SAMSequenceDictionary; //导入方法依赖的package包/类
private void collectFileReadersAndHeaders(final List<String> sampleList, SAMSequenceDictionary samSequenceDictionary) {
    for (final File input : INPUT) {
        final VCFFileReader in = new VCFFileReader(input, false);
        final VCFHeader header = in.getFileHeader();
        final SAMSequenceDictionary dict = in.getFileHeader().getSequenceDictionary();
        if (dict == null || dict.isEmpty()) {
            if (null == samSequenceDictionary) {
                throw new IllegalArgumentException("Sequence dictionary was missing or empty for the VCF: " + input.getAbsolutePath() + " Please add a sequence dictionary to this VCF or specify SEQUENCE_DICTIONARY.");
            }
            header.setSequenceDictionary(samSequenceDictionary);
        } else {
            if (null == samSequenceDictionary) {
                samSequenceDictionary = dict;
            } else {
                try {
                    samSequenceDictionary.assertSameDictionary(dict);
                } catch (final AssertionError e) {
                    throw new IllegalArgumentException(e);
                }
            }
        }
        if (sampleList.isEmpty()) {
            sampleList.addAll(header.getSampleNamesInOrder());
        } else {
            if (!sampleList.equals(header.getSampleNamesInOrder())) {
                throw new IllegalArgumentException("Input file " + input.getAbsolutePath() + " has sample names that don't match the other files.");
            }
        }
        inputReaders.add(in);
        inputHeaders.add(header);
    }
}
 
开发者ID:broadinstitute,项目名称:picard,代码行数:33,代码来源:SortVcf.java

示例3: getSequenceDictionary

import htsjdk.samtools.SAMSequenceDictionary; //导入方法依赖的package包/类
/**
 * Returns the sequence dictionary for this source of Features.
 * Uses the dictionary from the VCF header (if present) for variant inputs,
 * otherwise attempts to create a sequence dictionary from the index file (if present).
 * Returns null if no dictionary could be created from either the header or the index.
 */
public SAMSequenceDictionary getSequenceDictionary() {
    SAMSequenceDictionary dict = null;
    final Object header = getHeader();
    if (header instanceof VCFHeader) {
        dict = ((VCFHeader) header).getSequenceDictionary();
    }
    if (dict != null && !dict.isEmpty()) {
        return dict;
    }
    if (hasIndex) {
        return IndexUtils.createSequenceDictionaryFromFeatureIndex(new File(featureInput.getFeaturePath()));
    }
    return null;
}
 
开发者ID:broadinstitute,项目名称:gatk,代码行数:21,代码来源:FeatureDataSource.java


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