Package: crispio
🌱 crispioCommand-line utilities and Python API for designing CRISPRi experiments in bacteria.crispiomakes it easy to design annotated and systematically named libraries of guide RNAs.
Alternatively,crispiocan map a FASTA of existing guides to a genome.Hint: If you have a table of guide RNAs from the literature that you want to annotate
with genomic features,crispiois your tool. Usebioino table2fastato convert the table to a FASTA file, then usecrispio map.InstallationCommand-line interfaceGenerating new guide RNAsMapping known guide RNAs to a genomeAnnotating with extra featuresChecking for off-targetsPython APIIssues, bugs, suggestionsDocumentationInstallationThe easy wayInstall the pre-compiled version from GitHub:$pipinstallcrispioFrom sourceClone the repository, thencdinto it. Then run:$pipinstall-e.Command-line interfaceThe main way to usecrispiois with its several subcommands. You can get
help by enteringcrispio <subcommand> --help.$crispio--help
usage:crispio[-h]{generate,map,featurize,offtarget}...

DesignandanalysisofbacterialCRISPRiexperiments.

optionalarguments:-h,--helpshowthishelpmessageandexitSub-commands:{generate,map,featurize,offtarget}Usethesecommandstospecifythetoolyouwanttouse.generateGenerateandannotateallguideRNAsforagivengenome.mapMapandannotateprovidedguideRNAstoagivengenome.featurizeAnnotateguideRNAswithadditionalcalculatedfeatures.offtargetComparetwosetsofguideRNAsforpotentialcross-targetactivity.Generating new guide RNAsGiven a genome in FASTA format and a matching GFF,both available for your favourite bacterium from NCBI,
along with a PAM sequence or name of a common Cas9 ortholog, you can generate all the possible
guide RNAs and annotate them from the GFF in one go.The commandcrisio generatefinds the position on the genome, annotates
with genomic features, replichore, and sequence context, detects restriction
sites, and gives each guide RNA a unique ID and a human-readable
adjective-noun mnemonic.crispiogenerate-l20--pamSth1-gEcoMG1655-NC_000913.3.fasta-aEcoMG1655-NC_000913.3.gff3|head

🚀GeneratingsgRNAswiththefollowingparameters:subcommand:generatemax_length:20min_length:Nonepam:Sth1genome:<_io.TextIOWrappername='/dev/fd/63'mode='r'encoding='UTF-8'>annotations:<_io.TextIOWrappername='/dev/fd/62'mode='r'encoding='UTF-8'>attributes:['Name','locus_tag','old_locus_tag','gene','gene_biotype']output:<_io.TextIOWrappername='<stdout>'mode='w'encoding='utf-8'>func:<function_generateat0x7fc2715bb160>
Buildingannotationlookuptable.100%|██████████████████████████████████████████████████████████████████████████████████████████████|998/998[00:02<00:00,402.28it/s]##sequence-region NC_000913.3 1 46416520it[00:00,?it/s]##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=511145##genome-sequence       NC_000913.3     1       6930##genome-description    Escherichia coli str. K-12 substr. MG1655, complete genome##genome-filename       63#sgRNA-map      crispio 63      62153it[00:00,13306.14it/s,at_site=6918,direction=forward,guides_created=153,pam_sites_found=153]162it[00:00,10236.95it/s,at_site=6757,direction=reverse,guides_created=315,pam_sites_found=315]NC_000913.3crispioprotospacer221.+.ID=sgr-e5373243;Name=thrL-21-modest_saddle;ann_Name=thrL;ann_end=255;ann_feature=gene;ann_gene=thrL;ann_gene_biotype=protein_coding;ann_locus_tag=_up-thrL;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=190;ann_strand=+;guide_context_down=TATGTCTCTGTGTGGATTAA;guide_context_up=CAGCACCCCAGGAACCCATA;guide_length=20;guide_re_sites=;guide_sequence=GCTTTTCATTCTGACTGCAA;guide_sequence_hash=19d8fdaa;mnemonic=modest_saddle;pam_end=28;pam_offset=-166;pam_replichore=R;pam_search=NNRGVAN;pam_sequence=CGGGCAA;pam_start=21;source_name=thrL-21-modest_saddle

...

