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


Java SAMFileHeader.clone方法代码示例

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


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

示例1: setupWriter

import htsjdk.samtools.SAMFileHeader; //导入方法依赖的package包/类
/**
 * Creates a program record for the program, adds it to the list of program records (@PG tags) in the bam file and sets
 * up the writer with the header and presorted status.
 *
 * @param originalHeader      original header
 * @param programRecord       the program record for this program
 */
public static SAMFileHeader setupWriter(final SAMFileHeader originalHeader, final SAMProgramRecord programRecord) {
    final SAMFileHeader header = originalHeader.clone();
    final List<SAMProgramRecord> oldRecords = header.getProgramRecords();
    final List<SAMProgramRecord> newRecords = new ArrayList<SAMProgramRecord>(oldRecords.size()+1);
    for ( SAMProgramRecord record : oldRecords )
        if ( (programRecord != null && !record.getId().startsWith(programRecord.getId())))
            newRecords.add(record);

    if (programRecord != null) {
        newRecords.add(programRecord);
        header.setProgramRecords(newRecords);
    }
    return header;
}
 
开发者ID:PAA-NCIC,项目名称:SparkSeq,代码行数:22,代码来源:Utils.java

示例2: createHeaderFromSampleName

import htsjdk.samtools.SAMFileHeader; //导入方法依赖的package包/类
public static SAMFileHeader createHeaderFromSampleName(
		SAMFileHeader header, String sampleName) {
	SAMFileHeader newHeader = header.clone();
	List<SAMReadGroupRecord> groups = header.getReadGroups();
	List<SAMReadGroupRecord> rgroups = new ArrayList<SAMReadGroupRecord>(
			groups.size());

	for (SAMReadGroupRecord g : groups) {
		if (g.getSample().equals(sampleName))
			rgroups.add(g);
	}
	newHeader.setReadGroups(rgroups);
	return newHeader;
}
 
开发者ID:BGI-flexlab,项目名称:SOAPgaea,代码行数:15,代码来源:SamFileHeader.java

示例3: setHeaderOptions

import htsjdk.samtools.SAMFileHeader; //导入方法依赖的package包/类
/**
 * Sets the sort order to the one specified in {@link #sortOrder} and remove the @PG lines it
 * {@link #noRemoveTaskProgramGroup} is false.
 *
 * @param header header to update.
 *
 * @return new header (modified accordingly).
 */
private SAMFileHeader setHeaderOptions(final SAMFileHeader header) {
    // clone the SAMFileHeader
    final SAMFileHeader toReturn = header.clone();
    toReturn.setSortOrder(sortOrder);
    if (noRemoveTaskProgramGroup) {
        logger.warn(
                "Program Group header lines (@PG) from DistMap multi-part output are maintained. This may contain information for each Map-Reduce task.");
    } else {
        toReturn.setProgramRecords(new ArrayList<>());
    }
    return toReturn;
}
 
开发者ID:magicDGS,项目名称:ReadTools,代码行数:21,代码来源:DistmapPartDownloader.java


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