public void addPG(SAMFileHeader header, String program, String cmd, String version) { SAMProgramRecord programRecord = header.createProgramRecord(); programRecord.setCommandLine(cmd); programRecord.setProgramName(program); programRecord.setProgramVersion(version); }
/** * Creates a program record (@PG) tag * * @param toolkit the engine * @param walker the walker object (so we can extract the command line) * @param PROGRAM_RECORD_NAME the name for the PG tag * @return a program record for the tool */ public static SAMProgramRecord createProgramRecord(GenomeAnalysisEngine toolkit, Object walker, String PROGRAM_RECORD_NAME) { final SAMProgramRecord programRecord = new SAMProgramRecord(PROGRAM_RECORD_NAME); try { programRecord.setProgramVersion(CommandLineProgram.getVersionNumber()); } catch (MissingResourceException e) { // couldn't care less if the resource is missing... } programRecord.setCommandLine(toolkit.createApproximateCommandLineArgumentString(toolkit, walker)); return programRecord; }
private SAMProgramRecord createProgramRecord() { if ( NO_PG_TAG ) return null; final SAMProgramRecord programRecord = new SAMProgramRecord(PROGRAM_RECORD_NAME); try { programRecord.setProgramVersion(CommandLineProgram.getVersionNumber()); } catch (MissingResourceException e) { // this is left empty on purpose (perhaps Andrey knows why?) } programRecord.setCommandLine(getToolkit().createApproximateCommandLineArgumentString(getToolkit(), this)); return programRecord; }
@Test public void testGetSAMString() { SAMProgramRecord r = new SAMProgramRecord("SW-eIV"); r.setProgramName("telnet"); r.setProgramVersion("0.17-40"); r.setCommandLine("telnet towel.blinkenlights.nl"); Assert.assertEquals("@PG\tID:SW-eIV\tPN:telnet\tVN:0.17-40\tCL:telnet towel.blinkenlights.nl", r.getSAMString()); } }
chainedPgIds.put(existingId, newPgId); final SAMProgramRecord programRecord = new SAMProgramRecord(newPgId); programRecord.setProgramVersion(PROGRAM_GROUP_VERSION); programRecord.setCommandLine(PROGRAM_GROUP_COMMAND_LINE); programRecord.setProgramName(PROGRAM_GROUP_NAME);
chainedPgIds.put(existingId, newPgId); final SAMProgramRecord programRecord = new SAMProgramRecord(newPgId); programRecord.setProgramVersion(PROGRAM_GROUP_VERSION); programRecord.setCommandLine(PROGRAM_GROUP_COMMAND_LINE); programRecord.setProgramName(PROGRAM_GROUP_NAME);
if (PROGRAM_RECORD_ID != null) { prod = new SAMProgramRecord(PROGRAM_RECORD_ID); prod.setProgramVersion(PROGRAM_GROUP_VERSION); prod.setCommandLine(PROGRAM_GROUP_COMMAND_LINE); prod.setProgramName(PROGRAM_GROUP_NAME);
if (PROGRAM_RECORD_ID != null) { prod = new SAMProgramRecord(PROGRAM_RECORD_ID); prod.setProgramVersion(PROGRAM_GROUP_VERSION); prod.setCommandLine(PROGRAM_GROUP_COMMAND_LINE); prod.setProgramName(PROGRAM_GROUP_NAME);
@Override public void initialize() { // initialize sample -> read group map final List<SAMReadGroupRecord> sampleRGs = new ArrayList<SAMReadGroupRecord>(); for ( final String sample : SampleUtils.getUniqueSamplesFromRods(getToolkit(), Arrays.asList(variantCollection.variants.getName())) ) { final SAMReadGroupRecord rg = createRG(sample); sampleRGs.add(rg); sample2RG.put(sample, rg); } // initialize BAM headers header = new SAMFileHeader(); header.setSequenceDictionary(getToolkit().getReferenceDataSource().getReference().getSequenceDictionary()); header.setSortOrder(SAMFileHeader.SortOrder.coordinate); header.setReadGroups(sampleRGs); final SAMProgramRecord programRecord = new SAMProgramRecord(PROGRAM_RECORD_NAME); if ( !NO_PG_TAG ) { programRecord.setProgramVersion(CommandLineProgram.getVersionNumber()); programRecord.setCommandLine(getToolkit().createApproximateCommandLineArgumentString(getToolkit(), this)); } header.setProgramRecords(Arrays.asList(programRecord)); readWriter.setPresorted(false); readWriter.writeHeader(header); halfReadLength = readLength / 2; errorRate = QualityUtils.qualToErrorProb((byte)phredErrorRate); readQuals = new byte[readLength]; Arrays.fill(readQuals, (byte)phredErrorRate); if ( samplingMode == ReadSamplingMode.POISSON ) poissonRandom = new Poisson(readDepth, new MersenneTwister((int)RANDOM_SEED)); }
program.setProgramVersion(PG.getVersion());
if (pg == null) { pg = new SAMProgramRecord("ABRA2"); pg.setProgramVersion(this.version); pg.setCommandLine(cl); pg.setProgramVersion(this.version); pg.setCommandLine(cl); samHeaders[i].addProgramRecord(pg);
programRecord.setProgramVersion(getVersion()); header.addProgramRecord(programRecord);
final SAMProgramRecord program1 = new SAMProgramRecord("0"); program1.setCommandLine("Hi, Mom!"); program1.setProgramVersion("123"); builder1.setProgramRecord(program1); builder1.addFrag("read1", 20, 28833, false); final SAMProgramRecord program2 = new SAMProgramRecord("0"); program2.setCommandLine("Hi, Mom!"); program2.setProgramVersion("123"); builder2.setProgramRecord(program2); builder2.addFrag("read2", 19, 28833, false);
program.setProgramVersion(PG.getVersion());
final SAMProgramRecord program2 = new SAMProgramRecord("0"); program2.setCommandLine("Hi, Dad!"); program2.setProgramVersion("123"); builder2.setProgramRecord(program2); builder2.addFrag("read2", 19, 28833, false);
programRecord.setProgramVersion(getVersion()); header.addProgramRecord(programRecord);