Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doco updates #184

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ conda env create -n aviary -f aviary.yml
conda activate aviary
pip install -e .
```
The `aviary` executable can then be run from any directory. Since the code in
this directory is then used for running, any updates made there will be
immediately available. We recommend this mode for developing and debugging
aviary.

## Checking installation
Whatever option you choose, running `aviary --help` should return the following
output:

Expand Down Expand Up @@ -86,22 +91,6 @@ Utility modules:

```

Upon first running aviary you will be prompted to input the location for where you would like
your conda environments to be stored, the GTDB release installed on your system, the location of your
EnrichM database, and the location of your BUSCO database. These locations will be stored as environment
variables, but for aviary to be able to use those environment variables you will have to either source your .bashrc
or reactivate your conda environment depending on whether you installed aviary within a conda environment or not:

```
conda deactivate; conda activate aviary

OR

source ~/.bashrc
```

These environment variables can be reset using `aviary configure`

## Databases

Aviary uses programs which require access to locally stored databases.
Expand All @@ -111,7 +100,7 @@ The **required** databases are as follows:
* [GTDB](https://gtdb.ecogenomic.org/downloads)
* [EggNog](https://github.com/eggnogdb/eggnog-mapper/wiki/eggNOG-mapper-v2.1.5-to-v2.1.8#setup)
* [CheckM2](https://github.com/chklovski/CheckM2)

* [SingleM](https://wwood.github.io/singlem/)

### Installing databases

Expand Down
95 changes: 26 additions & 69 deletions aviary/aviary.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ def str2bool(v):
else:
raise argparse.ArgumentTypeError('Boolean value expected.')

def add_workflow_arg(parser, default, help=None):
if help is None:
help = 'Main workflow to run. This is the snakemake target rule to run.'
parser.add_argument(
'-w', '--workflow',
help=help,
dest='workflow',
nargs="+",
default=default,
)

def main():
if len(sys.argv) == 1 or sys.argv[1] == '-h' or sys.argv[1] == '--help':
phelp()
Expand Down Expand Up @@ -832,13 +843,7 @@ def main():



assemble_options.add_argument(
'-w', '--workflow',
help='Main workflow to run',
dest='workflow',
nargs="+",
default=['complete_assembly_with_qc'],
)
add_workflow_arg(assemble_options, ['complete_assembly_with_qc'])

########################## ~ RECOVER ~ ###########################

Expand All @@ -862,13 +867,7 @@ def main():
required=False,
)

recover_options.add_argument(
'-w', '--workflow',
help='Main workflow to run',
dest='workflow',
nargs="+",
default=['recover_mags'],
)
add_workflow_arg(recover_options, ['recover_mags'])

recover_options.add_argument(
'--perform-strain-analysis', '--perform_strain_analysis',
Expand Down Expand Up @@ -902,13 +901,7 @@ def main():
required=False,
)

annotate_options.add_argument(
'-w', '--workflow',
help='Main workflow to run',
dest='workflow',
nargs="+",
default=['annotate'],
)
add_workflow_arg(annotate_options, ['annotate'])

########################## ~ diversity ~ ###########################

Expand All @@ -933,13 +926,7 @@ def main():
required=False,
)

diversity_options.add_argument(
'-w', '--workflow',
help='Main workflow to run',
dest='workflow',
nargs="+",
default=['lorikeet'],
)
add_workflow_arg(diversity_options, ['lorikeet'])

diversity_options.add_argument(
'--perform-strain-analysis', '--perform_strain_analysis',
Expand Down Expand Up @@ -975,13 +962,7 @@ def main():
required=True,
)

cluster_options.add_argument(
'-w', '--workflow',
help='Main workflow to run',
dest='workflow',
nargs="+",
default=['complete_cluster'],
)
add_workflow_arg(cluster_options, ['complete_cluster'])

########################## ~ VIRAL ~ ###########################

Expand All @@ -997,13 +978,7 @@ def main():

''')

viral_options.add_argument(
'-w', '--workflow',
help='Main workflow to run',
dest='workflow',
nargs="+",
default=['create_webpage_genotype'],
)
add_workflow_arg(viral_options, ['create_webpage_genotype'])

########################## ~ COMPLETE ~ ###########################

Expand All @@ -1028,13 +1003,7 @@ def main():
required=False,
)

complete_options.add_argument(
'-w', '--workflow',
help='Main workflow to run',
dest='workflow',
nargs="+",
default=['get_bam_indices', 'recover_mags', 'annotate', 'lorikeet'],
)
add_workflow_arg(complete_options, ['get_bam_indices', 'recover_mags', 'annotate', 'lorikeet'])

########################## ~ ISOLATE ~ ###########################

Expand All @@ -1050,13 +1019,7 @@ def main():

''')

isolate_options.add_argument(
'-w', '--workflow',
help='Main workflows to run',
dest='workflow',
nargs="+",
default=['circlator'],
)
add_workflow_arg(isolate_options, ['circlator'])

########################## ~ BATCH ~ ###########################

Expand Down Expand Up @@ -1131,12 +1094,10 @@ def main():
default='95'
)

batch_options.add_argument(
'-w', '--workflow',
help='Main workflow to run for each sample',
dest='workflow',
nargs="+",
default=['get_bam_indices', 'recover_mags', 'annotate', 'lorikeet'],
add_workflow_arg(
batch_options,
['get_bam_indices', 'recover_mags', 'annotate', 'lorikeet'],
help='Main workflow (snakemake target rule) to run for each sample'
)

########################## ~ configure ~ ###########################
Expand Down Expand Up @@ -1188,13 +1149,7 @@ def main():
required=False,
)

configure_options.add_argument(
'-w', '--workflow',
help=argparse.SUPPRESS,
dest='workflow',
nargs="+",
default=['download_databases'],
)
add_workflow_arg(configure_options, ['download_databases'], help=argparse.SUPPRESS)

###########################################################################
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
Expand Down Expand Up @@ -1303,6 +1258,8 @@ def manage_env_vars(args):
args.eggnog_db_path = Config.get_software_db_path('EGGNOG_DATA_DIR', '--eggnog-db-path')
if args.checkm2_db_path is None:
args.checkm2_db_path = Config.get_software_db_path('CHECKM2DB', '--checkm2-db-path')
if args.singlem_metapackage_path is None:
args.singlem_db_path = Config.get_software_db_path('SINGLEM_METAPACKAGE_PATH', '--singlem-metapackage-path')
except AttributeError:
pass

Expand Down
Loading