All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opencb.biodata.tools.alignment.stats.SequenceKmers Maven / Gradle / Ivy

There is a newer version: 3.3.0
Show newest version
/*
 * 
 *
 */

package org.opencb.biodata.tools.alignment.stats;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class SequenceKmers {

	public int kvalue;
	public Map kmersMap;

	public SequenceKmers() {
		this(0);
	}

	public SequenceKmers(int k) {
		kvalue = k;
		kmersMap = new HashMap<>();
	}

	public int getKvalue() {
		return kvalue;
	}

	public void setKvalue(int k) {
		kvalue = k;
	}

	public String toJSON() throws IOException {
		ObjectWriter objectWriter = new ObjectMapper().writer();
		return objectWriter.writeValueAsString(this);
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder("SequenceKmers{");
		sb.append("kvalue=").append(kvalue);
		sb.append(", kmersMap=").append(kmersMap);
		sb.append('}');
		return sb.toString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy