本文整理汇总了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;
}
示例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;
}
示例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;
}