// gnomAD exome variant dataset
private static final String VCF_PATH = "/Volumes/gjb/smacgowan/NOBACK/resources/gnomad/gnomad.exomes.r2.0.1.sites.vcf.gz";
+ // "https://storage.cloud.google.com/gnomad-public/release/2.0.1/vcf/exomes/gnomad.exomes.r2.0.1.sites.vcf.gz";
+
/**
* A test to exercise some basic functionality of the htsjdk VCF reader
*
pw.close();
return f;
}
-
- // "https://storage.cloud.google.com/gnomad-public/release/2.0.1/vcf/exomes/gnomad.exomes.r2.0.1.sites.vcf.gz";
/**
* A 'test' that demonstrates querying an indexed VCF file for features in a
CloseableIterator<VariantContext> features = reader.query("17",
43128978 + 9724, 43128978 + 9734); // first 11 CDS positions
- assertEquals(features.next().getStart(), 43138702);
- assertEquals(features.next().getStart(), 43138704);
- assertEquals(features.next().getStart(), 43138707);
- assertEquals(features.next().getStart(), 43138708);
- assertEquals(features.next().getStart(), 43138710);
- assertEquals(features.next().getStart(), 43138711);
+ assertEquals(printNext(features), 43138702);
+ assertEquals(printNext(features), 43138704);
+ assertEquals(printNext(features), 43138707);
+ assertEquals(printNext(features), 43138708);
+ assertEquals(printNext(features), 43138710);
+ assertEquals(printNext(features), 43138711);
assertFalse(features.hasNext());
features.close();
reader.close();
}
+
+ /**
+ * Prints the toString value of the next variant, and returns its start
+ * location
+ *
+ * @param features
+ * @return
+ */
+ protected int printNext(CloseableIterator<VariantContext> features)
+ {
+ VariantContext next = features.next();
+ System.out.println(next.toString());
+ return next.getStart();
+ }
}