TableRecalibration now puts the full list of walker arguments into the PG tag of the bam file it creates. Thanks Matt and Eric. Also, the default nback for the HomopolymerCovariate is 8, down from 10.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2339 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
rpoplin 2009-12-12 17:29:41 +00:00
parent 014013630f
commit 78e94b5a84
3 changed files with 19 additions and 7 deletions

View File

@ -40,7 +40,7 @@ import net.sf.samtools.SAMRecord;
public class HomopolymerCovariate implements ExperimentalCovariate {
int numBack = 10;
int numBack = 8;
// Initialize any member variables using the command-line arguments passed to the walkers
public void initialize( final RecalibrationArgumentCollection RAC ) {

View File

@ -58,7 +58,7 @@ public class RecalibrationArgumentCollection {
@Argument(fullName = "window_size_nqs", shortName="nqs", doc="The window size used by MinimumNQSCovariate for its calculation", required=false)
public int WINDOW_SIZE = 5;
@Argument(fullName = "homopolymer_nback", shortName="nback", doc="The number of previous bases to look at in HomopolymerCovariate", required=false)
public int HOMOPOLYMER_NBACK = 10;
public int HOMOPOLYMER_NBACK = 8;
public boolean checkSolidRecalMode() {
return ( SOLID_RECAL_MODE.equalsIgnoreCase("DO_NOTHING") || SOLID_RECAL_MODE.equalsIgnoreCase("SET_Q_ZERO") ||

View File

@ -6,8 +6,7 @@ import org.broadinstitute.sting.gatk.walkers.WalkerName;
import org.broadinstitute.sting.gatk.walkers.Requires;
import org.broadinstitute.sting.gatk.walkers.DataSource;
import org.broadinstitute.sting.gatk.datasources.simpleDataSources.ReferenceOrderedDataSource;
import org.broadinstitute.sting.utils.cmdLine.Argument;
import org.broadinstitute.sting.utils.cmdLine.ArgumentCollection;
import org.broadinstitute.sting.utils.cmdLine.*;
import org.broadinstitute.sting.utils.*;
import java.util.ArrayList;
@ -16,6 +15,7 @@ import java.util.Random;
import java.util.regex.Pattern;
import java.io.File;
import java.io.FileNotFoundException;
import java.lang.reflect.Field;
/*
* Copyright (c) 2009 The Broad Institute
@ -94,7 +94,7 @@ public class TableRecalibrationWalker extends ReadWalker<SAMRecord, SAMFileWrite
private static final Pattern COMMENT_PATTERN = Pattern.compile("^#.*");
private static final Pattern OLD_RECALIBRATOR_HEADER = Pattern.compile("^rg,.*");
private static final Pattern COVARIATE_PATTERN = Pattern.compile("^ReadGroup,QualityScore,.*");
private static final String versionString = "v2.1.0"; // Major version, minor version, and build number
private static final String versionString = "v2.1.1"; // Major version, minor version, and build number
private SAMFileWriter OUTPUT_BAM = null;// The File Writer that will write out the recalibrated bam
private Random coinFlip; // Random number generator is used to remove reference bias in solid bams
@ -229,13 +229,25 @@ public class TableRecalibrationWalker extends ReadWalker<SAMRecord, SAMFileWrite
// Take the header of the input SAM file and tweak it by adding in a new programRecord with the version number and list of covariates that were used
SAMFileHeader header = getToolkit().getSAMFileHeader().clone();
if( !NO_PG_TAG ) {
SAMProgramRecord programRecord = new SAMProgramRecord( "TableRecalibrationWalker" );
SAMProgramRecord programRecord = new SAMProgramRecord( "GATK TableRecalibration" );
programRecord.setProgramVersion( versionString );
String commandLineString = "Covariates used: ";
String commandLineString = "Covariates used = [";
for( Covariate cov : requestedCovariates ) {
commandLineString += cov.getClass().getSimpleName() + ", ";
}
commandLineString = commandLineString.substring(0, commandLineString.length() - 2); // trim off the trailing comma
commandLineString += "] ";
// Add all of the arguments from the recalibraiton argument collection to the command line string
Field[] fields = RAC.getClass().getFields();
for( Field field : fields ) {
ArgumentTypeDescriptor atd = ArgumentTypeDescriptor.create(field.getType());
List<ArgumentDefinition> adList = atd.createArgumentDefinitions(new ArgumentSource(field.getType(), field));
for( ArgumentDefinition ad : adList ) {
commandLineString += (ad.fullName + "=" + JVMUtils.getFieldValue(field, RAC) + ", ");
}
}
commandLineString += "pQ = " + PRESERVE_QSCORES_LESS_THAN + ", ";
commandLineString += "smoothing = " + SMOOTHING;
programRecord.setCommandLine( commandLineString );
header.addProgramRecord( programRecord );
}