Skip to content

Commit 603a7fa

Browse files
committed
Merge branch 'run_level'
2 parents 57b8ee3 + fa964e5 commit 603a7fa

31 files changed

+4231
-2173
lines changed

.github/workflows/build.yml

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
name: Build and push Docker image upon release
2-
32
on:
4-
release:
5-
types: [build]
3+
push:
4+
branches:
5+
- build
66
jobs:
77
push_to_registry:
88
name: Build and push Docker image upon release
99
runs-on: ubuntu-latest
1010
steps:
11+
-
12+
name: Checkout repository
13+
uses: actions/checkout@v2
1114
-
1215
name: Set up QEMU
1316
uses: docker/setup-qemu-action@v2
17+
- name: get-npm-version
18+
id: package-version
19+
uses: martinbeentjes/[email protected]
1420
-
1521
name: Set up Docker Buildx
1622
uses: docker/setup-buildx-action@v2
17-
-
18-
name: Login to Docker Hub
19-
uses: docker/login-action@v2
20-
with:
21-
username: ${{ secrets.DOCKERHUB_USERNAME }}
22-
password: ${{ secrets.DOCKERHUB_TOKEN }}
23-
- name: Push to Docker Hub
24-
uses: docker/build-push-action@v1
23+
- name: Log in to Docker Hub
24+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
2525
with:
2626
username: ${{ secrets.DOCKERHUB_USERNAME }}
2727
password: ${{ secrets.DOCKERHUB_PASSWORD }}
28-
repository: ${{ secrets.DOCKERHUB_REPOSITORY }}
28+
-
29+
name: Build and Push to Docker Hub
30+
uses: docker/build-push-action@v4
31+
with:
2932
tag_with_ref: true
3033
tag_with_sha: true
34+
context: .
35+
push: true
36+
file: "./Dockerfile"
3137
platforms: linux/amd64,linux/arm64
32-
tags: latest
38+
tags: jhuaplbio/basestack_mytax2:${{ steps.package-version.outputs.current-version}}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
.DS_Store
2+
example-data
3+
!example-data/sample_metagenome.first.fastq
4+
!example-data/sample_metagenome.second.fastq
5+
databases/*
26
taxonomy
37
taxdump
48
output
59
node_modules
610
example-data/classifications/*
11+
712
/dist
813
tmp/*
914
tmp.*

Dockerfile

+26-33
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,38 @@ ARG DEBIAN_FRONTEND=noninteractive
88
# install apt dependencies and update conda
99
RUN apt-get --allow-releaseinfo-change update
1010
RUN apt-get install git -y \
11-
&& apt-get install -y nginx apt-transport-https ca-certificates wget unzip bzip2 libfontconfig1
12-
13-
RUN update-ca-certificates \
11+
&& apt-get install -y nginx apt-transport-https ca-certificates wget unzip bzip2 libfontconfig1 && \
12+
update-ca-certificates \
1413
&& apt-get install -y g++ gcc gawk bzip2 \
1514
&& apt-get -qq -y autoremove \
16-
&& apt-get autoclean
17-
RUN apt-get install -y curl
18-
RUN apt-get -y install software-properties-common && add-apt-repository ppa:deadsnakes/ppa && apt update -y
19-
RUN apt-get install -y python3.8
20-
RUN apt-get install -y python3-pip
21-
RUN python3 -m pip install anytree==2.8.0 pandas
22-
RUN curl -fsSL https://deb.nodesource.com/setup_17.x | bash -
23-
RUN apt-get install -y nodejs
15+
&& apt-get autoclean && \
16+
apt-get install -y curl && \
17+
apt-get -y install software-properties-common && add-apt-repository -y ppa:deadsnakes/ppa && apt update -y && \
18+
apt-get install -y python3.8 && \
19+
apt-get install -y python3-pip && \
20+
curl -fsSL https://deb.nodesource.com/setup_17.x | bash - && \
21+
apt-get install -y nodejs && \
22+
ln -sf /usr/bin/python3 /usr/bin/python
2423

2524
WORKDIR /opt
2625

27-
# Get Guppy barcoder for demux purposes
28-
RUN wget https://cdn.oxfordnanoportal.com/software/analysis/ont-guppy_6.4.6_linux64.tar.gz -O ./guppy_6_gpu.tar.gz
29-
RUN wget https://cdn.oxfordnanoportal.com/software/analysis/ont-guppy-cpu_6.4.6_linux64.tar.gz -O ./guppy_6_cpu.tar.gz
30-
RUN tar -xvzf /opt/guppy_6_gpu.tar.gz && mv /opt/ont-guppy /opt/ont-guppy-gpu && rm /opt/guppy_6_gpu.tar.gz
31-
RUN tar -xvzf /opt/guppy_6_cpu.tar.gz && mv /opt/ont-guppy-cpu /opt/ont-guppy && \
26+
# Get Guppy barcoder for demux purposes, remove the jsn files to save space. This will make basecalling unusable
27+
RUN wget https://cdn.oxfordnanoportal.com/software/analysis/ont-guppy_6.4.6_linux64.tar.gz -O ./guppy_6_gpu.tar.gz && \
28+
tar -xvzf /opt/guppy_6_gpu.tar.gz && mv /opt/ont-guppy /opt/ont-guppy-gpu && rm /opt/guppy_6_gpu.tar.gz && \
29+
wget https://cdn.oxfordnanoportal.com/software/analysis/ont-guppy-cpu_6.4.6_linux64.tar.gz -O ./guppy_6_cpu.tar.gz && \
30+
tar -xvzf /opt/guppy_6_cpu.tar.gz && mv /opt/ont-guppy-cpu /opt/ont-guppy && \
3231
ln -sf /opt/ont-guppy/bin/guppy_barcoder /usr/local/bin/guppy_barcoder && \
33-
rm /opt/guppy_6_cpu.tar.gz
32+
rm /opt/guppy_6_cpu.tar.gz && rm /opt/ont-guppy/data/*.jsn && rm /opt/ont-guppy-gpu/data/*.jsn
3433

35-
RUN wget https://github.com/DerrickWood/kraken2/archive/refs/tags/v2.1.3.tar.gz -O kraken2.tar.gz && tar -xvzf kraken2.tar.gz && rm kraken2.tar.gz && cd kraken2-2.1.3 && ./install_kraken2.sh /usr/bin/
36-
37-
RUN git clone https://github.com/jenniferlu717/KrakenTools.git && cd KrakenTools && chmod +x *.py && find . -name "*.py" -exec cp {} /usr/local/bin/ \;
38-
RUN ln -s /usr/bin/python3 /usr/bin/python
39-
COPY ./package.json /opt/package.json
34+
# RUN wget https://github.com/DerrickWood/kraken2/archive/refs/tags/v2.1.3.tar.gz -O kraken2.tar.gz && \
35+
# tar -xvzf kraken2.tar.gz && rm kraken2.tar.gz && \
36+
RUN git clone https://github.com/DerrickWood/kraken2.git --branch v2.1.3 && cd kraken2 && \
37+
./install_kraken2.sh /usr/bin/ && \
38+
git clone https://github.com/jenniferlu717/KrakenTools.git && \
39+
cd KrakenTools && chmod +x *.py && \
40+
find . -name "*.py" -exec cp {} /usr/local/bin/ \;
4041

42+
COPY ./package.json /opt/package.json
4143
RUN npm install
4244

4345
COPY ./babel.config.js /opt/babel.config.js
@@ -47,17 +49,8 @@ COPY ./vue.config.docker.js /opt/vue.config.js
4749
COPY ./src /opt/src
4850
RUN npm run build
4951
COPY ./server /opt/server
50-
# COPY dist /usr/share/nginx/html/mytax
51-
COPY nginx.conf /etc/nginx/nginx.conf
52-
RUN useradd nginx
53-
# RUN chown -R nginx:nginx /var/lib/nginx && \
54-
# chown -R nginx:nginx /var/log/nginx && \
55-
# chown -R nginx:nginx /etc/nginx/conf.d
56-
# RUN touch /var/run/nginx.pid && \
57-
# chown -R nginx:nginx /var/run/nginx.pid
58-
RUN ln -s /opt/dist /usr/share/nginx/html/mytax && chmod -R 777 /usr/share/nginx/html/mytax
52+
COPY ./nginx.conf /etc/nginx/nginx.conf
53+
RUN useradd nginx && ln -s /opt/dist /usr/share/nginx/html/mytax && chmod -R 777 /usr/share/nginx/html/mytax
5954
EXPOSE 80
6055

61-
# CMD ["conda", "run", "-n", "mytax2", "/bin/bash", "-c"]
62-
6356
# To Run docker build . -t jhuaplbio/basestack_mytax2 ; docker container run -it --rm -p 8098:80 jhuaplbio/basestack_mytax2 bash -c "nginx; bash "

README.md

+41-25
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,48 @@
11
# Mytax2 - Realtime reporting
22

33

4+
<<<<<<< HEAD
45
## Create Conda Environment
56
```
67
conda env create -f environment.yml
78
```
89

10+
=======
11+
>>>>>>> run_level
912
1013
## Project setup
14+
15+
### Create your Conda env first
16+
17+
```
18+
conda env create -f environment.yml
19+
```
20+
21+
:warning: Make sure if you're on a Mac arm64 processor that you specify you want amd64 like:
22+
23+
```
24+
CONDA_SUBDIR=osx-64 conda env create -f environment.yml
25+
```
26+
27+
### Create npm packages in the repo.
28+
1129
```
1230
npm install
1331
```
1432

15-
## Starting Development
33+
## Running the software
34+
35+
36+
### Compiles and hot-reloads for development
37+
38+
```
39+
npm run serveBoth
40+
```
1641

17-
Run the below 2 commands:
42+
### Adding another CORS port for development use
1843

19-
### Compiles and hot-reloads for development on frontent
2044
```
21-
npm run serve
45+
CORS_ADDR=192.168.55.1:7689 npm run serveBoth
2246
```
2347

2448
### Compiles and hot-reloads for development on server
@@ -40,24 +64,21 @@ npm run lint
4064
### Customize configuration
4165
See [Configuration Reference](https://cli.vuejs.org/config/).
4266

67+
To add any data, first you must make a run
4368

69+
1. Select "Add Run" and give it a name
70+
2. Then, select the blue and white cross icon on the left-hand side to add a sample. There can be multiple samples were run.
71+
3. Drag + Drop or select a fastq file (or .gz version) into the middle input. You can also input a directory of fastq files. If you want to analyze an entire run of barcodes, you should toggle the switch, which will match any directory in the specified input directory and make 1 sample per match. Alter the pattern matching in the appropriate field.
72+
4. OPTIONAL. IF using paired-end reads, add the R2 file into the top-left input field
73+
5. Select "Add" and the software will automatically start analyzing with Kraken2 and generating the Sunburst plots in realtime.
4474

45-
## Samplesheet input
46-
47-
You will need to create a samplesheet with information about the samples you would like to analyse before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row as shown in the examples below. By default, it will always look in the `/data/Samplesheet.csv` file for your desired deployment method. For example, in `dev` mode it will be `public/data/Samplesheet.csv`, for production (like in a Docker container running `nginx` like what is described below) it is in `<path_to_dist>/data/Samplesheet.csv`. If you want to check if it is accesible, you can access it at the localhost and port with the path like `localhost:8080/data/Samplesheet.csv` (this is the default dev port)
75+
### Debugging
4876

49-
The Samplesheet should look like (example below) this
77+
Depending on how you are deploying the tool, you can either run:
5078

51-
```console
52-
sample,path_1,path_2,format,platform,database,compressed
53-
NB11,<path_to_directory>/NB11,,directory,oxford,<path_to_database_directory>/flukraken2,
54-
NB03,<path_to_directory>/NB03,,directory,oxford,<path_to_database_directory>/flukraken2,
55-
ERR6913101,<path_to_directory>/ERR6913101_1.fastq.gz,<path_to_directory>/ERR6913101_2.fastq.gz,file,illumina,<path_to_database_directory>/flukraken2,
56-
ERR6913102,<path_to_directory>/ERR6913102_1.fastq.gz,<path_to_directory>/ERR6913102_2.fastq.gz,file,illumina,<path_to_database_directory>/flukraken2,
57-
flu_bc01,<path_to_directory>/flu_BC01.fastq,,file,oxford,<path_to_database_directory>/flukraken2,
58-
sample,<path_to_directory>/sample_metagenome.fastq,,file,oxford,<path_to_database_directory>/flukraken2,
59-
test,test2.fastq,,file,illumina,<path_to_database_directory>/flukraken2,
60-
```
79+
1. `sudo service mytax2 status` to check the service information
80+
2. Check the command-line logs if hosting/serving in development mode with `npm run serveBoth` or `npm run server`
81+
3. `docker container logs $container_name` if using Docker to deploy
6182

6283

6384

@@ -66,19 +87,14 @@ test,test2.fastq,,file,illumina,<path_to_database_directory>/flukraken2,
6687
| `sample` | Custom sample name. This entry will be identical for multiple sequencing libraries/runs from the same sample. Spaces in sample names are automatically converted to underscores (`_`). |
6788
| `path_1` | Full path to FastQ file for Illumina short reads 1 OR OXFORD reads. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
6889
| `path_2` | Full path to FastQ file for Illumina short reads 2. File has to be gzipped and have the extension ".fastq.gz" or ".fq.gz". |
69-
| `format` | TRUE/FALSE, is the row attributed to a demultiplexed barcode folder of 1 or more fastq files or is it a single file that is .gz? |
70-
| `platform` | Platform used, [ILLUMINA, OXFORD] |
71-
| `compressed` | TRUE/FALSE, is your set of files compressed or not as `.gz` format column |
72-
| `pattern` | Pattern to match items (regex) for barcoded runs |
73-
| `kits` | List of guppy barcode kits for barcode runs. Such as `EXP-NBD103` and `SQK-LWB001` |
90+
| `format` | TRUE/FALSE switch toggle, is the row attributed to a demultiplexed barcode folder of 1 or more fastq files or is it a single file that is .gz?. If toggled on, the entry will auto-detect anything matching the regex-based pattern and make 1 sample per pattern match in that directory. For example, barcode01,02,03, etc. |
91+
| `pattern` | Pattern to match items (regex) for barcoded runs, Optional |
7492

7593
An [example samplesheet](../examples/Samplesheet.csv) has been provided with the pipeline alongside some demo data.
7694

7795
## Creating a Docker image using the pre-built code.
7896

7997

80-
81-
8298
```
8399
conda activate mytax2
84100

databases/k2_HRSV.tar.gz

1.48 MB
Binary file not shown.

databases/k2_mpox.tar.gz

783 KB
Binary file not shown.

mytax2.service

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Unit]
2+
Description=MyTax Service
3+
After=network.target
4+
5+
[Service]
6+
Type=simple
7+
User=minion
8+
WorkingDirectory=/home/minion/mytax
9+
ExecStart=/bin/bash -c '/home/minion/miniconda3/bin/activate && npm run serveBoth'
10+
Environment="PATH=/home/minion/miniconda3/bin:/usr/bin:/bin"
11+
Restart=on-failure
12+
13+
[Install]
14+
WantedBy=multi-user.target

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "mytax",
3-
"version": "0.1.0",
3+
"version": "v2.2.6",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve --port 8080",
77
"serveProduction": "export NODE_ENV=production && vue-cli-service serve --port 8080",
8+
"serveBoth": "npm run serve & npm run server",
89
"build": "vue-cli-service build",
910
"lint": "vue-cli-service lint",
1011
"server": "export NODE_ENV=development && nodemon server/index.mjs --watch",
@@ -38,10 +39,12 @@
3839
"sass-loader": "^10.0.0",
3940
"socket.io": "^4.6.1",
4041
"socket.io-client": "^4.6.1",
42+
"tar": "^6.2.0",
43+
"unzipper": "^0.10.14",
4144
"vue": "^2.6.14",
4245
"vue-json-excel": "^0.3.0",
4346
"vue-json-to-csv": "^1.1.8",
44-
"vue-sweetalert2": "^5.0.2",
47+
"vue-sweetalert2": "^5.0.5",
4548
"vuetify": "^2.6.0",
4649
"winston": "^3.6.0",
4750
"ws": "^8.12.0"

0 commit comments

Comments
 (0)