From d9d4d35a3ef7142b255269c99f1c08259380bbe7 Mon Sep 17 00:00:00 2001
From: "Gervaise H. Henry" <gervaise.henry@utsouthwestern.edu>
Date: Wed, 6 Jan 2021 22:49:29 -0600
Subject: [PATCH] Move new bdbag fetch code from test

---
 workflow/scripts/bdbag_fetch.sh | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/workflow/scripts/bdbag_fetch.sh b/workflow/scripts/bdbag_fetch.sh
index 117340b..761b9c3 100644
--- a/workflow/scripts/bdbag_fetch.sh
+++ b/workflow/scripts/bdbag_fetch.sh
@@ -2,15 +2,7 @@
 
 if [ -z "${3}" ]
 then
-    bdbag --resolve-fetch all --fetch-filter filename\$*fastq.gz ${1}
-    for i in $(find */ -name "*R*.fastq.gz")
-    do
-        path=${2}.$(echo ${i##*/} | grep -o "R[1,2].fastq.gz")
-        cp ${i} ./${path}
-    done
-elif [ "${3}" == "TEST" ]
-then
-    bdbag --materialize ${1} --debug
+        bdbag --materialize ${1} --debug
     validateError=true
     bdbag --validate full ${1} && validateError=false
     if validateError
@@ -27,4 +19,12 @@ then
     then
         exit 1
     fi
+    for i in $(find */ -name "*R*.fastq.gz")
+    do
+        path=${2}.$(echo ${i##*/} | grep -o "R[1,2].fastq.gz")
+        cp ${i} ./${path}
+    done
+elif [ "${3}" == "TEST" ]
+then
+    bdbag --validate structure --validate-profile ${1} --debug
 fi
-- 
GitLab