TITLE: Primary Data Analysis - Basecalling, Demultiplexing, and Consensus Building for ONT Fungal Barcodes
AUTHORS: Stephen       Douglas Russell

[DESCRIPTION]
This protocol assumes that your MinION run has been completed and the data from the run has been saved. It should take you from raw data to usable FASTA files containing consensus sequences for each of your fungal barcodes. 

Note: This protocol assumes you are using 10.4.1 flowcells with V14 chemistry, so there is a process to filter out and combine your duplex reads with your simplex reads. It will also show the average quality scores from each simplex and duplex component.

[STEPS]
SECTION: Initial Post-Run Preparation
1. This protocol assumes the experiment name is "FirstRun."

Create a new working folder on the desktop. Ex - FirstRun. Within that create a new folder called "fast5," another called "Programs," and a final one called "NGSpeciesID."

I will start by copying all of the fast5 files from:

/var/lib/minknow/data/./FirstRun/CellName/long_unique_name/fast5 to the newly created fast5 folder on the desktop
SECTION: Initial Post-Run Preparation
2. Create an index file from your extraction template papers. This will allow you to link all of your reads with the individual specimens. A template for 10 plates (960 specimens) can be found here:

  

This .xlsx is formatted to utilize the Lab Code and iNaturalist # columns as the only inputs. It will combine these and all of the other columns into a single cell - concatenating them all into the final file name. For the Lab Code, I will typically put these into the iNaturalist "Voucher Number(s)" Observational Field, and then export them all at once into a .csv from iNat. This allows me to simply copy and paste many iNat numbers at once, without ever needing to input any of the numbers manually.

After editing, save as a tab-delimited text file in the NGSpeciesID folder. You will need to remove most of the final columns from the template. The final output should be saved like this:

  

SECTION: Initial Post-Run Preparation
3. Copy these Python scripts into the Programs folder you just created.

  
  
  

My shorthand "quick" guide for all of the following commands can be found in the file below. I use this file whenever working through this protocol. It is saved on my desktop. Just copy-and-paste the commands sequentially into the terminal.

Guppy Run Code - Final
SECTION: SUP Basecalling with Guppy
4. 
Run the basecalling command. The command below uses Super-accuracy mode with Guppy.

 


For a Flongle cell with 1.15Gb of bases and 700 - 1.18M reads, this command takes about 120 min to run. Example output:

 

Sometimes after the run I need to restart the CPU before this command runs successfully.
SECTION: SUP Basecalling with Guppy
5. This command will install the duplex tools you will need for filtering them out and combining them with the simplex reads.

 


SECTION: SUP Basecalling with Guppy
6. Around 20-30% of the reads in your final results will be duplex reads - the single fragment is read twice - once in the forward direction and one in the reverse direction. These reads need to be identified with the command below.

 

SECTION: SUP Basecalling with Guppy
7. Rerun Guppy basecalling with the duplex reads alone that were parsed out in the previous step. This step may take about 75 min.

 


SECTION: SUP Basecalling with Guppy
8. Combine all FASTQ files into a single file for simplex and duplex calls, show the read counts, and zip them.

 


SECTION: SUP Basecalling with Guppy
9. 
Remove the uncombined FASTQ files.

 

SECTION: Validate the QC of the Run
10. Compile quality control summary charts for the simplex and duplex reads. 

 


 

Review the images that are generated. Ensure the quality scores of your run are in an appropriate range. For a 10.4.1 Flongle with "Q20+" V14 chemistry, I typically get a peak in the 15-16 range.

  
 
Example of all outputs from this command:   

SECTION: Merge the Simplex and Duplex Reads
11. Use seqkit to extract all the filenames of reads from the simplex run.

 

SECTION: Merge the Simplex and Duplex Reads
12. Create additional file structure and move around necessary files.

 


SECTION: Merge the Simplex and Duplex Reads
13. Replace the reads in the simplex with the duplex reads.

 

Note: This code was derived from a post in the ONT Community Forums. It may be in need of some future revision.
SECTION: Merge the Simplex and Duplex Reads
14. Manually unzip the file here: ~/Desktop/FirstRun/combined_bases/combined.fastq.gz
SECTION: Merge the Simplex and Duplex Reads
15. Review the total number of reads in your final file and move some files for additional analysis.

 

SECTION: Demultiplex the Reads
16. Demultiplex your samples using MiniBar. This should take less than 5 min.

 

SECTION: Demultiplex the Reads
17. Remove several large files that are not necessary for most use cases and will just make your final analysis take longer.

 

SECTION: Create the Final Consensus Sequences
18. Utilize NGSpecies ID to generate your final consensus sequences from your demultiplexed samples. This can take 480 min. It would be great if someone could get this to run through the GPU.

 

SECTION: Summarize the Data
19. Create a summary file for your results.