本文整理汇总了Java中htsjdk.samtools.SAMFileHeader.getProgramRecords方法的典型用法代码示例。如果您正苦于以下问题:Java SAMFileHeader.getProgramRecords方法的具体用法?Java SAMFileHeader.getProgramRecords怎么用?Java SAMFileHeader.getProgramRecords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMFileHeader
的用法示例。
在下文中一共展示了SAMFileHeader.getProgramRecords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}