本文整理汇总了Java中htsjdk.samtools.SAMFileHeader.setSequenceDictionary方法的典型用法代码示例。如果您正苦于以下问题:Java SAMFileHeader.setSequenceDictionary方法的具体用法?Java SAMFileHeader.setSequenceDictionary怎么用?Java SAMFileHeader.setSequenceDictionary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMFileHeader
的用法示例。
在下文中一共展示了SAMFileHeader.setSequenceDictionary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createArtificialSamHeader
import htsjdk.samtools.SAMFileHeader; //导入方法依赖的package包/类
/**
* Creates an artificial sam header, matching the parameters, chromosomes which will be labeled chr1, chr2, etc
*
* @param numberOfChromosomes the number of chromosomes to create
* @param startingChromosome the starting number for the chromosome (most likely set to 1)
* @param chromosomeSize the length of each chromosome
* @return
*/
public static SAMFileHeader createArtificialSamHeader(int numberOfChromosomes, int startingChromosome, int chromosomeSize) {
SAMFileHeader header = new SAMFileHeader();
header.setSortOrder(htsjdk.samtools.SAMFileHeader.SortOrder.coordinate);
SAMSequenceDictionary dict = new SAMSequenceDictionary();
// make up some sequence records
for (int x = startingChromosome; x < startingChromosome + numberOfChromosomes; x++) {
SAMSequenceRecord rec = new SAMSequenceRecord("chr" + (x), chromosomeSize /* size */);
rec.setSequenceLength(chromosomeSize);
dict.addSequence(rec);
}
header.setSequenceDictionary(dict);
return header;
}