Question: Running Freebayes on 100+ Samples
0
gravatar for tpaisie
11 months ago by
tpaisie70
University of Florida
tpaisie70 wrote:

Hi everyone,

So I've been using Freebayes for a while now to do my variant calling with usually around 100-200 samples and I've never had a problem running it before. I usually make a text file with my list of bam files (everything is in the same directory and my bam files are indexed). I've actually used this same samples in the past calling variants with Freebayes, but now I cannot get Freebayes to run on these samples to save my life! I keep getting the following error:

[E::hts_open_format] Failed to open file 2012EL-1410.bam ERROR(freebayes): Could not open input BAM file: 2012EL-1410.bam

2012EL-1410.bam is just the name of the bam file that is first on my list. I've changed the read groups and everything for my samples. Like I said, I did the same exact pipeline I did before and never had a problem with running Freebayes and now I can't get it to run. I'm wondering if there was an updated and I need to do something differently but I can't find any info about what to do. Here is my Freebayes command:

freebayes -L $FILE1 -f $REF -v $FILE2 -T 0.001 -p 1 -i -X -n 0 -E 3 --min-repeat-size 5 -m 1 -q 20 -R 0 -Y 0 -e 1000 -F 0.5 -C 2 -3 0 -G 1 -! 0 -d

I do not believe there is a problem with my text file, its formatted with each bam file listed on one line, then the next bam file on the next line, one after the other.

Now just to test it out, I ran Freebayes with a list of 2 samples and it started running! So I'm not sure if something has changed in regards to the number of samples you can run with Freebayes now, because I ran it not that long ago with over 250 bam files with no problem and now I can't get it to run with 100 bam files.

The version of Freebayes I'm using is v1.1.0-20170823. Has anyone else had this problem and could help me out?? I would be appreciate it so much!!

Thanks!!

snp bacteria variant calling • 573 views
ADD COMMENTlink modified 11 months ago • written 11 months ago by tpaisie70

Is the file freebayes is complaining about in the same folder from where you start freebayes?

Check if there are any white-spaces around the filename in your text file and/or the file name.

fin swimmer

ADD REPLYlink written 11 months ago by finswimmer12k

Yeah I have, it's still not running. I've checked that many times, because originally I did think that was the problem.

ADD REPLYlink written 11 months ago by tpaisie70

You've said you have tested it with a list of two samples and it works. Was the same sample from the error message above in it?

ADD REPLYlink written 11 months ago by finswimmer12k

Those samples were part of the list, but it seems like it never even gets past the first sample. I took out the sample I mentioned in the error out of the list to see if it was just sample, and it just gave the same error with the next sample. So I have no idea what is going on.

ADD REPLYlink written 11 months ago by tpaisie70

So I did some looking at my bam file headers and noticed that some of the samples were ran with different versions of bowtie2. Do you think that could potentially be the issue?

ADD REPLYlink written 11 months ago by tpaisie70
1
gravatar for finswimmer
11 months ago by
finswimmer12k
Germany
finswimmer12k wrote:

If something wrong with the header freebayes would complain about this. Could you check with which character the lines terminates in your text file?

$ file samples.txt

This should print:

samples.txt: ASCII text

If the result is this:

samples.txt: ASCII text, with CRLF line terminators

we have found the problem. You can correct this than with dos2unix, by simply type dos2unix samples.txt

fin swimmer

ADD COMMENTlink written 11 months ago by finswimmer12k
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: 1995 users visited in the last hour