|
1 | 1 | # How to use the CLI
|
2 | 2 |
|
3 |
| -XspecT comes with a built-in command line interface (CLI), which enables quick classifications without the need to use the web interface. The command line interface can also be used to download and train filters. |
| 3 | +XspecT comes with a built-in command line interface (CLI), which enables quick classifications without the need to use the web interface. The command line interface can also be used to download and train models. |
4 | 4 |
|
5 | 5 | After installing XspecT, a list of available commands can be viewed by running:
|
6 | 6 |
|
7 | 7 | ```bash
|
8 | 8 | xspect --help
|
9 | 9 | ```
|
10 | 10 |
|
11 |
| -## Filter downloads |
| 11 | +## Model downloads |
12 | 12 |
|
13 |
| -A basic set of pre-trained filters (Acinetobacter and Salonella) can be downloaded using the following command: |
| 13 | +A basic set of pre-trained models (Acinetobacter and Salonella) can be downloaded using the following command: |
14 | 14 |
|
15 | 15 | ```bash
|
16 |
| -xspect download-filters |
| 16 | +xspect download-models |
17 | 17 | ```
|
18 | 18 |
|
19 |
| -For the moment, it is not possible to specify exactly which filters should be downloaded. |
| 19 | +For the moment, it is not possible to specify exactly which models should be downloaded. |
20 | 20 |
|
21 | 21 | ## Classification
|
22 | 22 |
|
23 | 23 | To classify samples, the command
|
24 | 24 |
|
25 | 25 | ```bash
|
26 |
| -xspect classify GENUS PATH |
| 26 | +xspect classify-species GENUS PATH |
27 | 27 | ```
|
28 | 28 |
|
29 | 29 | can be used, when `GENUS` refers to the NCBI genus name of your sample and `PATH` refers to the path to your sample *directory*. This command will classify the species of your sample within the given genus.
|
30 | 30 |
|
31 | 31 | The following options are available:
|
32 | 32 |
|
33 | 33 | ```bash
|
34 |
| --s, --species / --no-species Species classification. |
35 |
| --i, --ic / --no-ic IC strain typing. |
36 |
| --o, --oxa / --no-oxa OXA gene family detection. |
37 |
| --m, --meta / --no-meta Metagenome classification. |
38 |
| --c, --complete Use every single k-mer as input for |
39 |
| - classification. |
40 |
| --s, --save Save results to csv file. |
41 |
| ---help Show this message and exit. |
| 34 | +-m, --meta / --no-meta Metagenome classification. |
| 35 | +-s, --step INTEGER Sparse sampling step size (e. g. only every 500th |
| 36 | + kmer for step=500). |
| 37 | +--help Show this message and exit. |
42 | 38 | ```
|
43 | 39 |
|
44 |
| -### Species Classification |
| 40 | +To speed up the analysis, only every nth kmer can be considered ("sparse sampling"). For example, to only consider every 10th kmer, run: |
45 | 41 |
|
46 |
| -Species classification is run by default, without the need for further parameters: |
47 | 42 | ```bash
|
48 |
| -xspect classify Acinetobacter path |
49 |
| -``` |
50 |
| - |
51 |
| -Species classification can be toggled using the `-s`/`--species` (`--no-species`) option. To run classification without species classification, the option `--no-species` can be used, for example when running a different analysis: |
52 |
| - |
53 |
| -```bash |
54 |
| -xspect classify --no-species -i Acinetobacter path |
55 |
| -``` |
56 |
| - |
57 |
| -### IC Strain Typing |
58 |
| - |
59 |
| -To perform International Clonal (IC) type classification, the `-i`/`--ic` (`--no-ic`) option can be used: |
60 |
| - |
61 |
| -```bash |
62 |
| -xspect classify -i Acinetobacter path |
63 |
| -``` |
64 |
| - |
65 |
| -Please note that IC strain typing is only available for Acinetobacter baumanii. |
66 |
| - |
67 |
| -### OXA Gene Detection |
68 |
| - |
69 |
| -OXA gene detection can be enabled using the `-o`/`--oxa` (`--no-oxa`) option. |
70 |
| - |
71 |
| -```bash |
72 |
| -xspect classify -o Acinetobacter path |
| 43 | +xspect classify-species -s 10 Acinetobacter path |
73 | 44 | ```
|
74 | 45 |
|
75 | 46 | ### Metagenome Mode
|
76 | 47 |
|
77 | 48 | To analyze a sample in metagenome mode, the `-m`/`--meta` (`--no-meta`) option can be used:
|
78 | 49 |
|
79 | 50 | ```bash
|
80 |
| -xspect classify -m Acinetobacter path |
| 51 | +xspect classify-species -m Acinetobacter path |
81 | 52 | ```
|
82 | 53 |
|
83 |
| -Compared to normal XspecT modes, this mode first identifies reads belonging to the given genus and continues classification only with the resulting reads and is thus more suitable for metagenomic samples as the resulting runtime is decreased. |
| 54 | +Compared to normal XspecT species classification, this mode first identifies reads belonging to the given genus and continues classification only with the resulting reads, It is thus more suitable for metagenomic samples as the resulting runtime is decreased. |
84 | 55 |
|
85 |
| -## Filter Training |
| 56 | +### MLST Classification |
86 | 57 |
|
87 |
| -<aside> |
88 |
| -⚠️ Depending on genome size and the amount of species, training can take time! |
| 58 | +Samples can also be classified based on Multi-locus sequence type schemas. To MLST-classify a sample, run: |
89 | 59 |
|
90 |
| -</aside> |
91 |
| - |
92 |
| -In order to train filters, please first ensure [Jellyfish](https://github.com/gmarcais/Jellyfish) is installed. |
| 60 | +```bash |
| 61 | +xspect classify-mlst -p path |
| 62 | +``` |
93 | 63 |
|
94 |
| -### NCBI-based filter training |
| 64 | +## Model Training |
95 | 65 |
|
96 |
| -The easiest way to train new filters is to use data from NCBI, which is automatically downloaded and processed by XspecT. |
| 66 | +Models can be trained based on data from NCBI, which is automatically downloaded and processed by XspecT. |
97 | 67 |
|
98 |
| -To train a filter with data from NCBI, run the following command: |
| 68 | +To train a model, run the following command: |
99 | 69 |
|
100 | 70 | ```bash
|
101 |
| -xspect train your-ncbi-genus |
| 71 | +xspect train-species your-ncbi-genus |
102 | 72 | ```
|
103 | 73 |
|
104 | 74 | `you-ncbi-genus` can be a genus name from NCBI or an NCBI taxonomy ID.
|
105 | 75 |
|
106 |
| -### Custom data filter training |
107 |
| - |
108 |
| -XspecT filters can also be trained using custom data, which need to be provided as a folder for both filter and SVM training. The provided assembly files need to be in FASTA format and their names should be the species ID and the species name, for example `28901_enterica.fasta`. While the ID can be arbitrary, the standard is NCBI taxon IDs. |
109 |
| - |
110 |
| -The filters can then be trained using: |
| 76 | +To train models for MLST classifications, run: |
111 | 77 |
|
112 | 78 | ```bash
|
113 |
| -xspect train -bf-path directory/1 -svm-path directory/2 |
| 79 | +xspect train-mlst |
114 | 80 | ```
|
0 commit comments