TITLE: Mitogenome Assembly from NGS Genome Skimming Data
AUTHORS: Avery Hiley

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block">This protocol provides thorough instructions for how to assemble and annotate full mitochondrial genomes from NGS genome skimming data (specifically paired-end, FASTQ, gzipped reads). The steps are categorized in the following sections, which include detailed explanations throughout (e.g. why specific steps are executed in the manner instructed):</div><br/><div class = "text-block">I. Download Programs and Dependencies</div><div class = "text-block">II. Choose Working Directory</div><div class = "text-block">III. Simple Stats with SeqKit</div><div class = "text-block">IV. Clean and Trim Reads with Trimmomatic</div><div class = "text-block">V. Downsample Reads with MITObim</div><div class = "text-block">VI. Reformat Reads to Non-Interleaved with BBMap</div><div class = "text-block">VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes</div><div class = "text-block">VIII. Mitogenome Assembly with NOVOPlasty</div><br/><div class = "text-block">Furthermore, there are supplementary tutorial videos for each of the aforementioned protocol sections, which show all of the corresponding steps being executed. These videos may be used for extra guidance while running the protocol, and are especially helpful to see how long the commands take to execute and successfully terminate in real-time with real NGS genome skimming data.</div></div>

[STEPS]
?. [I. Download Programs and Dependencies]
Open up the App Store (macOS), and search for Xcode (macOS). Download Xcode Version 12.1. Minimize the App Store window. Proceed to step 3 while the Xcode download is in progress, because this may take some time.
?. [III. Simple Stats with SeqKit]
Optionally, follow along with this supplementary video as you perform section III. Simple Stats with SeqKit:Check the data statistics with SeqKit, namely the number and length of reads, by following the subsequent steps.
?. [IV. Clean and Trim Reads with Trimmomatic]
Optionally, follow along with this supplementary video as you perform section IV. Clean and Trim Reads with Trimmomatic:Clean and trim your raw reads with Trimmomatic by following the subsequent steps.
?. [V. Downsample Reads with MITObim]
Optionally, follow along with this supplementary video as you perform section V. Downsample Reads with MITObim:Conditional: MitoFinder has difficulty processing more than approximately 7 million reads paired-end (14 million reads interleaved). If your cleaned and trimmed output from step 12.5 is greater than 7 million reads, you should downsample your data with MITObim’s downsample.py function to achieve around this number (or even less) of paired-end reads.
?. [V. Downsample Reads with MITObim]
Copy and paste the following "MITObim's downsample.py" command into the text editor window:
Optional: Reads are randomly downsampled using a seed. You can try changing the seed for the random number generator to re-do this analysis if needed (e.g. if by chance you don’t get enough mitochondrial reads). To do this, define a seed for the random number generator to allow for replication of the process (downsampling again at the exact same percentage of reads you specified) by appending --rand -421039 (you can choose any 6 digit number) to the aforementioned "MITObim's downsample.py" command.*You will not know whether or not to try defining a random seed until you have tried to run MitoFinder at least once with the downsampled reads from MITObim.
?. [VI. Reformat Reads to Non-Interleaved with BBMap]
Optionally, follow along with this supplementary video as you perform section VI. Reformat Reads to Non-Interleaved with BBMap:Conditional: In the previous section, your reads had to be interleaved in order to correctly sample the same percentage of matching, complementary forward (P1) and reverse (P2) reads. MitoFinder requires non-interleaved, paired-end reads as input, so reformat your reads back into separate forward and reverse files with BBMap's reformat.sh function.
Section VI only needs to be done if the conditional section V was also completed. However, if you bypassed section V, you may skip ahead to section VII.
?. [I. Download Programs and Dependencies]
Optionally, follow along with this supplementary video as you perform section I. Download Programs and Dependencies:Download the required programs, including any prerequisites and dependencies, by following the subsequent steps.
Xcode Version 12.1 is for macOS only. Homebrew is for macOS or Linux. Furthermore, this entire protocol is structured for Mac computer users. However, alterations to the protocol for other operating systems (e.g. Windows OS and Linux) should be relatively simple, mainly requiring the use of different apps with equivalent applications to the macOS apps specified (e.g. Terminal and Finder) and different download links for the program/dependency installations.
All programs relevant to mitogenome assembly (bioinformatic softwares and pipelines) and computer apps are set in bold throughout the protocol text.
Additionally, specific file and folder names, buttons that you are instructed to click on, keyboard keys that you need to press, and direct text that you need to reference in any given step are set in italics.
?. [I. Download Programs and Dependencies]
Download Homebrew, and install the GNU Wget computer program and the GNU Command Line Tools by following the subsequent steps.
?. [I. Download Programs and Dependencies]
Open up a new Terminal (macOS) shell window. Copy, paste, and execute (click return on your keyboard) the following "/bin/bash -c Homebrew" command in order to download Homebrew:After executing the aforementioned command, you will be prompted to enter your computer password (example screenshot of the Terminal shell window pasted below for your reference).When prompted to do so, click return on your keyboard again to proceed with the installation (example screenshot of the Terminal shell window pasted below for your reference).
All commands used in this protocol are identified by the blue command icon that strikingly resembles the Terminal icon. The name of the command is listed to the right of the blue command icon. The associated command text (including any relevant arguments or specifications) to copy is transcribed in the dark grey box. The description of the command is listed underneath the dark grey box. When a command name is referred to in the protocol text (outside of the isolated, blue command icon contents), it will be placed in quotations.
If you are updated to the macOS Catalina software, the default login shell for Terminal is the Z shell (zsh). When an executed command has terminated in Terminal (zsh), whether or not successfully, you will see a line of text following either of these two formats:1. User@Computer ~ %Appears if a working directory (folder) was not specified in the Terminal shell window2. User@Computer Name_of_working_directory %Appears if a working directory (folder) was specified in the Terminal shell window2. User@Computer Name_of_working_directory %
?. [I. Download Programs and Dependencies]
Once the "/bin/bash -c Homebrew" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "brew install wget" command into the same Terminal shell window in order to install the GNU Wget computer program:
?. [I. Download Programs and Dependencies]
Once the "brew install wget" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "brew install coreutils" command into the same Terminal shell window in order to install the GNU Command Line Tools:
?. [I. Download Programs and Dependencies]
Download SeqKit v0.13.2 by following the subsequent steps.
?. [I. Download Programs and Dependencies]
Check if your Mac’s processor is 32-bit or 64-bit by viewing Processor under About This Mac. “If the processor is an Intel Core Solo or Intel Core Duo, it’s 32-bit only” (Gamet 2018).
?. [I. Download Programs and Dependencies]
Click on the following link: https://github.com/shenwei356/seqkit/releases/tag/v0.13.2
?. [I. Download Programs and Dependencies]
Download the correct SeqKit file for your corresponding OS X processor (example screenshot from the GitHub web page pasted below for your reference). Most likely your Mac's processor is 64-bit, so step 4.4 will assume this condition. Please adjust this subsequent step accordingly if your Mac's processor is 32-bit; only the file name in your Downloads should be different, but the instructions are the same.
?. [I. Download Programs and Dependencies]
If you downloaded the link for OS X 64-bit (seqkit_darwin_amd64.tar.gz), open the seqkit_darwin_amd64.tar file in your Downloads folder.
?. [I. Download Programs and Dependencies]
Open up a new Finder (macOS) window and go to your Applications folder. Transfer the resulting seqkit (Unix executable) file from your Downloads to your Applications folder.
?. [I. Download Programs and Dependencies]
Download Trimmomatic Version 0.39 by following the subsequent steps.
?. [I. Download Programs and Dependencies]
Click on the following link: http://www.usadellab.org/cms/?page=trimmomatic
?. [I. Download Programs and Dependencies]
Click on the Trimmomatic Version 0.39 binary link to start the download.
?. [I. Download Programs and Dependencies]
Transfer the resulting Trimmomatic-0.39 folder from your Downloads to your Applications folder.
?. [I. Download Programs and Dependencies]
Download MITObim Version 1.9.1 by following the subsequent steps.
?. [I. Download Programs and Dependencies]
Download BBMap Version 38.87 by following the subsequent steps.
?. [I. Download Programs and Dependencies]
Click on the following link: https://github.com/chrishah/MITObim
?. [I. Download Programs and Dependencies]
Click the green Code button on the right hand side of the page.
?. [I. Download Programs and Dependencies]
Click Download ZIP.
?. [I. Download Programs and Dependencies]
Transfer the resulting MITObim-master folder from your Downloads to your Applications folder.
?. [I. Download Programs and Dependencies]
Click on the following link: https://sourceforge.net/projects/bbmap/files/
?. [I. Download Programs and Dependencies]
Click the large, green Download Latest Version button, or click the blue link to download the BBMap_38.87.tar.gz file.
?. [I. Download Programs and Dependencies]
Transfer the resulting bbmap folder from your Downloads to your Applications folder.
?. [I. Download Programs and Dependencies]
Download MitoFinder v1.4 and install the dependencies by following the subsequent steps.
MitoFinder is one of the most all-inclusive and user-friendly bioinformatic pipelines for assembling mitochondrial genomes from various types of NGS data. MitoFinder was designed to capture mitochondrial genomes from smaller NGS datasets, namely from target enrichment phylogenomics. However, MitoFinder is also applicable to (and successful in analyzing NGS data obtained from) other sequence capture methods, transcriptomic data, and whole genome shotgun sequencing in diverse taxa. Although MetaSPAdes has a computation time on average twice that of the other two metagenomic assemblers (MEGAHIT and IDBA‐UD) that may be used with MitoFinder; Allio et al. (2020) determined that it is still the most effective in accurately assembling both UCE and mtDNA contigs, notably in the assembly of full mitochondrial genomes in a single contig.Upon completion of analyzing NGS datasets through the MitoFinder pipeline in combination with the MetaSPAdes assembler, MitoFinder generates a series of extremely organized and useful output files, including but not limited to:Fasta file (.fasta) containing the amino acid translations for the 13 PCGs (protein coding genes).Fasta file (.fasta) containing the nucleotide sequences for the 15 total mitochondrial genes (13 PCGs and 2 rRNAs).Fasta file (.fasta) containing the full length mitochondrial genome in a single nucleotide contig.Genbank files (.gb and .tbl) for the resulting mitogenome that are ready for upload to NCBI-- in addition to the full length, nucleotide mitogenome contig, this file contains the annotations of all the gene features (tRNAs and their products, PCGs and their corresponding translations, and rRNAs and their products).GFF file (.gff) containing the gene annotations, which can be easily dragged into Geneious and mapped onto the mitogenome contig. This gives a great visual for the gene order. Additionally, if MitoFinder wasn’t able to assemble all 15 genes for some reason, you may look for gaps in the gene order. If any gaps exist, you can map sequences of the missing gene from closely related animals to the annotated mitogenome contig. If you had a lot of raw reads to begin with, often these sequences will successfully map to one of the gaps in your gene order.Information file (.infos) containing the length of your final contig, the mitogenome coverage, the GC content, and the circularization.Fasta file in the metaspades output directory titled “contigs.fasta” containing a series of nuclear contigs that were assembled in addition to the mitochondrial genome contig, along with their nucleotide lengths and associated coverage in the dataset.
?. [I. Download Programs and Dependencies]
Open the BBMap_38.87.tar file in your Downloads folder.
?. [I. Download Programs and Dependencies]
Click on the following link: https://github.com/RemiAllio/MitoFinder
?. [I. Download Programs and Dependencies]
Scroll down on the GitHub web page until you see the README.md MitoFinder version 1.4 document.
?. [I. Download Programs and Dependencies]
Under Requirements, it states that automake, autoconf, and gcc must be installed on your system. Copy, paste, and execute (click return on your keyboard) the following "brew install automake autoconf gcc" command into the same Terminal shell window:
?. [I. Download Programs and Dependencies]
Under Prerequisites in the README.md MITObim - mitochondrial baiting and iterative mapping document (on the GitHub web page), it states that GNU utilities, Perl, and a running version of MIRA must be installed on your system.Click on the download here link listed after MIRA 4.0.2 (for the use with MITObim 1.8 and newer). Then click the large, green Download Latest Version button on the SourceForge web page. Open the mira_4.0.2_darwin13.1.0_x86_64_static.tar.bz2 file in your Downloads folder. Transfer the resulting mira_4.0.2_darwin13.1.0_x86_64_static folder from your Downloads to your Applications folder.
GNU utilities were already installed in step 3.
Mac OS X is based on a UNIX operating system and thus comes with a Perl interpreter already installed.
?. [I. Download Programs and Dependencies]
Under the Table of contents, select the MAC link for Installation guide for MitoFinder.
?. [I. Download Programs and Dependencies]
Copy and paste ftp://ftp.ncbi.nlm.nih.gov/blast/executables/LATEST/ into your Safari Internet browser. You must include the ftp:// preceding the link; do not just click the blue link. Select Allow in response to Do you want to allow this page to open “Finder”?
?. [I. Download Programs and Dependencies]
Connect to the server as a Guest.
?. [I. Download Programs and Dependencies]
Double click on the ncbi-blast-2.11.0+-x64-macosx.tar.gz file to download the associated BLAST binaries required for MitoFinder to run.
?. [I. Download Programs and Dependencies]
Transfer the resulting ncbi-blast-2.11.0+ folder from your Downloads to your Applications folder.
?. [I. Download Programs and Dependencies]
Under the Assemblers MetaSPAdes section on the GitHub web page, click the blue link to download the pre-compiled binaries.
?. [I. Download Programs and Dependencies]
Double click the SPAdes-3.14.0-Darwin.tar file in your Downloads. Transfer the resulting SPAdes-3.14.0-Darwin folder from your Downloads to your Applications folder.
?. [I. Download Programs and Dependencies]
In your Mitofinder.config file, delete default after blastfolder = and paste in the pathname you copied. Add a forward slash to the end of this text, resulting in blastfolder = /Applications/ncbi-blast-2.11.0+/bin/
?. [I. Download Programs and Dependencies]
Expand the SPAdes-3.14.0-Darwin folder in your Applications. Right click (or control click on your Mac keyboard) on the bin folder. Hold down option on your Mac keyboard while simultaneously clicking Copy “bin” as Pathname.
?. [I. Download Programs and Dependencies]
In your Mitofinder.config file, delete default after metaspadesfolder = and paste in the pathname you copied. Add a forward slash to the end of this text, resulting in metaspadesfolder = /Applications/SPAdes-3.14.0-Darwin/bin/
?. [I. Download Programs and Dependencies]
In order for MitoFinder to successfully annotate tRNA, you must install MiTFi, tRNAscan-SE, and ARWEN.Under the tRNA annotation ARWEN section on the GitHub web page, it states that you must compile the ARWEN source code on your MAC OS system using gcc. Copy, paste, and execute (click return on your keyboard) the following commands into the same Terminal shell window (one at a time); once a command has successfully terminated, copy, paste, and execute the subsequent command. After completion of the last command, you should see a series of command usages for ARWEN in the Terminal.After the last command terminates, close this Terminal shell window.
The MiTFi and tRNAscan-SE packages were simultaneously installed by MitoFinder when executing the "./install.sh" command. However, you must make sure that an updated version of Java is installed on your Mac in order for MiTFi and tRNAscan-SE to run properly. Open up System Preferences and click on the Java icon. This will open up the Java Control Panel in a separate window. If it states that a critical Java security update is available under the Update tab, then click the Update Now button. Alternatively, if it states that your system has the recommended version of Java under the Update tab, then you are good to go and may close out of the Java Control Panel.
?. [I. Download Programs and Dependencies]
Before analyzing your data, you must also download all the published mitogenomes that are closely related to your animal available on GenBank. Go to NCBI (https://www.ncbi.nlm.nih.gov/). Search the Nucleotide database for "Mitochondrion" AND “Annelida” (or your respective animal group if it's not Annelida). Click RefSeq on the left-hand side of the resulting search page. This filters out the incomplete mitogenomes and results in only those that are complete and have been properly annotated. Click Send to: in the upper right-hand corner. Then select the following options: Complete Record, File under Choose Destination, and GenBank under Format. Then click Create File. This is the file that you will use for MetaSPAdes to run properly, which utilizes the mitochondrial genomes of closely related animals to the species of interest as a reference for proper gene identification and annotation. Make sure you rename this sequence.gb file and transfer it from your Downloads to the working directory (aka folder) for your mitogenome assemblies.
***Never use spaces, punctuation, symbols, or special characters (periods, commas, parentheses, ampersands, asterisks, etc.) in your custom folder and file names! "Some of these symbols are used in operating systems to perform certain tasks, such as to identify folder levels in Microsoft products and Mac operating systems. Periods are used to identify file formats such as .jpg and .doc" (Bethcron 2017).***Use hyphens and/or underscores instead of spaces, punctuation, symbols, or special characters.
You must create your own working directory (aka folder) where you would like to store, organize, and analyze your genome skimming datasets within. I recommend utilizing a location within Dropbox, to ensure that your data is always backed up and to save storage space on your hard drive with the Smart Sync feature.For example, the pathway to my general working directory is /Users/Avery/Dropbox/Polynoidae_Mitogenomes, and a screenshot showing the contents of the corresponding Polynoidae_Mitogenomes folder is attached below for your reference. The annelida_mitogenomes.gb file is the renamed file downloaded from GenBank.
?. [I. Download Programs and Dependencies]
Download NOVOPlasty Version 4.2 by following the subsequent steps.
Due to MitoFinder's initial design for use with smaller, lower coverage NGS datasets, and the higher computation time for MetaSPAdes; the MitoFinder pipeline tends to get overloaded from paired-end input datasets larger than 7 M reads each (14 M reads total when the paired-end data is interleaved)-- based on personal experience running on a Mac desktop with a 4.2 GHz Quad-Core Intel Core i7 processor and 32 GB 2400 MHz DDR4 memory. Consequently, we downsample our data in order to efficiently run MitoFinder with MetaSPAdes, which may result in sub-optimal organelle coverage (typically we hope to achieve around 100X coverage). Therefore, it may also be useful to assemble the mitogenome with NOVOPlasty using your full dataset, to determine the maximum mitogenome coverage that can be obtained from your original reads (not downsampled)-- and to see if the resulting NOVOPlasty contig does or doesn't align perfectly to the MitoFinder contig, allowing you to compare two different pipelines for assembling the mitochondrial genome. Hence, we will proceed to download NOVOPlasty Version 4.2.In this protocol, we are utilizing NOVOPlasty solely for the two aforementioned reasons. However, NOVOPlasty pales in comparison to MitoFinder, especially when looking at accuracy of the resulting mitogenome assembly and organization & utility of output files. Most importantly, NOVOPlasty does not identify and annotate the 37 mitochondrial genes (13 protein coding genes [PCGs], 22 tRNAs, and 2 rRNAs) as MitoFinder with MetaSPAdes does. Furthermore, the majority of handy MitoFinder output files mentioned in step 8 are not generated with NOVOPlasty, which only results in the full-length, unannotated fasta sequence of the mitogenome in addition to a few stats-- such as the bp length of the contig, average library insert size, total reads analyzed, number of aligned and assembled reads, and the average organelle coverage. That being said, you will most likely use the results generated from MitoFinder in your official publication, while also reporting the maximum organelle coverage determined via NOVOPlasty as supplementary data-- only if the resulting mitogenome contigs from MitoFinder and NOVOPlasty are identical.***If you have significant mitogenome coverage with MitoFinder (which is more often the case), you do not have to use NOVOPlasty at all and can completely bypass section VIII.
?. [I. Download Programs and Dependencies]
Click on the following link: https://github.com/ndierckx/NOVOPlasty
?. [I. Download Programs and Dependencies]
Click the green Code button on the right hand side and Download ZIP.
?. [I. Download Programs and Dependencies]
Transfer the resulting NOVOPlasty-master folder from your Downloads to your Applications folder.
?. [II. Choose Working Directory]
Optionally, follow along with this supplementary video as you perform section II. Choose Working Directory:Open up a new text editor window (e.g. BBEdit, TextWrangler, or TextEdit), in which you will edit all your commands prior to pasting and executing them in Terminal. For more complex commands, it is easier to both edit and check for mistakes in the corresponding commands in a text editor prior to pasting them into Terminal.
Save this text file in the corresponding working directory for the species/sample of interest. Label the command name above each revised command, which will be tailored specifically to your data. Reference this text file when writing up the methods in your manuscript, as it contains all the bioinformatic steps executed (e.g. overall workflow, including the parameters and any adjustments from default settings) for the given species.
?. [II. Choose Working Directory]
Copy and paste the following "cd working directory" command into the text editor window.
?. [II. Choose Working Directory]
In Finder, navigate to (but do not expand the contents of) the folder that you created and named, where you want the resulting output files for the current sample you are working on to be saved.
***Reminder: Never use spaces, punctuation, symbols, or special characters (periods, commas, parentheses, ampersands, asterisks, etc.) in your custom folder and file names-- use hyphens and/or underscores instead!
If you followed the recommended file organization presented in step 8.31, then navigate to and expand your general working directory folder in Dropbox (in the given example, this is the Polynoidae_Mitogenomes folder).
?. [II. Choose Working Directory]
Paste and execute (click return on your keyboard) the revised "cd working directory" command in the Terminal shell window in order to officially choose your working directory for the remaining steps. Before proceeding, open/expand the chosen folder in Finder, and double check that you have saved the corresponding paired-end reads for this sample within the folder. A screenshot of the NGS data files is attached below for your reference:
?. [II. Choose Working Directory]
Right click (or control click on your Mac keyboard) on the associated folder for the species you are analyzing (e.g. MCZ70175C_Lepidonotopodium_williamsae_Protocol_Example located within the general Polynoidae_Mitogenomes working directory folder). Hold down option on your Mac keyboard while simultaneously clicking Copy “Folder_Name” as Pathname.
?. [III. Simple Stats with SeqKit]
Copy and paste the following "seqkit stats" command into the text editor window:
?. [III. Simple Stats with SeqKit]
In Finder, right click (or control click on your Mac keyboard) on either of the paired-end, gzipped, fastq files (.fq.gz) inside of the working directory folder you specified in section II. Hold down option on your Mac keyboard while simultaneously clicking Copy “File_Name.fq.gz” as Pathname.
?. [III. Simple Stats with SeqKit]
Copy, paste and execute (click return on your keyboard) the revised "seqkit stats" command in the Terminal shell window. A screenshot of the resulting output for Lepidonotopodium williamsae is attached below for your reference:
Resulting output:format: should be FASTQtype: should be DNAnum_seqs: number of reads (paired)sum_len: total length of all readsmin_len: length of shortest readavg_len: average length of readsmax_len: length of longest read
?. [III. Simple Stats with SeqKit]
Create (and save) a spreadsheet to record these statistics, which are relevant for use in your manuscript. Make sure that the first three column headers are:Sample ID; this is the lab code for the original gDNA extraction (e.g. MCZ70175C)Specimen Voucher; this is the official catalog number for the exact specimen that was sequenced, which will most likely be deposited at SIO-BICSpecies; e.g. Lepidonotopodium williamsaeSpecimen Voucher; this is the official catalog number for the exact specimen that was sequenced, which will most likely be deposited at SIO-BICThe most important column headers to add for the corresponding SeqKit output are the following:4. Total Number of Raw Reads (Paired-End); this corresponds to the output for num_seqs5. Total Length of Raw Reads (Paired-End); this corresponds to the output for sum_len6. Individual Length of Raw Reads; this corresponds to the output for avg_lenAs you analyze additional samples using this protocol, add their corresponding SeqKit statistics to this spreadsheet.
?. [IV. Clean and Trim Reads with Trimmomatic]
Copy and paste the following "Trimmomatic Paired End Mode" command into the text editor window.
Descriptions for the trimming steps & parameters:PE: specifies that the data is paired-end-phred33: specifies the base quality encodingsample_P1.fastq.gz: the forward paired output file generatedsample_U1.fastq.gz: the forward unpaired output file generatedsample_P2.fastq.gz: the reverse paired output file generatedsample_U2.fastq.gz: the reverse unpaired output file generatedILLUMINACLIP:TruSeq3-PE.fa:2:30:10: removes adaptersLEADING:3: removes leading low quality or N bases (below quality 3)TRAILING:3: removes trailing low quality or N bases (below quality 3)SLIDINGWINDOW:4:15: scans the read with a 4-base wide sliding window, cutting when the average quality per base drops below 15MINLEN:36: drops reads below the 36 bases long
?. [IV. Clean and Trim Reads with Trimmomatic]
In Finder, right click (or control click on your Mac keyboard) on the 1.fq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “file_name_1.fq.gz” as Pathname. In the text editor window, delete /path/to/1.fq.gz/file and paste in the true pathname you just copied.In Finder, right click (or control click on your Mac keyboard) on the 2.fq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “file_name_2.fq.gz” as Pathname. In the text editor window, delete /path/to/2.fq.gz/file and paste in the true pathname you just copied.
?. [IV. Clean and Trim Reads with Trimmomatic]
In the text editor window, replace the four occurrences of sample in sample_P1.fastq.gz sample_U1.fastq.gz sample_P2.fastq.gz sample_U2.fastq.gz with your true sample ID (e.g. MCZ70175C).
?. [IV. Clean and Trim Reads with Trimmomatic]
Copy the revised "Trimmomatic Paired End Mode" command in the text editor window. Then paste and execute (click return on your keyboard) it in the Terminal shell window.
?. [IV. Clean and Trim Reads with Trimmomatic]
Check the output for the number & percentage of reads (Both Surviving) retained after the "Trimmomatic Paired End Mode" command terminates. Optimally, this should be around 95% or above; the quality of your data is questionable if this percentage is much lower (e.g. 80%). See the screenshot below for your reference:
Both Surviving from the Trimmomatic output text in Terminal means that the same exact reads (complementary to one another) are chosen from both P1 (forward) and P2 (reverse) files.
?. [V. Downsample Reads with MITObim]
In the text editor window, delete 50 and replace it with the percentage of your choice that you would like to downsample your dataset to.In Finder, right click (or control click on your Mac keyboard) on the sample_P1.fastq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “sample_P1.fastq.gz” as Pathname. In the text editor window, delete /path/to/sample_P1.fastq.gz/file and paste in the true pathname you just copied.In Finder, right click (or control click on your Mac keyboard) on the sample_P2.fastq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “sample_P2.fastq.gz” as Pathname. In the text editor window, delete /path/to/sample_P2.fastq.gz/file and paste in the true pathname you just copied.Delete sample and 50 in sample_50p_Interleaved.fastq.gz and replace with your true sample ID and the percentage you decided to downsample to. For example, 50p stands for 50%.
?. [V. Downsample Reads with MITObim]
Copy the revised "MITObim's downsample.py" command in the text editor window. Then paste and execute (click return on your keyboard) it in the Terminal shell window.
?. [VI. Reformat Reads to Non-Interleaved with BBMap]
Copy and paste the following "BBMap's reformat.sh" command into the text editor window:
?. [VI. Reformat Reads to Non-Interleaved with BBMap]
In Finder, right click (or control click on your Mac keyboard) on the Interleaved.fastq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “sample...Interleaved.fastq.gz” as Pathname. In the text editor window, delete /path/to/Interleaved.fastq.gz/file and paste in the true pathname you just copied.Delete sample and 50 in both sample_50p_For.fastq.gz and sample_50p_Rev.fastq.gz. Replace sample with your true sample ID. Replace 50 with the percentage chosen in section V.
?. [VI. Reformat Reads to Non-Interleaved with BBMap]
Copy the revised "BBMap's reformat.sh" command in the text editor window. Then paste and execute (click return on your keyboard) it in the Terminal shell window.
As mentioned in step 14.6, you may optionally execute one of the BBMap output files (either the For.fastq.gz or Rev.fastq.gz file) with "seqkit stats" after the "BBMap's reformat.sh" command successfully terminates, to confirm that the number of reads is indeed half of what was stated for the interleaved file.*This is mainly for additional practice.
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
Optionally, follow along with this supplementary video as you perform section VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes:If you are analyzing paired-end input datasets larger than approximately 4 M reads each (8 M reads total when the paired-end data is interleaved), then I would recommend performing section VII on one of the three Rouse Lab Mac desktop computers, which have 64-bit processors and 32 GB memory-- allowing you to analyze up to ~7 M reads paired-end (14 M reads interleaved). I will teach you privately how to log in to one of these computers remotely, so you may still work from home.*This is another reason why it is convenient to store, organize, and analyze your data in a Dropbox folder; you'll be able to access your Dropbox folder from any computer and set it as your working directory.However, if your personal computer has 32 GB memory as well, disregard this note.Copy and paste the following "MitoFinder with MetaSPAdes assembler" command into the text editor window:
Furthermore, Marina is currently in the process of coordinating Rouse Lab use of the UCSD supercomputers. Once she finishes setting up the interface and downloading the required programs and dependencies, you will also be able to optionally run MitoFinder with the total trimmed/cleaned reads (no downsampling necessary) from section IV, because the UCSD supercomputers have much greater computing power than even the Rouse Lab Mac desktops do.***However, if you are already achieving more than 100X mitogenome coverage from running MitoFinder on your downsampled, trimmed/cleaned reads, it is not necessary to analyze your total trimmed/cleaned reads on the supercomputer, nor is it necessary to complete the NOVOPlasty section VIII below.
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
In the text editor window, delete sample and 50 in sample_MitoFinder_50p. Replace sample with your true sample ID, and replace 50 with the actual percentage you downsampled your reads to. In the given example, this results in MCZ70175C_MitoFinder_50p, since I did indeed downsample to 50%.In Finder, right click (or control click on your Mac keyboard) on the For.fastq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “sample...For.fastq.gz” as Pathname. In the text editor window, delete /path/to/For.fastq.gz/file and paste in the true pathname you just copied.In Finder, right click (or control click on your Mac keyboard) on the Rev.fastq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “sample...Rev.fastq.gz” as Pathname. In the text editor window, delete /path/to/Rev.fastq.gz/file and paste in the true pathname you just copied.In Finder, navigate to the .gb file (containing the downloaded full mitogenomes of closely related species) that you created and right click (or control click on your Mac keyboard) on the file name. Hold down option on your Mac keyboard while simultaneously clicking Copy “file_name.gb” as Pathname. In the text editor window, delete /path/to/gb/file and paste in the true pathname you just copied.The 5 following -o refers to the genetic code used for accurate translation of your 13 mitochondrial PCGs (e.g. 5 is the code for Invertebrate Mitochondrial DNA; 9 is the code for Echinoderm and Flatworm Mitochondrial DNA). Check the following link in case your code varies: https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi, but you will most likely be using 5 in the Rouse Lab.
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
Copy the revised "MitoFinder with MetaSPAdes assembler" command in the text editor window. Then paste and execute (click return on your keyboard) it in the Terminal shell window.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
Optionally, follow along with this supplementary video as you perform section VIII. Mitogenome Assembly with NOVOPlasty:Conditional/Optional: If you obtain significant mitogenome coverage with MitoFinder (100 or greater), you may skip this section. Alternatively, if your assembly had lower than optimal mitogenome coverage, you may try either or all of the following options:Downsample your trimmed/cleaned reads to a greater percentage, resulting in a maximum of ~7 million reads paired-end (14 million reads interleaved), and rerun the MitoFinder analysis with this revised data set on a computer with a 64-bit processor and 32 GB memory (e.g. Rouse Lab Mac desktops).Do not downsample your trimmed/cleaned reads at all, and rerun the MitoFinder analysis with the Trimmomatic paired-end output files (sample_P1.fastq.gz and sample_P2.fastq.gz) on the UCSD supercomputer, which has even greater computing power than the Rouse Lab Mac desktops. This will determine the maximum mitogenome coverage that can be obtained from ~95% of your original data (~5% was lost to Trimmomatic).Downsample your trimmed/cleaned reads to the same percentage, but append to the "MITObim's downsample.py" command a defined, 6 digit seed for the random number generator, in case you originally obtained a smaller than optimal percentage of mitochondrial reads by chance. Rerun the MitoFinder analysis with this revised data set.Assemble the mitogenome with NOVOPlasty using your raw reads as input, to determine the maximum mitogenome coverage that can be obtained from your original data.Furthermore, if you would like to practice using a different pipeline and/or are genuinely curious to compare the resulting mitogenome contigs from MitoFinder and NOVOPlasty, then proceed to section VIII.In Finder, open the chosen working directory from section II (e.g. MCZ70175C_Lepidonotopodium_williamsae_Protocol_Example). Create a new folder within this directory, named sample_NOVOPlasty (e.g. MCZ70175C_NOVOPlasty).
You must have a COI Sanger Sequence (FASTA format) obtained from the exact gDNA extraction of the species/sample of interest if you perform section VIII. Mitogenome Assembly with NOVOPlasty.
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
Optimally, MitoFinder with MetaSPAdes will find 15 genes (13 PCGs and 2 rRNAs) in the mtDNA contig upon successful termination of the command executed.Within your specified working directory, MitoFinder will create a folder named after the revised sample_MitoFinder_50p text specified after -j in the "MitoFinder with MetaSPAdes assembler" command (e.g. MCZ70175C_MitoFinder_50p). Within this folder, there will be an additional Final_Results folder containing the following output files:Additionally, MitoFinder will create a MitoFinder.log file and a .input file in your specified working directory. The MitoFinder.log file is especially handy for future reference, as it contains all the bioinformatic steps executed through the MitoFinder pipeline.
The "MitoFinder with MetaSPAdes assembler" command could potentially take a day and a half to terminate, so be patient while you await results. Once the MitoFinder with MetaSPAdes pipeline has terminated, close the Terminal shell window in which you executed the corresponding commands for sections II to VII.
?. [I. Download Programs and Dependencies]
Once the "cd Applications" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "wget MitoFinder" command into the same Terminal shell window:
?. [I. Download Programs and Dependencies]
Once the "wget MitoFinder" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "unzip master.zip" command into the same Terminal shell window:
?. [I. Download Programs and Dependencies]
Once the "unzip master.zip" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "mv MitoFinder" command into the same Terminal shell window:
?. [I. Download Programs and Dependencies]
Once the "cd MitoFinder" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "./install.sh" command into the same Terminal shell window:
?. [I. Download Programs and Dependencies]
Expand the MitoFinder folder in your Applications and drag the Mitofinder.config file into a text editor, such as BBEdit, TextWrangler, or TextEdit (macOS).
?. [I. Download Programs and Dependencies]
In Finder, right click (or control click on your Mac keyboard) on the megahit folder within the MitoFinder folder. Hold down option on your Mac keyboard while simultaneously clicking Copy “megahit” as Pathname.
?. [I. Download Programs and Dependencies]
In your Mitofinder.config file, delete default after megahitfolder = and paste in the pathname you copied. Add a forward slash to the end of this text, resulting in megahitfolder = /Applications/MitoFinder/megahit/
?. [I. Download Programs and Dependencies]
Expand the ncbi-blast-2.11.0+ folder in your Applications. Right click (or control click on your Mac keyboard) on the bin folder. Hold down option on your Mac keyboard while simultaneously clicking Copy “bin” as Pathname.
?. [I. Download Programs and Dependencies]
Save (do not save as or change the file name) the edited Mitofinder.config file in its original location (within the MitoFinder folder).
?. [I. Download Programs and Dependencies]
Expand the MitoFinder > trnascanSE folder in your Applications. Right click (or control click on your Mac keyboard) on the tRNAscan-SE-2.0 folder. Hold down option on your Mac keyboard while simultaneously clicking Copy “tRNAscan-SE-2.0” as Pathname.
?. [I. Download Programs and Dependencies]
In your Mitofinder.config file, delete default after mitfifolder = and paste in the pathname you copied. Add a forward slash to the end of this text, resulting in mitfifolder = /Applications/MitoFinder/mitfi/
?. [I. Download Programs and Dependencies]
In your Mitofinder.config file, delete default after trnascanfolder = and paste in the pathname you copied. Add a forward slash to the end of this text, resulting in trnascanfolder = /Applications/MitoFinder/trnascanSE/tRNAscan-SE-2.0/
?. [I. Download Programs and Dependencies]
Expand the MitoFinder folder in your Applications. Right click (or control click on your Mac keyboard) on the mitfi folder. Hold down option on your Mac keyboard while simultaneously clicking Copy “mitfi” as Pathname.
?. [II. Choose Working Directory]
In the text editor window, delete /path/to/folder/of/interest and paste in the true pathname you just copied. Select and copy the revised command text.
?. [II. Choose Working Directory]
Open up a new Terminal shell window.
Do not close this Terminal shell window until instructed to do so!
?. [III. Simple Stats with SeqKit]
In the text editor window, delete /path/to/file/of/interest and paste in the true pathname you just copied.
?. [V. Downsample Reads with MITObim]
Once the "MITObim's downsample.py" command has successfully terminated, copy and paste the "seqkit stats" command again into the text editor window:
?. [V. Downsample Reads with MITObim]
In Finder, right click (or control click on your Mac keyboard) on the Interleaved.fastq.gz file created by MITObim's downsample.py function. Hold down option on your Mac keyboard while simultaneously clicking Copy “sample...Interleaved.fastq.gz” as Pathname.
?. [V. Downsample Reads with MITObim]
In the text editor window, delete /path/to/file/of/interest and paste in the true pathname you just copied.
?. [V. Downsample Reads with MITObim]
Copy, paste and execute (click return on your keyboard) the revised "seqkit stats" command in the Terminal shell window. A screenshot of the resulting output for Lepidonotopodium williamsae is attached below for your reference:
The SeqKit results for the interleaved file will present the number of sequences as double what the real value is when analyzing the reads as paired-end. Therefore, divide the output for num_seqs by 2, and report the resulting number in step 14.7 (see below).*Optionally, you can confirm this for extra command line practice after section VI by repeating "seqkit stats" again on one of the two (either forward or reverse) files generated from BBMap's reformat.sh function.
?. [V. Downsample Reads with MITObim]
Add the column header Number of Reads Post-Downsampling (Paired-End) to the spreadsheet you created in step 11.5. Record the number of paired-end reads surviving after downsampling (e.g. 5,214,558 (50% of cleaned/trimmed reads)). Make sure to specify the percentage of the cleaned/trimmed reads that you downsampled to, because you may have to repeat section V and troubleshoot with different percentages if MitoFinder fails initially.*This statistic is critical to transcribe, because you must correctly report the amount of reads you analyzed for successful mitogenome assembly in your manuscript! Since you decided to downsample, that means you will be using a different total number of reads to run through the MitoFinder pipeline than your original raw data set contained.
?. [IV. Clean and Trim Reads with Trimmomatic]
Add the column header Number of Reads Post-Trimmomatic (Paired-End) to the spreadsheet you created in step 11.5 and record the output for Both Surviving. This is important because MitoFinder will be executed with the trimmed/cleaned reads as opposed to the raw reads, so this statistic must be included in your manuscript.
?. [I. Download Programs and Dependencies]
In order for your computer to have access to execute MitoFinder, copy, paste, and execute (click return on your keyboard) the following "chmod +x mitofinder" command into the same Terminal shell window, once the "./install.sh" command has successfully terminated:Delete the master.zip file in your Applications, as it no longer serves a purpose.
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
Double check that you have saved the text file containing all the revised commands executed from section II to section VII for the species/sample analyzed. In Finder, transfer this text file into the sample_MitoFinder_...p folder since it is specific to this analysis.*Reminder: Reference this text file when writing up the methods in your manuscript, as it contains all the MitoFinder bioinformatic steps executed (e.g. overall workflow, including the parameters, arguments, and any adjustments from default settings) for the given species.
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
Check the basic mitogenome statistics obtained from the MitoFinder analysis:In Finder, open the sample_MitoFinder_...p folder in your working directory. Then open the Final_Results folder. Drag the sample_MitoFinder_...p.infos file into a text editor, in which you'll be able to view the length of the contig (bp), coverage, GC content, and circularization.
On your own time, create a new spreadsheet to record the aforementioned MitoFinder statistics (along with others, such as gene order and number of total genes identified/annotated) for all samples/species analyzed in a given project.
?. [I. Download Programs and Dependencies]
Once the "mv MitoFinder" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "cd MitoFinder" command into the same Terminal shell window:
?. [I. Download Programs and Dependencies]
Once the "brew install automake autoconf gcc" command has successfully terminated, copy, paste, and execute (click return on your keyboard) the following "cd Applications" command into the same Terminal shell window:
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
In Finder, transfer the sample...Interleaved.fastq.gz, sample...For.fastq.gz, and sample...Rev.fastq.gz files into the sample_MitoFinder_...p folder since they are also specific to this analysis.
?. [VII. Mitogenome Assembly and Annotation: MitoFinder with MetaSPAdes]
File Cleanup: Before proceeding, open the chosen working directory from section II (e.g. MCZ70175C_Lepidonotopodium_williamsae_Protocol_Example) in Finder.Transfer the two aforementioned files into the sample_MitoFinder_...p folder, in order to keep all the output files associated with this specific MitoFinder analysis in one location.
If you have to troubleshoot and run several MitoFinder analyses for the species/sample of interest-- with different parameters and/or input data sets (downsampled to various percentages)-- then file organization can get messy if you do not follow these suggested file cleanup steps.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
Open a new Finder window, and open the NOVOPlasty-master folder in your Applications.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
Copy the config.txt file and paste it into the sample_NOVOPlasty folder that you just created.
Rename this file as sample_config.txt (e.g. MCZ70175C_config.txt).
?. [VIII. Mitogenome Assembly with NOVOPlasty]
Drag the sample_config.txt file into a text editor. Change the Project name from Test to sample_species (e.g. MCZ70175C_Lepidonotopodium_williamsae). Delete /path/to/reference_file/reference.fasta (optional) and /path/to/chloroplast_file/chloroplast.fasta (only for "mito_plant" option).
?. [VIII. Mitogenome Assembly with NOVOPlasty]
In Finder, navigate to the location of the COI sequence (FASTA format) for the corresponding species/sample of interest. Right click (or control click on your Mac keyboard) on the .fasta file for your COI sequence. Hold down option on your Mac keyboard while simultaneously clicking Copy “file_name.fasta” as Pathname.In the sample_config.txt file, delete /path/to/seed_file/Seed.fasta for the Seed Input and paste in the true pathname you just copied.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
In the sample_config.txt file, make sure your Read Length is set to the number transcribed under the Individual Length of Raw Reads header in your data statistics spreadsheet (this is most likely 150).
?. [VIII. Mitogenome Assembly with NOVOPlasty]
In Finder, navigate to the location of the raw reads for the corresponding species/sample of interest. Right click (or control click on your Mac keyboard) on the 1.fq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “file_name_1.fq.gz” as Pathname.In the sample_config.txt file, delete /path/to/reads/reads_1.fastq for the Forward reads and paste in the true pathname you just copied.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
In Finder, navigate to the location of the raw reads for the corresponding species/sample of interest. Right click (or control click on your Mac keyboard) on the 2.fq.gz file. Hold down option on your Mac keyboard while simultaneously clicking Copy “file_name_2.fq.gz” as Pathname.In the sample_config.txt file, delete /path/to/reads/reads_2.fastq for the Reverse reads and paste in the true pathname you just copied.Save this revised sample_config.txt file.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
Open up a new Terminal shell window. Copy and paste the following "cd working directory" command into Terminal and delete /path/to/folder/of/interest:In Finder, click once on the sample_NOVOPlasty folder. Drag the folder name into Terminal and execute (click return on your keyboard) the revised command.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
Copy and paste the following "NOVOPlasty: Mitogenome Assembly" command into the same Terminal shell window and delete /path/to/sample_config.txt/file:In Finder, click once on the sample_config.txt file. Drag the file name into Terminal and execute (click return on your keyboard) the revised command. Once it has terminated, you may close the Terminal shell window.
?. [VIII. Mitogenome Assembly with NOVOPlasty]
Upon successful termination of the "NOVOPlasty: Mitogenome Assembly" command, NOVOPlasty will create three output files within your specified working directory, the most important two being:The Contigs_1_sample_species.fasta file (e.g. Contigs_1_MCZ70175C_Lepidonotopodium_williamsae.fasta) will contain the full mitogenome contig assembled. This is not annotated as in MitoFinder, but is simply the full length sequence of the mitogenome (most likely ranging from 12,000 to 25,000 bp long).The log_sample_species.txt file (e.g. log_MCZ70175C_Lepidonotopodium_williamsae.txt) will contain the input parameters specified in the sample_config.txt file and the results of the mitogenome assembly, most importantly the length of the contig (bp) and the average organelle coverage (optimally 100 or more).
Proceed to align the resulting contigs from MitoFinder and NOVOPlasty to check whether or not they are identical. If the two mitogenome assemblies match, you may report the average organelle coverage obtained from NOVOPlasty (in addition to all the MitoFinder results) in your manuscript.However, as mentioned at the beginning of this section, you may also try troubleshooting MitoFinder with the suggested options. If any of these MitoFinder reruns result in at least 100X mitogenome coverage, it is not required to run NOVOPlasty whatsoever.