Skip to content

Commit 7b7f988

Browse files
committed
Added chromatin conformation capture module
1 parent 7f1bc98 commit 7b7f988

File tree

7 files changed

+402
-12
lines changed

7 files changed

+402
-12
lines changed

Code/TEPIC.sh

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Optional parameters:\n
2222
[-i minutes that should be spend at most per chromosome to find matching random regions (default 3)]\n
2323
[-j flag indicating that the reference genome contains a chr prefix]\n
2424
[-t flag indicating that the annotation should be transcript and not gene based]\n
25+
[-h a loop list file containing chromatin contacts]\n
26+
[-s size of the loop window used around a genes promoter to link chromatin loops to genes (default 5000)]\n
2527
[-q parameter to be set if only peak features should be computed (default FALSE)]\n"
2628

2729
#Initialising parameters
@@ -50,8 +52,10 @@ chrPrefix="FALSE"
5052
backgroundRegions=""
5153
onlyPeakFeatures="FALSE"
5254
transcripts="FALSE"
55+
loopWindow=5000
56+
loopList=""
5357
#Parsing command line
54-
while getopts "g:b:o:c:p:d:n:a:w:f:m:e:r:v:k:i:q:yluhxzjt" o;
58+
while getopts "g:b:o:c:p:d:n:a:w:f:m:e:r:v:k:i:q:h:s:yluhxzjt" o;
5559
do
5660
case $o in
5761
g) genome=$OPTARG;;
@@ -78,10 +82,8 @@ case $o in
7882
t) transcripts="TRUE";;
7983
k) backgroundRegions=$OPTARG;;
8084
q) onlyPeakFeatures=$OPTARG;;
81-
h) echo -e $help
82-
exit 1;;
83-
[?]) echo -e $help
84-
exit 1;;
85+
h) loopList=$OPTARG;;
86+
s) loopWindow=$OPTARG;;
8587
esac
8688
done
8789

@@ -248,6 +250,11 @@ then
248250
then
249251
echo "motif_length "$motifLength >> $metadatafile
250252
fi
253+
if [ -n "$loopList" ];
254+
then
255+
echo "loop_list "$loopList >> $metadatafile
256+
echo "loop_window "$loopWindow >> $metadatafile
257+
fi
251258
fi
252259
if [ -n "$randomGenome" ];
253260
then
@@ -425,17 +432,33 @@ fi
425432
if [ -n "$annotation" ];
426433
then
427434
echo "Generating gene scores"
428-
if [ -n "$dnase" ] || [ -n "$column" ] ;
435+
if [ -n $loopList ]
429436
then
430-
if [ "$originalScaling" == "FALSE" ] ;
437+
if [ -n "$dnase" ] || [ -n "$column" ] ;
431438
then
432-
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--peakCoverage" ${prefix}_Peak_Coverage.txt "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts}
439+
if [ "$originalScaling" == "FALSE" ] ;
440+
then
441+
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--peakCoverage" ${prefix}_Peak_Coverage.txt "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts} "--lwindows" ${loopWindow} "--conformationData" ${loopList}
442+
else
443+
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--signalScale" ${prefix}_Scaled_Affinity.txt "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts} "--lwindows" ${loopWindow} "--conformationData" ${loopList}
444+
fi
433445
else
434-
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--signalScale" ${prefix}_Scaled_Affinity.txt "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts}
435-
fi
446+
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--geneBody" $geneBody "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts} "--lwindows" ${loopWindow} "--conformationData" ${loopList}
447+
fi
436448
else
437-
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--geneBody" $geneBody "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts}
449+
if [ -n "$dnase" ] || [ -n "$column" ] ;
450+
then
451+
if [ "$originalScaling" == "FALSE" ] ;
452+
then
453+
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--peakCoverage" ${prefix}_Peak_Coverage.txt "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts}
454+
else
455+
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--signalScale" ${prefix}_Scaled_Affinity.txt "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts}
456+
fi
457+
else
458+
python ${working_dir}/annotateTSS.py ${annotation} ${affinity} "--geneViewAffinity" ${prefix}_Affinity_Gene_View.txt "--windows" $window "--decay" $decay "--geneBody" $geneBody "--geneBody" ${geneBody} "--normaliseLength" ${lengthNorm} "--motifLength" ${motifLength} "--additionalPeakFeatures" ${peakFeatures} "--onlyPeakFeatures" ${onlyPeakFeatures} "--transcript" ${transcripts}
459+
fi
438460
fi
461+
439462
if [ -n "$randomGenome" ] || [ -n "$backgroundRegions" ];
440463
then
441464
if [ -n "$dnase" ] || [ -n "$column" ] ;

0 commit comments

Comments
 (0)