本文整理汇总了Java中htsjdk.samtools.SAMReadGroupRecord.getPlatformUnit方法的典型用法代码示例。如果您正苦于以下问题:Java SAMReadGroupRecord.getPlatformUnit方法的具体用法?Java SAMReadGroupRecord.getPlatformUnit怎么用?Java SAMReadGroupRecord.getPlatformUnit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMReadGroupRecord
的用法示例。
在下文中一共展示了SAMReadGroupRecord.getPlatformUnit方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeReadGroupFile
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
private File makeReadGroupFile(final SAMReadGroupRecord readGroup, final String preExtSuffix) {
String fileName = null;
if (RG_TAG.equalsIgnoreCase("PU")){
fileName = readGroup.getPlatformUnit();
} else if (RG_TAG.equalsIgnoreCase("ID")){
fileName = readGroup.getReadGroupId();
}
if (fileName == null) {
throw new PicardException("The selected RG_TAG: "+RG_TAG+" is not present in the bam header.");
}
fileName = IOUtil.makeFileNameSafe(fileName);
if (preExtSuffix != null) fileName += preExtSuffix;
fileName += COMPRESS_OUTPUTS_PER_RG ? ".fastq.gz" : ".fastq";
final File result = (OUTPUT_DIR != null)
? new File(OUTPUT_DIR, fileName)
: new File(fileName);
IOUtil.assertFileIsWritable(result);
return result;
}
示例2: testGetReadGroupWithArguments
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
@Test
public void testGetReadGroupWithArguments() throws Exception {
// setting expected RG
final SAMReadGroupRecord expected = new SAMReadGroupRecord("RGID");
expected.setProgramGroup("ReadTools");
expected.setSample("sampleName");
// setting args
final ReadGroupArgumentCollection rgargs = new ReadGroupArgumentCollection();
// starting setting params
expected.setLibrary("LB");
rgargs.readGroupLibrary = "LB";
expected.setPlatform("ILLUMINA");
rgargs.readGroupPlatform = SAMReadGroupRecord.PlatformValue.ILLUMINA;
expected.setPlatformUnit("PU");
rgargs.readGroupPlatformUnit = expected.getPlatformUnit();
expected.setSequencingCenter("CN");
rgargs.readGroupSequencingCenter = expected.getSequencingCenter();
final Iso8601Date date = new Iso8601Date("2007-11-03");
expected.setRunDate(date);
rgargs.readGroupRunDate = date;
expected.setPredictedMedianInsertSize(100);
rgargs.readGroupPredictedInsertSize = expected.getPredictedMedianInsertSize();
expected.setPlatformModel("PM");
rgargs.readGroupPlatformModel = expected.getPlatformModel();
// testing
Assert.assertEquals(rgargs
.getReadGroupFromArguments(expected.getReadGroupId(), expected.getSample()),
expected);
}
示例3: readGroupValueFromRG
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/**
* If the sample has a PU tag annotation, return that. If not, return the
* read group id.
*/
private String readGroupValueFromRG(final SAMReadGroupRecord rg) {
final String platformUnit = rg.getPlatformUnit();
return platformUnit == null ? rg.getId() : platformUnit;
}
示例4: 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();
}
示例5: getKey
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
@Override
protected String getKey(SAMReadGroupRecord rg) {
return rg.getPlatformUnit();
}
示例6: getID
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/**
* Get the ID of the readgroup.
*/
public static String getID(final SAMReadGroupRecord rg) {
final String pu = rg.getPlatformUnit();
return pu == null ? rg.getId() : pu;
}
示例7: getPlatformUnit
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/**
* Returns the platform unit associated with the provided read's read group.
*
* @param read read whose platform unit to retrieve
* @param header SAM header containing read groups
* @return the platform unit for the provided read's read group as a String,
* or null if the read has no read group.
*/
public static String getPlatformUnit( final GATKRead read, final SAMFileHeader header ) {
final SAMReadGroupRecord readGroup = getSAMReadGroupRecord(read, header);
return readGroup != null ? readGroup.getPlatformUnit() : null;
}