apscale-gui 4.0.0__tar.gz → 4.0.2__tar.gz

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.
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: apscale_gui
3
+ Version: 4.0.2
4
+ Summary: Advanced Pipeline for Simple yet Comprehensive AnaLysEs of DNA metabarcoding data - Graphical User Interface
5
+ Home-page: https://github.com/TillMacher/apscale_gui
6
+ Author: Till-Hendrik Macher
7
+ Author-email: macher@uni-trier.de
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.12
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: apscale>=4.1.4
16
+ Requires-Dist: apscale_blast>=3.0.0
17
+ Requires-Dist: boldigger3>=3.0.3
18
+ Requires-Dist: demultiplexer3>=1.0.1
19
+ Requires-Dist: ete3>=3.1.3
20
+ Requires-Dist: lxml_html_clean>=0.4.2
21
+ Requires-Dist: playwright>=1.54.0
22
+ Requires-Dist: pandas>=2.3.1
23
+ Requires-Dist: numpy>=2.3.2
24
+ Requires-Dist: streamlit>=1.48.1
25
+ Requires-Dist: streamlit-file-browser>=3.2.22
26
+ Requires-Dist: scipy>=1.16.1
27
+ Requires-Dist: cutadapt>=5.1
28
+ Requires-Dist: update-checker>=0.18.0
29
+ Requires-Dist: update_checker
30
+ Requires-Dist: powerlaw>=1.5
31
+ Requires-Dist: requests>=2.32.3
32
+ Requires-Dist: beautifulsoup4>=4.13.4
33
+ Requires-Dist: lxml>=6.0.0
34
+ Requires-Dist: asyncio>=4.0.0
35
+ Requires-Dist: stqdm>=0.0.5
36
+ Requires-Dist: pycountry>=24.6.1
37
+ Requires-Dist: six>=1.16.0
38
+ Requires-Dist: duckdb>=1.3.2
39
+ Requires-Dist: openpyxl>=3.1.1
40
+ Requires-Dist: tqdm>=4.66.4
41
+ Requires-Dist: requests_html>=0.10.0
42
+ Dynamic: author
43
+ Dynamic: author-email
44
+ Dynamic: classifier
45
+ Dynamic: description
46
+ Dynamic: description-content-type
47
+ Dynamic: home-page
48
+ Dynamic: license
49
+ Dynamic: license-file
50
+ Dynamic: requires-dist
51
+ Dynamic: requires-python
52
+ Dynamic: summary
53
+
54
+ # APSCALE-GUI
55
+
56
+ [![Downloads](https://static.pepy.tech/badge/apscale-gui)](https://pepy.tech/project/apscale-gui)
57
+
58
+ Graphical user interface for the DNA metabarcoding pipeline [APSCALE](https://github.com/DominikBuchner/apscale) – no programming required. APSCALE-GUI runs in your browser (Streamlit) and guides you from the raw sequencing data to the taxonomic assignment: demultiplexing, raw data processing, and taxonomic assignment with [APSCALE-blast](https://github.com/TillMacher/apscale_blast) or [BOLDigger3](https://github.com/DominikBuchner/BOLDigger3).
59
+
60
+ * **Input:** paired-end sequencing data (`.fastq.gz`), demultiplexed or not
61
+ * **Output:** read tables (`.xlsx`/`.parquet`), sequences (`.fasta`) and taxonomy tables (`.xlsx`) in your project folder, ready for [TaxonTableTools2](https://github.com/TillMacher/TaxonTableTools2). APSCALE always creates both ESVs (denoised sequences) and OTUs (sequence groups, clustered with the sequence group threshold, default 97%)
62
+
63
+ ## Installation
64
+
65
+ The easiest way is the conda environment of the [APSCALE installer](https://github.com/TillMacher/apscale_installer), which installs APSCALE-GUI and all its dependencies (APSCALE, APSCALE-blast, BOLDigger3, Demultiplexer3, cutadapt, VSEARCH, SWARM, BLAST+).
66
+
67
+ Alternatively, install via pip (Python ≥ 3.12):
68
+
69
+ ```
70
+ pip install apscale_gui
71
+ ```
72
+
73
+ With pip, [VSEARCH](https://github.com/torognes/vsearch), [SWARM](https://github.com/torognes/swarm) and [BLAST+](https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/) must be installed separately and be available in your PATH. APSCALE-GUI checks whether they are installed and tells you what is missing.
74
+
75
+ To update, always update all packages together (mixing old and new versions leads to import errors):
76
+
77
+ ```
78
+ pip install --upgrade apscale_gui apscale apscale_blast boldigger3 demultiplexer3
79
+ ```
80
+
81
+ Or simply run the [APSCALE installer](https://github.com/TillMacher/apscale_installer) again.
82
+
83
+ **Note:** projects created with APSCALE v3 or older are not compatible with APSCALE v4. Please create a new project.
84
+
85
+ ## Usage
86
+
87
+ ```
88
+ conda activate apscale4
89
+ apscale_gui
90
+ ```
91
+
92
+ The graphical interface opens in your browser (use `apscale_gui dark` for the dark mode). Enter the path to your projects folder (e.g. an empty folder named `APSCALE_projects`) in the sidebar, create the database and tagging scheme folders, and create or select a project. Click **"🔄 Refresh files and folders"** at the top of each page when you have added new files.
93
+
94
+ ### Pages
95
+
96
+ **Start**
97
+ * **Home:** overview of the active project (raw files, demultiplexed files, FASTA files, databases), installed tools and package versions, links, tutorials and citations
98
+
99
+ **Raw Data Processing**
100
+ * **Demultiplexing:** demultiplex raw data with [Demultiplexer3](https://github.com/DominikBuchner/demultiplexer3): select or create a primer set, create a tagging scheme (opens as Excel sheet), and start the demultiplexing. Primer sets are stored in `APSCALE_projects/APSCALE_primersets` (primer sets from Demultiplexer2 can be copied there with one click). Processed raw files are moved to `01_raw_data/processed`
101
+ * **APSCALE:** adjust the settings (PE merging, primer trimming, quality filtering, dereplication, denoising, SWARM clustering, replicate merging, negative control removal, read table) and run APSCALE in basic mode (without replicate merging and negative control removal), complete mode, or module by module. The settings are saved to the project's settings file when the analysis starts
102
+
103
+ **Taxonomic Assignment**
104
+ * **APSCALE-BLAST:** BLAST your OTUs/ESVs against a local database. Pre-compiled databases can be downloaded directly (single databases via the Database Hub, or all latest databases at once)
105
+ * **BOLDigger3:** taxonomic assignment against the [BOLD Systems](https://boldsystems.org/) database. The local BOLD database file is downloaded with your BOLD account
106
+
107
+ **Downstream**
108
+ * **Data Analysis:** open the APSCALE analysis module, or continue with [TaxonTableTools2](https://github.com/TillMacher/TaxonTableTools2)
109
+
110
+ ### Project folder
111
+
112
+ ```
113
+ APSCALE_projects/
114
+ ├── APSCALE_databases/
115
+ ├── APSCALE_tagging_schemes/
116
+ ├── APSCALE_primersets/
117
+ └── My_project_apscale/
118
+ ├── 01_raw_data/data <- non-demultiplexed raw data
119
+ ├── 02_demultiplexing/data <- demultiplexed raw data
120
+ ├── 03_PE_merging/data
121
+ ├── 04_primer_trimming/data
122
+ ├── 05_quality_filtering/data
123
+ ├── 06_dereplication/data
124
+ ├── 07_denoising/data
125
+ ├── 08_swarm_clustering/data
126
+ ├── 09_replicate_merging/data
127
+ ├── 10_nc_removal/data
128
+ ├── 11_read_table/data <- read tables, FASTA files and taxonomy tables
129
+ ├── 12_analyze/data
130
+ └── Settings_My_project.xlsx
131
+ ```
132
+
133
+ * Paired-end files are matched by their names: both files of a pair must have the same name and differ only in the read number (e.g. `Sample1_R1.fastq.gz` and `Sample1_R2.fastq.gz`, or `Sample1_1.fastq.gz` and `Sample1_2.fastq.gz`). Files ending with `.fq.gz` are detected and can be renamed with one click.
134
+ * Most settings can be left at default. The primer sequences and the minimum and maximum length must be provided for each project. For details on all settings, see the [APSCALE manual](https://github.com/DominikBuchner/apscale/blob/main/manual/apscale_manual.pdf).
135
+ * For large datasets and large databases (e.g. COI), the BLAST task "megablast" decreases the runtime considerably.
136
+
137
+ ## Troubleshooting
138
+
139
+ | Problem | Solution |
140
+ |---|---|
141
+ | `ModuleNotFoundError: No module named 'apscale....'` or `ImportError: cannot import name '...' from 'boldigger3'` | The installed packages do not fit together. Update all packages at once (see [Installation](#installation)) or run the APSCALE installer again. |
142
+ | `ModuleNotFoundError: No module named '...'` (e.g. `stqdm`) | Install the missing module in the activated environment: `pip install <module name>` |
143
+ | `pip install apscale-gui` does not work | Use the package name with underscore: `pip install apscale_gui` |
144
+ | Errors with conda/Anaconda base libraries (e.g. `Intel MKL FATAL ERROR`) | Do not install into the base environment. Use the `apscale4` environment of the [APSCALE installer](https://github.com/TillMacher/apscale_installer). |
145
+ | Settings or result tables cannot be written | Close the Excel file (e.g. the settings file) before you start a run. |
146
+ | vsearch, swarm or blastn is missing | Run the [APSCALE installer](https://github.com/TillMacher/apscale_installer) again, or install the tools manually and add them to your PATH. |
147
+
148
+ ## Databases
149
+
150
+ Pre-compiled databases for APSCALE-blast are [available here](https://seafile.rlp.net/d/c172d076de1e4c45b594/) and are updated regularly. They are stored in `APSCALE_projects/APSCALE_databases`. Each database folder contains a `citation.txt`.
151
+
152
+ ## Citation
153
+
154
+ If you use APSCALE, please cite:
155
+
156
+ * **APSCALE:** Buchner, Macher & Leese (2022) Bioinformatics 38: 4817–4819. https://doi.org/10.1093/bioinformatics/btac588
157
+
158
+ Please also cite the programs and data you used:
159
+
160
+ * **cutadapt:** Martin (2011) EMBnet.journal 17: 10–12. https://doi.org/10.14806/ej.17.1.200
161
+ * **VSEARCH:** Rognes et al. (2016) PeerJ 4: e2584. https://doi.org/10.7717/peerj.2584
162
+ * **SWARM:** Mahé et al. (2022) Bioinformatics 38: 267–269. https://doi.org/10.1093/bioinformatics/btab493
163
+ * **BLAST+:** Camacho et al. (2009) BMC Bioinformatics 10: 421. https://doi.org/10.1186/1471-2105-10-421
164
+ * **BOLDigger:** Buchner & Leese (2020) Metabarcoding and Metagenomics 4: e53535. https://doi.org/10.3897/mbmg.4.53535
165
+ * **Databases:** see the `citation.txt` in the database folder and the [APSCALE-blast citations](https://github.com/TillMacher/apscale_blast#citation)
166
+
167
+ ## Reporting issues
168
+
169
+ Please open an [issue](https://github.com/TillMacher/apscale_gui/issues) or contact me via email (macher@uni-trier.de).
@@ -0,0 +1,116 @@
1
+ # APSCALE-GUI
2
+
3
+ [![Downloads](https://static.pepy.tech/badge/apscale-gui)](https://pepy.tech/project/apscale-gui)
4
+
5
+ Graphical user interface for the DNA metabarcoding pipeline [APSCALE](https://github.com/DominikBuchner/apscale) – no programming required. APSCALE-GUI runs in your browser (Streamlit) and guides you from the raw sequencing data to the taxonomic assignment: demultiplexing, raw data processing, and taxonomic assignment with [APSCALE-blast](https://github.com/TillMacher/apscale_blast) or [BOLDigger3](https://github.com/DominikBuchner/BOLDigger3).
6
+
7
+ * **Input:** paired-end sequencing data (`.fastq.gz`), demultiplexed or not
8
+ * **Output:** read tables (`.xlsx`/`.parquet`), sequences (`.fasta`) and taxonomy tables (`.xlsx`) in your project folder, ready for [TaxonTableTools2](https://github.com/TillMacher/TaxonTableTools2). APSCALE always creates both ESVs (denoised sequences) and OTUs (sequence groups, clustered with the sequence group threshold, default 97%)
9
+
10
+ ## Installation
11
+
12
+ The easiest way is the conda environment of the [APSCALE installer](https://github.com/TillMacher/apscale_installer), which installs APSCALE-GUI and all its dependencies (APSCALE, APSCALE-blast, BOLDigger3, Demultiplexer3, cutadapt, VSEARCH, SWARM, BLAST+).
13
+
14
+ Alternatively, install via pip (Python ≥ 3.12):
15
+
16
+ ```
17
+ pip install apscale_gui
18
+ ```
19
+
20
+ With pip, [VSEARCH](https://github.com/torognes/vsearch), [SWARM](https://github.com/torognes/swarm) and [BLAST+](https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/) must be installed separately and be available in your PATH. APSCALE-GUI checks whether they are installed and tells you what is missing.
21
+
22
+ To update, always update all packages together (mixing old and new versions leads to import errors):
23
+
24
+ ```
25
+ pip install --upgrade apscale_gui apscale apscale_blast boldigger3 demultiplexer3
26
+ ```
27
+
28
+ Or simply run the [APSCALE installer](https://github.com/TillMacher/apscale_installer) again.
29
+
30
+ **Note:** projects created with APSCALE v3 or older are not compatible with APSCALE v4. Please create a new project.
31
+
32
+ ## Usage
33
+
34
+ ```
35
+ conda activate apscale4
36
+ apscale_gui
37
+ ```
38
+
39
+ The graphical interface opens in your browser (use `apscale_gui dark` for the dark mode). Enter the path to your projects folder (e.g. an empty folder named `APSCALE_projects`) in the sidebar, create the database and tagging scheme folders, and create or select a project. Click **"🔄 Refresh files and folders"** at the top of each page when you have added new files.
40
+
41
+ ### Pages
42
+
43
+ **Start**
44
+ * **Home:** overview of the active project (raw files, demultiplexed files, FASTA files, databases), installed tools and package versions, links, tutorials and citations
45
+
46
+ **Raw Data Processing**
47
+ * **Demultiplexing:** demultiplex raw data with [Demultiplexer3](https://github.com/DominikBuchner/demultiplexer3): select or create a primer set, create a tagging scheme (opens as Excel sheet), and start the demultiplexing. Primer sets are stored in `APSCALE_projects/APSCALE_primersets` (primer sets from Demultiplexer2 can be copied there with one click). Processed raw files are moved to `01_raw_data/processed`
48
+ * **APSCALE:** adjust the settings (PE merging, primer trimming, quality filtering, dereplication, denoising, SWARM clustering, replicate merging, negative control removal, read table) and run APSCALE in basic mode (without replicate merging and negative control removal), complete mode, or module by module. The settings are saved to the project's settings file when the analysis starts
49
+
50
+ **Taxonomic Assignment**
51
+ * **APSCALE-BLAST:** BLAST your OTUs/ESVs against a local database. Pre-compiled databases can be downloaded directly (single databases via the Database Hub, or all latest databases at once)
52
+ * **BOLDigger3:** taxonomic assignment against the [BOLD Systems](https://boldsystems.org/) database. The local BOLD database file is downloaded with your BOLD account
53
+
54
+ **Downstream**
55
+ * **Data Analysis:** open the APSCALE analysis module, or continue with [TaxonTableTools2](https://github.com/TillMacher/TaxonTableTools2)
56
+
57
+ ### Project folder
58
+
59
+ ```
60
+ APSCALE_projects/
61
+ ├── APSCALE_databases/
62
+ ├── APSCALE_tagging_schemes/
63
+ ├── APSCALE_primersets/
64
+ └── My_project_apscale/
65
+ ├── 01_raw_data/data <- non-demultiplexed raw data
66
+ ├── 02_demultiplexing/data <- demultiplexed raw data
67
+ ├── 03_PE_merging/data
68
+ ├── 04_primer_trimming/data
69
+ ├── 05_quality_filtering/data
70
+ ├── 06_dereplication/data
71
+ ├── 07_denoising/data
72
+ ├── 08_swarm_clustering/data
73
+ ├── 09_replicate_merging/data
74
+ ├── 10_nc_removal/data
75
+ ├── 11_read_table/data <- read tables, FASTA files and taxonomy tables
76
+ ├── 12_analyze/data
77
+ └── Settings_My_project.xlsx
78
+ ```
79
+
80
+ * Paired-end files are matched by their names: both files of a pair must have the same name and differ only in the read number (e.g. `Sample1_R1.fastq.gz` and `Sample1_R2.fastq.gz`, or `Sample1_1.fastq.gz` and `Sample1_2.fastq.gz`). Files ending with `.fq.gz` are detected and can be renamed with one click.
81
+ * Most settings can be left at default. The primer sequences and the minimum and maximum length must be provided for each project. For details on all settings, see the [APSCALE manual](https://github.com/DominikBuchner/apscale/blob/main/manual/apscale_manual.pdf).
82
+ * For large datasets and large databases (e.g. COI), the BLAST task "megablast" decreases the runtime considerably.
83
+
84
+ ## Troubleshooting
85
+
86
+ | Problem | Solution |
87
+ |---|---|
88
+ | `ModuleNotFoundError: No module named 'apscale....'` or `ImportError: cannot import name '...' from 'boldigger3'` | The installed packages do not fit together. Update all packages at once (see [Installation](#installation)) or run the APSCALE installer again. |
89
+ | `ModuleNotFoundError: No module named '...'` (e.g. `stqdm`) | Install the missing module in the activated environment: `pip install <module name>` |
90
+ | `pip install apscale-gui` does not work | Use the package name with underscore: `pip install apscale_gui` |
91
+ | Errors with conda/Anaconda base libraries (e.g. `Intel MKL FATAL ERROR`) | Do not install into the base environment. Use the `apscale4` environment of the [APSCALE installer](https://github.com/TillMacher/apscale_installer). |
92
+ | Settings or result tables cannot be written | Close the Excel file (e.g. the settings file) before you start a run. |
93
+ | vsearch, swarm or blastn is missing | Run the [APSCALE installer](https://github.com/TillMacher/apscale_installer) again, or install the tools manually and add them to your PATH. |
94
+
95
+ ## Databases
96
+
97
+ Pre-compiled databases for APSCALE-blast are [available here](https://seafile.rlp.net/d/c172d076de1e4c45b594/) and are updated regularly. They are stored in `APSCALE_projects/APSCALE_databases`. Each database folder contains a `citation.txt`.
98
+
99
+ ## Citation
100
+
101
+ If you use APSCALE, please cite:
102
+
103
+ * **APSCALE:** Buchner, Macher & Leese (2022) Bioinformatics 38: 4817–4819. https://doi.org/10.1093/bioinformatics/btac588
104
+
105
+ Please also cite the programs and data you used:
106
+
107
+ * **cutadapt:** Martin (2011) EMBnet.journal 17: 10–12. https://doi.org/10.14806/ej.17.1.200
108
+ * **VSEARCH:** Rognes et al. (2016) PeerJ 4: e2584. https://doi.org/10.7717/peerj.2584
109
+ * **SWARM:** Mahé et al. (2022) Bioinformatics 38: 267–269. https://doi.org/10.1093/bioinformatics/btab493
110
+ * **BLAST+:** Camacho et al. (2009) BMC Bioinformatics 10: 421. https://doi.org/10.1186/1471-2105-10-421
111
+ * **BOLDigger:** Buchner & Leese (2020) Metabarcoding and Metagenomics 4: e53535. https://doi.org/10.3897/mbmg.4.53535
112
+ * **Databases:** see the `citation.txt` in the database folder and the [APSCALE-blast citations](https://github.com/TillMacher/apscale_blast#citation)
113
+
114
+ ## Reporting issues
115
+
116
+ Please open an [issue](https://github.com/TillMacher/apscale_gui/issues) or contact me via email (macher@uni-trier.de).
@@ -13,7 +13,6 @@ import subprocess
13
13
  import multiprocessing
14
14
  import platform
15
15
  from ete3 import NCBITaxa
16
- from distutils.util import strtobool
17
16
  import webbrowser
18
17
  import importlib.util
19
18
  import glob, datetime, os
@@ -29,11 +28,10 @@ import datetime, sys, getpass, requests_html, duckdb
29
28
  from tqdm import tqdm
30
29
  from stqdm import stqdm
31
30
 
32
- # demultiplexer2
33
- from demultiplexer2.create_primerset import create_primerset
34
- from demultiplexer2 import find_file_pairs
35
- from demultiplexer2.create_tagging_scheme import main as create_tagging_scheme
36
- from demultiplexer2.demultiplexing import main as demultiplexing
31
+ # demultiplexer3
32
+ from demultiplexer3.create_primerset import create_primerset
33
+ from demultiplexer3.create_tagging_scheme import find_file_pairs
34
+ from demultiplexer3.pipeline import main as demultiplexing
37
35
 
38
36
  # Apscale
39
37
  import apscale.a_create_project as a_create_project
@@ -254,7 +252,7 @@ def collect_primerset_information(primerset_path):
254
252
  def create_tagging_scheme(tagging_scheme_name, data_dir, primerset_path, path_to_projects):
255
253
  # find fastq.gz file pairs
256
254
  all_files = sorted(glob.glob(str(Path(data_dir).joinpath("*.fastq.gz"))))
257
- file_pairs, singles = find_file_pairs.find_file_pairs(all_files)
255
+ file_pairs, singles = find_file_pairs(all_files)
258
256
 
259
257
  if singles:
260
258
  st.warning("⚠️ Some files could not be paired:")
@@ -822,6 +820,7 @@ def project_selected():
822
820
  path_to_projects = Path('.')
823
821
  database_folder = Path('.')
824
822
  tagging_scheme_folder = Path('.')
823
+ primerset_folder = Path('.')
825
824
  project_folder = None
826
825
  project_name = ''
827
826
 
@@ -851,6 +850,7 @@ with st.sidebar:
851
850
 
852
851
  database_folder = path_to_projects / 'APSCALE_databases'
853
852
  tagging_scheme_folder = path_to_projects / 'APSCALE_tagging_schemes'
853
+ primerset_folder = path_to_projects / 'APSCALE_primersets'
854
854
 
855
855
  if path_to_projects == Path('.'):
856
856
  st.info('Please enter the path to your APSCALE projects folder.')
@@ -859,11 +859,12 @@ with st.sidebar:
859
859
  st.error("The given path does not exist or is not a directory.")
860
860
 
861
861
  else:
862
- if not database_folder.exists() or not tagging_scheme_folder.exists():
863
- st.warning("Please first initialise the database and tagging scheme folder.")
864
- if st.button('Create database and tagging scheme folders', width='stretch'):
862
+ if not database_folder.exists() or not tagging_scheme_folder.exists() or not primerset_folder.exists():
863
+ st.warning("Please first initialise the database, tagging scheme and primer set folders.")
864
+ if st.button('Create database, tagging scheme and primer set folders', width='stretch'):
865
865
  os.makedirs(database_folder, exist_ok=True)
866
866
  os.makedirs(tagging_scheme_folder, exist_ok=True)
867
+ os.makedirs(primerset_folder, exist_ok=True)
867
868
  st.rerun()
868
869
 
869
870
  #####################################
@@ -950,7 +951,7 @@ def page_home():
950
951
  - [VSEARCH](https://github.com/torognes/vsearch)
951
952
  - [CUTADAPT](https://github.com/marcelm/cutadapt)
952
953
  - [SWARM](https://github.com/torognes/swarm)
953
- - [Demultiplexer2](https://github.com/DominikBuchner/demultiplexer2)
954
+ - [Demultiplexer3](https://github.com/DominikBuchner/demultiplexer3)
954
955
  """)
955
956
  # Tutorials
956
957
  with st.expander("🎥 Video Tutorials", expanded=False):
@@ -990,7 +991,7 @@ def page_demultiplexing():
990
991
  st.title('🔀 Demultiplexing')
991
992
  refresh_button()
992
993
  st.markdown(
993
- "Demultiplex your raw data with **Demultiplexer2**. Raw files are expected in `01_raw_data/data`, "
994
+ "Demultiplex your raw data with **Demultiplexer3**. Raw files are expected in `01_raw_data/data`, "
994
995
  "the demultiplexed files are written to `02_demultiplexing/data`. "
995
996
  "If your data is already demultiplexed, copy it directly to `02_demultiplexing/data` and continue with **🧬 APSCALE**.")
996
997
  if not project_selected():
@@ -1007,16 +1008,29 @@ def page_demultiplexing():
1007
1008
 
1008
1009
  st.success(f"Found {n_raw_data} files for demultiplexing!")
1009
1010
 
1010
- # Locate Demultiplexer2 package and primersets
1011
- spec = importlib.util.find_spec("demultiplexer2")
1012
- demultiplexer2_path = Path(spec.origin).parent
1013
- primersets_path = demultiplexer2_path / "data" / "primersets"
1014
- primersets = [f for f in primersets_path.iterdir() if f.is_file() and "_primerset" in f.name]
1011
+ # Primer sets are stored in the "APSCALE_primersets" folder
1012
+ os.makedirs(primerset_folder, exist_ok=True)
1013
+ primersets = [f for f in primerset_folder.iterdir() if f.is_file() and "_primerset" in f.name and not f.name.startswith(("~", "."))]
1014
+
1015
+ # Demultiplexer2 stored the primer sets inside the package: offer to copy them to the new folder
1016
+ demultiplexer2_spec = importlib.util.find_spec("demultiplexer2")
1017
+ if demultiplexer2_spec is not None:
1018
+ old_primersets_path = Path(demultiplexer2_spec.origin).parent / "data" / "primersets"
1019
+ if old_primersets_path.exists():
1020
+ old_primersets = [f for f in old_primersets_path.iterdir() if f.is_file() and "_primerset" in f.name and not (primerset_folder / f.name).exists()]
1021
+ if old_primersets:
1022
+ st.info(f'Found {len(old_primersets)} primer set(s) from Demultiplexer2 that are not yet in your "APSCALE_primersets" folder.')
1023
+ if st.button('📥 Copy primer sets from Demultiplexer2', width='stretch'):
1024
+ for file in old_primersets:
1025
+ shutil.copy(file, primerset_folder / file.name)
1026
+ st.rerun()
1015
1027
  active_tagging_scheme = None
1016
1028
 
1017
1029
  st.write('#### 1) Primer set')
1018
1030
  with st.container(border=True):
1019
- # Select existing primer set
1031
+ # Select existing primer set (forget the old selection if it is not in the list anymore, e.g. after creating the first primer set)
1032
+ if st.session_state.get("active_primerset") not in primersets:
1033
+ st.session_state.pop("active_primerset", None)
1020
1034
  active_primerset = st.selectbox(
1021
1035
  "Select from existing primer sets:",
1022
1036
  sorted(primersets, key=lambda p: p.name.lower()),
@@ -1029,7 +1043,7 @@ def page_demultiplexing():
1029
1043
  open_file(st.session_state["active_primerset"])
1030
1044
  with col2:
1031
1045
  if st.button('📂 Open primer set folder', width='stretch'):
1032
- open_folder(primersets_path)
1046
+ open_folder(primerset_folder)
1033
1047
 
1034
1048
  # Input fields to create new primer set
1035
1049
  with st.expander("➕ Create new primer set"):
@@ -1039,11 +1053,15 @@ def page_demultiplexing():
1039
1053
  with col2:
1040
1054
  st.text_input("Number of primers", key="n_primers")
1041
1055
  if st.button("⚙️ Create primer set", width='stretch'):
1042
- create_primerset(
1043
- st.session_state['primerset_name'],
1044
- int(st.session_state['n_primers'])
1045
- )
1046
- st.success(f"New primer set '{st.session_state['primerset_name']}' created")
1056
+ # demultiplexer3 saves the primer set in the current working directory,
1057
+ # so we give the full path to save it in the "APSCALE_primersets" folder instead
1058
+ new_primerset = primerset_folder / f"{st.session_state['primerset_name']}_primerset.xlsx"
1059
+ if new_primerset.exists():
1060
+ st.error('A primer set with this name already exists. Please choose another name.')
1061
+ else:
1062
+ create_primerset(str(primerset_folder / st.session_state['primerset_name']), int(st.session_state['n_primers']))
1063
+ open_file(new_primerset)
1064
+ st.rerun()
1047
1065
 
1048
1066
  if active_primerset:
1049
1067
  st.write('#### 2) Tagging scheme')
@@ -1053,6 +1071,8 @@ def page_demultiplexing():
1053
1071
  f for f in tagging_scheme_folder.iterdir()
1054
1072
  if f.is_file() and "_tagging_scheme" in f.name and not f.name.startswith(".")
1055
1073
  ]
1074
+ if st.session_state.get("active_tagging_scheme") not in tagging_schemes:
1075
+ st.session_state.pop("active_tagging_scheme", None)
1056
1076
  active_tagging_scheme = st.selectbox(
1057
1077
  "Select from existing tagging schemes:",
1058
1078
  sorted(tagging_schemes, key=lambda p: p.name.lower()),
@@ -1082,10 +1102,11 @@ def page_demultiplexing():
1082
1102
  st.write(f"Output directory: **{output_dir}**")
1083
1103
 
1084
1104
  move_files = st.checkbox("Move raw files to 'processed' after demultiplexing?", value=True)
1105
+ trim_tags = st.checkbox("Remove tag sequences from the reads?", value=True, help="By default, the tags are removed from the reads.")
1085
1106
  if st.button('🔀 Begin demultiplexing', type='primary', width='stretch'):
1086
1107
  st.info('Starting demultiplexing! Please refer to the terminal for live outputs!')
1087
1108
  print('')
1088
- demultiplexing(st.session_state['active_primerset'], st.session_state['active_tagging_scheme'],output_dir)
1109
+ demultiplexing(st.session_state['active_primerset'], st.session_state['active_tagging_scheme'], output_dir, trim=trim_tags)
1089
1110
  if move_files:
1090
1111
  move_raw_files(project_folder)
1091
1112
  st.success('Finished demultiplexing and moved raw files!')
@@ -0,0 +1,169 @@
1
+ Metadata-Version: 2.4
2
+ Name: apscale_gui
3
+ Version: 4.0.2
4
+ Summary: Advanced Pipeline for Simple yet Comprehensive AnaLysEs of DNA metabarcoding data - Graphical User Interface
5
+ Home-page: https://github.com/TillMacher/apscale_gui
6
+ Author: Till-Hendrik Macher
7
+ Author-email: macher@uni-trier.de
8
+ License: MIT
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Requires-Python: >=3.12
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: apscale>=4.1.4
16
+ Requires-Dist: apscale_blast>=3.0.0
17
+ Requires-Dist: boldigger3>=3.0.3
18
+ Requires-Dist: demultiplexer3>=1.0.1
19
+ Requires-Dist: ete3>=3.1.3
20
+ Requires-Dist: lxml_html_clean>=0.4.2
21
+ Requires-Dist: playwright>=1.54.0
22
+ Requires-Dist: pandas>=2.3.1
23
+ Requires-Dist: numpy>=2.3.2
24
+ Requires-Dist: streamlit>=1.48.1
25
+ Requires-Dist: streamlit-file-browser>=3.2.22
26
+ Requires-Dist: scipy>=1.16.1
27
+ Requires-Dist: cutadapt>=5.1
28
+ Requires-Dist: update-checker>=0.18.0
29
+ Requires-Dist: update_checker
30
+ Requires-Dist: powerlaw>=1.5
31
+ Requires-Dist: requests>=2.32.3
32
+ Requires-Dist: beautifulsoup4>=4.13.4
33
+ Requires-Dist: lxml>=6.0.0
34
+ Requires-Dist: asyncio>=4.0.0
35
+ Requires-Dist: stqdm>=0.0.5
36
+ Requires-Dist: pycountry>=24.6.1
37
+ Requires-Dist: six>=1.16.0
38
+ Requires-Dist: duckdb>=1.3.2
39
+ Requires-Dist: openpyxl>=3.1.1
40
+ Requires-Dist: tqdm>=4.66.4
41
+ Requires-Dist: requests_html>=0.10.0
42
+ Dynamic: author
43
+ Dynamic: author-email
44
+ Dynamic: classifier
45
+ Dynamic: description
46
+ Dynamic: description-content-type
47
+ Dynamic: home-page
48
+ Dynamic: license
49
+ Dynamic: license-file
50
+ Dynamic: requires-dist
51
+ Dynamic: requires-python
52
+ Dynamic: summary
53
+
54
+ # APSCALE-GUI
55
+
56
+ [![Downloads](https://static.pepy.tech/badge/apscale-gui)](https://pepy.tech/project/apscale-gui)
57
+
58
+ Graphical user interface for the DNA metabarcoding pipeline [APSCALE](https://github.com/DominikBuchner/apscale) – no programming required. APSCALE-GUI runs in your browser (Streamlit) and guides you from the raw sequencing data to the taxonomic assignment: demultiplexing, raw data processing, and taxonomic assignment with [APSCALE-blast](https://github.com/TillMacher/apscale_blast) or [BOLDigger3](https://github.com/DominikBuchner/BOLDigger3).
59
+
60
+ * **Input:** paired-end sequencing data (`.fastq.gz`), demultiplexed or not
61
+ * **Output:** read tables (`.xlsx`/`.parquet`), sequences (`.fasta`) and taxonomy tables (`.xlsx`) in your project folder, ready for [TaxonTableTools2](https://github.com/TillMacher/TaxonTableTools2). APSCALE always creates both ESVs (denoised sequences) and OTUs (sequence groups, clustered with the sequence group threshold, default 97%)
62
+
63
+ ## Installation
64
+
65
+ The easiest way is the conda environment of the [APSCALE installer](https://github.com/TillMacher/apscale_installer), which installs APSCALE-GUI and all its dependencies (APSCALE, APSCALE-blast, BOLDigger3, Demultiplexer3, cutadapt, VSEARCH, SWARM, BLAST+).
66
+
67
+ Alternatively, install via pip (Python ≥ 3.12):
68
+
69
+ ```
70
+ pip install apscale_gui
71
+ ```
72
+
73
+ With pip, [VSEARCH](https://github.com/torognes/vsearch), [SWARM](https://github.com/torognes/swarm) and [BLAST+](https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/) must be installed separately and be available in your PATH. APSCALE-GUI checks whether they are installed and tells you what is missing.
74
+
75
+ To update, always update all packages together (mixing old and new versions leads to import errors):
76
+
77
+ ```
78
+ pip install --upgrade apscale_gui apscale apscale_blast boldigger3 demultiplexer3
79
+ ```
80
+
81
+ Or simply run the [APSCALE installer](https://github.com/TillMacher/apscale_installer) again.
82
+
83
+ **Note:** projects created with APSCALE v3 or older are not compatible with APSCALE v4. Please create a new project.
84
+
85
+ ## Usage
86
+
87
+ ```
88
+ conda activate apscale4
89
+ apscale_gui
90
+ ```
91
+
92
+ The graphical interface opens in your browser (use `apscale_gui dark` for the dark mode). Enter the path to your projects folder (e.g. an empty folder named `APSCALE_projects`) in the sidebar, create the database and tagging scheme folders, and create or select a project. Click **"🔄 Refresh files and folders"** at the top of each page when you have added new files.
93
+
94
+ ### Pages
95
+
96
+ **Start**
97
+ * **Home:** overview of the active project (raw files, demultiplexed files, FASTA files, databases), installed tools and package versions, links, tutorials and citations
98
+
99
+ **Raw Data Processing**
100
+ * **Demultiplexing:** demultiplex raw data with [Demultiplexer3](https://github.com/DominikBuchner/demultiplexer3): select or create a primer set, create a tagging scheme (opens as Excel sheet), and start the demultiplexing. Primer sets are stored in `APSCALE_projects/APSCALE_primersets` (primer sets from Demultiplexer2 can be copied there with one click). Processed raw files are moved to `01_raw_data/processed`
101
+ * **APSCALE:** adjust the settings (PE merging, primer trimming, quality filtering, dereplication, denoising, SWARM clustering, replicate merging, negative control removal, read table) and run APSCALE in basic mode (without replicate merging and negative control removal), complete mode, or module by module. The settings are saved to the project's settings file when the analysis starts
102
+
103
+ **Taxonomic Assignment**
104
+ * **APSCALE-BLAST:** BLAST your OTUs/ESVs against a local database. Pre-compiled databases can be downloaded directly (single databases via the Database Hub, or all latest databases at once)
105
+ * **BOLDigger3:** taxonomic assignment against the [BOLD Systems](https://boldsystems.org/) database. The local BOLD database file is downloaded with your BOLD account
106
+
107
+ **Downstream**
108
+ * **Data Analysis:** open the APSCALE analysis module, or continue with [TaxonTableTools2](https://github.com/TillMacher/TaxonTableTools2)
109
+
110
+ ### Project folder
111
+
112
+ ```
113
+ APSCALE_projects/
114
+ ├── APSCALE_databases/
115
+ ├── APSCALE_tagging_schemes/
116
+ ├── APSCALE_primersets/
117
+ └── My_project_apscale/
118
+ ├── 01_raw_data/data <- non-demultiplexed raw data
119
+ ├── 02_demultiplexing/data <- demultiplexed raw data
120
+ ├── 03_PE_merging/data
121
+ ├── 04_primer_trimming/data
122
+ ├── 05_quality_filtering/data
123
+ ├── 06_dereplication/data
124
+ ├── 07_denoising/data
125
+ ├── 08_swarm_clustering/data
126
+ ├── 09_replicate_merging/data
127
+ ├── 10_nc_removal/data
128
+ ├── 11_read_table/data <- read tables, FASTA files and taxonomy tables
129
+ ├── 12_analyze/data
130
+ └── Settings_My_project.xlsx
131
+ ```
132
+
133
+ * Paired-end files are matched by their names: both files of a pair must have the same name and differ only in the read number (e.g. `Sample1_R1.fastq.gz` and `Sample1_R2.fastq.gz`, or `Sample1_1.fastq.gz` and `Sample1_2.fastq.gz`). Files ending with `.fq.gz` are detected and can be renamed with one click.
134
+ * Most settings can be left at default. The primer sequences and the minimum and maximum length must be provided for each project. For details on all settings, see the [APSCALE manual](https://github.com/DominikBuchner/apscale/blob/main/manual/apscale_manual.pdf).
135
+ * For large datasets and large databases (e.g. COI), the BLAST task "megablast" decreases the runtime considerably.
136
+
137
+ ## Troubleshooting
138
+
139
+ | Problem | Solution |
140
+ |---|---|
141
+ | `ModuleNotFoundError: No module named 'apscale....'` or `ImportError: cannot import name '...' from 'boldigger3'` | The installed packages do not fit together. Update all packages at once (see [Installation](#installation)) or run the APSCALE installer again. |
142
+ | `ModuleNotFoundError: No module named '...'` (e.g. `stqdm`) | Install the missing module in the activated environment: `pip install <module name>` |
143
+ | `pip install apscale-gui` does not work | Use the package name with underscore: `pip install apscale_gui` |
144
+ | Errors with conda/Anaconda base libraries (e.g. `Intel MKL FATAL ERROR`) | Do not install into the base environment. Use the `apscale4` environment of the [APSCALE installer](https://github.com/TillMacher/apscale_installer). |
145
+ | Settings or result tables cannot be written | Close the Excel file (e.g. the settings file) before you start a run. |
146
+ | vsearch, swarm or blastn is missing | Run the [APSCALE installer](https://github.com/TillMacher/apscale_installer) again, or install the tools manually and add them to your PATH. |
147
+
148
+ ## Databases
149
+
150
+ Pre-compiled databases for APSCALE-blast are [available here](https://seafile.rlp.net/d/c172d076de1e4c45b594/) and are updated regularly. They are stored in `APSCALE_projects/APSCALE_databases`. Each database folder contains a `citation.txt`.
151
+
152
+ ## Citation
153
+
154
+ If you use APSCALE, please cite:
155
+
156
+ * **APSCALE:** Buchner, Macher & Leese (2022) Bioinformatics 38: 4817–4819. https://doi.org/10.1093/bioinformatics/btac588
157
+
158
+ Please also cite the programs and data you used:
159
+
160
+ * **cutadapt:** Martin (2011) EMBnet.journal 17: 10–12. https://doi.org/10.14806/ej.17.1.200
161
+ * **VSEARCH:** Rognes et al. (2016) PeerJ 4: e2584. https://doi.org/10.7717/peerj.2584
162
+ * **SWARM:** Mahé et al. (2022) Bioinformatics 38: 267–269. https://doi.org/10.1093/bioinformatics/btab493
163
+ * **BLAST+:** Camacho et al. (2009) BMC Bioinformatics 10: 421. https://doi.org/10.1186/1471-2105-10-421
164
+ * **BOLDigger:** Buchner & Leese (2020) Metabarcoding and Metagenomics 4: e53535. https://doi.org/10.3897/mbmg.4.53535
165
+ * **Databases:** see the `citation.txt` in the database folder and the [APSCALE-blast citations](https://github.com/TillMacher/apscale_blast#citation)
166
+
167
+ ## Reporting issues
168
+
169
+ Please open an [issue](https://github.com/TillMacher/apscale_gui/issues) or contact me via email (macher@uni-trier.de).
@@ -1,7 +1,7 @@
1
1
  apscale>=4.1.4
2
- apscale_blast>=1.2.7
2
+ apscale_blast>=3.0.0
3
3
  boldigger3>=3.0.3
4
- demultiplexer2>=1.1.6
4
+ demultiplexer3>=1.0.1
5
5
  ete3>=3.1.3
6
6
  lxml_html_clean>=0.4.2
7
7
  playwright>=1.54.0
@@ -19,3 +19,9 @@ beautifulsoup4>=4.13.4
19
19
  lxml>=6.0.0
20
20
  asyncio>=4.0.0
21
21
  stqdm>=0.0.5
22
+ pycountry>=24.6.1
23
+ six>=1.16.0
24
+ duckdb>=1.3.2
25
+ openpyxl>=3.1.1
26
+ tqdm>=4.66.4
27
+ requests_html>=0.10.0