Package: cctyper
CRISPRCasTyperDetect CRISPR-Cas genes and arrays, and predict the subtype based on both Cas genes and CRISPR repeat sequence.CRISPRCasTyper and RepeatType are also available through a webserverThis software finds Cas genes with a large suite of HMMs, then groups these HMMs into operons, and predicts the subtype of the operons based on a scoring scheme.
Furthermore, it finds CRISPR arrays withmincedand by BLASTing a large suite of known repeats, and using a kmer-based machine learning approach (extreme gradient boosting trees) it predicts the subtype of the CRISPR arrays based on the consensus repeat.
It then connects the Cas operons and CRISPR arrays, producing as output:CRISPR-Cas loci, with consensus subtype prediction based on both Cas genes (mostly) and CRISPR consensus repeatsOrphan Cas operons, and their predicted subtypeOrphan CRISPR arrays, and their predicted associated subtypeIt includes the following 46 subtypes/variants(find typing scheme here):I-A, I-B, I-C, I-D, I-E, I-F, I-F (transposon), I-G, II-A, II-B, II-C, III-A, III-B, III-C, III-D, III-E, III-F, IV-A1, IV-A2, IV-A3, IV-B, IV-C, IV-D, IV-E, V-A, V-B1, V-B2, V-C, V-D, V-E, V-F1, V-F2, V-F3, V-F (the rest), V-G, V-H, V-I, V-J, V-K, V-L, VI-A, VI-B1, VI-B2, VI-C, VI-D, VI-X, VI-Y.All subtypes from the most recent Nature Reviews Microbiology (Makarova et al. 2020):Evolutionary classification of CRISPR–Cas systems: a burst of class 2 and derived variantsUpdated type IV subtypes and variants based on:Type IV CRISPR–Cas systems are highly diverse and involved in competition between plasmidsType V-K:RNA-guided DNA insertion with CRISPR-associated transposasesTransposon associated type I-F:Transposon-encoded CRISPR–Cas systems direct RNA-guided DNA integrationNew V-A variants:Novel Type V-A CRISPR Effectors Are Active Nucleases with Expanded Targeting CapabilitiesNew Cas13s:Programmable RNA editing with compact CRISPR–Cas13 systems from uncultivated microbesV-L (cas12l):A new family of CRISPR-type V nucleases with C-rich PAM recognitionIt can automatically draw gene maps of CRISPR-Cas systems and orphan Cas operons and CRISPR arraysin vector graphics format for direct use in scientific manuscriptsCitationJakob Russel, Rafael Pinilla-Redondo, David Mayo-Muñoz, Shiraz A. Shah, Søren J. Sørensen - CRISPRCasTyper: Automated Identification, Annotation and Classification of CRISPR-Cas loci. The CRISPR Journal Dec 2020Find a free to read version onBioRxivTable of contentsQuick startInstallationCRISPRCasTyper - How toPlottingRepeatType - How toUpdated modelsRepeatType - TrainTroubleshootQuick startcondacreate-ncctyper-cconda-forge-cbioconda-crussel88cctyper
condaactivatecctyper
cctypermy.fastamy_outputInstallationCRISPRCasTyper can be installed either through conda or pip.It is advised to use conda, since this installs CRISPRCasTyper and all dependencies, and downloads the database in one go.CondaUseminicondaoranacondato install.Create the environment with CRISPRCasTyper and all dependencies and databasecondacreate-ncctyper-cconda-forge-cbioconda-crussel88cctyperpipIf you have the dependencies (Python >= 3.8, HMMER >= 3.2, Prodigal >= 2.6, minced, grep, sed) in your PATH you can install with pipInstall cctyper python modulepython-mpipinstallcctyperUpgrade cctyper python module to the latest versionpython-mpipinstallcctyper--upgradeWhen installing with pip, you need to download the database manually:# Download and unpacksvncheckouthttps://github.com/Russel88/CRISPRCasTyper/trunk/data
tar-xvzfdata/Profiles.tar.gz
mvProfiles/data/
rmdata/Profiles.tar.gz# Tell CRISPRCasTyper where the data is:# either by setting an environment variable (has to be done for each terminal session, or added to .bashrc):exportCCTYPER_DB="/path/to/data/"# or by using the --db argument each time you run CRISPRCasTyper:cctyperinput.faoutput--db/path/to/data/CRISPRCasTyper - How toCRISPRCasTyper takes as input a nucleotide fasta, and produces outputs with CRISPR-Cas predictionsActivate environmentcondaactivatecctyperRun with a nucleotide fasta as inputcctypergenome.famy_outputIf you have a complete circular genome (each entry in the fasta will be treated as having circular topology)cctypergenome.famy_output--circularFor metagenome assemblies and short contigs/plasmids/phages, change the prodigal modeThe default prodigal mode expects the input to be a single draft or complete genomecctyperassembly.famy_output--prodigalmetaCheck the different optionscctyper-hOutputCRISPR_Cas.tab:CRISPR_Cas loci, with consensus subtype predictionContig: Sequence accessionOperon: Operon ID (Sequence accession @ NUMBER)Operon_Pos: [Start, End] of operonPrediction: Consenus prediction based on both Cas operon and CRISPR arraysCRISPRs: CRISPRs adjacent to Cas operonDistances: Distances to CRISPRs from Cas operonPrediction_Cas: Subtype prediction based on Cas operonPrediction_CRISPRs: Subtype prediction of CRISPRs based on CRISPR repeat sequencescas_operons.tab:All certain Cas operonsContig: Sequence accessionOperon: Operon ID (Sequence accession @ NUMBER)Start: Start of operonEnd: End of operonPrediction: Subtype predictionComplete_Interference: Percent completion of the interference module(s). Can be a list if best_type is a list (Hybrid and Ambiguous)Complete_Adaptation: Percent completion of the adaptation module(s). Can be a list if best_type is a list (Hybrid and Ambiguous)Best_type: Subtype with the highest score. If the score is high then Prediction = Best_typeBest_score: Score of the highest scoring subtypeGenes: List of Cas genesPositions: List of Gene IDs for the genesE-values: List of E-values for the genesCoverageSeq: List of sequence coverages for the genesCoverageHMM: List of HMM coverages for the genesStrand_Interference: Strand of interference module. 1 is positive strand, -1 is negative strand, 0 is mixed, NA if no interference gene foundStrand_Adaptation: Strand of adaptation module. 1 is positive strand, -1 is negative strand, 0 is mixed, NA if no adaptation gene foundcrisprs_all.tab:All CRISPR arrays, also false positivesContig: Sequence accessionCRISPR: CRISPR ID (minced: Sequence accession _ NUMBER; repeatBLAST: Sequence accession - NUMBER _ NUMBER)Start: Start of CRISPREnd: End of CRISPRConsensus_repeat: Consensus repeat sequenceN_repeats: Number of repeatsRepeat_len: Length of repeat sequencesSpacer_len_avg: Average spacer lengthRepeat_identity: Average identity of repeat sequencesSpacer_identity: Average identity of spacer sequencesSpacer_len_sem: Standard error of the mean of spacer lenghtsTrusted: TRUE/FALSE, is the array trusted. Based on repeat/spacer identity, spacer sem, prediction probability and adjacency to a cas operonPrediction: Prediction of the associated subtype based on the repeat sequenceSubtype: Subtype with highest prediction probability. Prediction = Subtype if Subtype_probability is highSubtype_probability: Probability of subtype predictioncrisprs_near_cas.tab:CRISPRs part of CRISPR-Cas lociSame columns as crisprs_all.tabcrisprs_orphan.tab:Orphan CRISPRs (those not in CRISPR_Cas.tab)Same columns as crisprs_all.tabcrisprs_putative.tab:Low quality CRISPRs. Most likely false positivesSame columns as crisprs_all.tabcas_operons_orphan.tab:Orphan Cas operons (those not in CRISPR_Cas.tab)Same columns as cas_operons.tabCRISPR_Cas_putative.tab:Putative CRISPR_Cas loci, often lonely Cas genes next to a CRISPR arraySame columns as CRISPR_Cas.tabcas_operons_putative.tab:Putative Cas operons, mostly false positives, but also some ambiguous and partial systemsSame columns as cas_operons.tabspacers/*.fa:Fasta files with all spacer sequenceshmmer.tab:All HMM vs. ORF matches, unfiltered resultsHmm: HMM nameORF: ORF name (Sequence accession _ Gene ID)tlen: ORF lengthqlen: HMM lengthEval: E-value of alignmentscore: Alignment scorestart: ORF startend: ORF endAcc: Sequence accessionPos: Gene IDCov_seq: Sequence coverageCov_hmm: HMM coveragestrand: Coding strand is like input (1) or reverse complement (-1)genes.tabAll genes and their positionsContig: Sequence accessionStart: Start of ORFEnd: End of ORFStrand: Coding strand is like input (1) or reverse complement (-1)Pos: Gene IDarguments.tab:File with arguments given to CRISPRCasTyperhmmer.logError messages from HMMER (only produced if any errors were encountered)If run with--keep_tmpthe following is also producedprodigal.logLog from prodigalproteins.faaProtein sequenceshmmer/*.tabAlignment output from HMMER for each Cas HMMminced.out:CRISPR array output from mincedblast.tab:BLAST output from repeat alignment against flanking regions of cas operonsFlank....:Fasta of flanking regions near cas operons and BLAST database of thisNotes on outputFiles are only created if there is any data. For example, the CRISPR_Cas.tab file is only created if there are any CRISPR-Cas loci.PlottingCRISPRCasTyper will automatically plot a map of the CRISPR-Cas loci, orphan Cas operons, and orphan CRISPR arrays.These maps can be expanded (--expand N) by adding unknown genes and genes with alignment scores below the thresholds. This can help in identify potentially un-annotated genes in operons. You can generate new plots without having to re-run the entire pipeline by adding--redo_typingto the command. This will re-use the mappings and re-type the operons and re-make the plot, based on new thresholds and plot parameters.The plot below is run with--expand 5000Arrays are in alternating black/white displaying the actual number of repeats/spacers, and with their predicted subtype association based on the consensus repeat sequence.The interference module is in yellow.The adaptation module is in blue.Cas6 is in red.Accessory genes are in purpleGenes with alignment scores below the thresholds are lighter and with parentheses around names.Unknown genes are in gray (the number matches the genes.tab file)RepeatTyper - How toWith an input of CRISPR repeats (one per line, in a simple textfile) RepeatTyper will predict the subtype, based on the kmer composition of the repeatActivate environmentcondaactivatecctyperRun with a simple textfile, containing only CRISPR repeats (in capital letters), one repeat per line.repeatTyperepeats.txtOutputThe script prints:Repeat sequencePredicted subtypeProbability of predictionNotes on outputPredictions with probabilities below 0.75 are uncertain, and should be taken with a grain of salt.Prior to version 1.4.0 the curated repeatTyper model was included in CCTyperFrom version 1.4.0 and onwards updated repeatTyper models are included in CCTyper (see more information in the section below)The followinig subtypes are included in the updated model as per December 2022:I-A, I-B, I-C, I-D, I-E, I-F, I-F (Transposon), I-GII-A, II-B, II-CIII-A, III-B, III-C, III-D, III-E, III-FIV-A1, IV-A2, IV-A3, IV-D, IV-EV-A, V-B1, V-E, V-F1, V-F2, V-F3, V-F (the rest), V-G, V-I, V-J, V-KVI-A, VI-B1, VI-B2, VI-C, VI-DThis is the accuracy per subtype (on an unseen test dataset):I-A      0.76I-B      0.81I-C      0.97I-D      0.86I-E      0.95I-F      0.96I-F_T    0.99I-G      0.89II-A     0.92II-B     0.97II-C     0.90III-A    0.82III-B    0.68III-C    0.60III-D    0.59III-E    1.00III-F    0.25IV-A1    0.85IV-A2    0.68IV-A3    0.96IV-D     0.85IV-E     0.92V-A      1.00V-B1     0.90V-E      0.30V-F      0.87V-F1     0.87V-F2     0.90V-F3     0.90V-G      0.67V-I      0.80V-J      0.63V-K      0.99VI-A     0.96VI-B1    0.96VI-B2    1.00VI-C     0.67VI-D     0.97Updated RepeatTyper modelsTheCCTyper webserveris crowdsourcing subtyped repeats and includes an updated RepeatTyper model based on a much larger set of repeats and contains additional subtypes compared to the curated RepeatTyper model.
This updated model is automatically retrained each month and the models can be downloadedhere.From version 1.4.0 and onwards of CCTyper the newest repeatTyper model is included upon release of the version.Each model contains a training report (xgb_report), where you can find the training log, and in the bottom the accuracy, both overall and per subtype.Use new model in CRISPRCasTyperSave the original database files:mv${CCTYPER_DB}/type_dict.tab${CCTYPER_DB}/type_dict_orig.tab
mv${CCTYPER_DB}/xgb_repeats.model${CCTYPER_DB}/xgb_repeats_orig.modelMove the new model into the database foldermvrepeat_model/*${CCTYPER_DB}/CRISPRCasTyper and RepeatTyper will now use the new model for repeat prediction!RepeatTyper - TrainYou can train the repeat classifier with your own set of subtyped repeats. With a tab-delimeted input where 1. column contains the subtypes and 2. column contains the CRISPR repeat sequences, RepeatTrain will train a CRISPR repeat classifier that is directly usable for both RepeatTyper and CRISPRCasTyper.TrainrepeatTraintyped_repeats.tabmy_classifierUse new model in RepeatTyperrepeatTyperepeats.txt--dbmy_classifierUse new model in CRISPRCasTyperSave the original database files:mv${CCTYPER_DB}/type_dict.tab${CCTYPER_DB}/type_dict_orig.tab
mv${CCTYPER_DB}/xgb_repeats.model${CCTYPER_DB}/xgb_repeats_orig.modelMove the new model into the database foldermvmy_classifier/*${CCTYPER_DB}/CRISPRCasTyper and RepeatTyper will now use the new model for repeat prediction!TroubleshootRunning out of memoryLarge metagenomic assemblies with many small contigs can exhaust the RAM on your laptop. Fortunately, as metagenomic contigs are analysed separately (when run with--prodigal meta) a simple solution is to split the input into smaller chunks (e.g. withpyfasta)