Basic pLAST usage

Imports and configuration

[1]:
import logging
from pathlib import Path
from threadpoolctl import threadpool_limits
import pandas as pd
from plast.data import PLASTData
from plast.plast import PLAST
from examples.configuration import config

Load configuration to PLASTData object

[2]:
pl_data = PLASTData(config)
Loading pLAST data...

Analyze sequence using MMseqs2 model

Initialize PLAST object - load config, choose model and add logger

[3]:
plast = PLAST(data=pl_data, model="mmseqs2_model")

Load example plasmid sequence from .fasta file and annotate with prodigal

[4]:
plast = plast.load_nt_fasta(open("examples/NC_005000.1.fasta").read())
print("Plasmid of langth", plast.length, "has the following annotation:")
display(plast.parsed)
Plasmid of langth 24873 has the following annotation:
locus_tag start end strand type gene product translation
0 NC_005000.1_1 1 291 -1 CDS MSINTFVYSHPINVYIIKNLGITVEQFCELYAYPQGTVASWITRQR...
1 NC_005000.1_2 427 606 -1 CDS MNIIQQYELKYITFDQLSEEIWGYGQRLINEVGVERFSFYVEAAAG...
2 NC_005000.1_3 603 980 -1 CDS MRAEMGELKMIDYNDRGRLKWAGFYLSDHTEEIDADNEQRTSQNLA...
3 NC_005000.1_4 946 2271 -1 CDS MMDYSKEPVNDYFLIDMKSFYASVECIERNLDPLTTELVVMSRADN...
4 NC_005000.1_5 2721 3335 1 CDS MRVAYIRVSSIDQNEQRQIEEMKKFGAERIFIEKQSGATITHRPVF...
5 NC_005000.1_6 3500 4504 -1 CDS MEYKFNLNLKEVLPTQGTININGQDNDDDIVIKKIEFIDSDINVFF...
6 NC_005000.1_7 4963 5220 -1 CDS MIKAWSDDAWDDYLYWHEQGNKSNIKKINKLIKDIDRSPFAGLGKP...
7 NC_005000.1_8 5213 5482 -1 CDS MEAVAYSNFRQNLRSYMKQVNEDAETLIVTSKDVEDTVVVLSKRDY...
8 NC_005000.1_9 5620 6126 1 CDS MSAGTSNPAFSWAINKSNAIHIILDSLLPYFCFSCCNSFCLFSSNV...
9 NC_005000.1_10 6173 6868 -1 CDS MQQNPTEDVSHFLTNKEHLNEVIRRIQKDFSCMEEMKYFIQRVEEQ...
10 NC_005000.1_11 6924 7571 1 CDS MTMNHFKGKQFQQDVIIVAVGYYLRYNLSYREVQEILYDRGINVSH...
11 NC_005000.1_12 7524 7763 -1 CDS MDTETDQLQNQVLLDNFVDIMKEDSINTFVPENVLNLIKTFSSTYE...
12 NC_005000.1_13 7789 8130 -1 CDS MRISPELKKLIEKYRCVKDTEGMSPAKVYKLVGENENLYLKMTDSR...
13 NC_005000.1_14 8232 8774 -1 CDS MITEMKAGHLKDIDKPSEPFEVIGKIIPRYENENWTFTELLYEAPY...
14 NC_005000.1_15 8771 9679 -1 CDS MRSEKEMMDLVLSLAEQDERIRIVTLEGSRANINIPKDEFQDYDIT...
15 NC_005000.1_16 9712 10446 -1 CDS MKENKYDDNIFFQKYSQMSRSQKGLAGAGEWETLKKMLPDFKGKRV...
16 NC_005000.1_17 10427 11344 -1 CDS MAWNFYSSESIKGACLMVDNIIKSVAEKLSSLSYIEGIVLGGSRAR...
17 NC_005000.1_18 11399 11644 -1 CDS MIDVNELLEEAIRETENLNDGEVFLVKDLFKGYVGNRIPRKDRLLL...
18 NC_005000.1_19 11671 12345 -1 CDS MYQNYTINQLCLPIDLEIKLEENDFAHAIVQFVDSIPDEVFLPYYQ...
19 NC_005000.1_20 12802 12993 -1 CDS MSKYCLFLIVIYYLTGGNNSMSRFFKFGKLHVTKGNGDKLLDILLT...
20 NC_005000.1_21 12938 13675 -1 CDS MNKNIKYSQNFLTSEKVLNQIIKQLNLKETDTVYEIGTGKGHLTTK...
21 NC_005000.1_22 13904 14167 -1 CDS MGNLGAQKEKRNDTPISAKKDIMGDKTVRVRADLHHIIKIETAKNG...
22 NC_005000.1_23 14564 15250 1 CDS MTMNHFKGKQFQQDVIIVAVGYYLRYNLSYREVQEILYDRGINVSH...
23 NC_005000.1_24 15306 15854 1 CDS MEDDGFTRLDLAFDFEDDLSDYYALSEKALKRTVFFGTTGKAETKY...
24 NC_005000.1_25 15987 17174 1 CDS MTQVHFTFESEEIQAIINESGANDTAKTLMTIMFNQLMEEQRNQYI...
25 NC_005000.1_26 17464 18111 1 CDS MTFNIINLETWDRKEYFNHYFNQQTTYSVTKELDITLLKSMIKDKG...
26 NC_005000.1_27 18098 18253 1 CDS MNGFKSKINFINLSNHDIYKFIATTFLVAFVLILNLVLNYEWLAFC...
27 NC_005000.1_28 18426 18824 1 CDS MSEHDNNLASDLSVGGNRKPNRKEPKQISFRVNEGEYEKLRSSAET...
28 NC_005000.1_29 18806 19192 1 CDS MATTKISSTKSTSRAINYAEKRAEEKSALNCDIDYAKSSFKATREM...
29 NC_005000.1_30 19240 19926 1 CDS MTMNHFKGKQFQQDVIIVAVGYYLRYNLSYREVQEILYDRGINVSH...
30 NC_005000.1_31 20542 21582 -1 CDS MNDFNYYKSKEIYREKYYQMPKVFFTNEKYMDLSNDAKIAYMLLKD...
31 NC_005000.1_32 21931 22257 -1 CDS MAEDNRSQAAVSRLLGNKNKKNFKSKEVEEIELTKKNISKVIKDQG...
32 NC_005000.1_33 22244 23047 -1 CDS MGDILMARILSVANQKGGVSKTTTSVNLAACLKFVYGKNVLLVDID...
33 NC_005000.1_34 23471 24658 -1 CDS MTQVHFTFESEEIQAIINESGANDTAKTLMTIMFNQLMEEQRNQYI...

Assign cluster identifiers to the plasmid proteins

GPU usage is recommended

[5]:
plast = plast.assign_mmseqs_clusters(use_gpu=False, threads=16)
print("Number of assigned clusters:", len(plast.vector))
print("Assigned clusters:")
print(plast.vector)
Number of assigned clusters: 34
Assigned clusters:
['503696', '766345', '869197', '1937138', '978057', '383425', '945760', '589250', '690891', '1551360', '1281006', None, '1324730', '503880', '1456404', '465833', '1342390', '643142', '840054', '126491', '1148733', '112363', '1281006', '23491', '464026', '1559939', None, '645043', '1967057', '1281006', '1058438', '1180625', '1377695', '464026']

Pass data through pLAST model and receive embeddings

[6]:
plast = plast.encode()
print("Plasmid embedding:")
print(plast.embedding)
Plasmid embedding:
[ 0.1384209  -0.04938016  0.08050069 -0.28110254 -0.15616207 -0.07490253
  0.16827418 -0.13507421 -0.23134972  0.17394237  0.03949427  0.14928077
  0.0778301  -0.12385113  0.08690757 -0.0044575   0.12068866 -0.17245157
 -0.05543656 -0.12488046 -0.06651291 -0.0363512   0.0564674  -0.05215054
  0.13757774 -0.15772095 -0.08525286  0.01317535  0.01092703 -0.11166314
  0.15189844  0.05494929 -0.0992474   0.1242907  -0.05032507 -0.02236419
  0.05827509  0.08067824 -0.19969554 -0.24305034  0.1439417  -0.06540675
  0.16099109  0.11031093 -0.12261283 -0.0014736   0.09187076  0.15333791
 -0.11933523 -0.24098885  0.0586763   0.3031614  -0.01348991 -0.13698538
 -0.02973128 -0.02080188  0.14846162 -0.08702841 -0.10383306  0.01379118
  0.10749927  0.16289651  0.00122075  0.03645242]

