molepi / Molecular-Data-Science

FOS course Molecular Data Science
6 stars 3 forks source link

Running gPLINK on MacOS #1

Open martijncalker opened 3 years ago

martijncalker commented 3 years ago

In order to run gPLINK on MacOS, make sure you're familiar with the command line (cli). You need brew to install oracle-jdk.

Download the zip, extract the zip. In your terminal, move to the location where you've unpacked the zip (the gPLINK.jar should be there). We can now start gplink via:

java -jar gPLINK.jar

Enjoy! 🍻

Tested on: Catalina 10.15.7

Screenshot 2020-10-22 at 12 33 49
louisevanalst commented 3 years ago

Since the shipped MacOS version of plink (cli) doesn't work, we'll run it from inside a container with Docker.

FROM debian:stable

ENV PLINK_VERSION=1.07
ENV INSTRUCTION=x86_64
ENV DEBIAN_FRONTEND=noninteractive

# RUN apk add openssl wget unzip libxext
RUN apt-get update \
 && apt-get install -y openssl wget unzip \
 && wget -O /tmp/plink.zip http://zzz.bwh.harvard.edu/plink/dist/plink-${PLINK_VERSION}-${INSTRUCTION}.zip \
 && unzip -d /opt /tmp/plink.zip \
 && ln -s /opt/plink-${PLINK_VERSION}-${INSTRUCTION} /usr/local/bin/plink \
 && rm /tmp/plink.zip

WORKDIR /data

ENTRYPOINT ["/usr/local/bin/plink", "--noweb"]

Build the image:

$ docker build -t plink:local .

Run the plink container (note that we mount the current working directory pwd, make sure your plink-files are there):

$ docker run --rm -it -v $(pwd):/data --entrypoint /bin/bash plink:local

From within the container, we can now use plink:

$ plink --noweb --file lls --out output

(exit to leave the container)

Or you can run plink directly via:

$ docker run --rm -v $(pwd):/data plink:local --file lls --out output