diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b940040 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM continuumio/miniconda:latest + +COPY environment.yml . +RUN apt-get update -y && apt-get install -y zlib1g zlib1g-dev gcc +RUN conda update -n base -c defaults conda && \ + conda env update --name base --file /environment.yml && \ + rm /environment.yml + +COPY SNP/ /SNP +WORKDIR /checkmate +COPY patterngenerator/ . +COPY ngscheckmate_fastq-source ./ngscheckmate_fastq-source +COPY patterngenerator ./patterngenerator +RUN cd ngscheckmate_fastq-source && alias cc=$(which gcc) && make +RUN cd patterngenerator && make +RUN chmod +x ngscheckmate_fastq-source/ngscheckmate_fastq && cp ngscheckmate_fastq-source/ngscheckmate_fastq /bin/ && cp ngscheckmate_fastq-source/ngscheckmate_fastq ./ +RUN chmod +x patterngenerator/patternconverter && cp patterngenerator/patternconverter /bin/ && cp patterngenerator/patternconverter ./ + +COPY tests/ . +COPY ncm_fastq.py ncm_test.py ncm.py /bin/ + +RUN chmod +x /bin/ncm_fastq.py && chmod +x /bin/ncm.py + +ENV NCM_HOME /checkmate \ No newline at end of file diff --git a/README.md b/README.md index b3d5719..8dc45af 100644 --- a/README.md +++ b/README.md @@ -84,9 +84,9 @@ export NCM_HOME=/NGSCheckMate #### 2) Configuration (required only for the BAM module) If your input is BAM/VCF files, add the following lines in your ncm.conf file in the package directory. If your input is FASTQ files, you can skip this step. ``` -REF= -SAMTOOLS= -BCFTOOLS= +export REF= +export SAMTOOLS= +export BCFTOOLS= ``` #### Buid for fastq module / patterngenerator diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..01ebf5a --- /dev/null +++ b/environment.yml @@ -0,0 +1,16 @@ +name: NGSCheckMate +channels: + - anaconda + - conda-forge + - bioconda +dependencies: + - python=2.7 + - samtools=1.3.1 + - bcftools=1.9 + - make + - zlib + - gxx_linux-64 + - pip + - pip: + - requests + - git+https://github.com/SimBioSysInc/MAFpy.git \ No newline at end of file diff --git a/ncm.py b/ncm.py index 0bff27c..3b66e6c 100644 --- a/ncm.py +++ b/ncm.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import os import math import subprocess, time @@ -1177,15 +1179,9 @@ def run_mpileup(): else: print "WARNNING : NCM_HOME is not defined yet. Therefore, program will try to search ncm.conf file from the current directory" INSTALL_DIR="" - with open(INSTALL_DIR + "ncm.conf",'r') as F: - for line in F.readlines(): - temp = line.split('=') - if temp[0].startswith("SAMTOOLS"): - SAMTOOLS = temp[1].strip() - elif temp[0].startswith("BCFTOOLS"): - BCFTOOLS = temp[1].strip() - elif temp[0].startswith("REF"): - REF = temp[1].strip() + SAMTOOLS = os.environ.get("SAMTOOLS", False) or "samtools" + BCFTOOLS = os.environ.get("BCFTOOLS", False) or "bcftools" + REF= os.environ.get("BCFTOOLS", False) # REF="/NAS/nas33-2/mpileup/hg19.fasta" version ="" diff --git a/ncm_fastq.py b/ncm_fastq.py index daa5910..abb448f 100644 --- a/ncm_fastq.py +++ b/ncm_fastq.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python import os import sys import math diff --git a/ncm_test.py b/ncm_test.py index 528565f..a0d1832 100644 --- a/ncm_test.py +++ b/ncm_test.py @@ -888,18 +888,10 @@ def remove_internal_files(): def run_mpileup(): - SAMTOOLS="" - BCFTOOLS="" - REF="" - with open("./ncm.conf",'r') as F: - for line in F.readlines(): - temp = line.split('\"') - if temp[0].startswith("SAMTOOLS"): - SAMTOOLS = temp[1].strip() - elif temp[0].startswith("BCFTOOLS"): - BCFTOOLS = temp[1].strip() - elif temp[0].startswith("REF"): - REF = temp[1].strip() + SAMTOOLS = os.environ.get("SAMTOOLS", False) or "samtools" + BCFTOOLS = os.environ.get("BCFTOOLS", False) or "bcftools" + REF= os.environ.get("BCFTOOLS", False) + # REF="/NAS/nas33-2/mpileup/hg19.fasta" for sample in bam_list: diff --git a/ngscheckmate_fastq-source/Makefile b/ngscheckmate_fastq-source/Makefile index eed3347..f2b630b 100755 --- a/ngscheckmate_fastq-source/Makefile +++ b/ngscheckmate_fastq-source/Makefile @@ -1,4 +1,4 @@ -COMPILER = gcc +CC ?= gcc DFLAGS = CFLAGS = -c OFLAGS = -lpthread -lm -lz -o @@ -7,15 +7,15 @@ OFLAGS = -lpthread -lm -lz -o EXECNAME = ngscheckmate_fastq ngscheckmate: stringhash2.o ngscheckmate_functions.o ngscheckmate_main.o - ${COMPILER} ${DFLAGS} stringhash2.o ngscheckmate_functions.o ngscheckmate_main.o ${OFLAGS} ${EXECNAME} + ${CC} ${DFLAGS} stringhash2.o ngscheckmate_functions.o ngscheckmate_main.o ${OFLAGS} ${EXECNAME} stringhash2.o: stringhash2.c stringhash2.h - ${COMPILER} ${DFLAGS} ${CFLAGS} stringhash2.c + ${CC} ${DFLAGS} ${CFLAGS} stringhash2.c ngscheckmate_functions.o: ngscheckmate_functions.c ngscheckmate.h patternconvert.h - ${COMPILER} ${DFLAGS} ${CFLAGS} ngscheckmate_functions.c patternconvert.h + ${CC} ${DFLAGS} ${CFLAGS} ngscheckmate_functions.c patternconvert.h ngscheckmate_main.o: ngscheckmate_main.c ngscheckmate.h - ${COMPILER} ${DFLAGS} ${CFLAGS} ngscheckmate_main.c + ${CC} ${DFLAGS} ${CFLAGS} ngscheckmate_main.c diff --git a/vaf_ncm.py b/vaf_ncm.py index 61a9168..1387e07 100644 --- a/vaf_ncm.py +++ b/vaf_ncm.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python import os import sys import math