Articles on SunTzunami's Bloghttps://blogs.python-gsoc.orgUpdates on different articles published on SunTzunami's BlogenMon, 23 Aug 2021 09:57:32 +0000Google Summer of Code Final Work Producthttps://blogs.python-gsoc.org/en/suntzunamis-blog/google-summer-of-code-final-work-product-1/<h1>Google Summer of Code Final Work Product</h1> <ul> <li><strong>Name:</strong> Sajag Swami</li> <li><strong>Organisation:</strong> Python Software Foundation</li> <li><strong>Sub-Organisation:</strong> FURY</li> <li><strong>Project:</strong> <a href="https://github.com/fury-gl/fury/wiki/Google-Summer-of-Code-2021#project-1-molecular-surface-and-ribbon-representations-for-proteins">FURY: Ribbon and Molecular Surface Representations for Proteins</a></li> </ul> <h2>Proposed Objectives</h2> <ul> <li>Ribbon Representation</li> <li>Molecular Surface Representation</li> <li>Stretch Goals: <ol> <li>Stick Representation</li> <li>Ball and stick Representation</li> <li>Wire Representation</li> <li>Pipes and Planks Representation</li> <li>Sphere Representation</li> </ol> </li> </ul> <h2>Objectives Completed</h2> <ol> <li><strong>Ribbon Representation</strong> <p>Ribbon diagrams, also known as Richardson diagrams, are 3D schematic representations of protein structure. Ribbon diagrams are generated by interpolating a smooth curve through the polypeptide backbone. α-helices are shown as coiled ribbons. β-strands as sheets, and non-repetitive coils or loops as lines or thin strips. It was implemented by using vtkProteinRibbonFilter. Generating a vtkPolyData of appropriate format required by vtkProteinRibbonFilter was initially unclear due to lack of examples. I was able to understand what kind of output the filter required after a meeting with mentors. Tests were added and a demo was created.</p> <p><em>Pull Requests:</em></p> <ul> <li><strong>Ribbon representation:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> <li><strong>Ribbon Representation demo:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> </ul> </li> <li><strong>Ball and Stick Representation</strong> <p>The ball-and-stick model is a molecular model of a chemical substance which displays both the three-dimensional position of the atoms and the bonds between them. The atoms are typically represented by spheres, connected by tubes which represent the bonds. It was created by using vtkOpenGLMoleculeMapper. Added vtkSimpleBondPerceiver for detection of bonds. Tests were added and a demo was created.</p> <p><em>Pull Requests:</em></p> <ul> <li><strong>Ball and Stick Representation:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> <li><strong>Ball and Stick Representation demo:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> </ul> </li> <li><strong>Stick Representation</strong> <p>Stick model is a special case of Ball and Stick model where atomic radius of all molecules is set equal to the radius of tubes used to create bonds. It was created by using vtkOpenGLMoleculeMapper. Tests were added and a demo was created.</p> <p><em>Pull Requests:</em></p> <ul> <li><strong>Stick Representation:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> <li><strong>Stick Representation demo:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> </ul> </li> <li><strong>Sphere Representation</strong> <p>In chemistry, a space-filling model, also known as a calotte or sphere model, is a type of three-dimensional (3D) molecular model where the atoms are represented by spheres whose radii are proportional to the radii of the atoms. It was created by using vtkOpenGLMoleculeMapper. Tests were added and a demo was created.</p> <p><em>Pull Requests:</em></p> <ul> <li><strong>Sphere Representation:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> <li><strong>Sphere Representation demo:</strong> <a href="https://github.com/fury-gl/fury/pull/452">https://github.com/fury-gl/fury/pull/452</a></li> </ul> </li> </ol> <h2>Objectives in Progress</h2> <ul> <li><strong>Molecular Surfaces</strong> <p>There are three types of molecular Surfaces:</p> <ul> <li>Van der Waals</li> <li>Solvent Accessible</li> <li>Solvent Excluded</li> </ul> <p>Currently the first two molecular surfaces i.e. Van der Waals and Solvent Accessible are implemented. The code is based on the paper "Generating Triangulated Macromolecular Surfaces by Euclidean Distance Transform" by Dong Xu and Yang Zhang.</p> <p><em>Pull Requests:</em></p> <ul> <li><strong>Molecular Surfaces Implementation:</strong> <a href="https://github.com/fury-gl/fury/pull/492">https://github.com/fury-gl/fury/pull/492</a></li> </ul> </li> </ul> <h2>Other Objectives</h2> <ol> <li><strong>2D Animated Surfaces</strong> <p>This was a simple demonstration that animated Two-Dimensional (2D) functions using FURY. Created a grid of x-y coordinates and mapped the heights (z-values) to the corresponding x, y coordinates to generate the surfaces. Used colormaps to color the surfaces.</p> <p><em>Pull Requests:</em></p> <ul> <li><strong>Animated Surfaces:</strong> <a href="https://github.com/fury-gl/fury/pull/362">https://github.com/fury-gl/fury/pull/362</a></li> </ul> </li> <li><strong>Updated miscellaneous animations</strong> <ol style=""> <li>Updated the demo of helical motion to stop using multiple line actors as discussed in the meeting.</li> <li>Updated the demo of brownian motion to make it more scientifically useful (removed unnecessary rotation of camera during animation and box actor).</li> <li>Display simulation data for brownian motion and helical motion animations (number of simulated steps for brownian motion and velocity of the particle for helical motion).</li> <li>Created utility functions to make the code understandable and used these in emwave, helical and brownian animations.</li> </ol> <p><em>Pull Requests:</em></p> <ul> <li><strong>Updated helical, brownian, emwave animations:</strong> <a href="https://github.com/fury-gl/fury/pull/462">https://github.com/fury-gl/fury/pull/462</a></li> </ul> </li> <li><strong>GSoC weekly Blogs</strong> <p>Weekly blogs were added for FURY's Website.</p> <p><em>Pull Requests:</em></p> <ul> <li><strong>First Evaluation:</strong> <a href="https://github.com/fury-gl/fury/pull/475">https://github.com/fury-gl/fury/pull/475</a></li> <li><strong>Second Evaluation:</strong> <a href="https://github.com/fury-gl/fury/pull/475">https://github.com/fury-gl/fury/pull/493</a></li> </ul> </li> </ol> <h2>Timeline</h2> <table style="width: 750px; border: 1px solid black;"> <tbody><tr class="header"> <th>Date</th> <th>Description</th> <th>Blog Link</th> </tr> <tr> <td>08-06-2021</td> <td>Welcome to my GSoC Blog!</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-1-11/">Weekly Check-in #1</a></td> </tr> <tr> <td>14-06-2021</td> <td>First Week of coding: sphere model.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-2-11/">Weekly Check-in #2</a></td> </tr> <tr> <td>21-06-2021</td> <td>Bonding algorithms, ball and stick model progress.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-3-13/">Weekly Check-in #3</a></td> </tr> <tr> <td>28-06-2021</td> <td>VTK molecular visualization classes.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-4-14/">Weekly Check-in #4</a></td> </tr> <tr> <td>05-07-2021</td> <td>Genesis of <code>molecular</code> module.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-5-13/">Weekly Check-in #5</a></td> </tr> <tr> <td>12-07-2021</td> <td>Ribbon representation, updated <code>molecular</code> module</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-6-18/">Weekly Check-in #6</a></td> </tr> <tr> <td>19-07-2021</td> <td>Updated <code>molecular</code> module and misc. animations.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-7-16/">Weekly Check-in #7</a></td> </tr> <tr> <td>26-07-2020</td> <td>Ribbon, Tests to <code>molecular</code> module, animated surfaces.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-8-11/">Weekly Check-in #8</a></td> </tr> <tr> <td>02-08-2021</td> <td>Optimized molecular with mentors, GSoC blogs.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-9-11/">Weekly Check-in #9</a></td> </tr> <tr> <td>09-08-2021</td> <td>Bounding box, <code>molecular</code> tutorial.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-10-11/">Weekly Check-in #10</a></td> </tr> <tr> <td>16-08-2021</td> <td>Molecular Surfaces (VDW, SAS) implementation.</td> <td><a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-11-9/">Weekly Check-in #11</a></td> </tr> </tbody></table> <p>Detailed weekly tasks and work done can be found <a href="https://blogs.python-gsoc.org/en/suntzunamis-blog/">here</a>.</p>sajagswami@gmail.com (SunTzunami)Mon, 23 Aug 2021 09:57:32 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/google-summer-of-code-final-work-product-1/Weekly Check-in #11https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-11-9/<h2>Tenth/Final week of coding</h2> <p>Welcome to the eleventh and final weekly check-in. This was the tenth and final week of coding. <br>The summer went by swiftly and the coding period has come to an end. It was a great learning experience. Two crucial technical skills that I enhanced over this summer:</p> <ol> <li>Ability to understand documentation of different packages</li> <li>Ability to implement algorithms from scientific papers</li> </ol> <p>I was able to evolve my problem solving approach thanks to the challenges I faced during the coding period. <br>My mentors, core team and the FURY community were extremely supportive and helped me whenever I got stuck. I'd like to thank Nasim and Elefth for helping me with the theoretical aspects of the project and helping me understand the research papers and underlying math. I'd like to thank Serge for his code reviews which helped me improve my code quality and helped me make my code more <em>pythonic</em>. I'd like to thank Javier for helping me with the Ribbon representation (which was something that I had been stuck on for a while). Javier also showed me the projects which he was working on which were truly fascinating and also inspired me to work on projects of my own. <br><br>One crucial learning outcome over the course of coding period: <br>Ability to break down problems into smaller pieces (<strong><a href="https://www.bbc.co.uk/bitesize/guides/zqqfyrd/revision/1">decomposition</a></strong>). Most of the times, I tried to implement everything in one go. This is not a good approach and gets problematic when what you're trying to implement is complicated. Segmenting a problem's solution into steps is the way to go. A time when I employed this approach of segmenting the implementation into several steps during GSoC was when writing the code for the molecular surfaces which involved the following steps:</p> <ol> <li>Creating a grid of a specific resolution</li> <li>Finding the ids of voxels composing the molecular surface</li> <li>Implementing marching cubes or some other isosurface generation algorithm</li> <li>Smoothen the isosurface obtained in previous step</li> </ol> <p> </p> <p>I'll be sharing my progress for the final week of coding now. The github repo of FURY can be found <a href="https://github.com/fury-gl/fury">here</a>.</p> <h2>What did you do this week?</h2> <ol> <li>Implemented <a href="https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0008140">this paper</a><a> (PR created: </a><a href="https://github.com/fury-gl/fury/pull/492">PR #492</a>) to generate <strong>Van der Waals surface</strong> and <strong>solvent-accessible surface</strong>. It was a good learning experience because the first time I read the paper, I didn't understand the underlying math, it all seemed alien to me. I had to read it many times, read up the algorithms used and understand the terminologies. I had a meeting with the mentors to understand a bit of the theory which proved to be quite fruitful as I understood how to go about making the space-filling model. <a href="https://pyscience.wordpress.com/2014/09/11/surface-extraction-creating-a-mesh-from-pixel-data-using-python-and-vtk/">This</a> blog was kinda helpful in understanding how to use <code>vtkMarchingCubes</code> with numpy arrays. One of the earliest SAS rendering looked like this (this implementation was not strictly according to the paper): <br><img height="300" src="https://user-images.githubusercontent.com/65067354/129559593-baf201bf-720c-45f7-9269-3b31954efd5e.png" width="300"> <br>Current implementation (this implementation was according to the paper): <br><img height="300" src="https://user-images.githubusercontent.com/65067354/129560374-14180b22-14b2-449b-88a6-b3140226418d.png" width="300"> <br>grid dimenstions = 256 × 256 × 256, used smoothing algorithms recommended by vtk</li> <li>I also understood how to go about rendering volumes. I think that the ability to render volumes with FURY will be a cool capability and I'll discuss my implementation and request the mentors for feedback and ideas in the weekly meeting. Example of volume rendering: <br><img height="300" src="https://user-images.githubusercontent.com/65067354/129562606-50a9f0cf-e16d-4501-b0fa-a0038fda406b.png" width="300"></li> </ol> <p> </p> <h2>What is coming up next week?</h2> <p>I'll try to get <a href="https://github.com/fury-gl/fury/pull/452">PR #452</a> merged. Documentation work to be done as GSoC coding period has come to an end.</p> <h2>Did you get stuck anywhere?</h2> <p>The paper I was trying to implement seemed quite intimidating at first. Understanding it and the underlying math took a few days. Implementing it in python was also a challenge as usage of <code>vtkMarchingCubes</code> with numpy arrays is not that well documented. All in all, it was a nice learning experience.</p> <h1 style="background-color: crimson; color: #fefbd8; font-family: courier; text-align: center;">Parting Words</h1> <p>In retrospect, it wasn't always smooth sailing as I used to get stuck quite often (sometimes for weeks) while working on certain representations (VTK documentation wasn't quite helpful and didn't have many python examples). But I didn't give up and read hundreds (if not thousands) of blogs and many research papers to find the solutions to the problems that I encountered (I read over <a href="https://discourse.vtk.org/u/suntzunami/summary">600 topics</a> on the VTK forum). The key to breaking an impasse is to be unrelenting in the pursuit of answers. Also, <strong>don't hesitate to seek help</strong> as most of the times the impasse that one faces is something that others have encountered before and they might offer some insight that can help. This pursuit gets quite frustrating at times but the satisfaction one feels after getting the answers makes this struggle worthwhile (<strong>quitting ain't an option</strong>!).</p> <p>The coding period has ended and my GSoC journey too is nearing its end but I believe that I'm just getting started with Open Source and I can't wait to work on the ideas I developed over the course of this summer. I have some exciting project ideas for FURY (physics and animation based) that I hope to work on.<br><br>To the Reader, <br>Good luck with your future endeavours and goals. <br>Never give up.</p> <h4><em>Au Revoir :)</em></h4> <p><br><img height="360" src="https://i.imgur.com/xZhJipq.jpeg" width="432"></p>sajagswami@gmail.com (SunTzunami)Mon, 16 Aug 2021 12:26:00 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-11-9/Weekly Check-in #10https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-10-11/<h2>Ninth week of coding </h2> <p>Welcome to the tenth weekly check-in. I'll be sharing my progress for the ninth week of coding.</p> <h2> What did you do this week? </h2> <p></p><ol> <li>Updated <a href="https://github.com/fury-gl/fury/pull/452">PR #452</a>: <ul><li>Made ribbon representation faster.</li> <li>Added an actor to display bounding box around the molecule. <br>Preview: <br> <img height="300" src="https://user-images.githubusercontent.com/65067354/128624529-03c026be-7f80-4792-b57e-eceeb1767ec2.png" width="300"></li></ul></li> <li>Made a tutorial which showcases the abilities of <code>molecular</code> module (will create a PR after <code>molecular</code> module is merged).</li> <li>I'm trying to implement a native implementation of molecular surfaces in FURY. Currently searching for recent research papers to find good algorithms to generate the molecular surfaces.(the ones I'd collected in the research period were archaic and rather time consuming). The papers that I've read so far seem a tad bit intimidating as I've never done math related to this domain yet. Implementing them will be a good learning experience I reckon.</li></ol> <p></p> <h2>What is coming up next week?</h2> <p></p><ol><li>Try to create a native implementation of molecular surface.</li> <li>Small fixes to <a href="https://github.com/fury-gl/fury/pull/362">PR #362</a>, <a href="https://github.com/fury-gl/fury/pull/462">PR #462.</a> </li></ol><p></p> <h2>Did you get stuck anywhere?</h2> <p>No.</p>sajagswami@gmail.com (SunTzunami)Mon, 09 Aug 2021 18:27:32 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-10-11/Weekly Check-in #9https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-9-11/<h2>Eighth week of coding </h2> <p>Welcome to the ninth weekly check-in. I'll be sharing my progress for the eighth week of coding.</p> <h2> What did you do this week? </h2> <p></p><ol> <li>Updated <a href="https://github.com/fury-gl/fury/pull/452">PR #452</a>: Had an extra meeting with the mentors in which we fine-tuned the <code>molecular</code> module and optimized it to make it more <i>pythonic</i>.</li> <li>I was able to generate vertices and triangles for Solvent Excluded Surfaces (a type of molecular surface representation popularly called SES) by using a bioconda package called <a href="https://anaconda.org/bioconda/msms">msms</a>. It's based on <a href="https://onlinelibrary.wiley.com/doi/10.1002/%28SICI%291097-0282%28199603%2938%3A3%3C305%3A%3AAID-BIP4%3E3.0.CO%3B2-Y">this paper</a> by Michel F. Sanner, Arthur J. Olson &amp; Jean-Claude Spehner. It was then rendered via <code><a href="https://github.com/fury-gl/fury/blob/master/fury/actor.py#L261">surface actor</a></code>. <br>Preview (SES surface generated by using msms): <br> <img height="300" src="https://user-images.githubusercontent.com/65067354/128756004-553d1880-b6e1-4a43-99fa-5bd6a2ee70d4.png" width="300"> <br> </li> <li>Added my GSoC blogs to the FURY blogs directory. (<a href="https://github.com/fury-gl/fury/pull/475/files">PR #475</a>)</li> </ol> <p></p> <h2>What is coming up next week?</h2> <p></p><ul><li>Research about recent papers having good (fast) algorithms to create the molecular surfaces.</li> <li>Create tutorials to explain how to use <code>molecular</code> module.</li> </ul>Other goals will be decided in the meeting with mentors.<p></p> <h2>Did you get stuck anywhere?</h2> <p>No.</p>sajagswami@gmail.com (SunTzunami)Mon, 02 Aug 2021 05:35:34 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-9-11/Weekly Check-in #8https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-8-11/<h2>Seventh week of coding </h2> <p>Welcome to the eighth weekly check-in. I'll be sharing my progress for the seventh week of coding.</p> <h2> What did you do this week? </h2> <p></p><ol> <li>Updated <a href="https://github.com/fury-gl/fury/pull/452">PR #452</a>: <ul><li>Added Ribbon representation to the <code>molecular</code> module.</li> <li>Added tests for all functions and classes of <code>molecular module</code>. Writing tests is kinda fascinating.</li></ul></li> <li>Updated <a href="https://github.com/fury-gl/fury/pull/462">PR #462</a>: Addressed the reviews of team members and mentors, added more new features. Preview: <br> <img height="300" src="https://user-images.githubusercontent.com/65067354/126382288-b755c01d-8010-43ab-87db-2f1a4fb5b015.png" width="300"> <br> </li> <li>Updated <a href="https://github.com/fury-gl/fury/pull/362">PR #362</a>: Addressed the feedbacks of team members and mentors.</li></ol> <p></p> <h2>What is coming up next week?</h2> <p></p><ol><li>Work more on <code>molecular</code> module, meeting with mentors and core team on thursday to optimize the module and merge <a href="https://github.com/fury-gl/fury/pull/452">PR #452</a>.</li> <li>Work upon molecular surface representation.</li></ol><p></p> <h2>Did you get stuck anywhere?</h2> <p>No.</p>sajagswami@gmail.com (SunTzunami)Mon, 26 Jul 2021 18:29:46 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-8-11/Weekly Check-in #7https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-7-16/<h2>Sixth week of coding </h2> <p>Welcome to the seventh weekly check-in. I'll be sharing my progress for the sixth week of coding.</p> <h2> What did you do this week? </h2> <p> </p><ol> <li>Updated <a href="https://github.com/fury-gl/fury/pull/452">Molecular module</a>: <ul><li>Made it more <i>pythonic</i>.</li> <li>Implemented Ribbon representation.</li> <li>Added support to pass atomic data in the form of numpy arrays. Earlier, the users were required to append molecular information one atom at a time.</li></ul> </li><li>Created a <a href="https://github.com/fury-gl/fury/pull/462">PR</a> to: <ul> <li>update the helical motion animation to use a single line actor, added textblocks to display velocity of the particle. Preview: <br> <img height="300" src="https://user-images.githubusercontent.com/65067354/126033284-882ed6fd-fcc3-4a1c-8dfd-3220908859b1.png" width="400"> <br> </li> <li>For brownian motion simulation, I removed rotation (azimuth) and box actor, added textblock to display the number of particles and to show the simulation steps. Preview: <br> <img height="400" src="https://user-images.githubusercontent.com/65067354/126033291-da68cb0d-b856-48ad-9aa4-c46621052267.png" width="400"> <br> </li> </ul></li> <li>Updated surface animation (<a href="https://github.com/fury-gl/fury/pull/362">PR #362</a>): used gridUI, added multiple animations). Preview: <br> <img height="400" src="https://user-images.githubusercontent.com/65067354/126061012-b183a47d-ed5e-4026-938b-4124da291524.png" width="400"> <br> </li><a href="https://github.com/fury-gl/fury/pull/362"> </a><li><a href="https://github.com/fury-gl/fury/pull/362">Created a </a><a href="https://discourse.vtk.org/t/vtkmoleculemapper-gaps-in-bonds-on-zooming-in/6183">topic</a> on vtk discourse forum to query about gaps in bonds (tried resolving it by manipulating vtkProperties: BackfaceCulling, FrontfaceCulling but was unsuccessful)</li> <li>Read about molecular surface (theory).</li></ol> <p></p> <h2>What is coming up next week?</h2> <p></p><ol> <li>Update <code>molecular</code> module by adding tests, ribbon actor</li> <li>More work on molecular surface representation</li> <li>Experiment to check if molecules can be interacted with.</li> </ol> <p></p> <h2>Did you get stuck anywhere?</h2> <p>No.</p>sajagswami@gmail.com (SunTzunami)Mon, 19 Jul 2021 17:32:30 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-7-16/Weekly Check-in #6https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-6-18/<h2>Fifth week of coding </h2> <p>Welcome to the sixth weekly check-in. I'll be sharing my progress for the fifth week of coding.</p> <h2> What did you do this week? </h2> <p> </p><ol><li>Generalised the <code>vtkProteinRibbonFilter</code> implementation. I'd like to thank Javier for helping me debug the code. We understood what kinda input <code>vtkProteinRibbonFIlter</code> requires over the course of the mid-week meeting. Refer to <a href="https://discourse.vtk.org/t/proteinribbonfilter/4545">this link</a> to understand what kinda <code>PolyData</code> is required by the filter. Latter half of the week was spent in manipulating the data according to the required input and I was able to use the filter to render ribbons. Refer to <a href="https://discourse.vtk.org/t/vtkproteinribbonfilter-usage-without-using-vtkpdbreader/6079/2">this link</a> to understand how to send appropriate data to the filter.</li> <li>Updated the <a href="https://github.com/fury-gl/fury/pull/452">molecular module</a> based on the feedback of team members and mentors.</li> <li>Updated animated surfaces <a href="https://github.com/fury-gl/fury/pull/362">PR</a>.<br> Preview of the animation: <br> <img height="300" src="https://user-images.githubusercontent.com/65067354/125155195-d4105800-e17b-11eb-9e6d-2b66ba7a8f6e.gif" width="300"></li> </ol> <p></p> <h2>What is coming up next week?</h2> <p> </p><ol><li>Update <code>molecular</code> module based on team members' suggestions and add tests for the same.</li> <li>Add protein ribbon implementation to <code>molecular</code> module.</li> <li>Begin working on molecular surface model.</li> </ol> <p></p> <h2>Did you get stuck anywhere?</h2> <p>No.</p>sajagswami@gmail.com (SunTzunami)Mon, 12 Jul 2021 18:16:51 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-6-18/Weekly Check-in #5https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-5-13/<h2>Fourth week of coding </h2> <p>Welcome to the fifth weekly check-in. I'll be sharing my progress for the fourth week of coding.</p> <h2> What did you do this week? </h2> <p>Created a <a href="https://github.com/fury-gl/fury/pull/452">PR</a> for the molecular module. Enables the ability to create three types of molecular representations: </p><ol> <li>Sphere Representation aka Space-filling model aka calotte model aka CPK model</li> <li>Stick Representation</li> <li>Ball and Stick Representation</li> </ol> <p></p> <h2>What is coming up next week?</h2> <p>Mentors suggested changes to be made to the molecular module which shall be done by this week. A mid-week meeting with mentors has been scheduled to understand what kinda input <code>vtkProteinRibbonFilter</code> requires. Hopefully this will help me in implementing Ribbon model. Other goals will be decided after the meeting.</p> <h2>Did you get stuck anywhere?</h2> <p>I've been unsuccessful in sending protein data to <code>vtkProteinRibbonFilter</code> via a <code>vtkPolyData</code>. </p>sajagswami@gmail.com (SunTzunami)Mon, 05 Jul 2021 17:43:56 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-5-13/Weekly Check-in #4https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-4-14/<h2>Third week of coding </h2> <p>Welcome to the fourth weekly check-in. I'll be sharing my progress for the third week of coding.</p> <h2> What did you do this week? </h2> <p> I made a document with code snippets and visuals to show how one can use some vtk classes in python for molecular visualization. Classes of interest : </p><ul> <li><code>vtkMolecule</code> (store atomic information about the molecule)</li> <li><code>vtkSimpleBondPerceiver</code> (calculate bonding info for a vtkMolecule)</li> <li><code>vtkMoleculeMapper</code> (mapper to draw vtkMolecule object)</li> <li><code>vtkPeriodicTable</code> (stores chemical data sourced from the Blue Obelisk Data).</li> </ul> Link to the document - <a href="https://docs.google.com/document/d/1LC2MgT9mUQK0Yo9hsI4lWqaTXHWAkSNxyBKWGAqHqe8/edit">Molecular_viz_vtk</a>. In addition to the document, I read some research papers recommended by my mentors to understand some other (and potentially better) methods of ribbon visualization. Tried to implement <code>vtkProteinRibbonFilter</code> usage without using <code>vtkPDBReader</code> but was unsuccessful in this endeavour. It's kinda tough to understand what exactly <code>vtkProteinRibbonFilter</code> requires as input. I'll have to dig deeper into its documentation. <p></p> <h2>What is coming up next week?</h2> <p>Three goals for next week - </p><ol> <li>Implement <code>vtkProteinRibbonFilter</code> usage without using <code>vtkPDBReader</code>. </li> <li>Make a class that inherits from <code>vtkMolecule</code>. It's instances will be used to store molecular data and pass it on to different functions for rendering purposes.</li> <li>Start reading the theory behind molecular surface representation.</li> </ol> <p></p> <h2>Did you get stuck anywhere?</h2> <p>Implementing <code>vtkProteinRibbonFilter</code> usage via <code>vtkPolyData</code> without using <code>vtkPDBReader</code> has confounded me for some time now. Ribbon representation's code progress is at an impasse until I implement <code>vtkProteinRibbonFilter</code>.</p>sajagswami@gmail.com (SunTzunami)Mon, 28 Jun 2021 18:15:34 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-4-14/Weekly Check-in #3https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-3-13/<h2>Second week of coding </h2> <p>Welcome to the third weekly check-in. I'll be sharing my progress for the second week of coding.</p> <h2> What did you do this week? </h2> <p> I created an example to demonstrate how one can render multiple bonds (double and triple). This required me to write an algorithm to detect bonding. I used <a href="https://www.kaggle.com/aekoch95/bonds-from-structure-data">this</a> as a reference and made a few tweaks of my own to detect the presence of double/triple bonds from interatomic distances. The math involved in bond detection was quite intriguing. <br> Preview (molecules rendered: Ethane, Ethene, Ethyne from left to right): <br> <img height="300" src="https://user-images.githubusercontent.com/65067354/122672109-7d040c80-d1e7-11eb-815d-1d07fe47bbc4.png" width="300"> <br> </p> <p> In addition to this, I tried understanding the codebase of <code>vtkMolecule</code>, <code>vtkSimpleBondPerceiver</code>, <code>vtkMoleculeMapper</code>, <code>vtkPeriodicTable</code> and was able to render ball and stick models, stick models using it. This will be of great help although it's rather slow in rendering large molecules (using shaders to improve its speed will be crucial if it's to be utilised). </p><ul> <li>Preview of Stick representation using <code>vtkMoleculeMapper</code>: <br> <img height="300" src="https://github.com/SunTzunami/gsoc2021_blog_data/blob/master/visuals/week2_wire_rep.png?raw=true" width="300"> </li> <li>Preview of Ball and Stick representation using <code>vtkMoleculeMapper</code>: <br> <img height="300" src="https://github.com/SunTzunami/gsoc2021_blog_data/blob/master/visuals/week2_bs_rep.png?raw=true" width="300"> <br> </li> </ul> <p></p> <h2>What is coming up next week?</h2> <p>Try to implement the above models using shaders. Try implementing the ribbon model using the <code>vtkProteinRibbonFilter.</code> The rest will be decided in the meeting with the mentors.</p> <h2>Did you get stuck anywhere?</h2> <p> Predicting bonds had been a problem since the past few weeks, it was resolved to a large extent by <code>vtkSimpleBondPerceiver</code> (the only limitation of <code>vtkSimpleBondPerceiver</code> being its inability to predict multiple bonds). </p>sajagswami@gmail.com (SunTzunami)Mon, 21 Jun 2021 11:28:47 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-3-13/Weekly Check-in #2https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-2-11/<h2> First week of coding </h2> <p>Welcome to the second weekly check-in. I'll be sharing my progress for the first week of coding.</p> <h2> What did you do this week? </h2> <p> I implemented the space filling model for proteins and created a <a href="https://github.com/fury-gl/fury/pull/439/files#diff-5b48734659c3e326af7d91c037bac1799c6ff76e15ebee5bd2488a50f035d9a0">PR</a> for the same. <br> Preview (protein: <a href="https://www.rcsb.org/structure/3pgk">3pgk</a>): <br> <img alt="https://user-images.githubusercontent.com/65067354/121518963-b92cb580-ca0e-11eb-8232-3512edc04670.png" src="https://user-images.githubusercontent.com/65067354/121518963-b92cb580-ca0e-11eb-8232-3512edc04670.png"> <br> The PR has: </p><ul><li>Actor for space filling model</li> <li>Two examples where I show how to visualize the proteins: <ol><li>In <a href="https://github.com/fury-gl/fury/pull/439/files#diff-2c9d065c4d4873b6ce534137cfd990cea495faffd249ff35cf51e36749883534">example 1</a>, I parse a PDBx file myself and extract the atomic info essential for constructing the model which is then used by the actor to visualize it.</li> <li>In <a href="https://github.com/fury-gl/fury/pull/439/files#diff-68e69b9f24731ed981cd91763f3dd078aa2bf9a4da638d561352a9cf37cfd29c">example 2</a>, I parse a PDB file by using Biopython module and extract the atomic info essential for constructing the model which is then used by the actor to visualize it.</li> </ol> </li><li>I created a basic test for the actor which needs to be improved. I'll discuss how to improve the test with the mentors. </li></ul> <p></p> <h2>What is coming up next week?</h2> <p> I'll try to implement ball and stick model or ribbon model depending on which model is decided in the meeting with the mentors and try to improve the tests for space filling model. Writing an algorithm to generate bonds from structure data will be the challenge</p> <h2>Did you get stuck anywhere?</h2> <p> I tried to create a class in python which inherits from a class in VTK called <code>vtkMoleculeReaderBase</code> but was unsuccessful in this endeavour (some classes from VTK can't be inherited apparently). I'll try to find a workaround.</p>sajagswami@gmail.com (SunTzunami)Mon, 14 Jun 2021 07:36:08 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-2-11/Weekly Check-in #1https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-1-11/<h2> Welcome to my GSoC Blog! </h2> Hi all! I'm Sajag Swami, a sophomore at Indian Institute of Technology, Roorkee. I will be working on bringing Ribbon and Molecular Surface protein representations to FURY. <p></p> As a part of my stretch goals, I’ll try to bring the following molecular representations to FURY: <ul><li>Stick</li> <li>Ball and stick</li> <li>Wire</li> <li>Pipes and Planks</li> <li>Sphere</li></ul> <h2>What did you do during the Community Bonding Period?</h2> <p> I had weekly meetings with my mentors and other core team members. In the first meeting I got acquainted with the team members and learnt more about FURY and its goal/vision. In the later meetings we discussed about various representations of proteins and how to go about implementing them in FURY. We talked about different libraries which can be used to parse PDB and PDBx files. I made a <a href="https://docs.google.com/document/d/1mSoAWyXlLNrCa3hN-hiP35Lj7rURYMk5jFnWZbZp70s/edit">doc</a> for the same to list pros and cons of using each library. I worked upon my <a href="https://github.com/fury-gl/fury/pull/404">previous PR</a> too during the community bonding period and fixed its docstring syntax. </p> <p> As my college ended early courtesy covid, I had extra time during which I experimented and learnt more about PDB and PDBx files - the details they contain and how to parse them. A small backbone visualisation of 1mb0 protein made on FURY by extracting coordinate data of its alpha carbons - <br> <img alt="https://github.com/SunTzunami/gsoc2021_blog_data/blob/master/visuals/week1_backbone.png?raw=true" src="https://github.com/SunTzunami/gsoc2021_blog_data/blob/master/visuals/week1_backbone.png?raw=true"> </p> <h2>What is coming up next week?</h2> I have two major goals for the next week - <ul> <li>Make an actor for the space filling model of the proteins and make PR for the same which will also include the unit tests and a small tutorial for the users.</li> <li>Try understanding the documentation of <code>vtkProteinRibbonFilter</code> which will prove beneficial for generating Ribbon diagrams.</li> </ul> <h2>Did you get stuck anywhere?</h2> Dealing with large protein structures was kinda difficult as it gets computationally taxing to render many molecules. FURY team was pretty helpful and instructed me to use shaders (luckily for me, the shader in question had been implemented by the community members). This resolved the issue of dealing with large files to a great extent.sajagswami@gmail.com (SunTzunami)Tue, 08 Jun 2021 02:28:56 +0000https://blogs.python-gsoc.org/en/suntzunamis-blog/weekly-check-in-1-11/