diff --git a/etl/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/etl/genotype/MultialleleCounter.java b/etl/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/etl/genotype/MultialleleCounter.java deleted file mode 100644 index fec6a83c..00000000 --- a/etl/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/etl/genotype/MultialleleCounter.java +++ /dev/null @@ -1,44 +0,0 @@ -package edu.harvard.hms.dbmi.avillach.hpds.etl.genotype; - -import java.io.*; -import java.util.ArrayList; -import java.util.TreeSet; -import java.util.concurrent.ConcurrentHashMap; - -import edu.harvard.hms.dbmi.avillach.hpds.data.genotype.VariantMasks; -import edu.harvard.hms.dbmi.avillach.hpds.data.genotype.VariantSpec; -import edu.harvard.hms.dbmi.avillach.hpds.data.genotype.VariantStore; -import edu.harvard.hms.dbmi.avillach.hpds.storage.FileBackedByteIndexedStorage; - -public class MultialleleCounter { - - public static void main(String[] args) throws ClassNotFoundException, IOException { - VariantStore variantStore = VariantStore.readInstance("/opt/local/hpds/all/"); - for (String contig : variantStore.getVariantMaskStorage().keySet()) { - System.out.println("Starting contig : " + contig); - FileBackedByteIndexedStorage> - currentChromosome = variantStore.getVariantMaskStorage().get(contig); - currentChromosome.keys().parallelStream().forEach((offsetBucket) -> { - System.out.println("Starting bucket : " + offsetBucket); - ConcurrentHashMap maskMap; - maskMap = currentChromosome.get(offsetBucket); - - TreeSet variantsSortedByOffset = new TreeSet<>(); - for (String variant : maskMap.keySet()) { - variantsSortedByOffset.add(new VariantSpec(variant)); - } - ArrayList variantsSortedByOffsetList = new ArrayList<>(variantsSortedByOffset); - for (int y = 1; y < variantsSortedByOffsetList.size(); y++) { - if (variantsSortedByOffsetList.get(y).metadata.offset.equals(variantsSortedByOffsetList.get(y - 1).metadata.offset)) { - try { - System.out.println("Matching offsets : " + variantsSortedByOffsetList.get(y - 1).specNotation() + " : " + variantsSortedByOffsetList.get(y).specNotation() + ":" + maskMap.get(variantsSortedByOffsetList.get(y - 1).specNotation()).heterozygousMask.toString(2) + ":" + ":" + maskMap.get(variantsSortedByOffsetList.get(y).specNotation()).heterozygousMask.toString(2)); - } catch (NullPointerException e) { - System.out.println("Matching offsets : " + variantsSortedByOffsetList.get(y - 1).specNotation() + " : " + variantsSortedByOffsetList.get(y).specNotation()); - } - } - } - System.out.println("Completed bucket : " + offsetBucket); - }); - } - } -} diff --git a/etl/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/etl/genotype/VariantCounter.java b/etl/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/etl/genotype/VariantCounter.java deleted file mode 100644 index 4d22c572..00000000 --- a/etl/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/etl/genotype/VariantCounter.java +++ /dev/null @@ -1,28 +0,0 @@ -package edu.harvard.hms.dbmi.avillach.hpds.etl.genotype; - -import edu.harvard.hms.dbmi.avillach.hpds.data.genotype.VariantMasks; -import edu.harvard.hms.dbmi.avillach.hpds.data.genotype.VariantStore; -import edu.harvard.hms.dbmi.avillach.hpds.storage.FileBackedByteIndexedStorage; - -import java.io.IOException; -import java.util.concurrent.ConcurrentHashMap; - -public class VariantCounter { - - public static void main(String[] args) throws ClassNotFoundException, IOException { - VariantStore variantStore = VariantStore.readInstance("/opt/local/hpds/all/"); - for(String contig : variantStore.getVariantMaskStorage().keySet()) { - int[] countOfVariants = {0}; - FileBackedByteIndexedStorage> - currentChromosome = variantStore.getVariantMaskStorage().get(contig); - currentChromosome.keys().parallelStream().forEach((offsetBucket)->{ - ConcurrentHashMap maskMap; - maskMap = currentChromosome.get(offsetBucket); - if(maskMap!=null) { - countOfVariants[0]+=maskMap.size(); - } - }); - System.out.println(contig + "," + countOfVariants[0]); - } - } -}