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

org.biopax.paxtools.pattern.miner.CustomFormat Maven / Gradle / Ivy

Go to download

BioPAX Pattern Search library. Also, converts BioPAX model to SIF (simple binary interactions) text format.

There is a newer version: 6.0.0
Show newest version
package org.biopax.paxtools.pattern.miner;

/**
 * Used for customizing the columns in the SIF text output.
 * @author Ozgun Babur
 */
public class CustomFormat implements SIFToText
{
	/**
	 * Value generators for custom columns.
	 */
	private OutputColumn[] columns;

	public CustomFormat(String... cols)
	{
		columns = new OutputColumn[cols.length];

		for (int i = 0; i < cols.length; i++)
		{
			columns[i] = new OutputColumn(cols[i]);
		}
	}

	/**
	 * Prepares the line in the output file for the given interaction.
	 * @param inter the interaction
	 * @return output line.
	 */
	@Override
	public String convert(SIFInteraction inter)
	{
		String s = inter.toString();

		for (OutputColumn column : columns)
		{
			s += "\t" + column.getColumnValue(inter);
		}

		return s;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy