From 1e3e759891dd7f945a1850e5232331bec4686907 Mon Sep 17 00:00:00 2001 From: Cade Mirchandani Date: Tue, 10 Jan 2023 23:08:32 +0000 Subject: [PATCH 1/2] add build dockerfile --- Dockerfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..26834e7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM ubuntu:18.04 +RUN apt-get update -y && apt-get install -y autoconf build-essential libboost-all-dev zlib1g-dev libbz2-dev libcurl4-openssl-dev liblzma-dev samtools cmake python3 python3-pip libjpeg-dev +RUN pip3 install --upgrade pip setuptools wheel +RUN pip3 install matplotlib +RUN apt-get install -y python curl bzip2 && apt-get autoclean && rm -rf /var/lib/apt/lists/* +RUN curl -L https://github.com/lh3/minimap2/releases/download/v2.17/minimap2-2.17_x64-linux.tar.bz2 | tar -jxvf - +ENV PATH="${PATH}:/minimap2-2.17_x64-linux" +COPY . /workdir +WORKDIR /workdir +RUN mkdir build && cd build && cmake .. && make -j 4 +ENV PATH="${PATH}:/workdir/build" \ No newline at end of file From a09d8f88dfb4e68f83b420891152b34c08fd49bf Mon Sep 17 00:00:00 2001 From: Cade Mirchandani Date: Wed, 11 Jan 2023 04:31:29 +0000 Subject: [PATCH 2/2] add argparse for parsing input paths and labels --- scripts/plot_matrix.py | 43 +++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/scripts/plot_matrix.py b/scripts/plot_matrix.py index 2f81350..26c65f0 100644 --- a/scripts/plot_matrix.py +++ b/scripts/plot_matrix.py @@ -2,7 +2,7 @@ from matplotlib import cm import matplotlib.colors as colors import numpy - +import argparse A,C,G,T = 0,1,2,3 # Index key for storing base data in matrix form @@ -148,17 +148,38 @@ def main(): # ------------------------------------------------------------------------------------------------------ - paths = [ - "/home/ryan/code/runlength_analysis_cpp/build/output/rle_test/length_frequency_matrix_nondirectional.csv", - "/home/ryan/code/runlength_analysis_cpp/build/output/rle_test/length_frequency_matrix_nondirectional.csv", - ] - - labels = [ - "test", - "test", - ] - + # paths = [ + # "/home/ryan/code/runlength_analysis_cpp/build/output/rle_test/length_frequency_matrix_nondirectional.csv", + # "/home/ryan/code/runlength_analysis_cpp/build/output/rle_test/length_frequency_matrix_nondirectional.csv", + # ] + # labels = [ + # "test", + # "test", + # ] + + # quick cli for workflow use from https://stackoverflow.com/questions/32761999/how-to-pass-an-entire-list-as-command-line-argument-in-python + CLI=argparse.ArgumentParser() + CLI.add_argument( + "--paths", # name on the CLI - drop the `--` for positional/required parameters + nargs="*", # 0 or more values expected => creates a list + type=str, + default=[], # default if nothing is provided + ) + CLI.add_argument( + "--labels", + nargs="*", + type=str, # any type/callable can be used here + default=[], + ) + + # parse the command line + args = CLI.parse_args() + # access CLI options + print("paths: %r" % args.paths) + print("labels: %r" % args.paths) + paths = args.paths + labels = args.labels figure,axes = pyplot.subplots(ncols=len(paths), nrows=1) colormap = pyplot.get_cmap("viridis") # colormap = truncate_colormap(colormap, max=0.5)