This repository provides a CUDA-optimized implementation of the ITERBEST algorithm to optimize the layout of DNA-barcodes on 2d arrays.
You need the follwing dependencies present on your system.
- CUDA 11.x with
nvccin the search path
The algorithm can be compiled with different parameters:
- NUMBER_OF_BARCODES: This parameter specifies the number of newline separated barcodes to read from stdin.
- BARCODE_LENGTH: This specifies the length of each barcode in bytes.
- DIM_X and DIM_Y: These specifiy the dimensions of the array on which the barcodes should be layed out. Note that
(DIM_X * DIM_Y) <= NUMBER_OF_BARCODESmust be true. - NEIGHBORHOOD: This describes the neighborhood strategy to apply. A default strategy which uses 8 unweighted neighbors is provided.
Now you can build the program using
./scripts/build_iterbest.sh <NUMBER_OF_BARCODES> <BARCODE_LENGTH> <DIM_X> <DIM_Y> [ <NEIGHBORHOOD_NAME> ]
The program reads the specified number of barcodes from stdin and writes the result to stdout. Additionally, log output is written to stderr.
Test it out using the following command.
cat <MY_BARCODE_LIBRARY> | ./bin/barlay 1> result.json
After the progress bar reaches 100% you should find a resulting layout in ./result.json.
Neighborhood definitions can be found in ./src/iterbest/neighborhood/*.
Run ./scripts/define_new_neighborhood.sh <NEIGHBORHOOD_NAME> to create the boilerplate for a new neighborhood.
In the created file you must define a type named Neighborhood and two functions load and nquality. ITERBEST will use these to determine the best candidate at a position (x,y).
Take ./src/iterbest/neighborhood/n8.cu as an example.
The code defined here runs on the GPU so take this in mind for performance reasons.
-
SSH into the login node of the HP cluster (Currently this works only if CUDA 12.3 is installed on the cluster nodes and nvcc is located at
/usr/local/cuda-12.3/bin/nvcc). -
git clonethis repo somewhere. Stay where you are, do not cd into the cloned repo. -
Copy the barcode set somewhere onto the login node (eg next to the cloned repo).
-
Configure iterbest using
barcode-layout/scripts/configure_iterbest.sh <NUMBER_OF_BARCODES> <BARCODE_LENGTH> <DIM_X> <DIM_Y> [ <NEIGHBORHOOD_NAME> ]. -
Queue the job using
sbatch barcode-layout/scripts/batch.sh <KUERZEL> <PATH_TO_BARCODE_SET>. -
Follow the progress using
tail -f slurm-<JOB_ID>.err. Once finished, the generated layout will be initerbest-layout-<JOB_ID>.json.