Probesaerch align primer/probe/gRNA sequences against selected genome databases. It currently has two versions: V3 and V3.2. The app is written in Nodejs, Expressjs, and Vue.js.
- Install Node.js: https://nodejs.dev/learn/how-to-install-nodejs
- Install Razers3: Follow the instructions provided in the SeqAn GitHub repository to set up Razers3 aligner executable.
- setup the app
git clone https://github.com/TsailabBioinformatics/ProbeSearchV3
cd ProbeSearchV3
npm install
cd vue
npm install
# Update the directories path of `data/` and `indices/` in the script. Refer to [Editing Backend section.](#editting-probesearchv3)
node app.js
pm2 is a node process manager that keeps the node app runnning as a background process. Run pm2 list
to checkout the current node processes running on pm2. If for some reason probesearch or probesearchv3.2 is no longer running, we can run pm2 start app.js --name probesearch
to restart it. Also, one can run pm2 --help
to learn about all of its functions.
Here is description of full stack of ProbeSearchV3.
Directory Structure
data/
: Fasta files are located in/data/probesearchDB/data/
on the serverbowtie/
: Bowtie2 executables are located inbowtie/
scripts/
: Helper scripts for Bowtie2indices/
: Bowtie2 uses indexed versions of the fasta files. Indices are located inindices/
.- In order to create an index for bowtie, use
./bowtie/bowtie2-build <path_to_fasta> <index_name>
. Then move these indices toindices/
- In order to create an index for batmis, use
./usr/local/bin/build_index <path_to_fasta> <index_name>
. Then move these indices toindices/
- Indices are integral to bowtie2 alignment.
app.js
makes a call to./bowtie/bowtie2 -x indices/<db> -k 30 -c <read>
. Here,<db>
represents the user-selected database, and<read>
represents the input read.
- In order to create an index for bowtie, use
GeneTable/
: contains gene database used by V3.2vue/
: Frontend Vue files
Data Flow
The following details how data moves in the app. We'll see how the client-side form submission request leads to the eventual alignment result response.
-
Initial Input Processing
User input is first handled bySequenceForm.vue
. WithinSequenceForm.vue
, these data are tracked asread: ''
anddb: []
.read
is a string because it represents a primer/probe/gRNA sequence, anddb
is an array because it represents a set of genome databases. When the user fills out the form, the variables are defined respetively. Then, when the user submits the form (e.g., clicksSearch
), the variables are propagated, or emitted (in Vue lingo), up to its parent componentApp.vue
.App.vue
, then processes the user input and makes a put request to the Express api,app.js
(axios.put('/', payload)
). -
API Functions
The put function first calls a child process:./bowtie/bowtie2 -x indices/ + String(req.body.db) -k 30 -c + String(req.body.read) + --end-to-end --no-hd
. Note,req.body.db
andreq.body.read
is the Express way of accessing the inputted db and read respectively. This child process initiates the bowtie2 alignment function, which returns a SAM file asstdout
. Then, the SAM file, orstdout
is parsed and molded into an alignment illustration. The illustration of the alignmened is thne returned toApp.vue
. -
Returning Alignment Result
app.js
sends back data in the form of an illustration toApp.vue
. In turn,App.vue
passes this data to a child component calledAlignmentResult.vue
. Once theAlignmentResult
component(s) receive the data, they show on client side.
Both versions share the same user interface to avoid complexity. However, their backend implementations differ.
Each version has three separate scripts:
-
Bowtie2 Scripts:
- Handles alignment using Bowtie2 for all genome databases except sPta717V2.0.
- V3:
app.js
- V3.2:
appV3.js
-
Specialized Bowtie2 Script:
- Specifically for the sPta717V2.0 database due to differences in output format.
- Script:
717V2.js
-
Razers3 Scripts:
- Utilizes Razers3 aligner for alignment.
- V3:
razers3.js
- V3.2:
razers3V3.js
- V3: Entry point is through
app.js
. - V3.2: Entry point is through
appV3.js
.
- Frontend
- The frontend can be editted from within the
vue/
directory. - The three components as of now are the parent,
App.vue
, and its children,SequenceForm.vue
&AlignmentResult.vue
. - After editting the vue files, run
npm run build
from within thevue/
directory. This command builds the static HTML, css, and js for the frontend and places them invue/dist/
directory. The express app,app.js
, references these static files automatically, so that's all: edit then build.
- The frontend can be editted from within the
- API
- The main app can be editted at
app.js
orappV3.js
based on the version of the app. It is written in Express.
- The main app can be editted at
- Backend
- The backend consists of two mains parts: the fasta files & the indexed fasta files. In order to edit the backend, or implement more genomes, do the following:
- Transfer whatever fasta files you wish to the parent directory.
- Build the indices:
./bowtie/bowtie2-build <path_to_fasta> <index_name>
. Name the index (second parameter) the same name as you display the database on the frontend. - Move the raw fasta file to the
data/
directory, and move the indexed fasta files to theindices/
directory. - Go the Express
app.js
, and add todb_dictionary
, which facilitates a dictionary between the frontend name of the database and the location of the fasta file.
-
V3:
- Allows users to input primer/probe/gRNA sequences and select a set of genome databases.
- Upon submission, the app returns the result of the input read aligned against the selected genome using the Bowtie2 software.
- Provides an option to change the aligner to Razers3, primarily used for aligning with short reads.
-
V3.2:
- Includes all features of V3.
- Additionally provides Gene Features and CDS Overlapping Info.
Make sure all the files - app.js, appV3.js, razers3.js, razers3V3.js and 717V2.js have update path according to respective directories.