Package: magcluster
MagClusterMagCluster is a tool for identification, annotation and visualization of magnetosome gene clusters (MGCs) from genomes of magnetotactic bacteria (MTB). MagCluster leverages the physical cluster property of magnetosome genes on the chromosome to identify MGCs, which are otherwise difficult to accurately identify based solely on sequence identity.MagCluster workflow schematic(a) Genomes are annotated using Prokka with a mandatory reference file of magnetosome proteins database via --proteins. (b) Putative MGC-containing contigs are retrieved by MGC_Screen module from GenBank files: (b1) contigs shorter than 2000 bp (by default) are discarded; (b2) magnetosome genes are identified through a text-mining strategy using the keyword ‘magnetosome’ in protein names, and contigs containing less than 3 (by default) magnetosome genes are discarded; (b3) putative MGCs are screened under a 10,000-bp (by default) window, and the minimum number of magnetosome genes (3 by default) in each window size is re-checked. (c) Putative MGCs are aligned and visualized using clinker.ContentsInstallationCondaBiocondaPipUsageGenomes annotationMGCs screeningMGCs alignment and visualizationTutorialsCitationsContact usInstallationMagCluster has been checked by bioconda on Linux and MacOS. It is currently not supported on Windows, tryWSLinstead if you are using Win10.CondaMagCluster can be installed throughConda. We recommend creating anew environmentfor MagCluster to avoid dependency conflicts.# Download yml filewgethttps://github.com/RunJiaJi/magcluster/releases/download/0.2.0/magcluster-0.2.0.yml# Install MagClustercondaenvcreate-nmagcluster--filemagcluster-0.2.0.yml# Optional cleanuprmmagcluster-0.2.0.yml# Activate magcluster environmentcondaactivatemagcluster# Check for the usage of MagClustermagcluster-hBioconda# Create magcluster environmentcondacreate-nmagcluster# Activate magcluster environmentcondaactivatemagcluster# Install MagCluster through bioconda channelcondainstall-cconda-forge-cbiocondamagcluster# Check for the usage of MagClustermagcluster-h*cough*If conda takes too long on solving environment, Ctrl+C and trymamba*cough*PipAlternatively, you can install MagCluster through pip in an existing environment. In this way, please make sure you haveProkkainstalled.# Install MagCluster through pippipinstallmagcluster# Check for the usage of MagClustermagcluster-hUsageMagCluster comprises three modules for MGCs batch processing:
(i) genomes annotation withProkka(ii) MGCs screening with MGC_Screen
(iii) MGCs visualization withclinkerusage:magcluster[options]Options:{prokka,mgc_screen,clinker}prokkaGenomeannotationwithProkkamgc_screenMagnetosomegeneclusterscreeningwithMGC_ScreenclinkerMagnetosomegeneclustervisualizationwithclinkerGenomes annotationMultiple genome files(.fasta/.fna/.fa/.FASTA) orgenome-containing folder(s)are accepted as input for batch annotation. The general usage is the same as Prokka, but some parameters are set with default values for genomes batch annotation.To avoid confusion, the name of each genome is used as the output folder’s name (--outdir GENOME_NAME), output files’ prefix (--prefix GENOME_NAME), and GenBank file’s locus_tag (--locustag GENOME_NAME) by default. The--compliantparameter is also used by default to ensure standard GenBank files.For MGCs annotation, MagCluster requires amandatory filecontaining magnetosome protein sequences from representative MTB strains, which is attached to MagCluster and used by default.
The value of--evalueis recommended to set to 1e-05.exampleusage:# MGCs annotation with multiple MTB genomes as input$magclusterprokka--evalue1e-05MTB_genome1.fastaMTB_genome2.fastaMTB_genome3.fasta# MGCs annotation with MTB genomes containing folder as input$magclusterprokka--evalue1e-05./MTB_genomes_folderMGCs screeningMGC_Screen module retrieves MGC-containing contigs/scaffolds in GenBank files.As magnetosome genes are always physically clustered together in MTB genomes, MGC_Screen uses ‘magnetosome’ as the keyword searching for product names in GenBank files generated by above Prokka module and identifies putative MGCs based on the existence of multiple magnetosome genes in a given contig and a given length of screening window.Three parameters involved in MGCs screening,--contiglength,--windowsizeand--threshold(see below). You can adjust them according to needs.For each genome, MGC_Screen produces two files as output: aGenBank file of putative MGCs containing contigsand acsv file summarizing all putative magnetosome protein sequences.usage:magclustermgc_screen[-h][-lCONTIGLENGTH][-winWINDOWSIZE][-thTHRESHOLD][-oOUTDIR]gbkfile[gbkfile...]positionalarguments:gbkfile.gbk/.gbffilestoanalyzed.Multiplefilesorfiles-containingfolderisacceptable.

