Skip to content

Commit

Permalink
initial alpha testing (demultiplex test OK)
Browse files Browse the repository at this point in the history
  • Loading branch information
afmcc committed Aug 1, 2018
1 parent 8cc75cd commit 95ba379
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
14 changes: 6 additions & 8 deletions ag_gbs_qc_prism.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
}
Expand Down
24 changes: 24 additions & 0 deletions demultiplex_prism.mk
Original file line number Diff line number Diff line change
@@ -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"

14 changes: 9 additions & 5 deletions demultiplex_prism.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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() {
Expand Down Expand Up @@ -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
}
Expand Down
6 changes: 1 addition & 5 deletions genotype_prism.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
#


%.genotype_priosm:
$*.sh
date > $@

%.demultiplex_prism:
%.genotype_prism:
$*.sh
date > $@

Expand Down

0 comments on commit 95ba379

Please sign in to comment.