XspecT 0.4.1__py3-none-any.whl → 0.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of XspecT might be problematic. Click here for more details.

Files changed (78) hide show
  1. xspect/classify.py +32 -0
  2. xspect/file_io.py +3 -9
  3. xspect/filter_sequences.py +56 -0
  4. xspect/main.py +13 -18
  5. xspect/mlst_feature/mlst_helper.py +102 -13
  6. xspect/mlst_feature/pub_mlst_handler.py +32 -6
  7. xspect/models/probabilistic_filter_mlst_model.py +160 -32
  8. xspect/models/probabilistic_filter_model.py +1 -0
  9. xspect/ncbi.py +8 -6
  10. xspect/train.py +13 -5
  11. xspect/web.py +173 -0
  12. xspect/xspect-web/.gitignore +24 -0
  13. xspect/xspect-web/README.md +54 -0
  14. xspect/xspect-web/components.json +21 -0
  15. xspect/xspect-web/dist/assets/index-CMG4V7fZ.js +290 -0
  16. xspect/xspect-web/dist/assets/index-jIKg1HIy.css +1 -0
  17. xspect/xspect-web/dist/index.html +14 -0
  18. xspect/xspect-web/dist/vite.svg +1 -0
  19. xspect/xspect-web/eslint.config.js +28 -0
  20. xspect/xspect-web/index.html +13 -0
  21. xspect/xspect-web/package-lock.json +6865 -0
  22. xspect/xspect-web/package.json +58 -0
  23. xspect/xspect-web/pnpm-lock.yaml +4317 -0
  24. xspect/xspect-web/public/vite.svg +1 -0
  25. xspect/xspect-web/src/App.tsx +29 -0
  26. xspect/xspect-web/src/api.tsx +62 -0
  27. xspect/xspect-web/src/assets/react.svg +1 -0
  28. xspect/xspect-web/src/components/classification-form.tsx +284 -0
  29. xspect/xspect-web/src/components/classify.tsx +18 -0
  30. xspect/xspect-web/src/components/data-table.tsx +78 -0
  31. xspect/xspect-web/src/components/dropdown-checkboxes.tsx +63 -0
  32. xspect/xspect-web/src/components/dropdown-slider.tsx +42 -0
  33. xspect/xspect-web/src/components/filter-form.tsx +423 -0
  34. xspect/xspect-web/src/components/filter.tsx +15 -0
  35. xspect/xspect-web/src/components/header.tsx +46 -0
  36. xspect/xspect-web/src/components/landing.tsx +7 -0
  37. xspect/xspect-web/src/components/models-details.tsx +138 -0
  38. xspect/xspect-web/src/components/models.tsx +53 -0
  39. xspect/xspect-web/src/components/result-chart.tsx +44 -0
  40. xspect/xspect-web/src/components/result.tsx +155 -0
  41. xspect/xspect-web/src/components/spinner.tsx +30 -0
  42. xspect/xspect-web/src/components/ui/accordion.tsx +64 -0
  43. xspect/xspect-web/src/components/ui/button.tsx +59 -0
  44. xspect/xspect-web/src/components/ui/card.tsx +92 -0
  45. xspect/xspect-web/src/components/ui/chart.tsx +351 -0
  46. xspect/xspect-web/src/components/ui/command.tsx +175 -0
  47. xspect/xspect-web/src/components/ui/dialog.tsx +135 -0
  48. xspect/xspect-web/src/components/ui/dropdown-menu.tsx +255 -0
  49. xspect/xspect-web/src/components/ui/file-upload.tsx +1459 -0
  50. xspect/xspect-web/src/components/ui/form.tsx +165 -0
  51. xspect/xspect-web/src/components/ui/input.tsx +21 -0
  52. xspect/xspect-web/src/components/ui/label.tsx +24 -0
  53. xspect/xspect-web/src/components/ui/navigation-menu.tsx +168 -0
  54. xspect/xspect-web/src/components/ui/popover.tsx +46 -0
  55. xspect/xspect-web/src/components/ui/select.tsx +183 -0
  56. xspect/xspect-web/src/components/ui/separator.tsx +26 -0
  57. xspect/xspect-web/src/components/ui/slider.tsx +61 -0
  58. xspect/xspect-web/src/components/ui/switch.tsx +29 -0
  59. xspect/xspect-web/src/components/ui/table.tsx +113 -0
  60. xspect/xspect-web/src/components/ui/tabs.tsx +64 -0
  61. xspect/xspect-web/src/index.css +120 -0
  62. xspect/xspect-web/src/lib/utils.ts +6 -0
  63. xspect/xspect-web/src/main.tsx +10 -0
  64. xspect/xspect-web/src/types.tsx +34 -0
  65. xspect/xspect-web/src/utils.tsx +6 -0
  66. xspect/xspect-web/src/vite-env.d.ts +1 -0
  67. xspect/xspect-web/tsconfig.app.json +32 -0
  68. xspect/xspect-web/tsconfig.json +13 -0
  69. xspect/xspect-web/tsconfig.node.json +24 -0
  70. xspect/xspect-web/vite.config.ts +24 -0
  71. {xspect-0.4.1.dist-info → xspect-0.5.0.dist-info}/METADATA +6 -8
  72. xspect-0.5.0.dist-info/RECORD +85 -0
  73. {xspect-0.4.1.dist-info → xspect-0.5.0.dist-info}/WHEEL +1 -1
  74. xspect/fastapi.py +0 -102
  75. xspect-0.4.1.dist-info/RECORD +0 -24
  76. {xspect-0.4.1.dist-info → xspect-0.5.0.dist-info}/entry_points.txt +0 -0
  77. {xspect-0.4.1.dist-info → xspect-0.5.0.dist-info}/licenses/LICENSE +0 -0
  78. {xspect-0.4.1.dist-info → xspect-0.5.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,255 @@
1
+ import * as React from "react"
2
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"
3
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function DropdownMenu({
8
+ ...props
9
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
10
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
11
+ }
12
+
13
+ function DropdownMenuPortal({
14
+ ...props
15
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
16
+ return (
17
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
18
+ )
19
+ }
20
+
21
+ function DropdownMenuTrigger({
22
+ ...props
23
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
24
+ return (
25
+ <DropdownMenuPrimitive.Trigger
26
+ data-slot="dropdown-menu-trigger"
27
+ {...props}
28
+ />
29
+ )
30
+ }
31
+
32
+ function DropdownMenuContent({
33
+ className,
34
+ sideOffset = 4,
35
+ ...props
36
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
37
+ return (
38
+ <DropdownMenuPrimitive.Portal>
39
+ <DropdownMenuPrimitive.Content
40
+ data-slot="dropdown-menu-content"
41
+ sideOffset={sideOffset}
42
+ className={cn(
43
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
44
+ className
45
+ )}
46
+ {...props}
47
+ />
48
+ </DropdownMenuPrimitive.Portal>
49
+ )
50
+ }
51
+
52
+ function DropdownMenuGroup({
53
+ ...props
54
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
55
+ return (
56
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
57
+ )
58
+ }
59
+
60
+ function DropdownMenuItem({
61
+ className,
62
+ inset,
63
+ variant = "default",
64
+ ...props
65
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
66
+ inset?: boolean
67
+ variant?: "default" | "destructive"
68
+ }) {
69
+ return (
70
+ <DropdownMenuPrimitive.Item
71
+ data-slot="dropdown-menu-item"
72
+ data-inset={inset}
73
+ data-variant={variant}
74
+ className={cn(
75
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
76
+ className
77
+ )}
78
+ {...props}
79
+ />
80
+ )
81
+ }
82
+
83
+ function DropdownMenuCheckboxItem({
84
+ className,
85
+ children,
86
+ checked,
87
+ ...props
88
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
89
+ return (
90
+ <DropdownMenuPrimitive.CheckboxItem
91
+ data-slot="dropdown-menu-checkbox-item"
92
+ className={cn(
93
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
94
+ className
95
+ )}
96
+ checked={checked}
97
+ {...props}
98
+ >
99
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
100
+ <DropdownMenuPrimitive.ItemIndicator>
101
+ <CheckIcon className="size-4" />
102
+ </DropdownMenuPrimitive.ItemIndicator>
103
+ </span>
104
+ {children}
105
+ </DropdownMenuPrimitive.CheckboxItem>
106
+ )
107
+ }
108
+
109
+ function DropdownMenuRadioGroup({
110
+ ...props
111
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
112
+ return (
113
+ <DropdownMenuPrimitive.RadioGroup
114
+ data-slot="dropdown-menu-radio-group"
115
+ {...props}
116
+ />
117
+ )
118
+ }
119
+
120
+ function DropdownMenuRadioItem({
121
+ className,
122
+ children,
123
+ ...props
124
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
125
+ return (
126
+ <DropdownMenuPrimitive.RadioItem
127
+ data-slot="dropdown-menu-radio-item"
128
+ className={cn(
129
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
130
+ className
131
+ )}
132
+ {...props}
133
+ >
134
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
135
+ <DropdownMenuPrimitive.ItemIndicator>
136
+ <CircleIcon className="size-2 fill-current" />
137
+ </DropdownMenuPrimitive.ItemIndicator>
138
+ </span>
139
+ {children}
140
+ </DropdownMenuPrimitive.RadioItem>
141
+ )
142
+ }
143
+
144
+ function DropdownMenuLabel({
145
+ className,
146
+ inset,
147
+ ...props
148
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
149
+ inset?: boolean
150
+ }) {
151
+ return (
152
+ <DropdownMenuPrimitive.Label
153
+ data-slot="dropdown-menu-label"
154
+ data-inset={inset}
155
+ className={cn(
156
+ "px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
157
+ className
158
+ )}
159
+ {...props}
160
+ />
161
+ )
162
+ }
163
+
164
+ function DropdownMenuSeparator({
165
+ className,
166
+ ...props
167
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
168
+ return (
169
+ <DropdownMenuPrimitive.Separator
170
+ data-slot="dropdown-menu-separator"
171
+ className={cn("bg-border -mx-1 my-1 h-px", className)}
172
+ {...props}
173
+ />
174
+ )
175
+ }
176
+
177
+ function DropdownMenuShortcut({
178
+ className,
179
+ ...props
180
+ }: React.ComponentProps<"span">) {
181
+ return (
182
+ <span
183
+ data-slot="dropdown-menu-shortcut"
184
+ className={cn(
185
+ "text-muted-foreground ml-auto text-xs tracking-widest",
186
+ className
187
+ )}
188
+ {...props}
189
+ />
190
+ )
191
+ }
192
+
193
+ function DropdownMenuSub({
194
+ ...props
195
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
196
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
197
+ }
198
+
199
+ function DropdownMenuSubTrigger({
200
+ className,
201
+ inset,
202
+ children,
203
+ ...props
204
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
205
+ inset?: boolean
206
+ }) {
207
+ return (
208
+ <DropdownMenuPrimitive.SubTrigger
209
+ data-slot="dropdown-menu-sub-trigger"
210
+ data-inset={inset}
211
+ className={cn(
212
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",
213
+ className
214
+ )}
215
+ {...props}
216
+ >
217
+ {children}
218
+ <ChevronRightIcon className="ml-auto size-4" />
219
+ </DropdownMenuPrimitive.SubTrigger>
220
+ )
221
+ }
222
+
223
+ function DropdownMenuSubContent({
224
+ className,
225
+ ...props
226
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
227
+ return (
228
+ <DropdownMenuPrimitive.SubContent
229
+ data-slot="dropdown-menu-sub-content"
230
+ className={cn(
231
+ "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
232
+ className
233
+ )}
234
+ {...props}
235
+ />
236
+ )
237
+ }
238
+
239
+ export {
240
+ DropdownMenu,
241
+ DropdownMenuPortal,
242
+ DropdownMenuTrigger,
243
+ DropdownMenuContent,
244
+ DropdownMenuGroup,
245
+ DropdownMenuLabel,
246
+ DropdownMenuItem,
247
+ DropdownMenuCheckboxItem,
248
+ DropdownMenuRadioGroup,
249
+ DropdownMenuRadioItem,
250
+ DropdownMenuSeparator,
251
+ DropdownMenuShortcut,
252
+ DropdownMenuSub,
253
+ DropdownMenuSubTrigger,
254
+ DropdownMenuSubContent,
255
+ }