Example #1
0
  @Override
  protected void runImpl() throws ExecutionFailedException {
    info("Loading...");
    ArrayList<Dna> reads;
    // ToDo: rewrite it to use normal reader
    try {
      reads = ReadsPlainReader.loadReads(readsFile.get().getPath());
    } catch (IOException e) {
      throw new ExecutionFailedException(e);
    }

    info("Creating string...");
    GluedDnasString string = GluedDnasString.createGluedDnasString(reads);
    info("Full string length = " + groupDigits(string.length));

    info("Dumping...");
    string.dump(fullStringFile.get());
  }
Example #2
0
  @Override
  protected void runImpl() throws ExecutionFailedException {
    outputDir.get().mkdir();

    Iterator<File> originalReadsIterator = Arrays.asList(originalReads.get()).iterator();
    Iterator<File> correctedReadsIterator = Arrays.asList(correctedReads.get()).iterator();

    for (Iterator<UniPair<File>> it =
            new UniZippingIterator<File>(originalReadsIterator, correctedReadsIterator);
        it.hasNext(); ) {
      UniPair<File> cur = it.next();
      BinqReader initial = null;
      try {
        initial = new BinqReader(cur.first);
      } catch (IOException e) {
        throw new ExecutionFailedException("Can't create library from from file " + cur.first, e);
      }

      BinqReader fixed = null;
      try {
        fixed = new BinqReader(cur.second);
      } catch (IOException e) {
        throw new ExecutionFailedException("Can't create library from from file " + cur.second, e);
      }

      String fn = (new File(initial.name())).getName();
      //            System.err.println("fn = " + fn);

      try {
        IOUtils.dnaQs2BinqFile(
            new MergeIterator(fixed.iterator(), initial.iterator()),
            outputDir.get() + File.separator + initial.name() + ".binq",
            false);
      } catch (IOException e) {
        throw new ExecutionFailedException(e);
      }
    }
  }