Skip to content

Commit

Permalink
Merge pull request #123 from rki-mf1/feat/match-from-file
Browse files Browse the repository at this point in the history
Allow query parameters to be read from a file
  • Loading branch information
matthuska authored Oct 30, 2023
2 parents c0df8ab + c26b4a0 commit 4432ba1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Genomic profiles can be defined to align genomes. For this purpose, the variants

The positions refer to the reference (first nucleotide in the genome is position 1). Using the option `-i` multiple variant definitions can be combined into a nucleotide, amino acid or mixed profile, which means that matching genomes must have all those variations in common. In contrast, alternative variations can be defined by multiple `-i` options. As an example, `-i S:N501Y S:E484K` matches genomes sharing the _Nelly_ **AND** _Erik_ variation while `-i S:N501Y -i S:E484K` matches to genomes that share either the _Nelly_ **OR** _Erik_ variation **OR** both. Accordingly, using the option `-e` profiles can be defined that have not to be present in the matched genomes.

To filter genomes based on metadata specific options can be used (see table below). Only genomes linked to the respective metadata are then considered. Metadata values are negated when introduced by ^ (e.g. `--acc ^ID1` matches all genomes accessions but ID1). Metadata filtering is case-insensitive. To see the amount of available metadata in your database use the info tool (see section 3.5).
To filter genomes based on metadata specific options can be used (see table below). Only genomes linked to the respective metadata are then considered. Metadata values are negated when introduced by ^ (e.g. `--acc ^ID1` matches all genomes accessions but ID1). Metadata filtering is case-insensitive. To see the amount of available metadata in your database use the info tool (see section 3.5). For many of the options multiple values can be specified on the command line (e.g. `--acc seq1 seq2`) or the query values can written one per line in a file and the file name provided (e.g. `--acc @ids.txt`).

| option | value(s) | note |
|---------------------|-----------------------------------------------------------------------|------|
Expand Down
4 changes: 4 additions & 0 deletions sonar.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def parse_args():
"remove",
parents=[general_parser],
help="remove genome sequences to the database.",
fromfile_prefix_chars="@",
)
parser_remove = parser_remove.add_mutually_exclusive_group()
parser_remove.add_argument(
Expand All @@ -153,6 +154,7 @@ def parse_args():
"match",
parents=[general_parser],
help="get mutations profiles for given accessions.",
fromfile_prefix_chars="@",
)
parser_match.add_argument(
"--include",
Expand Down Expand Up @@ -346,6 +348,7 @@ def parse_args():
"restore",
parents=[general_parser],
help="restore sequence(s) from the database.",
fromfile_prefix_chars="@",
)
parser_restore.add_argument(
"--acc",
Expand All @@ -369,6 +372,7 @@ def parse_args():
"var2vcf",
parents=[general_parser],
help="export variants from the database to vcf format.",
fromfile_prefix_chars="@",
)
parser_var2vcf.add_argument(
"--acc",
Expand Down

0 comments on commit 4432ba1

Please sign in to comment.