Skip to content

alignmentSieve v3.5.6 creates too many open files #1421

@kijiy

Description

@kijiy

Hi,

I found that alignmentSieve in deepTools v3.5.6 creates too many tmp files. I don't know if this is specific to my environment, but I report it here as a potential bug.

# Filter out low-quality mappers
alignmentSieve -p 1 -b bowtie_out.bam --minMappingQuality 30 --samFlagInclude 2 -o MAPQ30.bam

# Output
[E::hts_open_format] Failed to open file "/tmp/_deeptools_pq0n_woe.bam" : Too many open files
Traceback (most recent call last):
  File "/path/to/alignmentSieve", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/path/to/deeptools/alignmentSieve.py", line 409, in main
    pysam.samtools.cat(*arguments)
  File "/path/to/pysam/utils.py", line 84, in __call__
    raise SamtoolsError(
pysam.utils.SamtoolsError: "samtools returned with error 1: stdout=, stderr=samtools cat: fail to open file '/tmp/_deeptools_pq0n_woe.bam': Too many open files\n"

# Check the version
alignmentSieve --version
alignmentSieve 3.5.6

I realized this created ~3000 temporary files in the tmpdir, which probably caused the bug.

ls -lh /tmp/_deeptools_* | grep myusername | wc -l
2994

This error does not occur when using alignmentSieve 3.5.5.

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions