Skip to content

Commit

Permalink
Updated the cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisgKent committed Sep 10, 2024
1 parent cc090f2 commit 943f9b7
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 28 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,39 +310,37 @@ Create a new scheme in the required format
**Usage**:

```console
$ primal-page create [OPTIONS] SCHEMEPATH
$ primal-page create [OPTIONS]
```

**Arguments**:

* `SCHEMEPATH`: The path to the primerscheme directory [required]

**Options**:

* `--schemename TEXT`: The name of the scheme [required]
* `--ampliconsize INTEGER RANGE`: Amplicon size [x>=100; required]
* `--schemeversion TEXT`: Scheme version, default is parsed from config.json [required]
* `--species INTEGER`: The species this scheme targets. Please use NCBI taxonomy ids [required]
* `--authors TEXT`: Any authors [required]
* `--primerbed PATH`: The path to the primer.bed file [required]
* `--reference PATH`: The path to the reference.fasta file [required]
* `--schemestatus [withdrawn|deprecated|autogenerated|draft|tested|validated]`: Scheme status [default: draft]
* `--citations TEXT`: Any associated citations. Please use DOI
* `--primerbed PATH`: Manually specify the primer bed file, default is *primer.bed
* `--reference PATH`: Manually specify the reference.fasta file, default is *.fasta
* `--output PATH`: Where to output the scheme [default: primerschemes]
* `--configpath PATH`: Where the config.json file is located
* `--algorithmversion TEXT`: The version of primalscheme or other
* `--description TEXT`: A description of the scheme
* `--derivedfrom TEXT`: Which scheme has this scheme been derived from
* `--primerclass [primerschemes]`: The primer class [default: primerschemes]
* `--collection [ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET]`: The collection
* `--collection [ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP]`: The collection
* `--link-protocol TEXT`: Optional link to protocol
* `--link-validation TEXT`: Optional link to validation data
* `--links-homepage TEXT`: Optional link to homepage
* `--link-vendor TEXT`: Optional link to vendors
* `--link-misc TEXT`: Optional miscellaneous link
* `--fix / --no-fix`: Attempt to fix the scheme [default: no-fix]
* `--help`: Show this message and exit.
* `--contact-info TEXT`: Contact information
* `--additional-files PATH`: Additional files to include in the ./work directory
* `--help`: Show this message and exit.


## `primal-page download`

Expand Down Expand Up @@ -480,13 +478,13 @@ Add a Collection to the Collection list in the info.json file
**Usage**:

```console
$ primal-page modify add-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}
$ primal-page modify add-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}
```

**Arguments**:

* `SCHEMEINFO`: The path to info.json [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}`: The Collection to add [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}`: The Collection to add [required]

**Options**:

Expand Down Expand Up @@ -689,13 +687,13 @@ Remove an Collection from the Collection list in the info.json file
**Usage**:

```console
$ primal-page modify remove-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}
$ primal-page modify remove-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}
```

**Arguments**:

* `SCHEMEINFO`: The path to info.json [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}`: The Collection to remove [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}`: The Collection to remove [required]

**Options**:

Expand Down Expand Up @@ -756,4 +754,4 @@ $ primal-page remove [OPTIONS] SCHEMEINFO

**Options**:

* `--help`: Show this message and exit.
* `--help`: Show this message and exit.
Binary file added docs/assets/primal-page-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 11 additions & 12 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,39 +107,38 @@ Create a new scheme in the required format
**Usage**:

```console
$ primal-page create [OPTIONS] SCHEMEPATH
$ primal-page create [OPTIONS]
```

**Arguments**:

* `SCHEMEPATH`: The path to the primerscheme directory [required]

**Options**:

* `--schemename TEXT`: The name of the scheme [required]
* `--ampliconsize INTEGER RANGE`: Amplicon size [x>=100; required]
* `--schemeversion TEXT`: Scheme version, default is parsed from config.json [required]
* `--species INTEGER`: The species this scheme targets. Please use NCBI taxonomy ids [required]
* `--authors TEXT`: Any authors [required]
* `--primerbed PATH`: The path to the primer.bed file [required]
* `--reference PATH`: The path to the reference.fasta file [required]
* `--schemestatus [withdrawn|deprecated|autogenerated|draft|tested|validated]`: Scheme status [default: draft]
* `--citations TEXT`: Any associated citations. Please use DOI
* `--primerbed PATH`: Manually specify the primer bed file, default is *primer.bed
* `--reference PATH`: Manually specify the reference.fasta file, default is *.fasta
* `--output PATH`: Where to output the scheme [default: primerschemes]
* `--configpath PATH`: Where the config.json file is located
* `--algorithmversion TEXT`: The version of primalscheme or other
* `--description TEXT`: A description of the scheme
* `--derivedfrom TEXT`: Which scheme has this scheme been derived from
* `--primerclass [primerschemes]`: The primer class [default: primerschemes]
* `--collection [ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET]`: The collection
* `--collection [ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP]`: The collection
* `--link-protocol TEXT`: Optional link to protocol
* `--link-validation TEXT`: Optional link to validation data
* `--links-homepage TEXT`: Optional link to homepage
* `--link-vendor TEXT`: Optional link to vendors
* `--link-misc TEXT`: Optional miscellaneous link
* `--fix / --no-fix`: Attempt to fix the scheme [default: no-fix]
* `--contact-info TEXT`: Contact information
* `--additional-files PATH`: Additional files to include in the ./work directory
* `--help`: Show this message and exit.


## `primal-page download`

Download schemes from the index.json
Expand Down Expand Up @@ -276,13 +275,13 @@ Add a Collection to the Collection list in the info.json file
**Usage**:

```console
$ primal-page modify add-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}
$ primal-page modify add-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}
```

**Arguments**:

* `SCHEMEINFO`: The path to info.json [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}`: The Collection to add [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}`: The Collection to add [required]

**Options**:

Expand Down Expand Up @@ -485,13 +484,13 @@ Remove an Collection from the Collection list in the info.json file
**Usage**:

```console
$ primal-page modify remove-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}
$ primal-page modify remove-collection [OPTIONS] SCHEMEINFO COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}
```

**Arguments**:

* `SCHEMEINFO`: The path to info.json [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET}`: The Collection to remove [required]
* `COLLECTION:{ARTIC|MODJADJI|QUICK-LAB|COMMUNITY|WASTE-WATER|CLINICAL-ISOLATES|WHOLE-GENOME|PANEL|MULTI-TARGET|VARVAMP}`: The Collection to remove [required]

**Options**:

Expand Down
24 changes: 24 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,31 @@ From primalscheme a file should be output called `{scheme-name}.primer.bed`. Thi
![primerbed](assets/primalscheme1bed.png)

### Using `primal-page`

![primerbed](assets/primal-page-create.png)

`primal-page` provides lots of options for creating the metadata. However, most of these are optional.

#### Required options
| Option | Description |
| -------------------- | ---------------------------------------------- |
| `--schemename` | The name of the scheme |
| `--ampliconsize` | The amplicon size |
| `--schemeversion` | The version of the scheme |
| `--species` | The `taxid` of the target species |
| `--authors` | The authors of the scheme |
| `--schemestatus` | The status of the scheme |
| `--primerbed` | A .bed file containing the primers |
| `--reference` | A .fasta file containing the reference genomes |
| `--output` | Where to create the files |
| `--algorithmversion` | Which version was used (`primalscheme1`) |

The requirements of these settings are listed in the [cli](cli.md)

```
primal-page create --schemename example-scheme --ampliconsize 400 --schemeversion v1.0.0 --species 1 --authors 'John Smith' --authors 'Jane Doe' --schemestatus draft --primerbed {path to file} --reference {path to file} --output {~/primerschemes/primerschemes} --algorithmversion primalscheme1
```


## Manual editing of files
Expand Down
4 changes: 2 additions & 2 deletions primal_page/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ def create(
primerbed: Annotated[
pathlib.Path,
typer.Option(
help="Manually specify the primer bed file, default is *primer.bed",
help="The path to the primer.bed file",
readable=True,
),
],
reference: Annotated[
pathlib.Path,
typer.Option(
help="Manually specify the reference.fasta file, default is *.fasta",
help="The path to the reference.fasta file",
readable=True,
),
],
Expand Down

0 comments on commit 943f9b7

Please sign in to comment.