k6_results.tex 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. \chapter{Results and Discussion}
  2. The two tables \ref{t:effectivity}, \ref{t:efficiency} contain raw measurement values for the two goals, described in \ref{k5:goals}. The first table visualizes how long each compression procedure took, in milliseconds. The second one contains file sizes in bytes. Each row contains information about one of the \texttt{Homo\_sapiens.GRCh38.dna.chromosome.}x\texttt{.fa} files. To improve readability, the filename in all tables were replaced by \texttt{File}. To determine which file was compressed, simply replace the placeholder with the number following \texttt{File}.\\
  3. \section{Interpretation of Results}
  4. The units milliseconds and bytes store a high persicion for measurements. Unfortunately they are harder to read and compare to the human eye. Therefore, starting with comparing sizes, \ref{t:sizepercent} contains each file size in percentage, in relation to the respective source file. The compression with \acs{GeCo} with the file Homo\_sapiens.GRCh38.dna.chromosome.11.fa resulted in a file that were only 17.6\% as big.\\
  5. \label{t:sizepercent}
  6. \sffamily
  7. \begin{footnotesize}
  8. \begin{longtable}[ht]{ p{.2\textwidth} p{.2\textwidth} p{.2\textwidth} p{.2\textwidth}}
  9. \caption[Compression Effectivity] % Caption für das Tabellenverzeichnis
  10. {File sizes in different compression formats in \textbf{percent}} % Caption für die Tabelle selbst
  11. \\
  12. \toprule
  13. \textbf{ID.} & \textbf{\acs{GeCo} \%} & \textbf{Samtools \acs{BAM}\%}& \textbf{Samtools \acs{CRAM} \%} \\
  14. \midrule
  15. File 1& 18.32& 24.51& 22.03\\
  16. File 2& 20.15& 26.36& 23.7\\
  17. File 3& 19.96& 26.14& 23.69\\
  18. File 4& 20.1& 26.26& 23.74\\
  19. File 5& 17.8& 22.76& 20.27\\
  20. File 6& 17.16& 22.31& 20.11\\
  21. File 7& 16.21& 21.69& 19.76\\
  22. File 8& 17.43& 23.48& 21.66\\
  23. File 9& 18.76& 25.16& 23.84\\
  24. File 10& 20.0& 25.31& 23.63\\
  25. File 11& 17.6& 24.53& 23.91\\
  26. File 12& 20.28& 26.56& 23.57\\
  27. File 13& 19.96& 25.6& 23.67\\
  28. File 14& 16.64& 22.06& 20.44\\
  29. File 15& 79.58& 103.72& 92.34\\
  30. File 16& 19.47& 25.52& 22.6\\
  31. File 17& 19.2& 25.25& 22.57\\
  32. File 18& 19.16& 25.04& 22.2\\
  33. File 19& 18.32& 24.4& 22.12\\
  34. File 20& 18.58& 24.14& 21.56\\
  35. File 21& 16.22& 22.17& 19.96\\
  36. &&&\\
  37. \textbf{Total}& 21.47& 28.24& 25.59\\
  38. \bottomrule
  39. \end{longtable}
  40. \end{footnotesize}
  41. \rmfamily
  42. Overall, Samtools \acs{BAM} resulted in 71.76\% size reduction, the \acs{CRAM} methode improved this by rughly 2.5\%. \acs{GeCo} provided the greatest reduction with 78.53\%. This gap of about 4\% comes with a comparatively great sacrifice in time.\\
  43. \label{t:time}
  44. \sffamily
  45. \begin{footnotesize}
  46. \begin{longtable}[ht]{ p{.2\textwidth} p{.2\textwidth} p{.2\textwidth} p{.2\textwidth}}
  47. \caption[Compression Effectivity] % Caption für das Tabellenverzeichnis
  48. {Compression duration in seconds} % Caption für die Tabelle selbst
  49. \\
  50. \toprule
  51. \textbf{ID.} & \textbf{\acs{GeCo} } & \textbf{Samtools \acs{BAM}}& \textbf{Samtools \acs{CRAM} } \\
  52. \midrule
  53. File 1 & 23.5& 3.786& 16.926\\
  54. File 2 & 24.65& 3.784& 17.043\\
  55. File 3 & 2.016& 3.123& 13.999\\
  56. File 4 & 19.408& 3.011& 13.445\\
  57. File 5 & 18.387& 2.862& 12.802\\
  58. File 6 & 17.364& 2.685& 12.015\\
  59. File 7 & 15.999& 2.503& 11.198\\
  60. File 8 & 14.828& 2.286& 10.244\\
  61. File 9 & 12.304& 2.078& 9.21\\
  62. File 10 & 13.493& 2.127& 9.461\\
  63. File 11 & 13.629& 2.132& 9.508\\
  64. File 12 & 13.493& 2.115& 9.456\\
  65. File 13 & 99.902& 1.695& 7.533\\
  66. File 14 & 92.475& 1.592& 7.011\\
  67. File 15 & 85.255& 1.507& 6.598\\
  68. File 16 & 82.765& 1.39& 6.089\\
  69. File 17 & 82.081& 1.306& 5.791\\
  70. File 18 & 79.842& 1.277& 5.603\\
  71. File 19 & 58.605& 0.96& 4.106\\
  72. File 20 & 64.588& 1.026& 4.507\\
  73. File 21 & 41.198& 0.721& 3.096\\
  74. &&&\\
  75. \textbf{Total}&42.57&2.09&9.32\\
  76. \bottomrule
  77. \end{longtable}
  78. \end{footnotesize}
  79. \rmfamily
  80. As \ref{t:time} is showing, the average compression duration for \acs{GeCo} is at 42.57s. That is a little over 33s, or 78\% longer than the average runtime of samtools for compressing into the \acs{CRAM} format.\\
  81. Since \acs{CRAM} requires a file in \acs{BAM} format, the third row is calculated by adding the time needed to compress into \acs{BAM} with the time needed to compress into \acs{CRAM}.
  82. While \acs{SAM} format is required for compressing a \acs{FASTA} into \acs{BAM} and further into \acs{CRAM}, in itself it does not features no compression. However, the conversion from \acs{SAM} to \acs{FASTA} can result in a decrease in size. At first this might be contra intuitive, since as described in \ref{k2:sam} \acs{SAM} stores more information than \acs{FASTA}. This can be explained by comparing the sequence storing mechanism. A \acs{FASTA} sequence section can be spread over multiple lines whereas \acs{SAM} files store a sequence in just one line, converting can result in a \acs{SAM} file that is smaller than the original \acs{FASTA} file.
  83. % (hi)storytime
  84. Before interpreting this data further, a quick view into development processes: \acs{GeCo} stopped development in the year 2016 while Samtools is being developed since 2015, to this day, with over 70 people contributing.\\
  85. % interpret bit files and compare
  86. \section{View on Possible Improvements}
  87. % todo explain new findings
  88. S. Petukhov described new findings about the distribution of nucleotides. With the probability of one nucleotide, in a sequence of sufficient length, information about the direct neighbours is revealed. For example, with the probability of \texttt{C}, the probabilities for sets (n-plets) of any nucleotide \texttt{N}, including \texttt{C} can be determined:\\
  89. %\%C ≈ Σ\%CN ≈ Σ\%NС ≈ Σ\%CNN ≈ Σ\%NCN ≈ Σ\%NNC ≈ Σ\%CNNN ≈ Σ\%NCNN ≈ Σ\%NNCN ≈ Σ\%NNNC\\
  90. % begin optimization
  91. Considering this and the meassured results, an improvement in the arithmetic coding process and therefore in \acs{GeCo}s efficiency, would be a good start to equalize the great gap in the compression duration. Combined with a tool that is developed with todays standards, there is a possibility that even greater improvements could be archived.\\
  92. % simple theoretical approach
  93. How would a theoretical improvement approach look like? As described in \ref{k4:arith}, entropy coding requires to determine the probabilies of each symbol in the alphabet. The simplest way to do that, is done by parsing the whole sequence from start to end and increasing a counter for each nucleotide that got parsed.
  94. With new findings discovered by S. Petukhov in cosideration, the goal would be to create an entropy coding implementation that beats current implementation in the time needed to determine probabilities. A possible approach would be that the probability of one nucleotide can be used to determine the probability of other nucelotides, by a calculation rather than the process of counting each one.
  95. This approach throws a few questions that need to be answered in order to plan a implementation:
  96. \begin{itemize}
  97. \item How many probabilities are needed to calculate the others?
  98. \item Is there space for improvement in the parsing/counting process?
  99. %\item Is there space for visible improvements, when only counting one nucleotide?
  100. \item How can the variation between probabilities be determined?
  101. \end{itemize}
  102. Second point must be asked, because the improvement in counting only one nucleotide in comparison to counting three, would be to little to be called relevant.
  103. %todo compare time needed: to store a variable <-> parsing the sequence
  104. To compare parts of a programm and their complexity, the Big-O notation is used. Unfortunally this is only covering loops and coditions as a whole. Therefore a more detailed view on operations must be created:
  105. Considering a single threaded loop with the purpose to count every nucleotide in a sequence, the process of counting can be split into several operations, defined by this pseudocode.
  106. %todo use GeCo arith function with bigO
  107. while (sequence not end):\\
  108. next\_nucleotide = read\_next\_nucleotide(sequence)\\
  109. for (element in alphabet\_probabilities):\\
  110. if (element equals next\_nucleotide)\\
  111. element = element + 1\\
  112. fi\\
  113. rof\\
  114. elihw\\
  115. This loop will itterate over a whole sequence, counting each nucleotide. In line three, a inner loop can be found which itterates over the alphabet, to determine which symbol should be increased. Considering the findings, described above, the inner loop can be left out, because there is no need to compare the read nucleotide against more than one symbol. The Big-O notation for this code, with any sequence with the length of n, would be decreseased from O($n^2$) to O($n\cdot 1)$) or simply O(N) \cite{big-o}. Which is clearly an improvement in complexety and therefor also in runtime.\\
  116. The runtime for calculations of the other symbols probabilities must be considered as well and compared against the nested loop to be certain, that the overall was improved.
  117. % more realistic view on parsing todo need cites
  118. In practice, obviously smarter ways are used, to determine probabilities. Like splitting the sequence in multiple parts and parse each subsequence asynchronous. This results can either sumed up for global probabilities or get used individually on each associated subsequence. Either way, the presented improvement approach should be appliable to both parsing methods.\\
  119. % how is data interpreted
  120. % why did the tools result in this, what can we learn
  121. % improvements
  122. % - goal: less time to compress
  123. % - approach: optimize probability determination
  124. % -> how?