Skip to content

Commit

Permalink
Update images with ONT-DART nomenclature
Browse files Browse the repository at this point in the history
  • Loading branch information
joshims1 committed Sep 28, 2022
1 parent d8cf8c6 commit 09180e9
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 37 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ The code as provided has also been modified to include a different set of amplic
presents.

# ONT-DART
_nanopore Detection of Amplicons in Real-Time_
_Oxford Nanopore Technologies Detection of Amplicons in Real-Time_

The scripts in this repository are designed for a very specific amplicon use-case, and are part of the nanoDART (nanopore Detection of Amplicons in Real-Time) analysis pipeline.
The scripts in this repository are designed for a very specific amplicon use-case, and are part of the ONT-DART (Oxford Nanopore Technologies Detection of Amplicons in Real-Time) analysis pipeline.
The input directory should be the standard Oxford Nanopore Technologies (ONT) MinKNOW software output named `fastq_pass`.
Each set of reads per barcode within this directory are aligned to an amplicon database with `blastn`.
The analysis is meant to be in 'real-time', meaning as reads are output from the basecalling algorithm of guppy (or whatever the standard is at the time) into the `fastq_pass` directory, they will be concatentated and analyzed at a user-define interval.
Visualization of output results from this processing pipeline are part of the front-end GUI application.

## Running ONT-DART Web Application in Development

This is for testing out the nanoDART web application on your machine for development purposes.
This is for testing out the ONT-DART web application on your machine for development purposes.

Before going through the steps, make sure Docker is installed on your machine: https://docs.docker.com/get-docker/. You'll also need to have access to the nanoDART accessory files for the blastn database. Copy the nanoDART accessory files directory into the project's root directory.
Before going through the steps, make sure Docker is installed on your machine: https://docs.docker.com/get-docker/. You'll also need to have access to the ONT-DART accessory files for the blastn database. Copy the ONT-DART accessory files directory into the project's root directory.

- Open terminal and navigate to the project's root directory.
- To build the Docker image for nanoDART, run the following command: `./build_image.sh`. This will properly bundle the frontend and backend web application files together and create a Docker image with the name **nanodart**.
- Finally, to run the web application, run the following command: `docker run -p 5000:5000 nanodart`. The web application can now be reached at the following URL: http://localhost:5000.
- To build the Docker image for ONT-DART, run the following command: `./build_image.sh`. This will properly bundle the frontend and backend web application files together and create a Docker image with the name **ont-dart**.
- Finally, to run the web application, run the following command: `docker run -p 5000:5000 ont-dart`. The web application can now be reached at the following URL: http://localhost:5000.

## Installing nanoDART Web Application to MK1C
## Installing ONT-DART Web Application to MK1C

Before going through the steps, make sure Docker is installed on your machine: https://docs.docker.com/get-docker/. You'll also need to have access to the nanoDART accessory files for the blastn database. Copy the nanoDART accessory files directory into the project's root directory.
Before going through the steps, make sure Docker is installed on your machine: https://docs.docker.com/get-docker/. You'll also need to have access to the ONT-DART accessory files for the blastn database. Copy the ONT-DART accessory files directory into the project's root directory.

- Open terminal and navigate to the project's root directory.
- To build the Docker image for nanoDART that is compatible with the MK1C, run the following command: `./build_and_save_image_arm64.sh`. This will generate a file named **nanodart.tar.gz** in your current directory which is the nanoDART Docker image that has been saved as a file.
- To build the Docker image for ONT-DART that is compatible with the MK1C, run the following command: `./build_and_save_image_arm64.sh`. This will generate a file named **ont-dart.tar.gz** in your current directory which is the ONT-DART Docker image that has been saved as a file.
- Transfer the Docker image file to the MK1C. This can be done through methods like USB or SSH (user: minit, password: minit).
- Through command line on the MK1C (either directly on the device or through SSH), run the following command: `docker load < /path/to/file/nanodart.tar.gz`. This will load the nanoDART Docker image onto the MK1C.
- Through command line on the MK1C (either directly on the device or through SSH), run the following command: `docker load < /path/to/file/ont-dart.tar.gz`. This will load the ONT-DART Docker image onto the MK1C.

## NOTES:
The target environment for this code is an Oxford Nanopore Technologies (ONT) MinION Mk1C,
Expand All @@ -61,7 +61,7 @@ Before going through the steps, make sure Docker is installed on your machine: h

## Usage

Upon opening the nanoDART website, you will be presented with three tabs.
Upon opening the ONT-DART website, you will be presented with three tabs.
To begin the process, select the "Analysis" tab.

![](./imgs/analysis.png)
Expand Down
6 changes: 3 additions & 3 deletions build_and_save_image_arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

(cd $SCRIPT_DIR/frontend && npm run build)
cp -r $SCRIPT_DIR/frontend/dist $SCRIPT_DIR/webapp
docker build $SCRIPT_DIR -t nanodart
docker buildx build --platform linux/arm64 $SCRIPT_DIR -t nanodart
docker save nanodart | gzip > nanodart.tar.gz
docker build $SCRIPT_DIR -t ont-dart
docker buildx build --platform linux/arm64 $SCRIPT_DIR -t ont-dart
docker save ont-dart | gzip > ont-dart.tar.gz
2 changes: 1 addition & 1 deletion build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

(cd $SCRIPT_DIR/frontend && npm run build)
cp -r $SCRIPT_DIR/frontend/dist $SCRIPT_DIR/webapp
docker build $SCRIPT_DIR -t nanodart
docker build $SCRIPT_DIR -t ont-dart
4 changes: 2 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nanoDART Frontend
# ONT-DART Frontend

## Building for Deployment

