Feb 17, 2023

Public workspaceAnalysis of ALEX Movies Containing Low-FRET Efficiency Pairs V.2

This protocol is a draft, published without a DOI.
  • 1University of Pennsylvania
Icon indicating open access to content
QR code linking to this content
Protocol Citation: Clark Fritsch 2023. Analysis of ALEX Movies Containing Low-FRET Efficiency Pairs. protocols.io https://protocols.io/view/analysis-of-alex-movies-containing-low-fret-effici-cpkbvksnVersion created by Clark Fritsch
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: February 17, 2023
Last Modified: February 17, 2023
Protocol Integer ID: 77155
Abstract
This protocol is meant to describe the procedure needed to detect and analyze pairs of fluorescently-labeled molecules that generate low-FRET efficiencies that might otherwise difficult to detect using the programs described in the "Basic Analysis Protocol".

In the "Basic Analysis Protocol", pair profiles are generated for both ALEX and non-ALEX movies by matching fluorescent spots in the green channel (emission from direct excitation of donor fluorophore with 532 nm laser) with fluorescent spots in the red channel (sensitized emission from excitation of the acceptor fluorophore by the donor fluorophore). However, if the fluorescent spots in the red channel are dim (low signal from sensitized emission / Low-FRET efficiency), it may be difficult to match up the fluorescent spots between the green and red channels to generate a pair profile (especially if the background intensity in the movie of interest is high).

To allow for detection of these pair profiles, the programs used in this protocol match the fluorescent spots in the donor channel with the fluorescent spots in the red channel that are due to the direct excitation of the acceptor fluorophore using the 648 nm laser. The spots caused by direct excitation of the acceptor fluorophore are generally much brighter, and therefore easier to detect, than the spots caused by the sensitized emission of the acceptor fluorophore. Once a pair between the spots in the green channel (caused by direct excitation of the donor fluorophore) and the spots in the red channel (caused by direct excitation of the acceptor fluorophore) is established, the programs then determine the intensity of the spots caused by the sensitized emission and format everything properly for further analysis.
Guidelines
All programs included in this protocol are meant to be run on a Windows system and will need adjustment for Mac and potentially Linux-based systems.
In NIS-Elements, we record our single-molecule FRET movies with a .nd2 file format. However, to analyze our data we must first convert our movies from .nd2 files to .tiff files.



To convert your ALEX .nd2 files to .tiff files, first open Fiji / ImageJ. Then go to File and open the ND2_tiff1.ijm program that is provided below:


Download ND2_tiff1.ijmND2_tiff1.ijm

Once you open the ND2_tiff1.ijm program, you should see the following screen:


  • Once the program is open, you will need to paste in the path to your .nd2 files between the " " for the path variable (highlighted in yellow in the above image).

  • Note that when you paste your path into the program, you may have the different directories in the path separated by backward slashes (\). You will need to replace these back slashes with forward slashes (/) for imagej to recognize the path.

  • Additionally, you will have to make sure that your path ends with a /. Otherwise the program will not process all of the files in the directory that you are interested in.

  • Example:
Change: D:\Basic_Analysis_Guide to D:/Basic_Analysis_Guide/

Once the correct path has been entered into the path variable, click the "Run" button at the bottom of the ND2_tiff1.ijm program window. The program will then begin processing your files and will open two additional windows. The first window is the Log window, which simply gives a progress report for which files in your directory of interest have been processed. The other window is an ImageJ Bio-Formats Import Options window that allows you to change the settings of your movies. For our case, however, you simply want to click "Okay" in the ImageJ Bio-Formats Import Options window. None of the settings needs to be changed.


The program may take a minute or two to process each movie, depending on how large each movie is. Once the program has finished converting one .nd2 file to a .tiff file, it will move on to the next movie in the directory and you will once again have to click "Okay" when the Bio-Formats Imports Options window opens up.

Once you have converted your .nd2 files to .tiff files, you will want to generate pair profiles by matching the donor fluorophores in the green channel with the spots for the sensitized emission from the acceptor fluorophores in the red channel. However, in movies where the FRET efficiencies are low, these sensitized emission spots can be difficult to detect using the programs introduced in the "Basic Analysis Protocol".

Diagram showing how pair profiles are generated in the "Basic Analysis Protocol".
Video