optionalarguments:-h,--helpshowthishelpmessageandexit-lCONTIGLENGTH,--contiglengthCONTIGLENGTHTheminimumlengthofcontigstobeconsidered(default'2,000 bp')-wWINDOWSIZE,--windowsizeWINDOWSIZEThelengthofMGCsscreeningwindow(default'10,000 bp')-thTHRESHOLD,--thresholdTHRESHOLDTheminimumnumberofmagnetosomegenesinagivencontigandagivenlengthofscreeningwindow(default'3')-oOUTDIR,--outdirOUTDIROutputfolder(default'mgc_screen')exampleusage:# MGCs screening with multiple GenBank files as input$magclustermgc_screen--threshold3--contiglength2000--windowsize10000file1.gbkfile2.gbkfile3.gbk# MGCs screening with GenBank files containing folder as input$magclustermgc_screen--threshold3--contiglength2000--windowsize10000./gbkfiles_folderMGCs alignment and visualizationWe useclinkerfor MGCs alignment and visualization. Note that the-pparameter is used by default to generate an interactive HTML web page where you can modify the MGCs figure and export it as a publication-quality file.exampleusage:# MGCs screening with multiple GenBank files as input$magclusterclinker-pMGC_align.html./MGCs_files_folder/*.gbkAttention: Although MagCluster is efficient, we strongly recommend that putative MGCs identified by MagCluster must be manually checked.TutorialsThis is a simple example to help you quickly start MagCluster journey. We use the genomes ofCandidatusMagnetominusculus xianensis strain HCH-1(see the paper) andMagnetofaba australisIT-1(see the paper) to show how it works.You can see thevideo tutorialhere or follow the detailed tutorial below.Step 0: Prepare MagClusterTo start your journey, make sure you have a working MagCluster in your system.For installation informations, please checkInstallation.In [1]:# Activate magcluster environmentcondaactivatemagcluster# Check MagCluster versionmagcluster-vOut:magcluster 0.2.0Step 1: Obtain dataYou can download genome data from NCBI.HCH-1LNQR00000000IT-1LVJN00000000In [2]:# Make a new foldermkdirmagtest# Open magtest foldercdmagtestIn [3]:# Download genomes from NCBIwgethttps://sra-download.ncbi.nlm.nih.gov/traces/wgs03/wgs_aux/LN/QR/LNQR01/LNQR01.1.fsa_nt.gz
wgethttps://sra-download.ncbi.nlm.nih.gov/traces/wgs03/wgs_aux/LV/JN/LVJN01/LVJN01.1.fsa_nt.gzOut:Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.
--2021-09-12 22:21:45--  https://sra-download.ncbi.nlm.nih.gov/traces/wgs03/wgs_aux/LN/QR/LNQR01/LNQR01.1.fsa_nt.gz
Resolving sra-download.ncbi.nlm.nih.gov (sra-download.ncbi.nlm.nih.gov)... 130.14.250.25, 130.14.250.24, 130.14.250.27
Connecting to sra-download.ncbi.nlm.nih.gov (sra-download.ncbi.nlm.nih.gov)|130.14.250.25|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1119868 (1.1M) [application/octet-stream]
Saving to: ‘LNQR01.1.fsa_nt.gz’

LNQR01.1.fsa_nt.gz  100%[===================>]   1.07M   742KB/s    in 1.5s    

2021-09-12 22:21:48 (742 KB/s) - ‘LNQR01.1.fsa_nt.gz’ saved [1119868/1119868]

Will not apply HSTS. The HSTS database must be a regular and non-world-writable file.
--2021-09-12 22:21:48--  https://sra-download.ncbi.nlm.nih.gov/traces/wgs03/wgs_aux/LV/JN/LVJN01/LVJN01.1.fsa_nt.gz
Resolving sra-download.ncbi.nlm.nih.gov (sra-download.ncbi.nlm.nih.gov)... 165.112.9.235, 165.112.9.231, 165.112.9.232
Connecting to sra-download.ncbi.nlm.nih.gov (sra-download.ncbi.nlm.nih.gov)|165.112.9.235|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1516495 (1.4M) [application/octet-stream]
Saving to: ‘LVJN01.1.fsa_nt.gz’

LVJN01.1.fsa_nt.gz  100%[===================>]   1.45M   370KB/s    in 4.0s    