Whole-plasmid comparison (global search)

get_most_similar() compares the embedding of the complete query plasmid against complete plasmid embeddings stored in the selected pLAST model.

[7]:
results = plast.get_most_similar(maxret=10)
[8]:
df = pd.DataFrame.from_dict(results, orient="index")

for c in ("pLAST_distance", "gc"):
    if c in df.columns:
        df[c] = pd.to_numeric(df[c], errors="coerce").round(6)

preferred = [
    "pLAST_distance",
    "length",
    "gc",
    "taxid",
    "organism",
    "definition",
    "taxonomy",
    "rep_type(s)",
    "AMR",
    "relaxase_type(s)",
    "mpf_type",
    "orit_type(s)",
    "predicted_mobility",
]
cols = [c for c in preferred if c in df.columns] + [
    c for c in df.columns if c not in preferred
]
display(df[cols])
pLAST_distance length gc taxid organism definition taxonomy rep_type(s) AMR relaxase_type(s) mpf_type orit_type(s) predicted_mobility accession database topology primary_cluster_id
COMPASS_NC_005000.1 0.984177 24873 0.340329 1352.0 -,Enterococcus faecium Enterococcus faecium plasmid pRUM, complete se... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1118,rc889 - MOBP - MOBP mobilizable COMPASS_NC_005000.1,GenBank_AF507977.1,IMGPR_p... COMPASS,GenBank,IMG-PR,RefSeq circular AD100
GenBank_GG692536.1 0.978578 22101 0.344378 565660.0 Enterococcus faecium Enterococcus faecium 1,231,410 map unlocalized... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1968,rc889 - - - - non-mobilizable GenBank_GG692536.1,IMGPR_plasmid_647533149_000... GenBank,IMG-PR,RefSeq linear AD100
COMPASS_NZ_CP018131.1 0.975886 23736 0.348290 1352.0 Enterococcus faecium Enterococcus faecium strain A_020709_82 plasmi... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1968,rc889 - - - - non-mobilizable COMPASS_NZ_CP018131.1,IMGPR_plasmid_2872254902... COMPASS,IMG-PR,PLDSB,RefSeq circular AD100
COMPASS_KP842560.1 0.974289 23269 0.341957 1352.0 Enterococcus faecium Enterococcus faecium strain 17i48 ST17 plasmid... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - MOBP - MOBP mobilizable COMPASS_KP842560.1,GenBank_KP842560.1,RefSeq_N... COMPASS,GenBank,RefSeq circular AD100
PLSDB_NZ_LR135437.1 0.974187 19194 0.341252 1352.0 Enterococcus faecium Enterococcus faecium isolate E8691 plasmid 3 Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - - - - non-mobilizable PLSDB_NZ_LR135437.1,RefSeq_NZ_LR135437.1 PLDSB,RefSeq linear AD100
EMBL_LN999989.1 0.973734 32402 0.345102 1352.0 Enterococcus faecium Enterococcus faecium isolate EFE11651 plasmid ... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc185,rc889 - MOBP - MOBP mobilizable EMBL_LN999989.1,IMGPR_plasmid_2875025650_00000... ENA,IMG-PR,PLDSB,RefSeq circular AD100
IMGPR_plasmid_647533152_000004 0.968064 25520 0.344262 NaN Enterococcus faecium NaN NaN rc889 AMK,AZM,BUT,CBM,CHL,CLI,CLR,CST,DAL,DIR,ERY,EV... MOBV - - mobilizable IMGPR_plasmid_647533152_000004 IMG-PR linear AD100
GenBank_CP097025.1 0.965033 23514 0.341371 1352.0 Enterococcus faecium Enterococcus faecium strain AT45b plasmid pAT4... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - MOBP - MOBP mobilizable GenBank_CP097025.1,PLSDB_NZ_CP097025.1,RefSeq_... GenBank,PLDSB,RefSeq circular AD100
GenBank_LPUE01000006.1 0.955718 45034 0.349336 NaN Enterococcus faecium Enterococcus faecium C68 map unlocalized plasm... NaN rc889 - MOBV - - mobilizable GenBank_LPUE01000006.1,RefSeq_NZ_LPUE01000006.1 GenBank,RefSeq linear AD100
PLSDB_NZ_LR135446.1 0.955302 44438 0.353436 1352.0 Enterococcus faecium Enterococcus faecium isolate E7114 plasmid 4 Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1763,rc889,rc943 - - - - non-mobilizable PLSDB_NZ_LR135446.1,RefSeq_NZ_LR135446.1 PLDSB,RefSeq linear AB173

