// Path: biograph-etl/src/main/java/it/cnr/icar/biograph/neo4j/Relations.java
// public enum RelationTypes implements RelationshipType
// {
//     CITED_IN,
//     IS_A,
//     REGULATES,
//     NEGATIVELY_REGULATES,
//     POSITIVELY_REGULATES,
//     PART_OF,
//     HAS_PART,
//     ANNOTATES,
//     PRECURSOR_OF,
//     INTERACTING_GENE,
//     INTERACTING_MIRNA,
//     INTERACTING_SNP,
//     CANCER2MIRNA,
//     REFERS_TO,
//     SYNONYM_OF,
//     CODING,
//     HAS_SNP,
//     MIRNA2PATHWAY,
//     CONTAINS
// }


import java.io.BufferedReader;
import java.io.FileReader;
import org.neo4j.graphdb.DynamicLabel;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.graphdb.Transaction;
import it.cnr.icar.biograph.neo4j.Relations.RelationTypes;
package it.cnr.icar.biograph.neo4j;




public class SNPTargets extends Importer {
	
	protected void importer(GraphDatabaseService graphDb, String fileName) throws Exception {
		String line;

	    BufferedReader reader = new BufferedReader(new FileReader(fileName));

        System.out.print("\nImporting miRNA target gain by SNPs in seed regions from " + fileName + " ");
        
        Label MIRNA_SNP = DynamicLabel.label( "MiRNAsnp" );
        Label INTERACTION = DynamicLabel.label( "Interaction" );
        Label GENE = DynamicLabel.label( "Gene" );
        
        // skip first line
        reader.readLine();
        
        try ( Transaction tx = graphDb.beginTx() ) {
	        while ((line = reader.readLine()) != null) {        	
	        	String datavalue[] = line.split("\t");
	        	
	        	//String id = datavalue[0];
	        	String gene_id = datavalue[1];
	        	String transcriptId = datavalue[2];
	        	//String mirAccession = datavalue[3];
	        	String SNPid = datavalue[4];
	        	
	        	int miRstart = Integer.valueOf(datavalue[5]);
	        	int miRend = Integer.valueOf(datavalue[6]);
	        	double energy = Double.valueOf(datavalue[7]);
// Path: biograph-etl/src/main/java/it/cnr/icar/biograph/neo4j/Relations.java
// public enum RelationTypes implements RelationshipType
// {
//     CITED_IN,
//     IS_A,
//     REGULATES,
//     NEGATIVELY_REGULATES,
//     POSITIVELY_REGULATES,
//     PART_OF,
//     HAS_PART,
//     ANNOTATES,
//     PRECURSOR_OF,
//     INTERACTING_GENE,
//     INTERACTING_MIRNA,
//     INTERACTING_SNP,
//     CANCER2MIRNA,
//     REFERS_TO,
//     SYNONYM_OF,
//     CODING,
//     HAS_SNP,
//     MIRNA2PATHWAY,
//     CONTAINS
// }


// Path: biograph-etl/src/main/java/it/cnr/icar/biograph/neo4j/SNPTargets.java
import java.io.BufferedReader;
import java.io.FileReader;
import org.neo4j.graphdb.DynamicLabel;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.graphdb.Transaction;
import it.cnr.icar.biograph.neo4j.Relations.RelationTypes;

package it.cnr.icar.biograph.neo4j;




public class SNPTargets extends Importer {
	
	protected void importer(GraphDatabaseService graphDb, String fileName) throws Exception {
		String line;

	    BufferedReader reader = new BufferedReader(new FileReader(fileName));

        System.out.print("\nImporting miRNA target gain by SNPs in seed regions from " + fileName + " ");
        
        Label MIRNA_SNP = DynamicLabel.label( "MiRNAsnp" );
        Label INTERACTION = DynamicLabel.label( "Interaction" );
        Label GENE = DynamicLabel.label( "Gene" );
        
        // skip first line
        reader.readLine();
        
        try ( Transaction tx = graphDb.beginTx() ) {
	        while ((line = reader.readLine()) != null) {        	
	        	String datavalue[] = line.split("\t");
	        	
	        	//String id = datavalue[0];
	        	String gene_id = datavalue[1];
	        	String transcriptId = datavalue[2];
	        	//String mirAccession = datavalue[3];
	        	String SNPid = datavalue[4];
	        	
	        	int miRstart = Integer.valueOf(datavalue[5]);
	        	int miRend = Integer.valueOf(datavalue[6]);
	        	double energy = Double.valueOf(datavalue[7]);
	        	double snpEnergy = Double.valueOf(datavalue[8]);