Exemplo n.º 1
0
  public static void main(String[] args) {
    try {
      String inFile =
          "/psychipc01/disk2/references/1000Genome/release/20130502_v5a/ALL.chr1.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz";
      String outFile =
          "/psychipc01/disk2/references/1000Genome/release/20130502_v5a/ALL.chr1.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes1.vcf.gz";
      BlockCompressedInputStream br = new BlockCompressedInputStream(new File(inFile));
      BlockCompressedOutputStream bw = new BlockCompressedOutputStream(new File(outFile));
      String line = null;
      String[] cells = null;

      int[] orgIndices =
          new int[] {
            0, 1, 2, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 33, 34, 35, 36, 37, 38,
            39, 40
          };
      int selectedColNum = orgIndices.length;
      int i, pos;
      String delimiter = "\t";

      while ((line = br.readLine()) != null) {
        line = line.trim();
        if (line.trim().length() == 0) {
          continue;
        }

        bw.write(line.replaceAll("[|]", "/").getBytes());
        bw.write("\n".getBytes());
      }
      bw.close();
      br.close();

    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Exemplo n.º 2
0
 @Override
 public void close() throws IOException {
   bci.close();
 }