Package: caspredict
CasPredictDetect CRISPR-Cas genes and arrays, and predict the subtype based on both Cas genes and CRISPR repeat sequence.CasPredict 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 withminced, 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 subtypes:All the ones in 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 integrationIt can automatically draw gene maps of CRISPR-Cas systems and orphan Cas operons and CRISPR arraysCitationComing soon...Table of contentsQuick startInstallationCasPredict - How toPlottingRepeatType - How toRepeatType - TrainQuick startcondacreate-ncaspredict-cconda-forge-cbioconda-crussel88caspredict
condaactivatecaspredict
caspredictmy.fastamy_outputInstallationCasPredict can be installed either through conda or pip.It is advised to use conda, since this installs CasPredict and all dependencies, and downloads with database in one go.CondaUseminicondaoranacondato install.Create the environment with caspredict and all dependencies and databasecondacreate-ncaspredict-cconda-forge-cbioconda-crussel88caspredictpipIf you have the dependencies (Python >= 3.8, HMMER >= 3.2, Prodigal >= 2.6, grep, sed) in your PATH you can install with pippython-mpipinstallcaspredictWhen installing with pip, you need to download the database manually:# Download and unpacksvncheckouthttps://github.com/Russel88/CasPredict/trunk/data
tar-xvzfdata/Profiles.tar.gz
mvProfiles/data/
rmdata/Profiles.tar.gz# Tell CasPredict where the data is:# either by setting an environment variable (has to done for each terminal session, or added to .bashrc):exportCASPREDICT_DB="/path/to/data/"# or by using the --db argument each time you run CasPredict:caspredictinput.faoutput--db/path/to/data/CasPredict - How toCasPredict takes as input a nucleotide fasta, and produces outputs with CRISPR-Cas predictionsActivate environmentcondaactivatecaspredictRun with a nucleotide fasta as inputcaspredictgenome.famy_outputUse multiple threadscaspredictgenome.famy_output-t20Check the different optionscaspredict-hOutputCRISPR_Cas.tab:CRISPR_Cas loci, with consensus subtype predictionContains a consensus prediction (Prediction), and the separate predictions for the Cas operon (Prediction_Cas) and CRISPR arrays (Prediction_CRISPRs)cas_operons.tab:All certain Cas operonsContains a prediction of subtype (Prediction) and the subtype with the highest score (Best_type). If the score is high then Prediction = Best_typecrisprs_all.tab:All CRISPR arraysContains a prediction of the associated subtype based on the repeat sequence (Prediction).The 'Subtype' column is the subtype with highest probability. Prediction = Subtype if Subtype_probability is highcrisprs_orphan.tab:Orphan CRISPRs (those not in CRISPR_Cas.tab)Same 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 resultsgenes.tabAll genes and their positionsarguments.tab:File with arguments given to CasPredicthmmer.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 mincedNotes 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.PlottingCasPredict 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 5Cas genes are in red.Cas genes, with alignment scores below the thresholds, are in dark greenUnknown genes are in gray (the number matches the genes.tab file)Arrays are in blue, with their predicted subtype association based on the consensus repeat sequence.RepeatType - How toWith an input of CRISPR repeats (one per line, in a simple textfile) RepeatType will predict the subtype, based on the kmer composition of the repeatActivate environmentcondaactivatecaspredictRun 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.The classifier was only trained on the subtypes for which there were enough (>20) repeats. It can therefore only predict subtypes of repeats associated with the following subtypes:I-A, I-B, I-C, I-D, I-E, I-F, I-GII-A, II-B, II-CIII-A, III-B, III-C, III-DIV-A1, IV-A2, IV-A3V-AVI-BThis is the accuracy per subtype (on an unseen test dataset):I-A0.60I-B0.90I-C0.98I-D0.47I-E1.00I-F0.99I-G0.83II-A0.94II-B1.00II-C0.89III-A0.89III-B0.49III-C0.60III-D0.28IV-A10.79IV-A20.78IV-A30.98V-A0.77VI-B1.00RepeatType - 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 RepeatType and CasPredict.TrainrepeatTraintyped_repeats.tabmy_classifierUse new model in RepeatTyperepeatTyperepeats.txt--dbmy_classifierUse new model in CasPredictSave the original database files:mv${CASPREDICT_DB}/type_dict.tab${CASPREDICT_DB}/type_dict_orig.tab
mv${CASPREDICT_DB}/xgb_repeats.model${CASPREDICT_DB}/xgb_repeats_orig.modelMove the new model into the database foldermvmy_classifier/*${CASPREDICT_DB}/CasPredict and RepeatType will now use the new model for repeat prediction!