/usr/share/doc/libbiojava-java-demos/examples/ssaha/CreateDNAFastaHashTableCompact.java is in libbiojava-java-demos 1:1.7.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | package ssaha;
import java.io.*;
import java.util.*;
import org.biojava.bio.*;
import org.biojava.bio.symbol.*;
import org.biojava.bio.seq.*;
import org.biojava.bio.seq.db.*;
import org.biojava.bio.seq.io.*;
import org.biojava.bio.program.ssaha.*;
/**
* Build a SSAHAj hash table
*
* @author Thomas Down
*/
public class CreateDNAFastaHashTableCompact {
public static void printUsage() {
System.err.println("Usage: java ssaha.CreateDNAFastaHashTable [<options>] hashfile.store seq1.fa [seq2.fa ...]");
System.err.println("Options are: ");
System.err.println(" -wordSize [default 10]");
System.err.println(" -stepSize [default 1]");
System.err.println(" -threshold [default 20000]");
}
public static void main(String[] args)
throws Exception {
File dataStoreFile = null;
int wordSize = 10;
int stepSize = 1;
int threshold = 20000;
List seqFiles = new ArrayList();
for (int i = 0; i < args.length; i++) {
if (args[i].charAt(0) == '-') {
if ("-threshold".equals(args[i])) {
threshold = Integer.parseInt(args[++i]);
} else if ("-wordSize".equals(args[i])) {
wordSize = Integer.parseInt(args[++i]);
} else if ("-stepSize".equals(args[i])) {
stepSize = Integer.parseInt(args[++i]);
} else {
System.err.println("Unknown option " + args[i]);
printUsage();
return;
}
} else {
if (dataStoreFile == null) {
dataStoreFile = new File(args[i]);
} else {
seqFiles.add(new File(args[i]));
}
}
}
if (dataStoreFile == null || seqFiles.size() == 0) {
printUsage();
return;
}
SequenceStreamer streamer = new SequenceStreamer.FileStreamer(
SeqIOTools.getSequenceFormat(
SeqIOTools.guessFileType((File) seqFiles.get(0))
),
DNATools.getDNA().getTokenization("token"),
seqFiles
);
DataStore ds = new CompactedDataStoreFactory().buildDataStore(
dataStoreFile,
streamer,
new DNANoAmbPack((byte) -1),
wordSize,
stepSize,
threshold
);
}
}
|