Expand Down Expand Up @@ -29,4 +29,4 @@ See [Configuration Reference](https://cli.vuejs.org/config/). This project uses

## Notes

- In order for the nanoDART website to work properly, it's important that the website is deployed on the same machine as the backend shell scripts. This is because the file paths provided to the web page are passed directly to the shell scripts for further processing.
- In order for the ONT-DART website to work properly, it's important that the website is deployed on the same machine as the backend shell scripts. This is because the file paths provided to the web page are passed directly to the shell scripts for further processing.
4 changes: 2 additions & 2 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "nanodart",
"name": "ont-dart",
"version": "0.1.0",
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
max-width="40"
contain
></v-img>
<v-toolbar-title><span style="color:white">nanoDART</span></v-toolbar-title>
<v-toolbar-title><span style="color:white">ONT-DART</span></v-toolbar-title>

<v-spacer></v-spacer>
<v-btn v-for="item in navItems" :key="item.title" :to="item.link" text tile color="white">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/AnalysisForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default {
},
data: () => ({
valid: true,
inputDirectory: '/app/nanoDART_accessory_files/nanoDART_testdata-20200114_GXB01192_PHASE2-NB_FLG001-BA/BA_NB_Flongle/20200114_1957_X1_ABR474_dac2eaf0/fastq_pass/',
inputDirectory: '/app/EXAMPLE/fastq_pass/',
barcodes: 'barcode10,barcode11,barcode12',
analysisInterval: '10',
threads: '1',
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/services/results.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ResultsService {
data: data,
responseType: 'blob'
}).then((response) => {
fileDownload(response.data, 'nanodart-tables.zip')
fileDownload(response.data, 'ont-dart-tables.zip')
})
}

Expand All @@ -27,7 +27,7 @@ class ResultsService {
data: data,
responseType: 'blob'
}).then((response) => {
fileDownload(response.data, 'nanodart.pdf')
fileDownload(response.data, 'ont-dart.pdf')
})
}
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
<div>
<v-row>
<v-col align="center">
<div class="text-h1">nanoDART</div>
<div class="text-h1">ONT-DART</div>
<div class="text-subtitle-2">
<u>nano</u>pore <u>D</u>etection of <u>A</u>mplicons in <u>R</u>eal-<u>T</u>ime
<u>Oxford Nanopore Technologies</u> <u>D</u>etection of <u>A</u>mplicons in <u>R</u>eal-<u>T</u>ime
</div>
</v-col>
</v-row>
<v-row>
<v-col>
<div class="text-body-1">
The nanoDART (nanopore Detection of Amplicons in Real-Time) analysis pipeline is used to identify the presence of amplicons
The ONT-DART (Oxford Nanopore Technologies Detection of Amplicons in Real-Time) analysis pipeline is used to identify the presence of amplicons
produced from a multiplex PCR reaction from sequence read output of an Oxford Nanopore Technologies (ONT) sequencing device
(e.g. MK1B, MK1C, or GridION). If all amplicon products from a particular organism are above the algorithm's three detection
thresholds, the organism is flagged as present in the sample.
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/Results.vue
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ export default {
this.renderHeatmap(this.plot.data)
},
downloadGraph() {
const config = { filename: 'nanodart_results' };
const config = { filename: 'ont-dart_results' };
d3_save_svg.save(d3.select('svg').node(), config);
},
downloadAll() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
config
.plugin('html')
.tap(args => {
args[0].title = "nanoDART"
args[0].title = "ONT-DART"
return args
})
}
Expand Down
2 changes: 1 addition & 1 deletion nanomonitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cat << EOF
Help message for \`nanomonitor.sh\`:
This algorithm is designed for a very specific amplicon use-case, and is part
of the nanoDART (nanopore Detection of Amplicons in Real-Time) analysis pipeline.
of the ONT-DART (Oxford Nanopore Technologies Detection of Amplicons in Real-Time) analysis pipeline.
The input fastq_pass (-i) directory should have subfolders named for barcodes.
For this use-case, subfolder names are expected to be from 'barcode01' to 'barcode12'.
Expand Down
20 changes: 13 additions & 7 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
dist_path = os.path.abspath('dist')

nanomonitor_path = Path.cwd().parent / 'nanomonitor.sh'
ref_directory = '/app/nanoDART_accessory_files/blastn/unencrypted_db/blastdb_all_amplicons'
ref_directory = '/app/EXAMPLE/Amplicon_blastdb/Amplicon_set'

running_analysis = False
output_directory: Optional[Path] = None
Expand All @@ -52,9 +52,15 @@ def run_nanomonitor(input_directory: Path, barcode_list: str, analysis_interval:
logs_dir = 'logs'
os.makedirs(logs_dir, exist_ok=True)
timestamp = time.strftime('%Y%m%d-%H%M%S')
output_directory = input_directory.parent / 'nanodart-output-{}'.format(timestamp)
output_directory = input_directory.parent / 'ont-dart-output-{}'.format(timestamp)
log_file = Path('{}/{}.log'.format(logs_dir, timestamp))

print(nanomonitor_path)
print(num_threads)
print(analysis_interval)
print(input_directory)
print(output_directory)
print(ref_directory)
subprocess.Popen([nanomonitor_path, '-t', num_threads, '-a', analysis_interval,
'-i', input_directory, '-n', barcode_list, '-o', output_directory,
'-r', ref_directory], stdout=open(log_file, 'wb'), stderr=subprocess.STDOUT)
Expand All @@ -64,7 +70,7 @@ def run_nanomonitor(input_directory: Path, barcode_list: str, analysis_interval:
@app.route('/')
def index():
"""
Generates main index page for nanoDART from template.
Generates main index page for ONT-DART from template.
Returns:
render_template: renders index.html template
Expand Down Expand Up @@ -154,7 +160,7 @@ def results_zip():

return send_file(memory_file,
mimetype='application/zip',
attachment_filename='nanodart-tables.zip',
attachment_filename='ont-dart-tables.zip',
as_attachment=True, cache_timeout=0)


Expand All @@ -170,11 +176,11 @@ def results_pdf():
options = {'page-size': 'Letter', 'margin-top': '0.75in', 'margin-bottom': '0.75in',
'margin-left': '0.75in', 'margin-right': '0.75in', 'quiet': ''}
html_header = '<!doctype html><html lang="en"><head><meta charset="utf-8">' + \
'<title>nanoDART</title></head><body>' + \
'<h1>nanoDART Report: ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S') + '</h1>'
'<title>ONT-DART</title></head><body>' + \
'<h1>ONT-DART Report: ' + datetime.now().strftime('%Y-%m-%d %H:%M:%S') + '</h1>'
html_string = html_header + content['html'] + '</body></html>'
pdf_bytes = pdfkit.from_string(html_string, options=options)
return send_file(io.BytesIO(pdf_bytes), attachment_filename='nanodart.pdf', as_attachment=True,
return send_file(io.BytesIO(pdf_bytes), attachment_filename='ont-dart.pdf', as_attachment=True,
mimetype='application/pdf')


Expand Down

0 comments on commit 09180e9

Please sign in to comment.