Hi Christos,
What do you mean by "gstacks breaks"?
Best,
Nicolas
--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/stacks-users.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/stacks-users.
For more options, visit https://groups.google.com/d/optout.
--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users+unsubscribe@googlegroups.com.
I see—I think I know where it comes from, and I was expecting this problem to come up at some point.
TL;DR: This is because of your UNIX configuration does not allow you to open more than (most likely) 1024 files at the same time. The solution is to increase it.
If you run in a shell:
ulimit -n
This will probably be 1024. But if you run
ulimit -Hn
you will most likely see a higher number. Then you can increase
the effective (soft) limit by running e.g.
ulimit -n 4096
before calling stacks/gstacks, or in your ~/.profile (or ~/.bashrc). Then it should work.
The other option is to merge all the samples' matches.bam files
first, into a single catalog.bam file, and then run gstacks, but
you're going to run into the same issue with samtools merge and
will have to do it iteratively. It's much easier to just increase
the limit for open files.
I'll see if the error message can be improved.
Best,
Nicolas
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users...@googlegroups.com.
[E::hts_open_format] Failed to open file /lustre/mngeve/catdata/cleandataplus1/ustacks_M3_out/ACR1_2.matches.bam
Error: Failed to open BAM file '/lustre/mngeve/catdata/cleandataplus1/ustacks_M3_out/ACR1_2.matches.bam'.
Aborted.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks...@googlegroups.com.
Visit this group at https://groups.google.com/group/stacks-users.
For more options, visit https://groups.google.com/d/optout.
--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks...@googlegroups.com.
Visit this group at https://groups.google.com/group/stacks-users.
For more options, visit https://groups.google.com/d/optout.
--
Stacks website: http://catchenlab.life.illinois.edu/stacks/
---
You received this message because you are subscribed to the Google Groups "Stacks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks...@googlegroups.com.
Hi Magdalene,
Could you confirm that the file actually exists at that path and can be opened with samtools?
Best,
Nicolas
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/48b39959-6d83-4d0a-a1c5-55884a1f8f7e%40googlegroups.com.
[E::hts_open_format] Failed to open file ../alignments/cl_f_130.bam
Error: Failed to open BAM file '../alignments/cl_f_130.bam'.
Error: You might need to increase your system's max-open-files limit, see https://groups.google.com/d/msg/stacks-users/GZqJM_WkMhI/m9Hreg4oBgAJ
Aborted.
To unsubscribe from this group and stop receiving emails from it, send an email to stacks...@googlegroups.com.
Hi Benni,
I don't have a pre-made answer, but I would like to point out two things:
* gstacks doesn't actually detect a problem with file limits. It
prints the google groups link whenever the opening of a
BAM file fails while there are already more than 250 successfully
opened BAM files. Do check your files individually (and I believe
the name of the file causing an error is given)
* gstacks should open one file per sample (the *.matches.bam) plus a few more (log/output files, etc). But some unrelated, concurrently running programs may use up a few files as well.
Best,
Nicolas
To unsubscribe from this group and stop receiving emails from it, send an email to stacks-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/b20a418c-6c6a-4d91-ac19-d7ecf258babcn%40googlegroups.com.
Hi Benni,
Julian may have something to add, but you would have to ask the people who did the demultiplexing and/or designed the barcodes.
Best,
Nicolas
To view this discussion on the web visit https://groups.google.com/d/msgid/stacks-users/12415e50-95cf-4582-913e-d1e33714b917n%40googlegroups.com.
ulimit -n 4096 seems to have fixed the problem.
I just wanted to note, for anyone encountering this error, to confirm whether the file number limit is causing the issue just check which one is your (file number limit + 1) file when catting all matches.bam files in your input directory. For instance, my file size limit is 1024, and the sample that couldn't get loaded was sample 1025 in the directory, which confirmed the issue was the file size limit.
Then, as Julian and Nicholas pointed out, check that the erroneous file exists, can be loaded by e.g. samtools, etc.