#!/bin/bash

###########################################
# The statistics pipeline is located here :
pipePath="/t1-data/data/hugheslab/jelenatools/CC/statistics"
###########################################

# This is wrapper around Marieke Oudelaar's script capture_R_analysis1.pl
# ( which is a combination of James Davies' original statistical analyses for captureC data)

###########################################

pathToUpstreamFolder="/t1-data/usr/....../Promoter_capture"

sampleFolders="Analysis_WT_EB5,Analysis_WT_EB6,Analysis_WT_EB7,Analysis_INSERT_Sp5,Analysis_INSERT_Sp6,Analysis_INSERT_Sp15"
CCversion="CB4" # or CC4
condition="INSERT" # Part of the CONDITION folder name which identifies it as "condition" folder
control="WT" # Part of the CONDITION folder name which identifies it as "condition" folder


# Then you select which oligos of interest you want to analyse.
# These are oligo names from your oligo file,
#  (except for combined globines the names will be these -  Hba : HbaCombined Hbb : HbbCombined ).
oligos="Mitof,SOX2,nanog"

# In which genome your sample was mapped ?
genome="mm9"

# Which name you would like to give your sample (and your public data hub) ?
name="myAnalysis"

# Where would you like to put it in your public directory ?
# (this dir does not need to exist beforehand)
publicFolder="/public/username/capturedata/analysis"


#############################################
# We are now here (the current directory) - the directory we are now running the pipe :

rundir=$( pwd )


# Tell where we are - print it to output :

echo "Running statisticsRunner.sh in folder ${rundir}"


# Tell the command to user - print it to output :

echo
echo ${pipePath}/statisticsRunner.sh
echo "            --genome ${genome} " 
echo "            --pf ${publicFolder} "
echo "            --condition ${condition} "
echo "            --control ${control} "
echo "            --name ${name} "
echo "            --path ${pathToUpstreamFolder} "
echo "            --folders ${sampleFolders} "
echo "            --oligos ${oligos} "
echo "            --ccversion ${CCversion}"
echo


# Run the command :

${pipePath}/statisticsRunner.sh --genome ${genome} --pf ${publicFolder} --condition ${condition} --control ${control} --name ${name} --path ${pathToUpstreamFolder} --folders ${sampleFolders} --oligos ${oligos} --ccversion ${CCversion}



# Tell the user that we are now finished :

echo "All done !"