Making several esoteric arguments in the BQSR @Hidden. Adding basic support for Complete Genomics machine cycle.

This commit is contained in:
Ryan Poplin 2011-09-28 16:17:31 -04:00
parent 1b45f21774
commit 3b73dc89fe
3 changed files with 19 additions and 8 deletions

View File

@ -159,10 +159,11 @@ public class CycleCovariate implements StandardCovariate {
*/ */
// todo -- this should be put into a common place in the code base // todo -- this should be put into a common place in the code base
private static List<String> PACBIO_NAMES = Arrays.asList("PACBIO");
private static List<String> ILLUMINA_NAMES = Arrays.asList("ILLUMINA", "SLX", "SOLEXA"); private static List<String> ILLUMINA_NAMES = Arrays.asList("ILLUMINA", "SLX", "SOLEXA");
private static List<String> SOLID_NAMES = Arrays.asList("SOLID"); private static List<String> SOLID_NAMES = Arrays.asList("SOLID");
private static List<String> LS454_NAMES = Arrays.asList("454"); private static List<String> LS454_NAMES = Arrays.asList("454");
private static List<String> COMPLETE_GENOMICS_NAMES = Arrays.asList("COMPLETE");
private static List<String> PACBIO_NAMES = Arrays.asList("PACBIO");
private static boolean isPlatform(SAMRecord read, List<String> names) { private static boolean isPlatform(SAMRecord read, List<String> names) {
String pl = read.getReadGroup().getPlatform().toUpperCase(); String pl = read.getReadGroup().getPlatform().toUpperCase();
@ -176,11 +177,10 @@ public class CycleCovariate implements StandardCovariate {
public void getValues(SAMRecord read, Comparable[] comparable) { public void getValues(SAMRecord read, Comparable[] comparable) {
//----------------------------- //-----------------------------
// ILLUMINA and SOLID // Illumina, Solid, PacBio, and Complete Genomics
//----------------------------- //-----------------------------
if( isPlatform(read, ILLUMINA_NAMES) || isPlatform(read, SOLID_NAMES) || isPlatform(read, PACBIO_NAMES) || isPlatform(read, COMPLETE_GENOMICS_NAMES) ) {
if( isPlatform(read, ILLUMINA_NAMES) || isPlatform(read, SOLID_NAMES) || isPlatform(read, PACBIO_NAMES)) {
final int init; final int init;
final int increment; final int increment;
if( !read.getReadNegativeStrandFlag() ) { if( !read.getReadNegativeStrandFlag() ) {
@ -222,6 +222,11 @@ public class CycleCovariate implements StandardCovariate {
cycle += increment; cycle += increment;
} }
} }
//-----------------------------
// 454
//-----------------------------
else if ( isPlatform(read, LS454_NAMES) ) { // Some bams have "LS454" and others have just "454" else if ( isPlatform(read, LS454_NAMES) ) { // Some bams have "LS454" and others have just "454"
final int readLength = read.getReadLength(); final int readLength = read.getReadLength();

View File

@ -245,8 +245,7 @@ public class RecalDataManager {
readGroup.setPlatform( RAC.DEFAULT_PLATFORM ); readGroup.setPlatform( RAC.DEFAULT_PLATFORM );
((GATKSAMRecord)read).setReadGroup( readGroup ); ((GATKSAMRecord)read).setReadGroup( readGroup );
} else { } else {
throw new UserException.MalformedBAM(read, "The input .bam file contains reads with no read group. First observed at read with name = " + read.getReadName() + throw new UserException.MalformedBAM(read, "The input .bam file contains reads with no read group. First observed at read with name = " + read.getReadName() );
" Users must set both the default read group using the --default_read_group <String> argument and the default platform using the --default_platform <String> argument." );
} }
} }
@ -271,8 +270,7 @@ public class RecalDataManager {
} }
readGroup.setPlatform( RAC.DEFAULT_PLATFORM ); readGroup.setPlatform( RAC.DEFAULT_PLATFORM );
} else { } else {
throw new UserException.MalformedBAM(read, "The input .bam file contains reads with no platform information. First observed at read with name = " + read.getReadName() + throw new UserException.MalformedBAM(read, "The input .bam file contains reads with no platform information. First observed at read with name = " + read.getReadName() );
" Users must set the default platform using the --default_platform <String> argument." );
} }
} }
} }

