From 829a61870ffee62aaff7f7beec4238732deb200b Mon Sep 17 00:00:00 2001
From: "Gervaise H. Henry" <gervaise.henry@utsouthwestern.edu>
Date: Mon, 28 Dec 2020 13:09:38 -0600
Subject: [PATCH] Update naming convention in dataQC

---
 workflow/rna-seq.nf         | 8 ++++----
 workflow/scripts/tinHist.py | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/workflow/rna-seq.nf b/workflow/rna-seq.nf
index 94ad34a..1f0a4b2 100644
--- a/workflow/rna-seq.nf
+++ b/workflow/rna-seq.nf
@@ -1133,8 +1133,8 @@ process dataQC {
     val ends from endsInfer_dataQC
 
   output:
-    path "${repRID}.tin.hist.tsv" into tinHist
-    path "${repRID}.tin.med.csv" into  tinMedInfer_fl
+    path "${repRID}_tin.hist.tsv" into tinHist
+    path "${repRID}_tin.med.csv" into  tinMedInfer_fl
     path "${repRID}.insertSize.inner_distance_freq.txt" into innerDistance
 
   script:
@@ -1157,12 +1157,12 @@ process dataQC {
     if [ "${ends}" == "pe" ]
     then
       echo -e "LOG: calculating inner distances for ${ends}" >> ${repRID}.dataQC.log
-      inner_distance.py -i "${bam}" -o ${repRID}.insertSize -r ./bed/genome.bed
+      inner_distance.py -i "${bam}" -o ${repRID}_insertSize -r ./bed/genome.bed
       echo -e "LOG: calculated" >> ${repRID}.dataQC.log
     elif [ "${ends}" == "se" ]
     then
       echo -e "LOG: creating dummy inner distance file for ${ends}" >> ${repRID}.dataQC.log
-      touch ${repRID}.insertSize.inner_distance_freq.txt
+      touch ${repRID}_insertSize.inner_distance_freq.txt
     fi
     """
 }
diff --git a/workflow/scripts/tinHist.py b/workflow/scripts/tinHist.py
index a95a9c2..ee36bb6 100644
--- a/workflow/scripts/tinHist.py
+++ b/workflow/scripts/tinHist.py
@@ -17,7 +17,7 @@ def get_args():
 
 def main():
     args = get_args()
-    tin = pd.read_csv(args.repRID + '.sorted.deduped.tin.xls',
+    tin = pd.read_csv(args.repRID + '_sorted.deduped.tin.xls',
                       sep="\t", header=0)
 
     hist = pd.cut(tin['TIN'], bins=pd.interval_range(
@@ -42,8 +42,8 @@ def main():
     hist = hist[['TOTAL'] + [i for i in hist.columns if i != 'TOTAL']]
     hist = hist.T.fillna(0.0).astype(int)
     #hist = hist.apply(lambda x: x/x.sum()*100, axis=1)
-    hist.to_csv(args.repRID + '.tin.hist.tsv', sep='\t')
-    medFile = open(args.repRID + '.tin.med.csv', "w")
+    hist.to_csv(args.repRID + '_tin.hist.tsv', sep='\t')
+    medFile = open(args.repRID + '_tin.med.csv', "w")
     medFile.write(str(round(tin['TIN'][(tin['TIN'] != 0)].median(), 2)))
     medFile.close()
 
-- 
GitLab