help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Makefile how combine more process


From: address@hidden
Subject: Makefile how combine more process
Date: Mon, 22 May 2017 15:36:30 +0200 (CEST)

Dear All
Sorry for my aive question iI'm learning ...
I have write  a makefile that prepare  some files:

RDIR=.
RFILES:=$(wildcard $(RDIR)/*.vcf)
OUTDIR=ORIGINAL
OUTFILES=$(patsubst %.vcf,$(OUTDIR)/%.gz,$(RFILES))
BCFTOOLS=bcftools 
OUTSOMATIC=SOMATIC
OUTVARDICT=$(patsubst 
$(OUTDIR)/%vardict.gz,$(OUTSOMATIC)/%.somatic.vcf,$(wildcard 
$(OUTDIR)/*vardict.gz))
OUTMUTEC2=$(patsubst 
$(OUTDIR)/%mutect2_all.gz,$(OUTSOMATIC)/%mutect2.somatic.vcf,$(wildcard 
$(OUTDIR)/*mutect2_all.gz))

OUTVARSCAN2=$(patsubst 
$(OUTDIR)/%varscan.gz,$(OUTSOMATIC)/%varscan2.somatic.vcf,$(wildcard 
$(OUTDIR)/*varscan.gz))

.PHONY: all

all: $(OUTDIR) $(OUTFILES) $(OUTSOMATIC) $(OUTVARDICT) $(OUTMUTEC2) 
$(OUTVARSCAN2)


$(OUTDIR)/%.gz: %.vcf
    bgzip -c $<  > $@


$(OUTDIR):
    test -d $@ || mkdir $@

$(OUTSOMATIC):
    test -d $@ || mkdir $@



$(OUTSOMATIC)/%.somatic.vcf: $(OUTDIR)/%vardict.gz
    $(BCFTOOLS)  view  -f PASS -i 'INFO/STATUS ~ ".*Somatic"' $<  > $@



$(OUTSOMATIC)/%mutect2.somatic.vcf: $(OUTDIR)/%mutect2_all.gz
    $(BCFTOOLS)  view  -f PASS $<  > $@



$(OUTSOMATIC)/%varscan2.somatic.vcf: $(OUTDIR)/%varscan.gz
    $(BCFTOOLS)  view  -f PASS -i 'SS="2"' $<  > $@




clean:
    rm -rf $(OUTDIR)
    rm -rf $(OUTSOMATIC)

I need to launch 3 time make -f Makefile for execute all the subroutine. How 
can improve that script?

So create a drectory with the  preliminary files I need for complete  the other 
steps. What is the right way?
thanks for any help
M


reply via email to

[Prev in Thread] Current Thread [Next in Thread]