本文整理汇总了Java中htsjdk.samtools.SAMReadGroupRecord.setPlatformModel方法的典型用法代码示例。如果您正苦于以下问题:Java SAMReadGroupRecord.setPlatformModel方法的具体用法?Java SAMReadGroupRecord.setPlatformModel怎么用?Java SAMReadGroupRecord.setPlatformModel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.samtools.SAMReadGroupRecord
的用法示例。
在下文中一共展示了SAMReadGroupRecord.setPlatformModel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSamFileHeader
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/** Creates a simple header with the values provided on the command line. */
public SAMFileHeader createSamFileHeader() {
final SAMReadGroupRecord rgroup = new SAMReadGroupRecord(this.READ_GROUP_NAME);
rgroup.setSample(this.SAMPLE_NAME);
if (this.LIBRARY_NAME != null) rgroup.setLibrary(this.LIBRARY_NAME);
if (this.PLATFORM != null) rgroup.setPlatform(this.PLATFORM);
if (this.PLATFORM_UNIT != null) rgroup.setPlatformUnit(this.PLATFORM_UNIT);
if (this.SEQUENCING_CENTER != null) rgroup.setSequencingCenter(SEQUENCING_CENTER);
if (this.PREDICTED_INSERT_SIZE != null) rgroup.setPredictedMedianInsertSize(PREDICTED_INSERT_SIZE);
if (this.DESCRIPTION != null) rgroup.setDescription(this.DESCRIPTION);
if (this.RUN_DATE != null) rgroup.setRunDate(this.RUN_DATE);
if (this.PLATFORM_MODEL != null) rgroup.setPlatformModel(this.PLATFORM_MODEL);
if (this.PROGRAM_GROUP != null) rgroup.setProgramGroup(this.PROGRAM_GROUP);
final SAMFileHeader header = new SAMFileHeader();
header.addReadGroup(rgroup);
for (final String comment : COMMENT) {
header.addComment(comment);
}
header.setSortOrder(this.SORT_ORDER);
return header ;
}
示例2: getReadGroupFromArguments
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
/**
* Gets a basic Read Group from the arguments.
*
* Note: the program group is set to {@link RTHelpConstants#PROGRAM_NAME}.
*
*/
public SAMReadGroupRecord getReadGroupFromArguments(final String id, final String sampleName) {
final SAMReadGroupRecord rg = new SAMReadGroupRecord(id);
rg.setProgramGroup(RTHelpConstants.PROGRAM_NAME);
rg.setSample(sampleName);
// the program group is the one in the project properties
rg.setProgramGroup(RTHelpConstants.PROGRAM_NAME);
if (readGroupLibrary != null) {
rg.setLibrary(readGroupLibrary);
}
if (readGroupPlatform != null) {
rg.setPlatform(readGroupPlatform.toString());
}
if (readGroupPlatformUnit != null) {
rg.setPlatformUnit(readGroupPlatformUnit);
}
if (readGroupSequencingCenter != null) {
rg.setSequencingCenter(readGroupSequencingCenter);
}
if (readGroupRunDate != null) {
rg.setRunDate(readGroupRunDate);
}
if (readGroupPredictedInsertSize != null) {
rg.setPredictedMedianInsertSize(readGroupPredictedInsertSize);
}
if (readGroupPlatformModel != null) {
rg.setPlatformModel(readGroupPlatformModel);
}
// return it
return rg;
}
示例3: 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);
}
示例4: doWork
import htsjdk.samtools.SAMReadGroupRecord; //导入方法依赖的package包/类
protected int doWork() {
IOUtil.assertInputIsValid(INPUT);
IOUtil.assertFileIsWritable(OUTPUT);
final SamReader in = SamReaderFactory.makeDefault()
.referenceSequence(REFERENCE_SEQUENCE)
.open(SamInputResource.of(INPUT));
// create the read-group we'll be using
final SAMReadGroupRecord rg = new SAMReadGroupRecord(RGID);
rg.setLibrary(RGLB);
rg.setPlatform(RGPL);
rg.setSample(RGSM);
rg.setPlatformUnit(RGPU);
if (RGCN != null) rg.setSequencingCenter(RGCN);
if (RGDS != null) rg.setDescription(RGDS);
if (RGDT != null) rg.setRunDate(RGDT);
if (RGPI != null) rg.setPredictedMedianInsertSize(RGPI);
if (RGPG != null) rg.setProgramGroup(RGPG);
if (RGPM != null) rg.setPlatformModel(RGPM);
if (RGKS != null) rg.setKeySequence(RGKS);
if (RGFO != null) rg.setFlowOrder(RGFO);
log.info(String.format("Created read-group ID=%s PL=%s LB=%s SM=%s%n", rg.getId(), rg.getPlatform(), rg.getLibrary(), rg.getSample()));
// create the new header and output file
final SAMFileHeader inHeader = in.getFileHeader();
final SAMFileHeader outHeader = inHeader.clone();
outHeader.setReadGroups(Collections.singletonList(rg));
if (SORT_ORDER != null) outHeader.setSortOrder(SORT_ORDER);
final SAMFileWriter outWriter = new SAMFileWriterFactory().makeSAMOrBAMWriter(outHeader,
outHeader.getSortOrder() == inHeader.getSortOrder(),
OUTPUT);
final ProgressLogger progress = new ProgressLogger(log);
for (final SAMRecord read : in) {
read.setAttribute(SAMTag.RG.name(), RGID);
outWriter.addAlignment(read);
progress.record(read);
}
// cleanup
CloserUtil.close(in);
outWriter.close();
return 0;
}