diff --git a/ag_gbs_qc_prism.sh b/ag_gbs_qc_prism.sh index bfd75ef..2c5de08 100755 --- a/ag_gbs_qc_prism.sh +++ b/ag_gbs_qc_prism.sh @@ -122,6 +122,7 @@ function echo_opts() { function configure_env() { cd $GBS_PRISM_BIN cp ag_gbs_qc_prism.sh $OUT_ROOT + cp ag_gbs_qc_prism.mk $OUT_ROOT cp demultiplex_prism.sh $OUT_ROOT cp genotype_prism.sh $OUT_ROOT cp get_cohort_fastq_filenames.psql $OUT_ROOT @@ -156,7 +157,7 @@ function get_targets() { for ((j=0;$j<$NUM_COHORTS;j=$j+1)) do cohort=${cohorts_array[$j]} cohort_moniker=${RUN}.$cohort - echo $OUT_ROOT/$cohort_moniker.ag_gbs_qc_prism >> $OUT_ROOT/ag_gbs_qc_targets.txt + echo $OUT_ROOT/$cohort_moniker.ag_gbs_qc_prism >> $OUT_ROOT/ag_gbs_qc_prism_targets.txt script=$OUT_ROOT/${cohort_moniker}.sh if [ -f $script ]; then if [ ! $FORCE == yes ]; then @@ -176,16 +177,13 @@ function get_targets() { $GBS_PRISM_BIN/list_keyfile.sh -s $libname -f $fcid -e $enzyme -g $gbs_cohort -q $qc_cohort -t qc > $OUT_ROOT/${cohort_moniker}.key $GBS_PRISM_BIN/list_keyfile.sh -s $libname -f $fcid -e $enzyme -g $gbs_cohort -q $qc_cohort -t unblind_script > $OUT_ROOT/${cohort_moniker}.unblind.sed - - # get the name of the fastq files - #fastq_filenames="" - - + $GBS_PRISM_BIN/list_keyfile.sh -s $libname -f $fcid -e $enzyme -g $gbs_cohort -q $qc_cohort -t files > $OUT_ROOT/${cohort_moniker}.filenames echo "#!/bin/bash cd $OUT_ROOT -#./demultiplex_prism.sh [-h] [-n] [-d] [-x gbsx|tassel3_qc|tassel3] [-l sample_info ] [-e enzymeinfo] -O outdir input_file_name(s) +mkdir -p $cohort # run demultiplexing +./demultiplex_prism.sh -x tassel3_qc -l $OUT_ROOT/${cohort_moniker}.key -e $enzyme -O $OUT_ROOT/$cohort \`cat $OUT_ROOT/${cohort_moniker}.filenames | awk '{print \$2}' -\` # run genotyping " > $script chmod +x $script @@ -203,7 +201,7 @@ function fake_prism() { function run_prism() { # do genotyping cd $OUT_ROOT - make -f ag_gbs_qc_prism.sh -d -k --no-builtin-rules -j 16 `cat $OUT_ROOT/ag_gbs_qc_prism_targets.txt` > $OUT_ROOT/ag_gbs_qc_prism.log 2>&1 + make -f ag_gbs_qc_prism.mk -d -k --no-builtin-rules -j 16 `cat $OUT_ROOT/ag_gbs_qc_prism_targets.txt` > $OUT_ROOT/ag_gbs_qc_prism.log 2>&1 # run summaries } diff --git a/demultiplex_prism.mk b/demultiplex_prism.mk new file mode 100644 index 0000000..9a58333 --- /dev/null +++ b/demultiplex_prism.mk @@ -0,0 +1,24 @@ +# genotype_priosm main makefile +#*************************************************************************************** +# references: +#*************************************************************************************** +# make: +# http://www.gnu.org/software/make/manual/make.html +# + + +%.demultiplex_prism: + $*.sh + date > $@ + +############################################## +# specify the intermediate files to keep +############################################## +.PRECIOUS: %.log %.genotype_priosm + +############################################## +# cleaning - not yet doing this using make +############################################## +clean: + echo "no clean for now" + diff --git a/demultiplex_prism.sh b/demultiplex_prism.sh index 7bfd3ca..a11403c 100755 --- a/demultiplex_prism.sh +++ b/demultiplex_prism.sh @@ -149,10 +149,9 @@ function echo_opts() { # function configure_env() { # copy scripts we need to outfolder - cd $SEQ_PRISMS_BIN - cp ../demultiplex_prism.sh $OUT_DIR - cp ../seq_prisms/data_prism.py $OUT_DIR - cp ../gbs_prism.mk $OUT_DIR + cd $GBS_PRISM_BIN + cp demultiplex_prism.sh $OUT_DIR + cp demultiplex_prism.mk $OUT_DIR cp $SAMPLE_INFO $OUT_DIR cp $ENZYME_INFO $OUT_DIR @@ -175,6 +174,11 @@ function check_env() { echo "SEQ_PRISMS_BIN not set - exiting" exit 1 fi + if [ -z "$GBS_PRISM_BIN" ]; then + echo "GBS_PRISM_BIN not set - exiting" + exit 1 + fi + } function get_targets() { @@ -342,7 +346,7 @@ function fake_prism() { function run_prism() { # do genotyping - make -f gbs_prism.mk -d -k --no-builtin-rules -j 16 `cat $OUT_DIR/demultiplex_targets.txt` > $OUT_DIR/demultiplex_prism.log 2>&1 + make -f demultiplex_prism.mk -d -k --no-builtin-rules -j 16 `cat $OUT_DIR/demultiplex_targets.txt` > $OUT_DIR/demultiplex_prism.log 2>&1 # run summaries } diff --git a/genotype_prism.mk b/genotype_prism.mk index a2a1b32..e6a6a0f 100644 --- a/genotype_prism.mk +++ b/genotype_prism.mk @@ -7,11 +7,7 @@ # -%.genotype_priosm: - $*.sh - date > $@ - -%.demultiplex_prism: +%.genotype_prism: $*.sh date > $@