Question: Error in freebayes SNP calling
0
gravatar for evelyn
3 months ago by
evelyn110
evelyn110 wrote:

Hello,

I am using freebayes to make a vcf from a list of .bam files (duplicates removed):

RUN=${SLURM_ARRAY_TASK_ID}
LIST_OF_BAMS=/path/list_of_bam.txt

    freebayes \
              -f        /path/genome.fasta \
              -L       ${LIST_OF_BAMS} \
              -E      1 \
              -T       0.01 \
              -p       2 \
              -F  0.2 \
              -C   2 \
              --min-coverage  3 \
              -m     1 \
              --min-base-quality   20 \
              --report-genotype-likelihood-max \ 
              -vcf all_SNPs_pt${SLURM_ARRAY_TASK_ID}.vcf

But it gives error:

[E::hts_open_format] Failed to open file  
ERROR(freebayes): Could not open input BAM file

I have checked the bam files are there in the mentioned path. Thank you for any help to solve this error.

snp • 201 views
ADD COMMENTlink modified 3 months ago by Biostar ♦♦ 20 • written 3 months ago by evelyn110

Just in case, ensure you have read permissions on the BAM files.

ADD REPLYlink written 3 months ago by _r_am31k

Which version of freebayes are you using?

ADD REPLYlink written 3 months ago by _r_am31k

I am using freebayes/1.3.2 and I created the bam files in a different directory. Do I need to have access permission for using files that I created?

ADD REPLYlink written 3 months ago by evelyn110

You need to be able to read the files. If you created the files, you should ideally have all necessary permissions but there's no harm in double checking. Also, make sure all the files listed in the /path/list_of_bam.txt are indeed BAM files.

ADD REPLYlink written 3 months ago by _r_am31k

Yes, they indeed are BAM files but it still does not work.

ADD REPLYlink written 3 months ago by evelyn110

Does it work with one BAM file (just hard code path) ? Can the SLURM worker node actually see the file ?

ADD REPLYlink written 3 months ago by colindaven2.5k

Hi, I used this command line for one bam file out of the list I have:

freebayes \
          -f        /path/genome.fasta \
     /path/sample1.bam
          -E         1 \
          -T                  0.01 \
          -p                 2 \
          -F  0.2 \
          -C   2 \
          --min-coverage            3 \
          -m     1 \
          --min-base-quality        20 \
          --report-genotype-likelihood-max \ 
          -vcf all_SNPs_pt.vcf

And it started creating the vcf file.

ADD REPLYlink written 3 months ago by evelyn110

Well, you've narrowed it down greatly to the variables (in my opinion). Not sure about the solution. I'm a SLURM user and cluster admin myself, but using variables is sometimes a little tough/weird. Maybe it's possible to hack the list of BAMs in there as a comma separated list(string). Alternatively you might look at solutions for this in Nextflow or snakemake ....

ADD REPLYlink written 3 months ago by colindaven2.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2154 users visited in the last hour