Skip to content

Commit

Permalink
Help message, classifier class checking, and some feature computer ex…
Browse files Browse the repository at this point in the history
…clusion
  • Loading branch information
abrari committed Jul 27, 2015
1 parent addff66 commit fdd1f71
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 11 deletions.
30 changes: 30 additions & 0 deletions src/gpsnp/app/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ public static void callSNPs(File inputBAM,

public static void main(String[] argv) {

if (argv.length == 0) {
printHelp();
return;
}

ArgParser args = new ArgParser(argv);

String referencePath;
Expand All @@ -181,6 +186,16 @@ public static void main(String[] argv) {
classifierClass = getRequiredStringArg(args, "-C", "Missing required argument for classifier class, use -C");
} catch (Exception e1) {
System.err.println(e1.getMessage());
System.out.println("---");
printHelp();
return;
}

// Check classifier class exists
try {
Class.forName("gpsnp.classifier." + classifierClass);
} catch (ClassNotFoundException e) {
System.err.println("Invalid classifier class: " + classifierClass + "\nUse either SeSpRuleClassifier or PrRcRuleClassifier");
return;
}

Expand Down Expand Up @@ -247,4 +262,19 @@ public static void main(String[] argv) {
}
}

public static void printHelp() {
System.out.println("SNP calling program version 0.1");
System.out.println("Required arguments:");
System.out.println(" -R reference file path (.fasta)");
System.out.println(" -B input BAM file (.bam)");
System.out.println(" -V output variant file (.vcf)");
System.out.println(" -C classifier class (SeSpRuleClassifier or PrRcRuleClassifier)");
System.out.println("Optional arguments:");
System.out.println(" -t [4] number of threads to run");
System.out.println(" -q [1.0] minimum Phred-scaled quality to report variant");
System.out.println(" -d [2] minimum total depth to examine for variant");
System.out.println(" -v [2] minimum reads with variant allele required for variant calling");
System.out.println(" -phred33 the input BAM is in Phred+33 scoring");
}

}
23 changes: 12 additions & 11 deletions src/gpsnp/featureComputer/FeatureList.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,24 @@ public static List<FeatureComputer> getFeatures() {
return computers;
}

// Exclude features that don't exists in the rule set
public static List<FeatureComputer> getFeatures(boolean isPhred33) {
List<FeatureComputer> computers = new ArrayList<FeatureComputer>();
computers.add(new TsTvComputer());
// computers.add(new TsTvComputer());
computers.add(new MaxQualAlleleComputer(isPhred33));
computers.add(new MeanQualAlleleComputer(isPhred33));
computers.add(new RelativeDistanceComputer());
// computers.add(new RelativeDistanceComputer());
computers.add(new DepthComputer());
computers.add(new AlignmentQualityComputer());
computers.add(new ErrorProbComputer());
computers.add(new DinucRepeatCounter());
computers.add(new StrandBiasComputer());
computers.add(new AreaMismatchComputer());
computers.add(new HomopolymerRunComputer());
computers.add(new NucDiversityComputer());
computers.add(new MismatchComputer());
// computers.add(new AlignmentQualityComputer());
// computers.add(new ErrorProbComputer());
// computers.add(new DinucRepeatCounter());
// computers.add(new StrandBiasComputer());
// computers.add(new AreaMismatchComputer());
// computers.add(new HomopolymerRunComputer());
// computers.add(new NucDiversityComputer());
// computers.add(new MismatchComputer());
computers.add(new AlleleBalanceComputer());
computers.add(new NearbyQualComputer(isPhred33));
// computers.add(new NearbyQualComputer(isPhred33));

return computers;
}
Expand Down

0 comments on commit fdd1f71

Please sign in to comment.