To bypass this issue, we will first use a program called "ALEXCombRGSwp 3.py" to rearranged the ALEX movies so that the spots that are caused by the direct excitation of the acceptor fluorophores with the red laser are arranged opposite the spots caused by the direct excitation of the donor fluorophores with the green laser. Because the spots that are caused by the direct excitation of the acceptor fluorophore are much brighter than the original sensitized emission spots, they are easier to detect and align with the spots in the green channel.
Diagram showing how pair profiles are generated using the "ALEX_Comb_RG_Swp_3.py" program.
Video


To begin, you want to make sure that you have your .tiff files in one directory as shown below:


Once you have your .tiff files in one directory, you will first to open Spyder (or whatever Python IDE that you prefer). Then go to File and open the "ALEX_Comb_RG_Swp_3.py" program that is provided below:


Download Alex_Comb_RG_Swp_3.pyAlex_Comb_RG_Swp_3.py


Then paste the path to the directory that contains your .tiff movies between the " " in the path variable at the top of the program, as highlighted in blue in the image below:


Then you simply run the program by clicking the green triangle button on the top bar of the Spyder tool bar and the program will begin processing your files. You can see the program's progress in the IPython Console in the lower right corner of the Spyder IDE, as shown below:



After the program finishes running, it will save the rearranged ALEX movies in a new directory called "wr" in the directory that contains your original .tiff files.


As stated in Step 6, these "wr" files are rearranged so that the spots caused by the direct excitation of the acceptor fluorophore by the red laser are arranged opposite the spots caused by the direct excitation of the donor fluorophore by the green laser.

You will then want to move each individual .tiff file to a separate directory for further processing. I like to name each directory according to the sample number for the movie. For example, a .tiff file named "s0101-wr.tiff" would go into a new directory called "s0101".



Now that we have our .tiff files in separate directories, we want to go ahead and detect any fluorophore spots that overlap in the green channel (emission from donor fluorophores that have been directly excited by the 532 nm laser) and the red channel (emission from acceptor fluorophores that have been directly excited by the 648 nm laser). We do this by using an imagej program that we call "3 spots detector", which is included below:

Download 3 spots detector.zip3 spots detector.zip

The directory for the spots detector program contains three sub-directories:

  • ImageJ test Jan 11
The ImageJ test Jan 11 directory contains an old version of the spots detector program and is saved simply for having a backup just in case something goes wrong with the most current version.

  • ImageJ1.8
The ImageJ1.8 directory contains the most recent version of the program and all of the required plugins that are needed to run the program.

  • NewDualview
The NewDualview directory contains the PSM files that contain information that the program needs
to run properly. There are many different PSM files in this directory for a variety of different types of analyses, most of which you don't really need to worry about.



The PSM files contained in the NewDualview directory need to be modified depending on the experimental conditions:



For the time being, the main settings that should be modified for each experiment are the minimum intensity thresholds for the donor (left) and acceptor (right) panels of each movie (highlighted in the above image). This point is discussed in further detail later on in the protocol. In addition to the minimum intensity thresholds, another setting that you may want to change is the number of initial frames that the Spot Detector program scans through to find overlap (and therefore FRET) between the spots in the left and right panels of each movie. Essentially, if you don't expect to see FRET in your movie until 300 frames into the movie, then you need to set the initial frames for the left and right panel to 300. If you expect to see FRET immediately upon starting the movie (which is the most common scenario), then you can set the initial frames to 100 or another similarly low number. Just note that the more frames that you make the program scan through to find overlap between spots in the different channels, the slower the program is going to run. If the program scans through the first 100 frames of a movie to find overlapping spots, the analysis might only take 5 minutes. If you make the program scan through all of the frames in a movie to find overlapping spots, then it might take an hour just to analyze one movie.


Begin the analysis by opening the ImageJ1.8 directory and double clicking on the ImageJ.exe program that is highlighted below:


Once imageJ is open you want to go to Plugins > ZD8 > PSM Analyze, as shown below:



You then want to navigate to the NewDualview directory in the original 3 spots detector directory and select a PSM file that contains settings appropriate to your movie:


After you select your PSM file and click "open" a program control window will open:


]You want to make sure to check the "ALEX Style" box and the "Show histograms" box to see the intensity distribution of the movie that you are analyzing. Additionally, you can check the "Show pairboxes" box if you want to see the pairs that the program selects for your movie. Note, however, that for the average movie, the boxes that the program displays are too dense to make any sense of. It is mainly good for troubleshooting and verifying that the program is analyzing the movie correctly. It also makes the program run very slowly, so I would avoid checking the "Show pairboxes" box unless absolutely necessary. The rest of the settings in the program control window can remain unchanged. Then click "OK".

