File refactoring
This commit is contained in:
121
workflow/.old/templates/qhtcp/REMcMaster3.sh
Normal file
121
workflow/.old/templates/qhtcp/REMcMaster3.sh
Normal file
@@ -0,0 +1,121 @@
|
||||
#REMcMaster.sh Is to perform all REMc task and to operate from source directory REMc
|
||||
# Gain permissions to the perl scripts for GTF
|
||||
currentDir="$PWD"
|
||||
GTFpath="$currentDir/GTF"
|
||||
chmod -R u+rwx "$GTFpath"
|
||||
#Step 0 Perform JoinInteractExps3dev.R to create the "REMcRdy_lm_only.csv" and "Shift_only.csv" files
|
||||
Rscript JoinInteractExps3dev.R
|
||||
|
||||
#Step1 Perform REMc java utility using file input file REMcRdy_lm_only.csv
|
||||
#and producing REMcRdy_lm_only.csv-finalTable.csv
|
||||
sh ./REMcJar2.sh
|
||||
wait
|
||||
#wait isn't holding process until Jar is complete. Should take at least 3minuites
|
||||
|
||||
#Step 2
|
||||
if [ -f "REMcRdy_lm_only.csv-finalTable.csv" ]; then
|
||||
echo "REMcRdy_lm_only.csv-finalTable.csv exists."
|
||||
#Jarflag= 1
|
||||
#echo "Jarflag = $Jarflag"
|
||||
echo "REMcJar... .sh completed"
|
||||
else
|
||||
echo "REMcJar failed"
|
||||
wait
|
||||
exit
|
||||
fi
|
||||
echo "start Step2"
|
||||
#Step2 If REMcJar successfully produces "REMcRdy_lm_only.csv-finalTable.csv"
|
||||
#then add shift values back to the "REMcRdy_lm_only.csv-finalTable.csv"
|
||||
#and output it as "REMcWithShift.csv" to be used to produce the REMc Heatmaps.
|
||||
if [ -f "REMcRdy_lm_only.csv-finalTable.csv" ]; then
|
||||
echo "REMcRdy_lm_only.csv-finalTable.csv exists."
|
||||
Rscript ./AddShiftVals2.R
|
||||
wait
|
||||
echo "AddShiftVals2.R executed"
|
||||
fi
|
||||
|
||||
#Step3 Execute REMcHeatmaps_zscores.R contingent upon "REMcWithShift.csv" being created.
|
||||
cd REMcHeatmaps
|
||||
if [ -f "REMcWithShift.csv" ]; then
|
||||
echo "REMcWithShift.csv exists."
|
||||
fi
|
||||
|
||||
rm *.pdf #Remove .pdf files to be sure of a clean 'slate'
|
||||
|
||||
cd ..
|
||||
Rscript REMcHeatmaps_zscores.R
|
||||
echo "REMcHeatmaps executed"
|
||||
wait
|
||||
cd REMcHeatmaps
|
||||
pdftk *.pdf output compiledREMcHeatmaps.pdf
|
||||
|
||||
#Step3b Execute REMcHeatmaps_Z_lm_wDAmPs_andHomology_221212.R contingent upon "REMcWithShift.csv" being created in ../REMcHeatmapsWithHomology.
|
||||
#cp ./Homology/REMcWithShift.csv ./REMcHeatmapsWithHomology/REMcWithShift.csv
|
||||
cp ./REMcWithShift.csv ../REMcHeatmapsWithHomology/
|
||||
cd ../REMcHeatmapsWithHomology
|
||||
if [ -f "REMcWithShift.csv" ]; then
|
||||
echo "REMcWithShift.csv exists."
|
||||
fi
|
||||
rm ./Homology/*.pdf #Remove .pdf files to be sure of a clean 'slate'
|
||||
rm ./Homology/*.csv #Remove .csv files to be sure of a clean 'slate'
|
||||
|
||||
Rscript REMcHeatmaps_Z_lm_wDAmPs_andHomology_221212.R REMcWithShift.csv Homology 17_0503_DAmPs_Only.txt Yeast_Human_Homology_Mapping_biomaRt_18_0920.csv
|
||||
|
||||
echo "REMcHeatmaps_Z_lm_wDAmPs_andHomology_221212.R executed"
|
||||
wait
|
||||
cd Homology
|
||||
pdftk *.pdf output compiledREMcHomologyHeatmaps.pdf
|
||||
|
||||
echo "pdftk executed"
|
||||
cd ../..
|
||||
|
||||
#Step4 Begin the process of GTF contingent upon "REMcRdy_lm_only.csv-finalTable.csv"
|
||||
# being produced by "REMcJar.sh" (Step1)
|
||||
if [ -f "REMcRdy_lm_only.csv-finalTable.csv" ]; then
|
||||
echo "REMcRdy_lm_only.csv-finalTable.csv exists."
|
||||
python3 DconJG2.py REMcRdy_lm_only.csv-finalTable.csv GTF/Process/
|
||||
#python2 DconJG.py REMcRdy_lm_only.csv-finalTable.csv 12 GTF/Process/
|
||||
else
|
||||
echo "DconJG2.py failed"
|
||||
wait
|
||||
exit
|
||||
|
||||
fi
|
||||
|
||||
if [ -f "GTF/Process/REMcRdy_lm_only/1-0-0-finaltable.csv" ]; then
|
||||
echo "Begin copying REMcRdy_lm_only to /Function and /Component"
|
||||
cp -r GTF/Process/REMcRdy_lm_only GTF/Function/
|
||||
echo "Copy to Function complete"
|
||||
wait
|
||||
cp -r GTF/Process/REMcRdy_lm_only GTF/Component/
|
||||
echo "Copy to Component complete"
|
||||
|
||||
wait
|
||||
|
||||
else
|
||||
echo "COPY failed"
|
||||
wait
|
||||
exit
|
||||
|
||||
fi
|
||||
|
||||
if [ -f "GTF/Function/REMcRdy_lm_only/1-0-0-finaltable.csv" ]; then
|
||||
echo "Begin concurrent running of GTF tasks"
|
||||
sh ./mProcess.sh &
|
||||
sh ./mFunction.sh &
|
||||
sh ./mComponent.sh &
|
||||
|
||||
echo "GTF ontologies run in background"
|
||||
|
||||
else
|
||||
echo "GTFontologies failed"
|
||||
|
||||
fi
|
||||
|
||||
wait
|
||||
|
||||
Rscript CompileGTF.R
|
||||
wait
|
||||
|
||||
echo "REMcMaster3.sh Finished"
|
||||
|
||||
Reference in New Issue
Block a user