NC_000913.3crispioprotospacer180199.+.ID=sgr-b71e7fa7;Name=thrL-199-bouncy_sabine;ann_Name=thrL;ann_end=255;ann_feature=gene;ann_gene=thrL;ann_gene_biotype=protein_coding;ann_locus_tag=b0001;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=190;ann_strand=+;guide_context_down=CACCATTACCACCACCATCA;guide_context_up=CAGATAAAAATTACAGAGTA;guide_length=20;guide_re_sites=;guide_sequence=CACAACATCCATGAAACGCA;guide_sequence_hash=3e6eb3a0;mnemonic=bouncy_sabine;pam_end=206;pam_offset=65;pam_replichore=R;pam_search=NNRGVAN;pam_sequence=TTAGCAC;pam_start=199;source_name=thrL-199-bouncy_sabineThe guides are output in GFF format, so it can be used directly as an annotation
track in your favourite genome browser.It can be dense for human beings to parse, so you can convert to a TSV usingbioino ggf2table:$headguides.gff|bioinogff2table2>/dev/null

seqidsourcefeaturestartendscorestrandphaseIDNameann_Nameann_endann_featureann_geneann_gene_biotypeann_locus_tagann_phaseann_scoreann_seqidann_sourceann_startann_strandguide_context_downguide_context_upguide_lengthguide_re_sitesguide_sequenceguide_sequence_hashmnemonicpam_endpam_offsetpam_replichorepam_searchpam_sequencepam_startsource_name
NC_000913.3crispioprotospacer221.+.sgr-e5373243thrL-21-modest_saddlethrL255genethrLprotein_coding_up-thrL..NC_000913.3RefSeq190+TATGTCTCTGTGTGGATTAACAGCACCCCAGGAACCCATA20GCTTTTCATTCTGACTGCAA19d8fdaamodest_saddle28-166RNNRGVANCGGGCAA21thrL-21-modest_saddle

...

NC_000913.3crispioprotospacer180199.+.sgr-b71e7fa7thrL-199-bouncy_sabinethrL255genethrLprotein_codingb0001..NC_000913.3RefSeq190+CACCATTACCACCACCATCACAGATAAAAATTACAGAGTA20CACAACATCCATGAAACGCA3e6eb3a0bouncy_sabine20665RNNRGVANTTAGCAC199thrL-199-bouncy_sabineAll the commands are pipeable. All the chatter goes tostderr, so
you can pipe your actual data throughstdout.Mapping known guide RNAs to a genomeThe commandcrispio mapis similar, but takes known guides in FASTA format as input.$crispiomapcv-nar-2020_TableS1.fasta-gEcoMG1655-NC_000913.3.fasta-aEcoMG1655-NC_000913.3.gff3--pamSpy

🚀MappingsgRNAswiththefollowingparameters:...
Buildingannotationlookuptable.100%|████████████████████████████████████████████████████████████████████████████████████████████|9490/9490[00:24<00:00,389.80it/s]FindingsgRNAsitesmatching21417sequencesfromcv-nar-2020_TableS1.fastaandmatchingPAMSpy(NGGN)inEcoMG1655-NC_000913.3.fasta...##sequence-region NC_000913.3 1 4641652##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=511145##genome-sequence       NC_000913.3     1       4641652##genome-description    Escherichia coli str. K-12 substr. MG1655, complete genome##genome-filename       EcoMG1655-NC_000913.3.fasta#sgRNA-map      crispio EcoMG1655-NC_000913.3.fasta     EcoMG1655-NC_000913.3.gff3100%|████████████████████████████████████████████████████|100/100[00:11<00:00,8.77it/s,current=GAATGCTACCGCCAGTGACC,not_found=0]Notfound:0guides:

NC_000913.3crispio24009462400965.+.ID=sgr-7a0a4f43;Name=nuoF-2400965-level_herman;ann_Name=nuoF;ann_end=2401555;ann_feature=gene;ann_gene=nuoF;ann_gene_biotype=protein_coding;ann_locus_tag=b2284;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=2400218;ann_strand=-;guide_context_down=TAGCACGACGTCCTTCCAGG;guide_context_up=CCATGCGCCGGAGGTTGCCG;guide_length=20;guide_re_sites=;guide_sequence=GGAAGGGTGGCTTCGAGCGT;guide_sequence_hash=6a359e86;mnemonic=level_herman;pam_end=2400969;pam_offset=0;pam_replichore=L;pam_search=NGGN;pam_sequence=GGGT;pam_start=2400965;source_name=GGAAGGGTGGCTTCGAGCGT

...

