Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Blaise LI
libhts
Commits
6d74c7a4
Commit
6d74c7a4
authored
Jun 05, 2019
by
Blaise Li
Browse files
Trying to set memory limits.
niceload may not be the appropriate way.
parent
6267d53a
Changes
2
Hide whitespace changes
Inline
Side-by-side
libhts/libhts.py
View file @
6d74c7a4
...
...
@@ -239,7 +239,7 @@ bowtie2_function_selector = {
def
make_seeding_function
(
seeding_string
):
"""Generates a function that computes the seeding pattern given a
string representing bowtie2 seeding settings (-L and -i options).
>>> make_seeding_function("-L 6 -i S,1,0.8")(18)
[[0, 6], [4, 10], [8, 14], [12, 18]]
"""
...
...
scripts/sam2indexedbam.sh
View file @
6d74c7a4
...
...
@@ -52,7 +52,6 @@ else
filter
=
"-F 4"
fi
# Test environment variable THREADS
if
[[
${
SAMTOOLS_THREADS
}
]]
then
threads_option
=
"--threads
${
SAMTOOLS_THREADS
}
"
...
...
@@ -60,17 +59,27 @@ else
threads_option
=
""
fi
if
[[
${
SAMTOOLS_MEM
}
]]
then
mem_option
=
"-m
${
SAMTOOLS_MEM
}
"
else
mem_option
=
""
fi
if
[
-e
${
SAM
}
]
then
# -u: output uncompressed bam, to save time when piping to samtools sort
samtools view
${
threads_option
}
-u
${
filter
}
${
SAM
}
| niceload
--mem
500M samtools
sort
${
threads_option
}
-T
${
tmpdir
}
-o
${
SAM
%.
${
ext
}}
_sorted.bam -
||
error_exit
"samtools sort failed"
#samtools view ${threads_option} -u ${filter} ${SAM} | niceload --mem 500M samtools sort ${mem_option} ${threads_option} -T ${tmpdir} -o ${SAM%.${ext}}_sorted.bam - || error_exit "samtools sort failed"
samtools view
${
threads_option
}
-u
${
filter
}
${
SAM
}
| samtools
sort
${
mem_option
}
${
threads_option
}
-T
${
tmpdir
}
-o
${
SAM
%.
${
ext
}}
_sorted.bam -
||
error_exit
"samtools sort failed"
#cat ${SAM} | samtools view ${threads_option} -u ${filter} - | samtools sort ${threads_option} -o ${SAM%.${ext}}_sorted.bam - || error_exit "samtools sort failed"
elif
[
-e
${
SAM
}
.gz
]
then
zcat
${
SAM
}
.gz | samtools view
${
threads_option
}
-u
${
filter
}
- | niceload
--mem
500M samtools
sort
${
threads_option
}
-T
${
tmpdir
}
-o
${
SAM
%.
${
ext
}}
_sorted.bam -
||
error_exit
"samtools sort failed"
#zcat ${SAM}.gz | samtools view ${threads_option} -u ${filter} - | niceload --mem 500M samtools sort ${mem_option} ${threads_option} -T ${tmpdir} -o ${SAM%.${ext}}_sorted.bam - || error_exit "samtools sort failed"
zcat
${
SAM
}
.gz | samtools view
${
threads_option
}
-u
${
filter
}
- | samtools
sort
${
mem_option
}
${
threads_option
}
-T
${
tmpdir
}
-o
${
SAM
%.
${
ext
}}
_sorted.bam -
||
error_exit
"samtools sort failed"
elif
[
-e
${
SAM
}
.bz2
]
then
bzcat
${
SAM
}
.bz2 | samtools view
${
threads_option
}
-u
${
filter
}
- | niceload
--mem
500M samtools
sort
${
threads_option
}
-T
${
tmpdir
}
-o
${
SAM
%.
${
ext
}}
_sorted.bam -
||
error_exit
"samtools sort failed"
#bzcat ${SAM}.bz2 | samtools view ${threads_option} -u ${filter} - | niceload --mem 500M samtools sort ${mem_option} ${threads_option} -T ${tmpdir} -o ${SAM%.${ext}}_sorted.bam - || error_exit "samtools sort failed"
bzcat
${
SAM
}
.bz2 | samtools view
${
threads_option
}
-u
${
filter
}
- | samtools
sort
${
mem_option
}
${
threads_option
}
-T
${
tmpdir
}
-o
${
SAM
%.
${
ext
}}
_sorted.bam -
||
error_exit
"samtools sort failed"
else
echo
"
${
SAM
}
not found, neither .gz or .bz2 versions."
echo
"Aborting."
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment