Adjust ulimit open file handle limit on Mac OS X Sierra for GATK
1
0
Entering edit mode
4.2 years ago
gaelgarcia05 ▴ 280

Hi,

I'm trying to run the VariantsToBinaryPed tool from GATK3, but it seems that my open file handle limit is too small for it to successfully run.

I've tried increasing the limit using ulimit, as shown below, but the GATK command still fails.

The command:

 > java -jar GenomeAnalysisTK.jar \
   -T VariantsToBinaryPed \
   -R Homo_sapiens_assembly38.fasta \
   -V  ~/vcf/snp.indel.recal.splitMA_norm.vcf.bgz\
   -m ~/03_IdentityCheck/KING/targeted_seq_ped_clean.fam\
   -bed output.bed\
   -bim output.bim\
   -fam output.fam\
   --minGenotypeQuality 0

returns this error:

    ERROR MESSAGE: An error occurred because there were too many files 
    open concurrently; your system's open file handle limit is probably too small.  
    See the unix ulimit command to adjust this limit or 
    ask your system administrator for help.

Following the advice given here, I ran:

echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
sudo ulimit -n 65536 65536

and added this line to my .bash_profile and sourced it:

ulimit -n 65536 65536

So that now, when I run ulimit -n, I get:

65536

However, I still get the same error from GATK:

    ERROR MESSAGE: An error occurred because there were too many files 
    open concurrently; your system's open file handle limit is probably too small.  
    See the unix ulimit command to adjust this limit or 
    ask your system administrator for help.

Is there anything else I can do to avoid this error?

Thank you.

gatk macosx ulimit gatk3 unix • 2.7k views
ADD COMMENT
0
Entering edit mode
4.2 years ago

Looks like methods for changing kernel parameters (like open file handle limits) change from version to version of OS X.

The approach in the blog you linked is for Yosemite.

If the issue is related to file handle limits, you may get better results from the Sierra-specific approach outlined here.

ADD COMMENT

Login before adding your answer.

Traffic: 1400 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