NC_000913.3crispioprotospacer24009332400952.+.ID=sgr-32446b00;Name=nuoF-2400952-telling_austria;ann_Name=nuoF;ann_end=2401555;ann_feature=gene;ann_gene=nuoF;ann_gene_biotype=protein_coding;ann_locus_tag=b2284;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=2400218;ann_strand=-;guide_context_down=TTCGAGCGTGGGTTAGCACG;guide_context_up=AGGTCGGTTTACCCCATGCG;guide_length=20;guide_re_sites=;guide_sequence=CCGGAGGTTGCCGGGAAGGG;guide_sequence_hash=1908728f;mnemonic=telling_austria;pam_end=2400956;pam_offset=0;pam_replichore=L;pam_search=NGGN;pam_sequence=TGGC;pam_start=2400952;source_name=CCGGAGGTTGCCGGGAAGGG

...

⏰Completedprocessin0:44:13.882252If you don't have a FASTA to hand, but a table instead, you can pipe it
throughbioino table2fasta:$catguide-table.tsv|bioinotable2fasta-ssequence-nguide_name|crispiomap-gEcoMG1655-NC_000913.3.fasta-aEcoMG1655-NC_000913.3.gff3--pamSth1##sequence-region NC_000913.3 1 4641652##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=511145##genome-sequence       NC_000913.3     1       4641652##genome-description    Escherichia coli str. K-12 substr. MG1655, complete genome##genome-filename       EcoMG1655-NC_000913.3.fasta#sgRNA-map      crispio EcoMG1655-NC_000913.3.fasta     EcoMG1655-NC_000913.3.gff3NC_000913.3crispioprotospacer12361255.+.ID=sgr-831073da;Name=thrA-1255-honest_brother;ann_Name=thrA;ann_end=2799;ann_feature=gene;ann_gene=thrA;ann_gene_biotype=protein_coding;ann_locus_tag=b0002;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=337;ann_strand=+;guide_context_down=TTCCAATCTGAATAACATGG;guide_context_up=CTCATTGGTGCCAGCCGTGA;guide_length=20;guide_re_sites=BbsI;guide_sequence=TGAAGACGAATTACCGGTCA;guide_sequence_hash=55934652;mnemonic=honest_brother;pam_end=1262;pam_offset=2462;pam_replichore=R;pam_search=NNRGVAN;pam_sequence=AGGGCAT;pam_start=1255;source_name=thrA-1255-honest_brother

...

NC_000913.3crispioprotospacer39994018.+.ID=sgr-83d65199;Name=thrC-4018-jolly_lunar;ann_Name=thrC;ann_end=5020;ann_feature=gene;ann_gene=thrC;ann_gene_biotype=protein_coding;ann_locus_tag=b0004;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=3734;ann_strand=+;guide_context_down=TGTTCCACGGGCCAACGCTG;guide_context_up=CCCGGCTCCGGTCGCCAATG;guide_length=20;guide_re_sites=BtgZI;guide_sequence=TTGAAAGCGATGTCGGTTGT;guide_sequence_hash=e539f903;mnemonic=jolly_lunar;pam_end=4025;pam_offset=1286;pam_replichore=R;pam_search=NNRGVAN;pam_sequence=CTGGAAT;pam_start=4018;source_name=thrC-4018-jolly_lunarAnnotating with extra featuresIt may be useful to calcuate additional guide RNA features for downstream applications like
machine learning. These are the available extra features:>>>fromcrispioimport*>>>get_features()['on_nontemplate_strand','context_up2','context_down2','context_up_autocorr','pam_n','pam_def','pam_gc','pam_autocorr','pam_scaff_corr','guide_purine','guide_gc','seed_seq','guide_start3','guide_end3','guide_autocorr','guide_scaff_corr']Using the command-line these can be easily added to a GFF or piped output
fromcrispio maporcrispio generate.$catmapped-guides.gff|head|crispiofeaturize--scaffoldSpy

