Error in freebayes SNP calling
0
0
Entering edit mode
3.7 years ago
evelyn ▴ 230

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 • 1.3k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Which version of freebayes are you using?

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 3314 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6