question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on nanosim_profile while running with NanoSim

See original GitHub issue

Hi there, I’ve been trying to run Camisim with NanoSim to simulate ONT reads. I’ve tested the program with the art simulator and works but I can’t figure out how to run it with NanoSim. The error I’m getting now seems to be related to the simulation profiles and nanosim cant locate them although the path is described in the config file. I’m using the suggested forked version of NanoSim as described in the Manual.

I run metagenomesimulation.py config.ini in the directory with the files I want to simulate and get this error:

2022-12-08 08:21:02 INFO: [MetagenomeSimulationPipeline] Metagenome simulation starting
2022-12-08 08:21:02 INFO: [MetagenomeSimulationPipeline] Validating Genomes
2022-12-08 08:21:02 INFO: [MetadataReader] Reading file: '/home/DNAUserseq/datadrive/CAMISIM/test/genome_to_id.tsv'
2022-12-08 08:21:03 INFO: [MetagenomeSimulationPipeline] Design Communities
2022-12-08 08:21:03 INFO: [CommunityDesign] Drawing strains.
2022-12-08 08:21:03 INFO: [MetadataReader 48366305545] Reading file: '/home/DNAUserseq/datadrive/CAMISIM/test/meta_data.tsv'
2022-12-08 08:21:03 INFO: [MetadataReader 23794736001] Reading file: '/home/DNAUserseq/datadrive/CAMISIM/test/genome_to_id.tsv'
2022-12-08 08:21:03 INFO: [CommunityDesign] Validating raw sequence files!
2022-12-08 08:21:05 INFO: [NcbiTaxonomy] Building taxonomy tree...
2022-12-08 08:21:05 INFO: [NcbiTaxonomy] Reading 'nodes' file:  '/tmp/tmp85a5imj6/NCBI/nodes.dmp'
2022-12-08 08:21:12 INFO: [NcbiTaxonomy] Reading 'names' file:  '/tmp/tmp85a5imj6/NCBI/names.dmp'
2022-12-08 08:21:13 INFO: [NcbiTaxonomy] Reading 'merged' file: '/tmp/tmp85a5imj6/NCBI/merged.dmp'
2022-12-08 08:21:13 INFO: [NcbiTaxonomy] Done (9s)
2022-12-08 08:21:13 INFO: [MetagenomeSimulationPipeline] Move Genomes
2022-12-08 08:21:13 WARNING: [GenomePreparation 55852882930] File /home/DNAUserseq/datadrive/CAMISIM/test/out/source_genomes/GCF_000154385.1.fa existing, skipping
2022-12-08 08:21:13 WARNING: [GenomePreparation 55852882930] File /home/DNAUserseq/datadrive/CAMISIM/test/out/source_genomes/GCF_000146045.2.fa existing, skipping
2022-12-08 08:21:13 WARNING: [GenomePreparation 55852882930] File /home/DNAUserseq/datadrive/CAMISIM/test/out/source_genomes/GCF_000091045.1.fa existing, skipping
2022-12-08 08:21:13 INFO: [MetagenomeSimulationPipeline] Read simulation
2022-12-08 08:21:13 INFO: [GenomePreparation 59470663380] Reading distribution file
2022-12-08 08:21:13 INFO: [GenomePreparation 59470663380] Reading genome location file
2022-12-08 08:21:13 INFO: [GenomePreparation 59470663380] Simulating reads using ReadSimulationNanosim readsimulator...
2022-12-08 08:21:13 INFO: [GenomePreparation 59470663380] Simulating reads from GCF_000154385.1: '/home/DNAUserseq/datadrive/CAMISIM/test/out/source_genomes/GCF_000154385.1.fa'
2022-12-08 08:21:13 INFO: [GenomePreparation 59470663380] Simulating reads from GCF_000146045.2: '/home/DNAUserseq/datadrive/CAMISIM/test/out/source_genomes/GCF_000146045.2.fa'
2022-12-08 08:21:13 INFO: [GenomePreparation 59470663380] Simulating reads from GCF_000091045.1: '/home/DNAUserseq/datadrive/CAMISIM/test/out/source_genomes/GCF_000091045.1.fa'
Traceback (most recent call last):
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 716, in <module>
    main()
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 708, in main
    read_profile(number, model_prefix, perfect, max_readlength, min_readlength)
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 125, in read_profile
    with open(model_profile, 'r') as mod_profile:
FileNotFoundError: [Errno 2] No such file or directory: 'tools/nanosim_profile/ecoli_model_profile'
Traceback (most recent call last):
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 716, in <module>
    main()
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 708, in main
    read_profile(number, model_prefix, perfect, max_readlength, min_readlength)
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 125, in read_profile
    with open(model_profile, 'r') as mod_profile:
FileNotFoundError: [Errno 2] No such file or directory: 'tools/nanosim_profile/ecoli_model_profile'
Traceback (most recent call last):
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 716, in <module>
    main()
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 708, in main
    read_profile(number, model_prefix, perfect, max_readlength, min_readlength)
  File "/home/DNAUserseq/software/NanoSimCami/src/simulator.py", line 125, in read_profile
    with open(model_profile, 'r') as mod_profile:
FileNotFoundError: [Errno 2] No such file or directory: 'tools/nanosim_profile/ecoli_model_profile'
2022-12-08 08:21:14 INFO: [GenomePreparation 59470663380] Simulating reads finished
2022-12-08 08:21:14 INFO: [MetagenomeSimulationPipeline] Generate gold standard assembly
2022-12-08 08:21:14 INFO: [MetadataReader 28817666041] Reading file: '/home/DNAUserseq/datadrive/CAMISIM/test/out/internal/genome_locations.tsv'
2022-12-08 08:21:14 ERROR: [MetagenomeSimulationPipeline] Empty bam file list in line 106
2022-12-08 08:21:14 INFO: [MetagenomeSimulationPipeline] Metagenome simulation aborted

This is my config file

[Main]
# phase 0: community design + read simulator, 1: read simulator only
phase=0 
max_processors=8
output_directory=/home/DNAUserseq/datadrive/CAMISIM/test/out 
temp_directory=/home/DNAUserseq/datadrive/CAMISIM/test/tmp
# Gold standard assembly
gsa=True    
# Gold standard for all samples combined
pooled_gsa=True 
# Anonymize seqs
anonymous=False
# Compress levels
compress=1 
# id of dataset, used in foldernames and is prefix in anonymous sequences
dataset_id=RL

[ReadSimulator]
readsim=/home/DNAUserseq/software/NanoSimCami/src/simulator.py
error_profiles=/home/DNAUserseq/software/CAMISIM/tools/nanosim_profile
samtools=/usr/bin/samtools

#error profiles:
#for ART:
#HiSeq 150bp: hi150
#MBARC-26 150bp: mbarc
#custom profile (see below): own
#for wgsim:
#error rate as <float> (e.g. 0.05 for 5 0.000000e+00rror rate)
#blank for nanosim and wgsim
profile=
# Specify the samples size in Giga base pairs
size=0.2
# ReadSimulator choose: 'art', 'wgsim', 'nanosim', 'pbsim'
type=nanosim
# Paired end read, insert size (not applicable for nanosim)
fragments_size_mean=
fragment_size_standard_deviation=

[CommunityDesign]
distribution_file_paths=
ncbi_taxdump=/home/DNAUserseq/software/CAMISIM/tools/ncbi-taxonomy_20170222.tar.gz
strain_simulation_template=/home/DNAUserseq/software/CAMISIM/scripts/StrainSimulationWrapper/sgEvolver/simulation_dir
number_of_samples=1

[community0]
metadata=/home/DNAUserseq/datadrive/CAMISIM/test/meta_data.tsv
id_to_genome_file=/home/DNAUserseq/datadrive/CAMISIM/test/genome_to_id.tsv
id_to_gff_file=
genomes_total=3
genomes_real=3
max_strains_per_otu=1
# how many genomes per species taxon
ratio=1 
# replicates / timeseries_lognormal / timeseries_normal / differential
mode=differential 
log_mu=1 
log_sigma=2
gauss_mu=1
gauss_sigma=1
view=False

# If you want to create a second community with other stats jus add the
# above sequence and repeat
# [community1]
# ...

Any help on this one?

Also is there a way to run CAMISIM with Docker and NanoSim since it isn’t included in the image? How would the command look like?

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
eparisiscommented, Dec 12, 2022

Thanks a lot I just tested it and works just fine!

0reactions
AlphaSquadcommented, Dec 9, 2022

It is not possible “out-of-the-box” (currently), but you can manually change the command lines with which Nanosim will be called in this script: scripts/ReadSimulationWrapper/readsimulationwrapper.py, lines 521 to 529. The option to simulate fastq with Nanosim is somewhat new so it didn’t find its way into CAMISIM yet

Read more comments on GitHub >

github_iconTop Results From Across the Web

If Dual SIM with two nano-SIM cards isn't working on your ...
Go to Settings > Cellular or Settings > Mobile Data and make sure that you see both plans. Tap each plan and make...
Read more >
What do I do if my eSIM or nanoSIM card isn't working? - Xfinity
Don't panic if you see one of the following error messages: No SIM; Insert SIM card; SOS. Before you decide you need a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found