BEGIN {
    errRate+=0;
    errRate*=4/3;

    split("ACGT",nucl,"");

    stderr="/dev/stderr";
    OFS="\t";
};

{
   if (NR%2 == 1) {
       print;
       next;
   };

   seq1=toupper($0);
   for (ii=1;ii<=length(seq1);ii++) {
       if (rand()<errRate) {
          b1=nucl[int(rand()*4)+1];
          if (b1!=substr(seq1,ii,1)) {
             nErr++;
             seq1=substr(seq1,1,ii-1) b1 substr(seq1,ii+1);
          };
       };
   };
   print seq1;
}