Analyze sequence using eggNOG model

Initialize PLAST object - load config, choose model and add logger

[14]:
plast = PLAST(data=pl_data, model="eggnog_model")

Load example plasmid sequence and GenBank annotation from .gb file

[15]:
plast = plast.load_gbff(Path("examples/NC_005000.1.gb"))
print("Plasmid of langth", plast.length, "has the following annotation:")
display(plast.parsed)
Plasmid of langth 24873 has the following annotation:
start end strand partial type coordinates locus_tag old_locus_tag inference note ... transl_table product protein_id translation EC_number GO_function GO_process GO_component pseudo gene
0 1 291 -1 0 CDS complement(1..291) HKK39_RS00005 pRUM_p01 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_000026576.1 MSINTFVYSHPINVYIIKNLGITVEQFCELYAYPQGTVASWITRQR... NaN NaN NaN NaN NaN NaN
1 427 606 -1 0 CDS complement(427..606) HKK39_RS00010 NaN COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_001021554.1 MNIIQQYELKYITFDQLSEEIWGYGQRLINEVGVERFSFYVEAAAG... NaN NaN NaN NaN NaN NaN
2 603 953 -1 0 CDS complement(603..953) HKK39_RS00015 pRUM_p02 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_000568378.1 MIDYNDRGRLKWAGFYLSDHTEEIDADNEQRTSQNLAKEQMTTEEI... NaN NaN NaN NaN NaN NaN
3 946 2271 -1 0 CDS complement(946..2271) HKK39_RS00020 pRUM_p03 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 Y-family DNA polymerase WP_000969590.1 MMDYSKEPVNDYFLIDMKSFYASVECIERNLDPLTTELVVMSRADN... 2.7.7.7 GO:0003684 - damaged DNA binding [EvidenceIEA]... GO:0006281 - DNA repair [Evidence IEA];GO:0006... NaN NaN NaN
4 2721 3335 1 0 CDS 2721..3335 HKK39_RS00025 pRUM_p04 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 recombinase family protein WP_001261742.1 MRVAYIRVSSIDQNEQRQIEEMKKFGAERIFIEKQSGATITHRPVF... NaN GO:0003677 - DNA binding [Evidence IEA];GO:000... GO:0015074 - DNA integration [Evidence IEA];GO... NaN NaN NaN
5 3500 4504 -1 0 CDS complement(3500..4504) HKK39_RS00030 pRUM_p05 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_000455809.1 MEYKFNLNLKEVLPTQGTININGQDNDDDIVIKKIEFIDSDINVFF... NaN NaN NaN NaN NaN NaN
6 4963 5220 -1 0 CDS complement(4963..5220) HKK39_RS00035 pRUM_p06 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 Txe/YoeB family addiction module toxin WP_000588503.1 MIKAWSDDAWDDYLYWHEQGNKSNIKKINKLIKDIDRSPFAGLGKP... NaN NaN GO:0008219 - cell death [Evidence IEA] NaN NaN NaN
7 5213 5482 -1 0 CDS complement(5213..5482) HKK39_RS00040 pRUM_p07 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 type II toxin-antitoxin system Phd/YefM family... WP_000388479.1 MEAVAYSNFRQNLRSYMKQVNEDAETLIVTSKDVEDTVVVLSKRDY... NaN GO:0003677 - DNA binding [Evidence IEA];GO:009... GO:0045927 - positive regulation of growth[Evi... GO:0110001 - toxin-antitoxin complex[Evidence ... NaN NaN
8 5613 5792 -1 0 CDS complement(5613..5792) HKK39_RS00045 NaN COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_001120991.1 MPIAIGNKRLPVTLDEKRQKELQQLKQKYGKSESRIMCIALDLLIA... NaN NaN NaN NaN NaN NaN
9 5890 6126 1 0 CDS 5890..6126 HKK39_RS00185 NaN COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_306297428.1 MKQNTSIAKNTTKFKCTAAAWRISISPTNRTNNRGMILFIWISFFL... NaN NaN NaN NaN NaN NaN
10 6173 6868 -1 0 CDS complement(6173..6868) HKK39_RS00050 pRUM_p10 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_002326819.1 MQQNPTEDVSHFLTNKEHLNEVIRRIQKDFSCMEEMKYFIQRVEEQ... NaN NaN NaN NaN NaN NaN
14 8232 8774 -1 0 CDS complement(8232..8774) HKK39_RS00070 pRUM_p14 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 streptothricin N-acetyltransferase Sat4 WP_000627290.1 MITEMKAGHLKDIDKPSEPFEVIGKIIPRYENENWTFTELLYEAPY... NaN NaN NaN NaN NaN sat4
15 8771 9679 -1 0 CDS complement(8771..9679) HKK39_RS00075 pRUM_p16 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 aminoglycoside nucleotidyltransferase ANT(6)-Ia WP_001255866.1 MRSEKEMMDLVLSLAEQDERIRIVTLEGSRANINIPKDEFQDYDIT... NaN NaN NaN NaN NaN NaN
16 9712 10446 -1 0 CDS complement(9712..10446) HKK39_RS00080 pRUM_p17 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 class I SAM-dependent methyltransferase WP_000662263.1 MKENKYDDNIFFQKYSQMSRSQKGLAGAGEWETLKKMLPDFKGKRV... 2.1.1.- GO:0008168 - methyltransferase activity[Eviden... GO:0032259 - methylation [Evidence IEA] NaN NaN NaN
17 10427 11296 -1 0 CDS complement(10427..11296) HKK39_RS00085 pRUM_p18 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 nucleotidyltransferase domain-containingprotein WP_000228166.1 MVDNIIKSVAEKLSSLSYIEGIVLGGSRARGTHTEDSDIDIGIYYN... NaN GO:0016779 - nucleotidyltransferase activity[E... NaN NaN NaN NaN
18 11399 11644 -1 0 CDS complement(11399..11644) HKK39_RS00090 pRUM_p19 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 single-stranded DNA-binding protein WP_000567888.1 MIDVNELLEEAIRETENLNDGEVFLVKDLFKGYVGNRIPRKDRLLL... NaN NaN NaN NaN NaN NaN
21 12938 13675 -1 0 CDS complement(12938..13675) HKK39_RS00105 pRUM_p21 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 23S rRNA (adenine(2058)-N(6))-methyltransferas... WP_001038792.1 MNKNIKYSQNFLTSEKVLNQIIKQLNLKETDTVYEIGTGKGHLTTK... NaN NaN NaN NaN NaN erm(B)
22 13800 13883 -1 0 CDS complement(13800..13883) HKK39_RS00110 NaN COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 23S rRNA methyltransferase attenuation leaderp... WP_001814874.1 MLVFQMRNVDKTSTVLKQTKNSDYADK NaN NaN GO:0046677 - response to antibiotic [EvidenceI... NaN NaN NaN
23 13904 14167 -1 0 CDS complement(13904..14167) HKK39_RS00115 NaN COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 peptide-binding protein WP_002311901.1 MGNLGAQKEKRNDTPISAKKDIMGDKTVRVRADLHHIIKIETAKNG... NaN NaN NaN NaN NaN NaN
25 14570 15250 1 0 CDS 14570..15250 HKK39_RS00125 pRUM_p22 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 IS6-like element IS1216 family transposase WP_001015311.1 MNHFKGKQFQQDVIIVAVGYYLRYNLSYREVQEILYDRGINVSHTT... NaN GO:0004803 - transposase activity [EvidenceIEA] GO:0006313 - DNA transposition [EvidenceIEA] NaN NaN NaN
27 15987 17174 1 0 CDS 15987..17174 HKK39_RS00135 pRUM_p24 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 IS256-like element IS16 family transposase WP_002296840.1 MTQVHFTFESEEIQAIINESGANDTAKTLMTIMFNQLMEEQRNQYI... NaN GO:0004803 - transposase activity [EvidenceIEA] GO:0006313 - DNA transposition [EvidenceIEA] NaN NaN NaN
28 17464 18111 1 0 CDS 17464..18111 HKK39_RS00140 pRUM_p25 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 type A-8 chloramphenicol O-acetyltransferase WP_000143686.1 MTFNIINLETWDRKEYFNHYFNQQTTYSVTKELDITLLKSMIKDKG... 2.3.1.28 NaN NaN NaN NaN NaN
29 18426 18824 1 0 CDS 18426..18824 HKK39_RS00145 pRUM_p26 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 plasmid mobilization protein WP_002340414.1 MSEHDNNLASDLSVGGNRKPNRKEPKQISFRVNEGEYEKLRSSAET... NaN GO:0003677 - DNA binding [Evidence IEA] NaN NaN NaN NaN
31 19246 19926 1 0 CDS 19246..19926 HKK39_RS00155 pRUM_p28 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 IS6-like element IS1216 family transposase WP_002343844.1 MNHFKGKQFQQDVIIVAVGYYLRYNLSYREVQEILYDRGINVSHTT... NaN GO:0004803 - transposase activity [EvidenceIEA] GO:0006313 - DNA transposition [EvidenceIEA] NaN NaN NaN
32 20542 21582 -1 0 CDS complement(20542..21582) HKK39_RS00160 pRUM_p29 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 replication initiator protein A WP_000997689.1 MNDFNYYKSKEIYREKYYQMPKVFFTNEKYMDLSNDAKIAYMLLKD... NaN NaN NaN NaN NaN NaN
33 21931 22257 -1 0 CDS complement(21931..22257) HKK39_RS00165 pRUM_p30 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 hypothetical protein WP_000796719.1 MAEDNRSQAAVSRLLGNKNKKNFKSKEVEEIELTKKNISKVIKDQG... NaN NaN NaN NaN NaN NaN
34 22244 23047 -1 0 CDS complement(22244..23047) HKK39_RS00170 pRUM_p31 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 ParA family protein WP_002311905.1 MGDILMARILSVANQKGGVSKTTTSVNLAACLKFVYGKNVLLVDID... NaN GO:0005524 - ATP binding [Evidence IEA];GO:001... NaN NaN NaN NaN
35 23471 24658 -1 0 CDS complement(23471..24658) HKK39_RS00175 pRUM_p32 COORDINATES: similar to AAsequence:RefSeq:WP_0... Derived by automated computational analysis us... ... 11 IS256-like element IS16 family transposase WP_002296840.1 MTQVHFTFESEEIQAIINESGANDTAKTLMTIMFNQLMEEQRNQYI... NaN GO:0004803 - transposase activity [EvidenceIEA] GO:0006313 - DNA transposition [EvidenceIEA] NaN NaN NaN

28 rows Γ— 21 columns

Assign cluster identifiers to the plasmid proteins

[16]:
plast = plast.assign_eggnog_annot(processes=16)
print("Number of assigned clusters:", len(plast.vector))
print("Assigned clusters:")
print(plast.vector)
Number of assigned clusters: 28
Assigned clusters:
['348UX', '306TJ', '33CM8', 'COG0389', 'COG1961', '306WU', 'COG4115', '30A2H', '3072V', nan, '3072Z', 'COG1246', '2Z7S1', 'COG4976', '30URY', '33359', 'COG0030', '2ZU0Q', '32NBG', 'COG3316', 'COG3328', 'COG4845', '32ZHN', 'COG3316', '3304N', '30894', 'COG1192', 'COG3328']

Pass data through pLAST model and receive embeddings

[17]:
plast = plast.encode()
print("Plasmid embedding:")
print(plast.embedding)
Plasmid embedding:
[ 0.06329472 -0.04143739  0.06984315  0.21632679 -0.00855456  0.18253054
  0.02088546  0.21080938 -0.00928008  0.01683181  0.02661998  0.02138225
 -0.06070902 -0.18135379  0.19305757  0.11264715  0.00702482 -0.21246433
 -0.12247914  0.00352493  0.154391    0.01665206 -0.00688221 -0.15605277
  0.08608653  0.15692472  0.16208734  0.2544252   0.07329971  0.0497661
 -0.00368475 -0.02327945 -0.04490764  0.12295408  0.19381781 -0.12716755
 -0.00991008 -0.25971994 -0.09920156  0.14554374 -0.10447495  0.05955252
 -0.0202443  -0.02432648 -0.01230781 -0.06949621  0.01995271 -0.07274803
  0.05103639  0.01892512 -0.28953275 -0.13400112 -0.08602309 -0.10764287
  0.29167795 -0.04042183 -0.01173846  0.15272175  0.00202008  0.09931558
 -0.1024653   0.08236861 -0.22468589  0.17022073]

Find similar plasmids in the database

[18]:
results = plast.get_most_similar(maxret=15)
[19]:
df = pd.DataFrame.from_dict(results, orient="index")

for c in ("pLAST_distance", "gc"):
    if c in df.columns:
        df[c] = pd.to_numeric(df[c], errors="coerce").round(6)

preferred = [
    "pLAST_distance",
    "length",
    "gc",
    "taxid",
    "organism",
    "definition",
    "taxonomy",
    "rep_type(s)",
    "AMR",
    "relaxase_type(s)",
    "mpf_type",
    "orit_type(s)",
    "predicted_mobility",
]
cols = [c for c in preferred if c in df.columns] + [
    c for c in df.columns if c not in preferred
]
display(df[cols])
pLAST_distance length gc taxid organism definition taxonomy rep_type(s) AMR relaxase_type(s) mpf_type orit_type(s) predicted_mobility accession database topology primary_cluster_id
RefSeq_NZ_CP097025.1 0.992807 23514 0.341371 1352.0 Enterococcus faecium Enterococcus faecium strain AT45b plasmid pAT4... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - MOBP - MOBP mobilizable GenBank_CP097025.1,PLSDB_NZ_CP097025.1,RefSeq_... GenBank,PLDSB,RefSeq circular AD100
RefSeq_NC_005000.1 0.988632 24873 0.340329 1352.0 -,Enterococcus faecium Enterococcus faecium plasmid pRUM, complete se... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1118,rc889 - MOBP - MOBP mobilizable COMPASS_NC_005000.1,GenBank_AF507977.1,IMGPR_p... COMPASS,GenBank,IMG-PR,RefSeq circular AD100
RefSeq_NZ_KP842560.1 0.987638 23269 0.341957 1352.0 Enterococcus faecium Enterococcus faecium strain 17i48 ST17 plasmid... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - MOBP - MOBP mobilizable COMPASS_KP842560.1,GenBank_KP842560.1,RefSeq_N... COMPASS,GenBank,RefSeq circular AD100
RefSeq_NZ_CP018131.1 0.986287 23736 0.348290 1352.0 Enterococcus faecium Enterococcus faecium strain A_020709_82 plasmi... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1968,rc889 - - - - non-mobilizable COMPASS_NZ_CP018131.1,IMGPR_plasmid_2872254902... COMPASS,IMG-PR,PLDSB,RefSeq circular AD100
RefSeq_NZ_LN999989.1 0.976933 32402 0.345102 1352.0 Enterococcus faecium Enterococcus faecium isolate EFE11651 plasmid ... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc185,rc889 - MOBP - MOBP mobilizable EMBL_LN999989.1,IMGPR_plasmid_2875025650_00000... ENA,IMG-PR,PLDSB,RefSeq circular AD100
RefSeq_NZ_CP066675.1 0.976408 25974 0.347617 1352.0 Enterococcus faecium Enterococcus faecium strain Dallas 163_1 plasm... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - - - - non-mobilizable GenBank_CP066675.1,PLSDB_NZ_CP066675.1,RefSeq_... GenBank,PLDSB,RefSeq circular AD100
RefSeq_NZ_LR135290.1 0.965348 26053 0.345066 1352.0 Enterococcus faecium Enterococcus faecium isolate E7199 plasmid 4 Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - - - - non-mobilizable IMGPR_plasmid_2912394829_000004,PLSDB_NZ_LR135... IMG-PR,PLDSB,RefSeq linear AD100
RefSeq_NZ_OP378686.1 0.961236 32622 0.344062 1352.0 Enterococcus faecium Enterococcus faecium strain VRE33536 plasmid p... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 AMK,AZM,CBM,CLI,CLR,CST,DAL,DBK,DIR,ERY,EVN,FF... - - - non-mobilizable RefSeq_NZ_OP378686.1 RefSeq circular AD100
RefSeq_NZ_AP026603.1 0.957876 31114 0.347496 1352.0 Enterococcus faecium Enterococcus faecium strain JHP80 plasmid pJHP... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc185,rc889 - - - - non-mobilizable DDBJ_AP026603.1,PLSDB_NZ_AP026603.1,RefSeq_NZ_... DDBJ,PLDSB,RefSeq circular AD100
RefSeq_NC_021170.1 0.947730 31136 0.348953 1352.0 Enterococcus faecium Enterococcus faecium plasmid pF856, complete s... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - - - - non-mobilizable COMPASS_JQ663598.1,GenBank_JQ663598.1,RefSeq_N... COMPASS,GenBank,RefSeq circular AB173
RefSeq_NZ_CP012431.1 0.944787 44226 0.354520 1352.0 Enterococcus faecium Enterococcus faecium strain ISMMS_VRE_1 plasmi... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1763,rc2146,rc889 - MOBV - - mobilizable COMPASS_NZ_CP012431.1,GenBank_CP012431.1,IMGPR... COMPASS,GenBank,IMG-PR,PLDSB,RefSeq circular AB173
RefSeq_NZ_CP027516.1 0.944101 37152 0.355243 1352.0 Enterococcus faecium Enterococcus faecium strain AUSMDU00004028 pla... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc1763,rc889 - - - - non-mobilizable COMPASS_NZ_CP027516.1,PLSDB_NZ_CP027516.1,RefS... COMPASS,PLDSB,RefSeq circular AB173
RefSeq_NZ_CP027510.1 0.943327 33328 0.355797 1352.0 Enterococcus faecium Enterococcus faecium strain AUSMDU00004055 pla... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - - - - non-mobilizable COMPASS_NZ_CP027510.1,PLSDB_NZ_CP027510.1,RefS... COMPASS,PLDSB,RefSeq circular AB173
RefSeq_NZ_KX574671.1 0.941715 37372 0.354758 1352.0 Enterococcus faecium Enterococcus faecium strain V24 plasmid pHvH-V... Bacteria;Bacillota;Bacilli;Lactobacillales;Ent... rc889 - - - - non-mobilizable COMPASS_KX574671.1,GenBank_KX574671.1,RefSeq_N... COMPASS,GenBank,RefSeq circular AB173
RefSeq_NZ_JACYGV010000007.1 0.940226 30475 0.359737 NaN Enterococcus faecium Enterococcus faecium strain VREA4 plasmid pVRE... NaN rc889 AMK,AZM,BUT,CBM,CLI,CLR,CST,DAL,DIR,ERY,EVN,FF... - - - non-mobilizable RefSeq_NZ_JACYGV010000007.1 RefSeq circular AB173
[ ]: