本文整理汇总了Java中htsjdk.samtools.SAMReadGroupRecord.getLibrary方法的典型用法代码示例。如果您正苦于以下问题:Java SAMReadGroupRecord.getLibrary方法的具体用法?Java SAMReadGroupRecord.getLibrary怎么用?Java SAMReadGroupRecord.getLibrary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMReadGroupRecord
的用法示例。
在下文中一共展示了SAMReadGroupRecord.getLibrary方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLibraryName
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/**
* Gets the library name from the header for the record. If the RG tag is not present on
* the record, or the library isn't denoted on the read group, a constant string is
* returned.
*/
public static String getLibraryName(final SAMFileHeader header, final SAMRecord rec) {
final String readGroupId = (String) rec.getAttribute(ReservedTagConstants.READ_GROUP_ID);
if (readGroupId != null) {
final SAMReadGroupRecord rg = header.getReadGroup(readGroupId);
if (rg != null) {
final String libraryName = rg.getLibrary();
if (null != libraryName) return libraryName;
}
}
return UNKNOWN_LIBRARY;
}
示例2: LibraryIdGenerator
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
public LibraryIdGenerator(final SAMFileHeader header) {
this.header = header;
for (final SAMReadGroupRecord readGroup : header.getReadGroups()) {
final String library = readGroup.getLibrary();
DuplicationMetrics metrics = metricsByLibrary.get(library);
if (metrics == null) {
metrics = new DuplicationMetrics();
metrics.LIBRARY = library;
metricsByLibrary.put(library, metrics);
}
}
}
示例3: getLibraryName
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/**
* Gets the library name from the header for the read group id. If the read group id is null
* or the library isn't denoted on the read group, a constant string is
* returned.
*/
public static String getLibraryName(final SAMFileHeader header, String readGroupId) {
if (readGroupId != null) {
final SAMReadGroupRecord rg = header.getReadGroup(readGroupId);
if (rg != null) {
final String libraryName = rg.getLibrary();
if (null != libraryName) return libraryName;
}
}
return "Unknown Library";
}
示例4: PicardAlignment
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
public PicardAlignment(SAMRecord record) {
super();
this.record = record;
this.flags = record.getFlags();
String refName = record.getReferenceName();
Genome genome = GenomeManager.getInstance().getCurrentGenome();
this.chr = genome == null ? refName : genome.getCanonicalChrName(refName);
// SAMRecord is 1 based inclusive. IGV is 0 based exclusive.
this.end = record.getAlignmentEnd(); // might be modified later for soft clipping
this.start = record.getAlignmentStart() - 1; // might be modified later for soft clipping
if (record.getReadPairedFlag()) {
String mateReferenceName = record.getMateReferenceName();
String mateChr = genome == null ? mateReferenceName : genome.getCanonicalChrName(mateReferenceName);
this.setMate(new ReadMate(mateChr,
record.getMateAlignmentStart() - 1,
record.getMateNegativeStrandFlag(),
record.getMateUnmappedFlag()));
}
String keySequence = null;
SAMFileHeader header = record.getHeader();
String flowOrder = null;
if (header != null) {
readGroup = (String) record.getAttribute("RG");
if (readGroup != null) {
SAMReadGroupRecord rgRec = header.getReadGroup(readGroup);
if (rgRec != null) {
this.sample = rgRec.getSample();
this.library = rgRec.getLibrary();
flowOrder = rgRec.getFlowOrder();
keySequence = rgRec.getKeySequence();
}
}
}
Object colorTag = record.getAttribute("YC");
if (colorTag != null) {
try {
color = ColorUtilities.stringToColor(colorTag.toString(), null);
} catch (Exception e) {
log.error("Error interpreting color tag: " + colorTag, e);
}
}
setPairOrientation();
setPairStrands();
createAlignmentBlocks(record.getCigarString(), record.getReadBases(), record.getBaseQualities(),
getFlowSignals(flowOrder, keySequence), flowOrder, this.getFlowSignalsStart());
}
示例5: FingerprintIdDetails
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
public FingerprintIdDetails(final SAMReadGroupRecord rg, final String file) {
this(rg.getPlatformUnit(), file);
this.sample = rg.getSample();
this.library = rg.getLibrary();
}
示例6: getKey
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
@Override
protected String getKey(SAMReadGroupRecord rg) {
return rg.getLibrary();
}
示例7: getLibrary
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/**
* Returns the library associated with the provided read's read group.
*
* @param read read whose library to retrieve
* @param header SAM header containing read groups
* @return the library for the provided read's read group as a String,
* or null if the read has no read group.
*/
public static String getLibrary( final GATKRead read, final SAMFileHeader header ) {
final SAMReadGroupRecord readGroup = getSAMReadGroupRecord(read, header);
return readGroup != null ? readGroup.getLibrary() : null;
}