// Path: sequence-miner/src/main/java/sequencemining/sequence/Sequence.java
// public class Sequence extends AbstractSequence implements Serializable {
// 	private static final long serialVersionUID = -2766830126344921771L;
// 
// 	/**
// 	 * Constructor
// 	 */
// 	public Sequence() {
// 		this.items = new ArrayList<>();
// 	}
// 
// 	/**
// 	 * Shallow Copy Constructor
// 	 *
// 	 * @param seq
// 	 *            sequence to shallow copy
// 	 */
// 	public Sequence(final Sequence seq) {
// 		this.items = seq.items;
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            a list of items that should be added to the new sequence
// 	 */
// 	public Sequence(final List<Integer> items) {
// 		this.items = new ArrayList<>(items);
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            an array of items that should be added to the new sequence
// 	 */
// 	public Sequence(final Integer... items) {
// 		this.items = new ArrayList<>(Arrays.asList(items));
// 	}
// 
// 	/**
// 	 * Join Constructor
// 	 *
// 	 * @param seqs
// 	 *            two sequences that should be joined
// 	 */
// 	public Sequence(final Sequence seq1, final Sequence seq2) {
// 		this.items = new ArrayList<>(seq1.items);
// 		this.items.addAll(seq2.items);
// 	}
// 
// }


import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.util.LinkedHashMap;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import ca.pfv.spmf.algorithms.sequentialpatterns.goKrimp.AlgoGoKrimp;
import ca.pfv.spmf.algorithms.sequentialpatterns.goKrimp.DataReader;
import sequencemining.sequence.Sequence;
package sequencemining.eval;




public class StatisticalSequenceMining {

	public static void main(final String[] args) throws IOException {

		// Datasets
		final String[] datasets = new String[] { "GAZELLE1" };
		for (int i = 0; i < datasets.length; i++) {
			final File dbPath = new File(
					"/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/Datasets/Paper/" + datasets[i] + ".dat");

			// Run GoKRIMP
			//final File saveFileGoKRIMP = new File(
			//		"/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/GoKrimp/" + datasets[i] + ".txt");
			//mineGoKrimpSequences(dbPath, saveFileGoKRIMP);

			// Run SQS
			final File saveFileSQS = new File(
					"/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/SQS/" + datasets[i] + ".txt");
			mineSQSSequences(dbPath, saveFileSQS, 1);
		}

	}

// Path: sequence-miner/src/main/java/sequencemining/sequence/Sequence.java
// public class Sequence extends AbstractSequence implements Serializable {
// 	private static final long serialVersionUID = -2766830126344921771L;
// 
// 	/**
// 	 * Constructor
// 	 */
// 	public Sequence() {
// 		this.items = new ArrayList<>();
// 	}
// 
// 	/**
// 	 * Shallow Copy Constructor
// 	 *
// 	 * @param seq
// 	 *            sequence to shallow copy
// 	 */
// 	public Sequence(final Sequence seq) {
// 		this.items = seq.items;
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            a list of items that should be added to the new sequence
// 	 */
// 	public Sequence(final List<Integer> items) {
// 		this.items = new ArrayList<>(items);
// 	}
// 
// 	/**
// 	 * Constructor
// 	 *
// 	 * @param items
// 	 *            an array of items that should be added to the new sequence
// 	 */
// 	public Sequence(final Integer... items) {
// 		this.items = new ArrayList<>(Arrays.asList(items));
// 	}
// 
// 	/**
// 	 * Join Constructor
// 	 *
// 	 * @param seqs
// 	 *            two sequences that should be joined
// 	 */
// 	public Sequence(final Sequence seq1, final Sequence seq2) {
// 		this.items = new ArrayList<>(seq1.items);
// 		this.items.addAll(seq2.items);
// 	}
// 
// }


// Path: sequence-miner/src/main/java/sequencemining/eval/StatisticalSequenceMining.java
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.lang.ProcessBuilder.Redirect;
import java.util.LinkedHashMap;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import ca.pfv.spmf.algorithms.sequentialpatterns.goKrimp.AlgoGoKrimp;
import ca.pfv.spmf.algorithms.sequentialpatterns.goKrimp.DataReader;
import sequencemining.sequence.Sequence;

package sequencemining.eval;




public class StatisticalSequenceMining {

	public static void main(final String[] args) throws IOException {

		// Datasets
		final String[] datasets = new String[] { "GAZELLE1" };
		for (int i = 0; i < datasets.length; i++) {
			final File dbPath = new File(
					"/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/Datasets/Paper/" + datasets[i] + ".dat");

			// Run GoKRIMP
			//final File saveFileGoKRIMP = new File(
			//		"/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/GoKrimp/" + datasets[i] + ".txt");
			//mineGoKrimpSequences(dbPath, saveFileGoKRIMP);

			// Run SQS
			final File saveFileSQS = new File(
					"/afs/inf.ed.ac.uk/user/j/jfowkes/Code/Sequences/SQS/" + datasets[i] + ".txt");
			mineSQSSequences(dbPath, saveFileSQS, 1);
		}

	}

	public static LinkedHashMap<Sequence, Double> mineGoKrimpSequences(final File dataset, final File saveFile)