View File

@ -26,6 +26,7 @@
package org.broadinstitute.sting.gatk.walkers.recalibration; package org.broadinstitute.sting.gatk.walkers.recalibration;
import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Hidden;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
@ -41,22 +42,29 @@ public class RecalibrationArgumentCollection {
////////////////////////////////// //////////////////////////////////
// Shared Command Line Arguments // Shared Command Line Arguments
////////////////////////////////// //////////////////////////////////
@Hidden
@Argument(fullName="default_read_group", shortName="dRG", required=false, doc="If a read has no read group then default to the provided String.") @Argument(fullName="default_read_group", shortName="dRG", required=false, doc="If a read has no read group then default to the provided String.")
public String DEFAULT_READ_GROUP = null; public String DEFAULT_READ_GROUP = null;
@Hidden
@Argument(fullName="default_platform", shortName="dP", required=false, doc="If a read has no platform then default to the provided String. Valid options are illumina, 454, and solid.") @Argument(fullName="default_platform", shortName="dP", required=false, doc="If a read has no platform then default to the provided String. Valid options are illumina, 454, and solid.")
public String DEFAULT_PLATFORM = null; public String DEFAULT_PLATFORM = null;
@Hidden
@Argument(fullName="force_read_group", shortName="fRG", required=false, doc="If provided, the read group ID of EVERY read will be forced to be the provided String. This is useful to collapse all data into a single read group.") @Argument(fullName="force_read_group", shortName="fRG", required=false, doc="If provided, the read group ID of EVERY read will be forced to be the provided String. This is useful to collapse all data into a single read group.")
public String FORCE_READ_GROUP = null; public String FORCE_READ_GROUP = null;
@Hidden
@Argument(fullName="force_platform", shortName="fP", required=false, doc="If provided, the platform of EVERY read will be forced to be the provided String. Valid options are illumina, 454, and solid.") @Argument(fullName="force_platform", shortName="fP", required=false, doc="If provided, the platform of EVERY read will be forced to be the provided String. Valid options are illumina, 454, and solid.")
public String FORCE_PLATFORM = null; public String FORCE_PLATFORM = null;
@Hidden
@Argument(fullName = "window_size_nqs", shortName="nqs", doc="The window size used by MinimumNQSCovariate for its calculation", required=false) @Argument(fullName = "window_size_nqs", shortName="nqs", doc="The window size used by MinimumNQSCovariate for its calculation", required=false)
public int WINDOW_SIZE = 5; public int WINDOW_SIZE = 5;
/** /**
* This window size tells the module in how big of a neighborhood around the current base it should look for the minimum base quality score. * This window size tells the module in how big of a neighborhood around the current base it should look for the minimum base quality score.
*/ */
@Hidden
@Argument(fullName = "homopolymer_nback", shortName="nback", doc="The number of previous bases to look at in HomopolymerCovariate", required=false) @Argument(fullName = "homopolymer_nback", shortName="nback", doc="The number of previous bases to look at in HomopolymerCovariate", required=false)
public int HOMOPOLYMER_NBACK = 7; public int HOMOPOLYMER_NBACK = 7;
@Hidden
@Argument(fullName = "exception_if_no_tile", shortName="throwTileException", doc="If provided, TileCovariate will throw an exception when no tile can be found. The default behavior is to use tile = -1", required=false) @Argument(fullName = "exception_if_no_tile", shortName="throwTileException", doc="If provided, TileCovariate will throw an exception when no tile can be found. The default behavior is to use tile = -1", required=false)
public boolean EXCEPTION_IF_NO_TILE = false; public boolean EXCEPTION_IF_NO_TILE = false;