Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RNA-seq
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
GUDMAP_RBK
RNA-seq
Commits
92f9b500
Commit
92f9b500
authored
5 years ago
by
Gervaise Henry
Browse files
Options
Downloads
Patches
Plain Diff
Add file rename in fetch.txt to modifyFetch.py
parent
b89416b5
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!37
v0.0.1
,
!4
Develop
,
!2
Resolve "process_getData"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
workflow/rna-seq.nf
+1
-14
1 addition, 14 deletions
workflow/rna-seq.nf
workflow/scripts/modifyFetch.py
+7
-1
7 additions, 1 deletion
workflow/scripts/modifyFetch.py
workflow/scripts/renameFastq.sh
+0
-12
0 additions, 12 deletions
workflow/scripts/renameFastq.sh
with
8 additions
and
27 deletions
workflow/rna-seq.nf
+
1
−
14
View file @
92f9b500
...
...
@@ -9,9 +9,6 @@ params.outDir = "${baseDir}/../output"
// Parse input variables
deriva = file(params.deriva)
deriva.copyTo('~/.bdbag/deriva-cookies.txt')
//deriva = Channel
// .fromPath(params.deriva)
// .ifEmpty { exit 1, "deriva cookie file not found: ${params.deriva}" }
bdbag = Channel
.fromPath(params.bdbag)
.ifEmpty { exit 1, "bdbag zip file not found: ${params.bdbag}" }
...
...
@@ -19,7 +16,7 @@ bdbag = Channel
outDir = params.outDir
/*
* splitData: split bdbag files by replicate so fetch can occure in parallel
* splitData: split bdbag files by replicate so fetch can occure in parallel
, and rename files to replicate rid
*/
process splitData {
tag "${bdbag.baseName}"
...
...
@@ -27,7 +24,6 @@ process splitData {
input:
file bdbag
file deriva
output:
file("Replicate_*.zip") into bdbagSplit mode flatten
...
...
@@ -39,15 +35,11 @@ process splitData {
"""
hostname
ulimit -a
ln -sf `readlink -e ${deriva}` ~/.bdbag/deriva-cookies.txt
study=`echo "${bdbag}" | cut -d'.' -f1`
echo LOG: \${study}
unzip ${bdbag}
echo LOG: bdgag unzipped
python3 ${baseDir}/scripts/modifyFetch.py --fetchFile \${study}
cd \${study}
bash ${baseDir}/scripts/fixFetch.sh
cd ..
echo LOG: fetch file filtered for only .fastq.gz
python3 ${baseDir}/scripts/splitFetch.py --fetchFile \${study}
echo LOG: fetch file split by replicates
...
...
@@ -67,7 +59,6 @@ process getData {
publishDir "${outDir}/temp/${task.process}", mode: "symlink"
input:
file deriva
each rep from bdbagSplit
output:
...
...
@@ -79,15 +70,11 @@ process getData {
ulimit -a
echo LOG:\${http_proxy}
export https_proxy=\${http_proxy}
ln -sf `readlink -e ${deriva}` ~/.bdbag/deriva-cookies.txt
replicate=\$(echo "${rep}" | cut -d'.' -f1 | rev | cut -f1 -d '/' | rev)
echo LOG: \${replicate}
echo LOG: deriva cookie loaded
unzip ${rep}
echo LOG: replicate bdbag unzipped
sh ${baseDir}/scripts/bdbagFetch.sh \${replicate}
echo LOG: replicate bdbag fetched
sh ${baseDir}/scripts/renameFastq.sh \${replicate}
echo LOG: fastq.gz files renamed to replicate RID
"""
}
This diff is collapsed.
Click to expand it.
workflow/scripts/modifyFetch.py
+
7
−
1
View file @
92f9b500
...
...
@@ -2,6 +2,7 @@
import
argparse
import
pandas
as
pd
import
re
def
get_args
():
parser
=
argparse
.
ArgumentParser
()
...
...
@@ -12,8 +13,13 @@ def get_args():
def
main
():
args
=
get_args
()
fetchFile
=
pd
.
read_csv
(
args
.
fetchFile
+
"
/fetch.txt
"
,
sep
=
"
\t
"
,
header
=
None
)
fileFile
=
pd
.
read_csv
(
args
.
fetchFile
+
"
/data/File.csv
"
,
sep
=
"
,
"
,
header
=
0
)
fileFile_filtered
=
fileFile
[
fileFile
[
"
File_Type
"
]
==
"
FastQ
"
]
fetchFile_filtered
=
fetchFile
[
fetchFile
[
2
].
str
[
-
9
:]
==
"
.fastq.gz
"
]
fetchFile_filtered
.
to_csv
(
args
.
fetchFile
+
"
/fetch.txt
"
,
sep
=
"
\t
"
,
header
=
False
,
index
=
False
)
fetchFile_filtered_renamed
=
fetchFile_filtered
for
i
in
fileFile_filtered
[
"
File_Name
"
]:
fetchFile_filtered_renamed
[
2
][
fetchFile_filtered_renamed
[
2
].
str
.
contains
(
i
,
regex
=
False
)]
=
fetchFile_filtered_renamed
[
2
][
fetchFile_filtered_renamed
[
2
].
str
.
contains
(
i
,
regex
=
False
)].
values
[
0
].
replace
(
re
.
sub
(
"
\.R.\.fastq\.gz
"
,
""
,
i
),
fileFile_filtered
[
"
Replicate_RID
"
][
fileFile_filtered
[
"
File_Name
"
]
==
i
].
values
[
0
])
fetchFile_filtered_renamed
.
to_csv
(
args
.
fetchFile
+
"
/fetch.txt
"
,
sep
=
"
\t
"
,
header
=
False
,
index
=
False
)
if
__name__
==
'
__main__
'
:
main
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
workflow/scripts/renameFastq.sh
deleted
100644 → 0
+
0
−
12
View file @
b89416b5
#!/bin
while
read
loc checksum fileLocation
;
do
file
=
$(
echo
${
fileLocation
##*/
}
)
;
fileName
=
$(
echo
${
file
%.R*.fastq.gz
}
)
;
fileExt
=
$(
echo
${
file
##
${
fileName
}
.
}
)
;
while
IFS
=
","
read
RID Study_RID Experiment_RID Replicate_RID Caption File_Type File_Name URI File_size MD5 GEO_Archival_URL dbGaP_Accession_ID Processed Notes Principal_Investigator Consortium Release_Date RCT RMT Legacy_File_RID GUDMAP_NGF_OID GUDMAP_NGS_OID
;
do
if
[
"
${
file
}
"
==
"
${
File_Name
}
"
]
;
then
find
.
-type
f
-name
"
${
file
}
"
-execdir
mv
{}
${
Replicate_RID
}
.
${
fileExt
}
';'
;
fi
;
done
<
$1
/data/File.csv
;
done
<
$1
/fetch.txt
;
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment