Commit 6d74c7a4 authored by Blaise Li's avatar Blaise Li
Browse files

Trying to set memory limits.

niceload may not be the appropriate way.
parent 6267d53a
......@@ -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]]
"""
......
......@@ -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."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment