Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum number of contigs in a simulation #2320

Open
teng-gao opened this issue Jul 1, 2018 · 4 comments
Open

Maximum number of contigs in a simulation #2320

teng-gao opened this issue Jul 1, 2018 · 4 comments

Comments

@teng-gao
Copy link

teng-gao commented Jul 1, 2018

It seems mason_simulator crushes if there are >150 contigs in the fasta file.

mason_simulator -ir myfasta.fa -n 5000 -o left.fq -or right.fq

Error message:
MASON SIMULATOR

INITIALIZING__________________________________________________________

Opening reference and variants file ... OK
Initializing fragment-to-contig distribution ... OK
Initializing simulation threads ... OK
Opening output file left.fq ... OK
Opening output file right.fq ...Abort trap: 6

@marehr
Copy link
Member

marehr commented Jul 17, 2018

Hi @teng-gao,

can you attach your file myfasta.fa to the bug report? So that we can recreate your issue?

@Yixuan39
Copy link

Hello @marehr ,

I think I met a similar problem.

The command I used is:

mason_simulator -ir ./simGenome/Cattle/GCF_000003205.7_Btau_5.0.1_genomic.fna --out test/Cattle_sim_R1.fasta --out-right test/Cattle_sim_R2.fasta --out-alignment test/Cattle.sam --num-threads 16 -n 1000000 --illumina-read-length 150

The error I got is:

MASON SIMULATOR

INITIALIZING__________________________________________________________

Opening reference and variants file ... OK
Initializing fragment-to-contig distribution ... OK
Initializing simulation threads ... OK
Opening output file test/Cattle_sim_R1.fasta ... OK
Opening output file test/Cattle_sim_R2.fasta ...[1] 9565 abort mason_simulator -ir ./simGenome/Cattle/GCF_000003205.7_Btau_5.0.1_genomic.fna

The reference data I used is from:
https://www.ncbi.nlm.nih.gov/data-hub/genome/GCF_002263795.2/

Thank you!

@eseiler
Copy link
Member

eseiler commented Apr 24, 2023

Mason seems to open a file handle for each fragment. The default limit is usually 1024 (ulimit -Sn).

If I increase my limit to 1048576 (ulimit -Sn 1048576, you can determine the absolute maximum via ulimit -Hn), simulation works.

Note: The file handle situation is a recurring problem with Mason. However, deferring the opening of the handles, i.e. only opening them when actually needed, would require a major restructuring of the code, which is not feasible for us. Hence, we focus on properly documenting the bahavior and adding checks with useful error output.

@Yixuan39
Copy link

Thank you for the answer! It works.

@SGSSGene SGSSGene reopened this Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants