Skip to content

Samtools mpileup [E::hts_open_format] Failed to open file .bam #1228

@alnam3

Description

@alnam3

Are you using the latest version of samtools and HTSlib? If not, please specify.

(run samtools --version)
Yes

Please describe your environment.

  • OS (run uname -sr on Linux/Mac OS or wmic os get Caption, Version on Windows)
    Linux 5.3.0-46-generic
  • machine architecture (run uname -m on Linux/Mac OS or wmic os get OSArchitecture on Windows)
    x86_64
  • compiler (run gcc --version or clang --version)
    7.5.0

Please specify the steps taken to generate the issue, the command you are running and the relevant output.

I'm mapping sequences and then doing SNP calling, using the following steps:

minimap2 -ax map-ont ref.fas mydata.fq | samtools view -b | samtools sort - > outfile.sam 
samtools mpileup -q 10 -aa -d 8000 -uf refs.fas outfile.sam | bcftools call -m > outfile.vcf

And get the error:

[E::hts_open_format] Failed to open file outfile.bam
[mpileup] failed to open outfile.bam : No such file or directory
Failed to read from standard input: unknown file type

I checked, my bam file is in the right folder and I can read it with samtools view.
I recently updated to samtools1.10, so I thought this might be the problem, but checked with an older version (samtools1.7) on files that used to work and it isn't working anymore. What can have happened?
And I know the u option is deprecated but bcftools mpileup gave me a similar error.

Thanks a lot!

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