コード例 #1
0
 @Test
 public void test() {
   FullVcfCodec fc = new FullVcfCodec();
   fc.setVCFHeader(this.header, this.version);
   VariantContextBlockIterator iter = new VariantContextBlockIterator(fc);
   List<VariantContext> ctxList = iter.convert(this.rows);
   assertEquals("Assume the same list size", this.rows.size(), ctxList.size());
 }
コード例 #2
0
 /** @throws java.lang.Exception */
 @Before
 public void setUp() throws Exception {
   rows = new LinkedList<CharBuffer>();
   String inFile = "/" + this.getClass().getName().replaceAll("\\.", "/") + ".vcf";
   FullVcfCodec codec = new FullVcfCodec();
   try (InputStream in = getStream(inFile); ) {
     LineIterator iter = codec.makeSourceFromStream(in);
     this.header = (VCFHeader) codec.readActualHeader(iter);
     this.version = codec.getVCFHeaderVersion();
   }
   try (InputStream in = getStream(inFile); ) {
     List<String> lines = IOUtils.readLines(in);
     for (String l : lines) {
       if (!l.startsWith("#")) {
         rows.add(CharBuffer.wrap(l));
       }
     }
   }
   //		rows.add(CharBuffer.wrap("20	60479	rs149529999	C	T 	100	PASS
   //	ERATE=0.0005;RSQ=0.8951;LDAF=0.0021;	GT:DS:GL	0|0:0.000:-0.19,-0.46,-2.68
   //	0|0:0.000:-0.01,-1.85,-5.00"));
 }