Line 22: | Line 22: | ||
<h2>Introduction</h2> | <h2>Introduction</h2> | ||
− | <p>To test the effect of our peptides and antibodies on sperm we needed a way to quantify the motility of spermatozoa. Ideally, we should see | + | <p>To test the effect of our peptides and antibodies on sperm we needed a way to quantify the motility of spermatozoa. Ideally, we should be able to see the decreasing of sperm motility when in contact with our molecules or our bacteria. |
+ | For this, we developed a software that is able to track spermatozoa frame by frame. This software can give us the speed of each spermatozoon from a video and thus permits us a quantitative analysis of sperm motility. Our tracking tool is based on the “Trackpy” package that contains basic functions for tracking biological elements in sample.</p> | ||
− | <p> | + | <p>All the functions that we are using are mentioned and described at the end of the page and the commented code is linked below. In this part, we are explaining the general principle and steps of our tracking software.</p> |
− | </p> | + | |
<h2>General steps to analyze the sperm motility : </h2> | <h2>General steps to analyze the sperm motility : </h2> | ||
Line 38: | Line 38: | ||
<br> | <br> | ||
− | <pThe first goal of the tracking is to identify all the spermatozoa. This identification needs to be | + | <pThe first goal of the tracking is to identify all the spermatozoa. This identification needs to be a good balance sensibility and specificity.</p> |
<br> | <br> | ||
Line 47: | Line 47: | ||
<br> | <br> | ||
− | <p>Once all spermatozoa are detected, the software analyzes the position frame by frame and | + | <p>Once all spermatozoa are detected, the software analyzes the position frame by frame and gives as an output the trajectory of each spermatozoa.</p> |
<br> | <br> | ||
Line 57: | Line 57: | ||
<br> | <br> | ||
− | <p>The trajectories | + | <p>The trajectories unable us to calculate the speed of each spermatozoa. We calculate the mean velocity and the median velocity with the uniform filter. |
− | + | Lastly, in some cases, we plotted a histogram with the percentage of motile spermatozoa depending on their velocity (figure4).<br> | |
− | + | ||
</p> | </p> | ||
Line 65: | Line 64: | ||
<p><caption>Figure 4: Histograms of the velocities of the spermatozoa for different concentrations of nisin. N represent the number of spermatozoa successfully tracked for each case.</caption></p> | <p><caption>Figure 4: Histograms of the velocities of the spermatozoa for different concentrations of nisin. N represent the number of spermatozoa successfully tracked for each case.</caption></p> | ||
− | + | <h2>The functions used in the script</h2> | |
− | <h2> | + | We start using the tp.locate function and put the good parameter that fit the circle to the object that has an average diameter. |
− | + | - We detect for each frame spermatozoa by using the tp.batch function and we link each frame with another and annotate the same particle at each frame. | |
− | + | - We filter the data that we get by using tp.filter to keep only the spermatozoa that we detect only for 60FPs. | |
− | We detect for each frame spermatozoa by using the | + | - We make other filtration as the filter by intensity to keep only the spermatozoa that have an intensity high specific mass. |
− | We filter the data that we get by using | + | - We add another filtration that it’s done manually in case the previous filtration doesn’t succeed to delete as the noise of background. Also, we combine the trajectory manually for the same spermatozoa. |
− | We make other filtration as the filter by intensity to keep only the spermatozoa that have an intensity high specific mass. | + | - We add to the script line of code to make a video with trajectory. To see the efficiency of the tracking. |
− | We add another filtration that it’s done manually in case the previous filtration doesn’t succeed to delete as the noise of background. Also, we combine the trajectory manually for the same spermatozoa. | + | - We use the function tp.compute_drift to delete the drift case by the flux of the medium. |
− | We add to the script line of code to make a video with trajectory. To see the | + | - We add to the DataFrame other columns that transform from pixel x and y position, to Um and final we calculate the velocity. |
− | We use the function | + | To have more flexibility to use the data for each Spermatozoa we transform the DataFrame to Nestedictionary that contain dictionary and each dictionary contain dx, dy, and velocity for spermatozoa. |
− | We add to the DataFrame other columns that transform from pixel x and y position, to Um and final we calculate the velocity. | + | - We calculate the velocity by using the medium filter to make a uniform speed for each spermatozoa, we plot the velocity. And we calculate the medium velocity for each spermatozoa. |
− | To have more flexibility to use the data for each Spermatozoa we transform the DataFrame to Nestedictionary that contain dictionary and each dictionary contain dx, dy, and velocity for spermatozoa. | + | - Finally, we plot the histogram with the percentage. |
− | + | ||
<h2>Explanation of the script line by line </h2> | <h2>Explanation of the script line by line </h2> |
Revision as of 20:12, 15 October 2018
Introduction
To test the effect of our peptides and antibodies on sperm we needed a way to quantify the motility of spermatozoa. Ideally, we should be able to see the decreasing of sperm motility when in contact with our molecules or our bacteria. For this, we developed a software that is able to track spermatozoa frame by frame. This software can give us the speed of each spermatozoon from a video and thus permits us a quantitative analysis of sperm motility. Our tracking tool is based on the “Trackpy” package that contains basic functions for tracking biological elements in sample.
All the functions that we are using are mentioned and described at the end of the page and the commented code is linked below. In this part, we are explaining the general principle and steps of our tracking software.
General steps to analyze the sperm motility :
First of all the video is recorded by the camera and saved in TIFF format (figure 1).
Figure 1: Video of spermatozoa
Figure 2: Frame by frame identification of the spermatozoa thanks to the software
Once all spermatozoa are detected, the software analyzes the position frame by frame and gives as an output the trajectory of each spermatozoa.
Figure 3: Trajectory of spermatozoa predicted by the software
The trajectories unable us to calculate the speed of each spermatozoa. We calculate the mean velocity and the median velocity with the uniform filter.
Lastly, in some cases, we plotted a histogram with the percentage of motile spermatozoa depending on their velocity (figure4).
The functions used in the script
We start using the tp.locate function and put the good parameter that fit the circle to the object that has an average diameter. - We detect for each frame spermatozoa by using the tp.batch function and we link each frame with another and annotate the same particle at each frame. - We filter the data that we get by using tp.filter to keep only the spermatozoa that we detect only for 60FPs. - We make other filtration as the filter by intensity to keep only the spermatozoa that have an intensity high specific mass. - We add another filtration that it’s done manually in case the previous filtration doesn’t succeed to delete as the noise of background. Also, we combine the trajectory manually for the same spermatozoa. - We add to the script line of code to make a video with trajectory. To see the efficiency of the tracking. - We use the function tp.compute_drift to delete the drift case by the flux of the medium. - We add to the DataFrame other columns that transform from pixel x and y position, to Um and final we calculate the velocity. To have more flexibility to use the data for each Spermatozoa we transform the DataFrame to Nestedictionary that contain dictionary and each dictionary contain dx, dy, and velocity for spermatozoa. - We calculate the velocity by using the medium filter to make a uniform speed for each spermatozoa, we plot the velocity. And we calculate the medium velocity for each spermatozoa. - Finally, we plot the histogram with the percentage.Explanation of the script line by line
Here you can find the script and its explanation line by line : tutorial .