Another window will then open and you will want to navigate to the directory that contains the rearranged .tiff file that you want to analyze. In this case, I want to analyze the "s0401-wr.tiff" movie, so I will navigate to the s0401 directory:


Note that your movie won't show up in the directory. That is fine. After navigating to your directory, just click "Open" and the program will begin running.


After the program begins running, three different windows will open (only one window if you didn't check the "Show histograms" box initially). The first window is the intensity histogram for the left side of your movie (the green channel):

For the above histogram, what you are seeing are the pixel intensities for every pixel on the left panel of the movie. This means that you are measuring the intensity of not only the fluorophore spots that you are interested in, but also the background. Ideally, you will select a minimum intensity threshold in your PSM file that allows you to ignore the intensity from the background, although it is not always possible to do this cleanly. If you look at the above histogram, you can see that there are two distinct peaks with one of the peaks having a broad shoulder. I assume that the peak that is farthest to the left is from the background intensity, whereas I assume that the peak that is farthest to the right is from the fluorophore spot intensity. I am not sure what shoulder on the far left peak is, but I would likely want to set my minimum intensity threshold to encompass it, just in case. Note that I set the minimum intensity threshold for the left channel to be around 1800 for the above histogram. If I wanted to get all of the shoulder, I would have to re-run the analysis with a minimum intensity threshold for the left channel at approximately 1500. This is largely empirical, though. In general, I want to avoid setting the minimum intensity value too high. If I was to set the minimum intensity value to 4500, for example, I would be excluding most of my fluorophore spots from being analyzed any further. Because of this, I would likely get very few pairs between the red and green channels of the movie. If I set the minimum intensity value too low, however, the only downside is that I would likely get a lot of pairs between the red and the green channels that were complete junk / noise. Note that the part of the histogram that is in green is the part of the intensity spectrum that will be considered for pairing with the red channel.
The second window is the intensity histogram for the right side of your movie (the red channel):

For the above histogram, what you are seeing are the pixel intensities for every pixel of the right panel of the movie. Unlike the histogram that was generated for the green channel, there is one distinct peak for this histogram and one very broad shoulder coming off to the right of the main peak. In this case, the main peak is likely to be attributable to the background intensity of the movie and is therefore not useful to us. The shoulder, however, is likely to be made up of the intensity values from our directly excited acceptor fluorophores. As you can see from the above histogram, I set the minimum intensity value in this case to be about 1300 as a first guess of the minimum intensity threshold. However, I probably got a bit too much of the background peak. If I wanted to re-run the analysis, I would set the minimum intensity threshold for the right channel to be about 1400 to exclude the background peak. This, however, is completely optional.
The third window is a log of the program's progress:

The log window contains a large amount of information regarding the number of spots that the program is trying to match between the two panels of you movie, the location of the spots in each panel of the movie, how many pairs the program finds between the two panels of the movie, etc. For the time being, the most relevant information that the program outputs can be found at the bottom of the window after the program has finished running. This information includes how many distinct spots the program found in the left panel of the movie (donor fluorophore / green channel) and the right panel of the movie (acceptor fluorophore / red channel). Additionally, you can see how many overlapping spots the program found between the two panels of the movie (in this case the program found 447 spots that overlapped between the right and left panels).
Note that the spot detector program can be quite slow. Sometimes taking upwards of 15 - 30 minutes to run per movie. However, the time that it takes to run the program can be minimized depending on the settings used in your PSM file (discussed above). Once you have finished running the spot detector program on one movie, you will want to repeat the analysis on each of your other movies, one at a time, by repeating Steps 12 - 14.

After running the Spot Detector program on all of your movies, navigate to the directory that contains your rearranged .tiff file. You will now see that the directory is filled with pairProfiles that contain the donor intensity and acceptor intensity as measured by the Spot Detector program:


You will also find the log file that was outputted from the Spot Detector program. While there are other files that the program outputs, we don't currently use them for any of our analyses and so I will not discuss them here.


While you do not really have to open the pairProfile.csv files for any reason most of the time, it is useful to know how they are formatted:


As you can see from the above excel file, each pair profile really only has two columns. The first column contains the intensity values over time of the donor fluorophore that the program found in the left panel / green channel of the movie. The second column contains the intensity values over time of the acceptor fluorophore that the program found in the right panel / red channel of the movie. The first entry of each column is the coordinate location of the spot in either the left or right panel of the movie. The second entry of each column is the intensity value of either spot during the first frame of the movie, the third entry of each column is the intensity value of either spot during the second frame of the movie, so on and so forth.

As discussed previously, if you are analyzing ALEX movies and have rearranged them properly using the "ALEX_Comb_RG_Swp_3.py" program, then the intensity from the sensitized emission of the acceptor fluorophore will be located at the second half of the .csv file. For example, if your movie was 892 frames then the intensity values from frames 1 - 446 would be from direct excitation of the donor fluorophore with the 532 nm laser (first column) and from the direct excitation of the acceptor fluorophore with the 648 nm laser (second column), whereas the intensity values from frames 447 - 892 would be from the sensitized emission from the acceptor fluorophore.


Now that you have generated the pair profiles from each of your movies, you want to re-format the pair profiles so that the first half of the .csv pair profiles will include the direct excitation of the donor fluorophore with the 532 nm laser (first column) and the sensitized emission from the acceptor fluorophore (second column). Likewise, we will have to re-format the data so that the second half of the .csv pair profiles will include the intensity values for the direct excitation of the acceptor fluorophore.

We can accomplish this using the "SwapBack2.py" program that is include below:

Download SwapBack2.pySwapBack2.py

To begin using the "SwapBack2.py" program, you will first want to open Spyder (or whatever Python IDE that you prefer). Then go to File and open the "SwapBack2.py" program. Then paste the path to the directory that contains the rearranged / swapped pair profiles for your rearranged ALEX movies between the " " in the path variable at the top of the program, as highlighted in blue in the image below:


Then you simply run the program by clicking the green triangle button on the top bar of the Spyder tool bar and the program will begin processing your files. You can see the program's progress in the IPython Console in the lower right corner of the Spyder IDE, as shown below:



After the "SwapBack2.py" program has finished running, you will find the new directory called "sb" within the directory containing your swapped pair profiles, as shown below:


The "sb" (swapped back) directory will contain a re-formatted copy of each of your pair profiles:


Repeat Step 19 for the swapped pair profiles for each of your movies.
Now that you have generated the "swapped back" pair profiles from each of your movies, you can now go through each of the pair profiles (FRET time traces, also simply called traces), and select which of the traces are good and which are just junk. You can do this using the following program:

Download PltPPsALEX4.pyPltPPsALEX4.py

The above program will plot the traces that you have generated so that you can visually determine whether the trace you are looking at is good or not.

To run the PltPPsALEX3.py" program, simply open it in Spyder (or your preferred Python IDE) and enter the path to the pair profiles that you want to analyze between the " " for the path variable, as shown below:



Once you run the program, you will see a window pop up that contains the plotted traces (shown individually) that are contained in your path directory. You will also see the controls for the program in the IPython Console in the lower right hand corner of the IDE:


I recommend dragging the IDE to the right hand of the screen and dragging the trace plot to the left hand of the screen. It will make it easier to cycle through the traces quickly.

As you can see at the bottom of the IPython console, the controls for the program are as follows:

  • (S)ave - type s into the console where the cursor is to save a good trace in a file called "GoodOnes.txt".

  • (B)ack - type b into the console where the cursor is to go back one trace in the directory.

  • (Q)uit: type q into the console where the cursor is to quit the program after you are done.


This step of the analysis can be extremely time consuming, depending on how many traces you have per movie and how many movies you have to analyze. It can easily take a week or two to get through a couple of days worth of experiments.

While cycling through your traces, make sure to pay attention to what index your are on. The program will not warn you when you have finished cycling through all of the traces in a directory. It will reach the last trace in the directory and then simply start again from the first trace in the directory. If you are not careful, you might end up getting duplicates in your "GoodOnes.txt" file if you select the same traces multiple times.

As you can see from the above image, the directory that I am analyzing has 71 traces (different directory from what I show in the first part of Step 23) in it that need to be looked at. The first trace is at index = 0, whereas the last trace is at index = 70. Once you have gone through all of the traces in the directory, the program will simply display the first trace again (i = 0).

Ideally you will have generated a catalog of traces that you consider worthy of further analysis by saving the good traces to the "GoodOnes.txt" file for a given directory. These files are very simply contain the name of the traces that you have selected and the index of the trace within the path directory. These "GoodOnes.txt" files can then be fed into other programs for downstream analysis, depending on what exactly you want to do with them: