GenomeAnalysisTK: better documentation of validation option.
AlleleFrequencyWalker: output the last reference interval if it's left hanging open. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@258 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
816e768a74
commit
25ace306b9
|
|
@ -98,7 +98,7 @@ public class GenomeAnalysisTK extends CommandLineProgram {
|
|||
protected void setupArgs() {
|
||||
m_parser.addRequiredArg("input_file", "I", "SAM or BAM file", "INPUT_FILE");
|
||||
m_parser.addOptionalArg("maximum_reads", "M", "Maximum number of reads to process before exiting", "MAX_READS_ARG");
|
||||
m_parser.addOptionalArg("validation_strictness", "S", "How strict should we be with validation", "STRICTNESS_ARG");
|
||||
m_parser.addOptionalArg("validation_strictness", "S", "How strict should we be with validation (lenient|silent|strict)", "STRICTNESS_ARG");
|
||||
m_parser.addOptionalArg("reference_sequence", "R", "Reference sequence file", "REF_FILE_ARG");
|
||||
m_parser.addOptionalArg("genome_region", "L", "Genome region to operation on: from chr:start-end", "REGION_STR");
|
||||
m_parser.addRequiredArg("analysis_type", "T", "Type of analysis to run", "Analysis_Name");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.io.PrintStream;
|
|||
public class AlleleFrequencyWalker extends LocusWalker<AlleleFrequencyEstimate, String>
|
||||
{
|
||||
@Argument public int N;
|
||||
@Argument public int DOWNSAMPLE;
|
||||
@Argument(required=false,defaultValue="0") public int DOWNSAMPLE;
|
||||
@Argument public String GFF_OUTPUT_FILE;
|
||||
|
||||
protected static Logger logger = Logger.getLogger(AlleleFrequencyWalker.class);
|
||||
|
|
@ -32,6 +32,18 @@ public class AlleleFrequencyWalker extends LocusWalker<AlleleFrequencyEstimate,
|
|||
String bases = getBases(context);
|
||||
double quals[][] = getOneBaseQuals(context);
|
||||
|
||||
/*
|
||||
// DEBUG: print the data for a read
|
||||
{
|
||||
List<SAMRecord> reads = context.getReads();
|
||||
for (int i = 0; i < reads.size(); i++)
|
||||
{
|
||||
String cigar = reads.get(i).getCigarString();
|
||||
System.out.println("DEBUG " + cigar);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
logger.debug(String.format("In alleleFrequnecy walker: N=%d, d=%d", N, DOWNSAMPLE));
|
||||
|
||||
if ((DOWNSAMPLE != 0) && (DOWNSAMPLE < bases.length()))
|
||||
|
|
@ -99,7 +111,8 @@ public class AlleleFrequencyWalker extends LocusWalker<AlleleFrequencyEstimate,
|
|||
return alleleFreq;
|
||||
}
|
||||
|
||||
static public String getBases (LocusContext context) {
|
||||
static public String getBases (LocusContext context)
|
||||
{
|
||||
// Convert bases to CharArray
|
||||
int numReads = context.getReads().size(); //numReads();
|
||||
char[] bases = new char[numReads];
|
||||
|
|
@ -115,7 +128,8 @@ public class AlleleFrequencyWalker extends LocusWalker<AlleleFrequencyEstimate,
|
|||
return new String(bases);
|
||||
}
|
||||
|
||||
static public double[][] getOneBaseQuals (LocusContext context) {
|
||||
static public double[][] getOneBaseQuals (LocusContext context)
|
||||
{
|
||||
int numReads = context.getReads().size(); //numReads();
|
||||
double[][] quals = new double[numReads][4];
|
||||
|
||||
|
|
@ -472,6 +486,27 @@ public class AlleleFrequencyWalker extends LocusWalker<AlleleFrequencyEstimate,
|
|||
|
||||
public void onTraversalDone(String result)
|
||||
{
|
||||
if (inside_confident_ref_interval)
|
||||
{
|
||||
// if we have a confident reference interval still hanging open, close it.
|
||||
String tokens[] = confident_ref_interval_start.split(":");
|
||||
String contig = tokens[0];
|
||||
int start = Integer.parseInt(tokens[1]);
|
||||
int end = last_position_considered;
|
||||
|
||||
double lod = confident_ref_interval_LOD_sum / confident_ref_interval_length;
|
||||
|
||||
output.format("%s\tCALLER\tREFERENCE\t%d\t%d\t%f\t.\t.\tLENGTH %d\n",
|
||||
contig,
|
||||
start,
|
||||
end,
|
||||
lod,
|
||||
(int)(confident_ref_interval_length));
|
||||
|
||||
inside_confident_ref_interval = false;
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
this.output.flush();
|
||||
|
|
|
|||
Loading…
Reference in New Issue