Commit fb774abb authored by Neva C. Durand's avatar Neva C. Durand
Browse files

Major change to terminology

parent 605341bd
Loading
Loading
Loading
Loading
+46 −4
Changes for SLURM/scripts/stats_sub.awk: 46 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ BEGIN {
  if (length(fname)>0) {
    while (getline < fname) {
      dups=$1;
      singdups=$2;
    }
  }
}
@@ -44,16 +45,57 @@ BEGIN {
}
END{
  if (tot==0) tot=1;
  printf("Sequenced Read Pairs:  %'d\n Normal Paired: %'d (%0.2f%)\n Chimeric Paired: %'d (%0.2f%)\n Chimeric Ambiguous: %'d (%0.2f%)\n Unmapped: %'d (%0.2f%)\n", tot, norm, norm*100/tot, chim, chim*100/tot, coll, coll*100/tot, unm, unm*100/tot);
  if (length(singleend)==0) {
      printf("Read type: Paired End\n");
      printf("Sequenced Read Pairs:  %'d\n", tot);
      # in the future, 1 alignment - on one end / substantially overlapping in sum
      printf("No chimera found: %'d (%0.2f%)\n",  unm, unm*100/tot);
      printf(" One or both reads unmapped: %'d (%0.2f%)\n",  unm, unm*100/tot);
      # 1 alignment would go here and be in sum of "no chimera found"
      printf("2 alignments: %'d (%0.2f%)\n", norm+chim, (norm+chim)*100/tot);
      printf(" 2 alignments (A...B): %'d (%0.2f%)\n", norm, norm*100/tot);
      printf(" 2 alignments (A1….A2B; A1B2...B1A2): %'d (%0.2f%)\n", chim, chim*100/tot);
      printf("3 or more alignments: %'d (%0.2f%)\n", coll, coll*100/tot);
     if (ligation ~ /XXXX/) {
       printf("Ligation Motif Present: N/A\n");
     }
     else {
       printf("Ligation Motif Present: %'d (%0.2f%)\n", lig, lig*100/tot);
     }
     printf("Average insert size: %0.2f\n",insertsize/NR);
     alignable=norm+chim;
  printf(" Single Alignment: %'d (%0.2f%)\n Average insert size: %0.2f\nAlignable (Normal+Chimeric Paired): %'d (%0.2f%)\n",  singleton, singleton*100/tot, insertsize/NR, alignable, alignable*100/tot);
  uniq=alignable+singleton-dups;
     uniq=alignable-dups;
     if (alignable==0) alignable=1;
  printf("Unique Reads: %'d (%0.2f%, %0.2f%)\nDuplicates: %'d (%0.2f%, %0.2f%)\n", uniq, uniq*100/(alignable+singleton), uniq*100/tot, dups, dups*100/(alignable+singleton), dups*100/tot);
     printf("Total Unique: %'d (%0.2f%, %0.2f%)\nTotal Duplicates: %'d (%0.2f%, %0.2f%)\n", uniq, uniq*100/alignable, uniq*100/tot, dups, dups*100/alignable, dups*100/tot);
  }
  else {
      printf("Read type: Single End\n");
      printf("Sequenced Reads:  %'d\n", tot);
      # in the future, 1 alignment - on one end / substantially overlapping in sum
      printf("No chimera found: %'d (%0.2f%)\n",  unm+singleton, (unm+singleton)*100/tot);
      printf(" 0 alignments: %'d (%0.2f%)\n",  unm, unm*100/tot);
      printf(" 1 alignment: %'d (%0.2f%)\n",  singleton, singleton*100/tot);
      printf("2 alignments: %'d (%0.2f%)\n", chim, chim*100/tot);
      printf("3 or more alignments: %'d (%0.2f%)\n", coll, coll*100/tot);
     if (ligation ~ /XXXX/) {
       printf("Ligation Motif Present: N/A\n");
     }
     else {
       printf("Ligation Motif Present: %'d (%0.2f%)\n", lig, lig*100/tot);
     }
     singuniq=singleton-singdups;
     if (singleton==0) singleton=1;
     printf("1 alignment unique: %'d (%0.2f%, %0.2f%)\n", singuniq, singuniq*100/singleton, singuniq*100/tot);
     printf("1 alignment duplicates: %'d (%0.2f%, %0.2f%)\n", singdups, singdups*100/singleton, singdups*100/tot);
     #Library Complexity Estimate (1 alignment)*
     alignable=norm+chim;
     uniq=alignable-dups;
     if (alignable==0) alignable=1;
     printf("2 alignment unique: %'d (%0.2f%, %0.2f%)\n", uniq, uniq*100/alignable, uniq*100/tot);
     printf("2 alignment duplicates: %'d (%0.2f%, %0.2f%)\n", dups, dups*100/alignable, dups*100/tot);
     #Library Complexity Estimate (2 alignment)*
     printf("Total Unique: %'d (%0.2f%, %0.2f%)\n", uniq+singuniq, (uniq+singuniq)*100/(singleton+alignable), (uniq+singuniq)*100/tot);
     printf("Total Duplicates: %'d (%0.2f%, %0.2f%)\n", dups+singdups, (dups+singdups)*100/(singleton+alignable), (dups+singdups)*100/tot);
     #Library Complexity Estimate (1+2 above)*
  }
}