2021-09-12 22:21:53 (370 KB/s) - ‘LVJN01.1.fsa_nt.gz’ saved [1516495/1516495]In [4]:# Check the genome fileslsOut:LNQR01.1.fsa_nt.gz LVJN01.1.fsa_nt.gzIn [5]:# Unzip filesgunzip*.gz
lsOut:LNQR01.1.fsa_nt LVJN01.1.fsa_ntIn [6]:# Rename the genomesmvLNQR01.1.fsa_ntHCH-1.fasta
mvLVJN01.1.fsa_ntIT-1.fasta
lsOut:HCH-1.fasta IT-1.fastaStep 2: Genomes annotationWe recommand theevalueto be set as 1e-05. Note that the--outdir,--prefix,--locustagand--compliantparameters are used by default. The reference MGCs file that we provide is also used with--proteins.This step should take a while and you can check the log file for details.In [7]:magclusterprokka--evalue1e-05./*.fastaIn [8]:# Move `.gbk` files to a new foldermkdirgbkfolder
mv-v*/*.gbkgbkfolder/Out:renamed 'HCH-1_annotation/HCH-1.gbk' -> 'gbkfolder/HCH-1.gbk'
renamed 'IT-1_annotation/IT-1.gbk' -> 'gbkfolder/IT-1.gbk'Step 3: MGCs screeningNow that we haveHCH-1.gbkandIT-1.gbk, let's start MGCs screening!In [9]:magclustermgc_screengbkfolder-omgcfolderOut:[22:30:40] INFO - Starting mgc_screen...
[22:30:40] INFO - Your file is HCH-1.gbk
[22:30:40] INFO - The minimum length of contigs to be considered is 2000
[22:30:40] INFO - The window size for MGCs screening is 10000
[22:30:40] INFO - The threshold of magnetosome genes in a given contig and a given length of screening window is 3
[22:30:40] INFO - The output directory is /mnt/c/Users/edith/Desktop/test/magtest/mgcfolder/
[22:30:40] INFO - Opening your file...
[22:30:40] INFO - Starting magnetosome genes screening...
[22:30:40] INFO - Magnetosome gene cluster containing contigs screening completed!
[22:30:40] INFO - Creating output folder: /mnt/c/Users/edith/Desktop/test/magtest/mgcfolder/
[22:30:40] INFO - Writing mgc.gbk file...
[22:30:40] INFO - Writing magpro.csv file(s)...
[22:30:40] INFO - Starting mgc_screen...
[22:30:40] INFO - Your file is IT-1.gbk
[22:30:40] INFO - The minimum length of contigs to be considered is 2000
[22:30:40] INFO - The maxmum length of contigs to be considered is 10000
[22:30:40] INFO - The threshold of magnetosome genes in one contig is 3
[22:30:40] INFO - The output directory is /mnt/c/Users/edith/Desktop/test/magtest/mgcfolder/
[22:30:40] INFO - Opening your file...
[22:30:40] INFO - Starting magnetosome genes screening...
[22:30:41] INFO - Magnetosome gene cluster containing contigs screening completed!
[22:30:41] INFO - /mnt/c/Users/edith/Desktop/test/magtest/mgcfolder/ folder already exists! Skip to next step
[22:30:41] INFO - Writing mgc.gbk file...
[22:30:41] INFO - Writing magpro.csv file(s)...
[22:30:41] INFO - Done! Thank you!In [10]:lsmgcfolderOut:HCH-1_magpro.csv HCH-1_mgc.gbk IT-1_magpro.csv IT-1_mgc.gbkGood job! Now you can open the.csvfiles to check the magnetosome protein sequences.Step 4: MGCs visualizationFinal step! We are almost there!Use clinker to generate a MGCs figure. We recommand to use the-oparameter to generate a MGCs alignment file where you can browse the homologous gene similarities among genomes.Be Careful! If there is complete genome(s) in your dataset, the alignment process will take unreasonable time. In that case, we recommand you skip the alignment process with-na(no alignment) parameter.In [11]:magclusterclinker-omgc_align.txt-pmgc_align.htmlmgcfolder/*.gbkOut:[22:31:00] INFO - Starting clinker
[22:31:00] INFO - Parsing files:
[22:31:00] INFO -   HCH-1_mgc.gbk
[22:31:00] INFO -   IT-1_mgc.gbk
[22:31:00] INFO - Starting cluster alignments
[22:31:00] INFO - HCH-1_mgc vs IT-1_mgc
[22:31:16] INFO - Generating results summary...
[22:31:16] INFO - Writing alignments to: mgc_align.txt
[22:31:16] INFO - Building clustermap.js visualisation
[22:31:16] INFO - Writing to: mgc_align.html
[22:31:17] INFO - Done!Congratulations! Now you should have an interactive html opened in your browser. You can adjust the figure as you like and export it as a.svgfile.CitationsIf you found MagCluster useful to your research, please cite us:Runjia Ji, Wensi Zhang, Yongxin Pan, and Wei Lin. 2022.MagCluster: a Tool for Identification, Annotation, and Visualization of Magnetosome Gene Clusters.Microbiology Resource Announcements. 11:e01031-21.doi:10.1128/mra.01031-21MagCluster usesProkkafor genomes annotation andclinkerfor gene clusters comparison and visualization. Please include the following citations when using MagCluster:Torsten Seemann. 2014.Prokka: rapid prokaryotic genome annotation.Bioinformatics. 30:2068-2069.doi:10.1093/bioinformatics/btu153Cameron L M Gilchrist, Yit-Heng Chooi. 2020.clinker & clustermap.js: Automatic generation of gene cluster comparison figures.Bioinformatics. 37:2473–2475.doi:10.1101/2020.11.08.370650Contact usIf you have any questions or suggestions, feel free to contact us.jirunjia@gmail.comorweilin@mail.iggcas.ac.cn