use of cz1.util.ArgsEngine in project polyGembler by c-zhou.
the class Anchor1 method setParameters.
@Override
public void setParameters(String[] args) {
// TODO Auto-generated method stub
if (myArgsEngine == null) {
myArgsEngine = new ArgsEngine();
myArgsEngine.add("-s", "--subject", true);
myArgsEngine.add("-q", "--query", true);
myArgsEngine.add("-b", "--blast", true);
myArgsEngine.add("-k", "--kmer-size", true);
myArgsEngine.add("-i", "--min-identity", true);
myArgsEngine.add("-f", "--min-fraction", true);
myArgsEngine.add("-di", "--diff-identity", true);
myArgsEngine.add("-df", "--diff-fraction", true);
myArgsEngine.add("-o", "--out-prefix", true);
myArgsEngine.parse(args);
}
if (myArgsEngine.getBoolean("-s")) {
this.subject_file = myArgsEngine.getString("-s");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the subject/reference file.");
}
if (myArgsEngine.getBoolean("-q")) {
this.query_file = myArgsEngine.getString("-q");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the query file.");
}
if (myArgsEngine.getBoolean("-k")) {
this.kmer_size = Integer.parseInt(myArgsEngine.getString("-k"));
} else {
printUsage();
throw new IllegalArgumentException("Please specify the kmer size of contig construction.");
}
if (myArgsEngine.getBoolean("-b")) {
this.blast_out = myArgsEngine.getString("-b");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the BLAST file.");
}
if (myArgsEngine.getBoolean("-o")) {
this.out_prefix = myArgsEngine.getString("-o");
if (new File(out_prefix + ".fa").exists() || new File(out_prefix + ".map").exists() || new File(out_prefix + "_unplaced.map").exists()) {
throw new RuntimeException("Output files exist. Please specify a different name.");
}
} else {
printUsage();
throw new IllegalArgumentException("Please specify the prefix of output files.");
}
if (myArgsEngine.getBoolean("-i")) {
this.min_ident = 100 * Math.min(1.0, Double.parseDouble(myArgsEngine.getString("-i")));
}
if (myArgsEngine.getBoolean("-f")) {
this.min_frac = Double.parseDouble(myArgsEngine.getString("-f"));
}
if (myArgsEngine.getBoolean("-di")) {
this.diff_ident = Double.parseDouble(myArgsEngine.getString("-di"));
}
if (myArgsEngine.getBoolean("-df")) {
this.diff_frac = Double.parseDouble(myArgsEngine.getString("-df"));
}
}
use of cz1.util.ArgsEngine in project polyGembler by c-zhou.
the class Consensus method setParameters.
@Override
public void setParameters(String[] args) {
// TODO Auto-generated method stub
if (myArgsEngine == null) {
myArgsEngine = new ArgsEngine();
myArgsEngine.add("-s", "--sequence", true);
myArgsEngine.add("-m", "--map", true);
myArgsEngine.add("-as", "--block-size", true);
myArgsEngine.add("-bs", "--batch-size", true);
myArgsEngine.add("-t", "--threads", true);
myArgsEngine.add("-l", "--min-size", true);
myArgsEngine.add("-o", "--out", true);
myArgsEngine.addWildOptions(bam_lib, true);
myArgsEngine.addWildOptions(ins_lib, true);
myArgsEngine.addWildOptions(w_lib, true);
myArgsEngine.parse(args);
}
if (myArgsEngine.getBoolean("-s")) {
this.sequence_file = myArgsEngine.getString("-s");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the contig file.");
}
if (myArgsEngine.getBoolean("-m")) {
this.map_file = myArgsEngine.getString("-m");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the map file.");
}
if (myArgsEngine.getBoolean("-as")) {
this.min_as = Integer.parseInt(myArgsEngine.getString("-as"));
}
if (myArgsEngine.getBoolean("-bs")) {
this.batch_size = Integer.parseInt(myArgsEngine.getString("-bs"));
}
if (myArgsEngine.getBoolean("-t")) {
this.THREADS = Integer.parseInt(myArgsEngine.getString("-t"));
}
if (myArgsEngine.getBoolean("-l")) {
this.min_size = Integer.parseInt(myArgsEngine.getString("-l"));
}
if (myArgsEngine.getBoolean("-o")) {
this.out_prefix = myArgsEngine.getString("-o");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the output file.");
}
this.parseDataLibrary(args);
}
use of cz1.util.ArgsEngine in project polyGembler by c-zhou.
the class SamFileSplit method setParameters.
@Override
public void setParameters(String[] args) {
// TODO Auto-generated method stub
if (args.length == 0) {
printUsage();
throw new IllegalArgumentException("\n\nPlease use the above arguments/options.\n\n");
}
if (myArgsEngine == null) {
myArgsEngine = new ArgsEngine();
myArgsEngine.add("-i", "--input-dir", true);
myArgsEngine.add("-b", "--bed-dir", true);
myArgsEngine.add("-t", "--threads", true);
myArgsEngine.add("-o", "--prefix", true);
myArgsEngine.parse(args);
}
if (myArgsEngine.getBoolean("-i")) {
bam_in = myArgsEngine.getString("-i");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the location of your BAM files.");
}
if (myArgsEngine.getBoolean("-b")) {
bed_in = myArgsEngine.getString("-b");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the location of your BED files.");
}
if (myArgsEngine.getBoolean("-t")) {
THREADS = Integer.parseInt(myArgsEngine.getString("-t"));
}
if (myArgsEngine.getBoolean("-o")) {
bam_out = myArgsEngine.getString("-o");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the location of your output BAM files.");
}
}
use of cz1.util.ArgsEngine in project polyGembler by c-zhou.
the class SamToTaxa method setParameters.
@Override
public void setParameters(String[] args) {
// TODO Auto-generated method stub
if (args.length == 0) {
printUsage();
throw new IllegalArgumentException("\n\nPlease use the above arguments/options.\n\n");
}
if (myArgsEngine == null) {
myArgsEngine = new ArgsEngine();
myArgsEngine.add("-i", "--index-file", true);
myArgsEngine.add("-t", "--threads", true);
myArgsEngine.add("-o", "--prefix", true);
myArgsEngine.add("-s", "--sam-file", true);
myArgsEngine.add("-S", "--sorted", false);
myArgsEngine.add("-x", "--max-coverage", true);
myArgsEngine.parse(args);
}
if (myArgsEngine.getBoolean("-s")) {
mySamFileName = myArgsEngine.getString("-s");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the name of your SAM/BAM file.");
}
if (myArgsEngine.getBoolean("-i")) {
myIndexFileName = myArgsEngine.getString("-i");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the index your FASTQ file.");
}
if (myArgsEngine.getBoolean("-S")) {
mySamIsSorted = true;
}
if (myArgsEngine.getBoolean("-t")) {
THREADS = Integer.parseInt(myArgsEngine.getString("-t"));
}
if (myArgsEngine.getBoolean("-o")) {
myOutputDir = myArgsEngine.getString("-o");
}
if (myArgsEngine.getBoolean("-x")) {
maxCov = Long.parseLong(myArgsEngine.getString("-x"));
}
this.makeOutputDir();
}
use of cz1.util.ArgsEngine in project polyGembler by c-zhou.
the class TagSequenceToFastq method setParameters.
@Override
public void setParameters(String[] args) {
// TODO Auto-generated method stub
if (args.length == 0) {
printUsage();
throw new IllegalArgumentException("\n\nPlease use the above arguments/options.\n\n");
}
if (myArgsEngine == null) {
myArgsEngine = new ArgsEngine();
myArgsEngine.add("-i", "--input-tag", true);
myArgsEngine.add("-t", "--threads", true);
myArgsEngine.add("-o", "--prefix", true);
myArgsEngine.parse(args);
}
if (myArgsEngine.getBoolean("-i")) {
myInputDir = myArgsEngine.getString("-i");
} else {
printUsage();
throw new IllegalArgumentException("Please specify the location of your FASTQ files.");
}
if (myArgsEngine.getBoolean("-t")) {
THREADS = Integer.parseInt(myArgsEngine.getString("-t"));
}
if (myArgsEngine.getBoolean("-o")) {
myOutputDir = myArgsEngine.getString("-o");
}
Utils.makeOutputDir(this.myOutputDir);
}
Aggregations