🚀FeaturizingsgRNAswiththefollowingparameters:...
>Generatingfeaturesforguides...##sequence-region NC_000913.3 1 4641652##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=511145##genome-sequence       NC_000913.3     1       4641652##genome-description    Escherichia coli str. K-12 substr. MG1655, complete genome##genome-filename       EcoMG1655-NC_000913.3.fasta#sgRNA-map      crispin EcoMG1655-NC_000913.3.fasta     EcoMG1655-NC_000913.3.gff3NC_000913.3crispinprotospacer24009462400965.+.ID=sgr-7a0a4f43;Name=nuoF-2400965-level_herman;ann_Name=nuoF;ann_end=2401555;ann_feature=gene;ann_gene=nuoF;ann_gene_biotype=protein_coding;ann_locus_tag=b2284;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=2400218;ann_strand=-;guide_context_down=TAGCACGACGTCCTTCCAGG;guide_context_up=CCATGCGCCGGAGGTTGCCG;guide_length=20;guide_re_sites=;guide_sequence=GGAAGGGTGGCTTCGAGCGT;guide_sequence_hash=6a359e86;mnemonic=level_herman;pam_end=2400969;pam_offset=0;pam_replichore=L;pam_search=NGGN;pam_sequence=GGGT;pam_start=2400965;source_name=GGAAGGGTGGCTTCGAGCGT;feat_on_nontemplate_strand=True;feat_context_up2=CG;feat_context_down2=TA;feat_context_up_autocorr=8.928;feat_pam_n=G;feat_pam_def=GGT;feat_pam_gc=0.750;feat_pam_autocorr=2.167;feat_pam_scaff_corr=1.917;feat_guide_purine=0.650;feat_guide_gc=0.650;feat_seed_seq=AGCGT;feat_guide_start3=GGA;feat_guide_end3=CGT;feat_guide_autocorr=8.704;feat_guide_scaff_corr=9.772

...

NC_000913.3crispinprotospacer17641121764131.+.ID=sgr-f3815635;Name=sufA-1764131-scarce_game;ann_Name=sufA;ann_end=1764386;ann_feature=gene;ann_gene=sufA;ann_gene_biotype=protein_coding;ann_locus_tag=b1684;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=1764018;ann_strand=-;guide_context_down=ATCGCTTGCAGCGGGACAAA;guide_context_up=GTCCTTCACGAACGAAATCG;guide_length=20;guide_re_sites=;guide_sequence=ACTTCCGTGCCATCAATAAA;guide_sequence_hash=dc4688e0;mnemonic=scarce_game;pam_end=1764135;pam_offset=0;pam_replichore=R;pam_search=NGGN;pam_sequence=CGGC;pam_start=1764131;source_name=ACTTCCGTGCCATCAATAAA;feat_on_nontemplate_strand=True;feat_context_up2=CG;feat_context_down2=AT;feat_context_up_autocorr=7.159;feat_pam_n=C;feat_pam_def=GGC;feat_pam_gc=1.000;feat_pam_autocorr=2.333;feat_pam_scaff_corr=1.667;feat_guide_purine=0.450;feat_guide_gc=0.400;feat_seed_seq=ATAAA;feat_guide_start3=ACT;feat_guide_end3=AAA;feat_guide_autocorr=7.767;feat_guide_scaff_corr=10.528100%|███████████████████████████████████████████████████████████████|4/4[00:00<00:00,1331.21it/s,current=sufA-1764131-scarce_game]⏰Completedprocessin0:00:00.065336The attributes starting withfeat_have been added.Checking for off-targetsOne downside of CRISPR-based tools is the possibility of off-target effects.crispio offtargetcompares two GFF files, or one GFF file against itself, for
guide RNA sites that share a seed sequence (4 PAM-proximal bases) and have a
Hamming distance of 4 or less.$catmapped-guides.gff|head|crispioofftarget-2<(catmapped-guides.gff)##sequence-region NC_000913.3 1 4641652##species https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=511145##genome-sequence       NC_000913.3     1       4641652##genome-description    Escherichia coli str. K-12 substr. MG1655, complete genome##genome-filename       EcoMG1655-NC_000913.3.fasta#sgRNA-map      crispin EcoMG1655-NC_000913.3.fasta     EcoMG1655-NC_000913.3.gff3#crosstalk-comparator   63NC_000913.3crispinprotospacer24009462400965.+.ID=sgr-7a0a4f43;Name=nuoF-2400965-level_herman;ann_Name=nuoF;ann_end=2401555;ann_feature=gene;ann_gene=nuoF;ann_gene_biotype=protein_coding;ann_locus_tag=b2284;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=2400218;ann_strand=-;guide_context_down=TAGCACGACGTCCTTCCAGG;guide_context_up=CCATGCGCCGGAGGTTGCCG;guide_length=20;guide_re_sites=;guide_sequence=GGAAGGGTGGCTTCGAGCGT;guide_sequence_hash=6a359e86;mnemonic=level_herman;pam_end=2400969;pam_offset=0;pam_replichore=L;pam_search=NGGN;pam_sequence=GGGT;pam_start=2400965;source_name=GGAAGGGTGGCTTCGAGCGT

