package com.graph.db.file.annotation.subscriber;

import com.graph.db.domain.input.annotation.GeneticVariant;
import com.graph.db.domain.output.GeneToGeneticVariantOutput;
import com.graph.db.file.GenericSubscriber;
import com.graph.db.output.OutputFileType;

public class GeneToGeneticVariantSubscriber extends GenericSubscriber<GeneticVariant> {
	
	public GeneToGeneticVariantSubscriber(String outputFolder, Class<?> parserClass) {
		super(outputFolder, parserClass, OutputFileType.GENE_TO_GENETIC_VARIANT);
	}

	@Override
	public void processRow(GeneticVariant variant) {
		variant.getTranscript_consequences().stream()
			.map(tc -> new GeneToGeneticVariantOutput(tc))
			.forEach(output -> write(output));
	}
}

@@ -190,16 +190,24 @@
 db.file.
+SetBased
 GenericS
@@ -313,16 +313,24 @@
 extends 
+SetBased
 GenericS
@@ -353,16 +353,44 @@
 cVariant
+, GeneToGeneticVariantOutput
 %3E %7B%0A%09%0A%09p
@@ -736,13 +736,15 @@
  -%3E 
-write
+set.add
 (out

fix issue where GeneToGeneticVariant relationship was being written out multiple times