Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
N
ngs_tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
bioinfo
ngs_tools
Commits
3417e5b5
Commit
3417e5b5
authored
May 03, 2018
by
Holger Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modernized dge_merge_treps
parent
0dea3358
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
20 deletions
+10
-20
dge_workflow/dge_utils.sh
dge_workflow/dge_utils.sh
+10
-20
No files found.
dge_workflow/dge_utils.sh
View file @
3417e5b5
...
...
@@ -259,36 +259,26 @@ fi
local
bam_dir
=
$1
;
# bam_dir=$baseDir/mapped_trim/
local
bio_
rep
s
=
$2
;
# bio_samples="test,lala"
local
bio_
sample
s
=
$2
;
# bio_samples="test,lala"
if
[
!
-d
"
$bam_dir
"
]
;
then
echo
"bam file directory does not exist!
$usage
'"
>
&2
;
return
;
fi
if
[
$(
echo
"
$
bio_samples
"
|
grep
","
|
wc
-l
)
-ne
1
]
;
then
if
[
$(
echo
"
$
{
bio_samples
}
"
|
grep
","
|
wc
-l
)
-ne
1
]
;
then
echo
"Invalid biosample spec!
$usage
'"
>
&2
;
return
;
fi
#for sample in aRG bRG N; do
for
sample
in
$(
echo
$bio_samples
|
tr
","
,
" "
)
;
do
# DEBUG sample=Insm1_1103
## todo use joblist instead here
(
sampleBams
=
$(
find
$bam_dir
-name
'*bam'
|
grep
-v
unmapped |
grep
$sample
)
echo
"merging
$sample
with
$sampleBams
"
## todo add read-groups to bam files
if
[
1
-eq
$(
echo
"
$sampleBams
"
|
wc
-l
)
]
;
then
cp
$sampleBams
$sample
.bam
else
samtools merge -
$(
echo
$sampleBams
| xargs
echo
)
| samtools
sort
-
$sample
fi
samtools index
$sample
.bam
)
&
for
condition
in
$(
echo
${
bio_samples
}
|
tr
","
,
" "
)
;
do
echo
merging
${
condition
}
bamFiles
=
$(
ls
${
bam_dir
}
/
${
condition
}*
.bam | xargs
echo
)
jl submit
--jl
.merge_reps
"
samtools merge --threads 10 -
${
bamFiles
}
| samtools sort -T
${
condition
}
-o
${
condition
}
.bam -
samtools index
${
condition
}
.bam
"
done
jl
wait
.merge_reps
}
export
-f
dge_merge_treps
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment