Skip to content

Commit

Permalink
Added a catch to skip mpileup lines with no sample info.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAustinNix authored and DavidAustinNix committed Feb 1, 2017
1 parent e0b3764 commit 8e1bdd6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Source/edu/utah/seq/parsers/mpileup/EstimateErrorRates.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ private void parse() {
if (ml.getChr() == null) continue;
if (outCounts != null) saveCounts(ml);

//merge sample counts
//merge sample counts?
MpileupSample[] toMerge = ml.getSamples();
if (toMerge == null || toMerge.length == 0) {
workingSamples.clear();
continue;
}

if (samplesToProcess != null){
MpileupSample[] sub = new MpileupSample[samplesToProcess.length];
Expand All @@ -134,7 +138,8 @@ private void parse() {
}
toMerge = sub;
}
MpileupSample sample = MpileupSample.mergeSampleCounts(toMerge);
MpileupSample sample = toMerge[0];
if (toMerge.length > 1) sample = MpileupSample.mergeSampleCounts(toMerge);

//check quality
checkQuality(sample);
Expand Down Expand Up @@ -167,6 +172,7 @@ private void parse() {

}catch (Exception e){
e.printStackTrace();
Misc.printErrAndExit("\nProblem paring mpileup file! Aborting."+mpileupFile);
}

}
Expand Down Expand Up @@ -367,7 +373,7 @@ public static void main(String[] args) {
public static void printDocs(){
System.out.println("\n" +
"**************************************************************************************\n" +
"** Estimate Error Rates: Jan 2016 **\n" +
"** Estimate Error Rates: Jan 2017 **\n" +
"**************************************************************************************\n" +
"EER scans an mpileup file looking for short windows of adjacent bps (default 7) where\n"+
"1) each base exceeds a minimum read depth of high quality bases (>100)\n"+
Expand Down Expand Up @@ -395,9 +401,9 @@ public static void printDocs(){
"-s Comma delimited list (zero is 1st sample, no spaces) of sample indexes to merge,\n"+
" defaults to all.\n"+
"-c File path to save a count table of parsed observations, defaults to none.\n"+
"-r Full path to R (version 3+) loaded with DESeq2, samr, and gplots defaults to\n"+
" '/usr/bin/R' file, see http://www.bioconductor.org . Type 'library(DESeq2);\n"+
" library(samr); library(gplots)' in R to see if they are installed. \n"+
//"-r Full path to R (version 3+) loaded with DESeq2, samr, and gplots defaults to\n"+
//" '/usr/bin/R' file, see http://www.bioconductor.org . Type 'library(DESeq2);\n"+
//" library(samr); library(gplots)' in R to see if they are installed. \n"+

"\nExample: java -Xmx4G -jar pathToUSeq/Apps/EstimateErrorRates -m normExo.mpileup.gz\n" +
" -r 200 -i 0.15 -f 2 -s 0,3,4 -c countTable.txt.gz\n" +
Expand Down

0 comments on commit 8e1bdd6

Please sign in to comment.