protected void flattenFastq(String input) {
        final String newline = System.getProperty("line.separator");
        StringBuilder sb = new StringBuilder();
        try (BufferedReader br = Files.newBufferedReader(FileSystems.getDefault().getPath(input), Charset.defaultCharset())) {
            String line = br.readLine();
            do {
                if (!line.startsWith("@")) {
                    Utils.error();
                }
                sb.append(line.trim());
                sb.append(newline);
                int lines = 0;
                for (;;) {
                    line = br.readLine();
                    if (line.startsWith("+")) {
                        break;
                    }
                    lines++;
                    sb.append(line.trim());
                }
                sb.append(newline);
                sb.append(line.trim());
                sb.append(newline);
                for (int i = 0; i < lines; i++) {
                    line = br.readLine();
                    sb.append(line.trim());
                }
                sb.append(newline);
                line = br.readLine();
            } while (line != null && !line.isEmpty());
        } catch (IOException e) {
            System.err.println("Error parsing file " + input);
        }
        try {
            Files.deleteIfExists(FileSystems.getDefault().getPath(input + "_flat"));
        } catch (IOException ex) {
            Logger.getLogger(ProcessingIlluminaSingle.class.getName()).log(Level.SEVERE, null, ex);
        }
        try (BufferedWriter bw = Files.newBufferedWriter(FileSystems.getDefault().getPath(input + "_flat"), Charset.defaultCharset(), StandardOpenOption.CREATE)) {
            bw.write(sb.toString());
            bw.flush();
        } catch (IOException e) {
            System.err.println("Error parsing file " + input);
        }
    }