...

NC_000913.3crispinprotospacer17641121764131.+.ID=sgr-f3815635;Name=sufA-1764131-scarce_game;ann_Name=sufA;ann_end=1764386;ann_feature=gene;ann_gene=sufA;ann_gene_biotype=protein_coding;ann_locus_tag=b1684;ann_phase=.;ann_score=.;ann_seqid=NC_000913.3;ann_source=RefSeq;ann_start=1764018;ann_strand=-;guide_context_down=ATCGCTTGCAGCGGGACAAA;guide_context_up=GTCCTTCACGAACGAAATCG;guide_length=20;guide_re_sites=;guide_sequence=ACTTCCGTGCCATCAATAAA;guide_sequence_hash=dc4688e0;mnemonic=scarce_game;pam_end=1764135;pam_offset=0;pam_replichore=R;pam_search=NGGN;pam_sequence=CGGC;pam_start=1764131;source_name=ACTTCCGTGCCATCAATAAAPython APISome classes and functions are exposed in an API for generating guide RNAs
in Python scripts.Guides can be generatedde novo.>>>fromcrispioimportGuideLibrary>>>genome="TTTTTTTTTTAAAAAAAAAATGATCGATCGATCGNGGAAAAAAAAAACCCCCCCCCCC">>>gl=GuideLibrary.from_generating(genome=genome)1it[00:00,2223.92it/s,at_site=34,direction=forward,guides_created=1,pam_sites_found=1]3it[00:00,6397.01it/s,at_site=53,direction=reverse,guides_created=4,pam_sites_found=4]>>>gl.genome'TTTTTTTTTTAAAAAAAAAATGATCGATCGATCGNGGAAAAAAAAAACCCCCCCCCCC'>>>len(gl.guide_matches)4>>>formatch_collectioningl.guide_matches:...forguideinmatch_collection.matches:...print(guide)...GuideMatch(pam_search='NGG',guide_seq='AAAAAATGATCGATCGATCG',pam_seq='NGG',pam_start=34,pam_end=37,reverse=False,guide_context_up='',guide_context_down='AAAAAAAAAACCCCCCCCCC',length=20,guide_start=14,guide_end=34)GuideMatch(pam_search='NGG',guide_seq='CCCCCCCC',pam_seq='CCC',pam_start=47,pam_end=50,reverse=True,guide_context_up='',guide_context_down='TTTTTTTTTTCCNCGATCGA',length=8,guide_start=50,guide_end=58)GuideMatch(pam_search='NGG',guide_seq='CCCCC',pam_seq='CCC',pam_start=50,pam_end=53,reverse=True,guide_context_up='',guide_context_down='GGGTTTTTTTTTTCCNCGAT',length=5,guide_start=53,guide_end=58)GuideMatch(pam_search='NGG',guide_seq='CC',pam_seq='CCC',pam_start=53,pam_end=56,reverse=True,guide_context_up='',guide_context_down='GGGGGGTTTTTTTTTTCCNC',length=2,guide_start=56,guide_end=58)Or they can be mapped to a genome.>>>fromcrispioimportGuideLibrary>>>genome="TTTTTTTTTTAAAAAAAAAATGATCGATCGATCGNGGAAAAAAAAAACCCCCCCCCCC">>>guide_seq="ATGATCGATCGATCG">>>gl=GuideLibrary.from_mapping(guide_seq=guide_seq,genome=genome)# doctest: +SKIP100%|████████████████████████████████████████████████████████|1/1[00:00<00:00,2263.52it/s,current=ATGATCGATCGATCGNGG,not_found=0]Notfound:0guides:>>>gl.genome'TTTTTTTTTTAAAAAAAAAATGATCGATCGATCGNGGAAAAAAAAAACCCCCCCCCCC'>>>len(gl.guide_matches)1>>>forcollectioningl.guide_matches:...formatchincollection.matches:...print(match)...GuideMatch(pam_search='NGG',guide_seq='ATGATCGATCGATCG',pam_seq='NGG',pam_start=34,pam_end=37,reverse=False,guide_context_up='',guide_context_down='AAAAAAAAAACCCCCCCCCC',length=15,guide_start=19,guide_end=34)Check the full API in thedocumentation.Issues, bugs, suggestionsDo not hesitate to add to ourissue tracker.DocumentationCheck the documentation and full APIhere.