Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --paths and --labels to scripts/plot_matrix.py and add Dockerfile #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"
43 changes: 32 additions & 11 deletions scripts/plot_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down