kfuku52 / csubst

Molecular convergence detection
BSD 3-Clause "New" or "Revised" License
25 stars 1 forks source link

ValueError: cannot mmap an empty file #31

Closed kfuku52 closed 1 year ago

kfuku52 commented 1 year ago
Wed Mar  8 06:35:02 JST 2023: Start: csubst exhaustive analysis
Traceback (most recent call last):
  File "/opt/conda/envs/biotools/bin/csubst", line 324, in <module>
    args.handler(args)
  File "/opt/conda/envs/biotools/bin/csubst", line 43, in command_analyze
    main_analyze(g)
  File "/opt/conda/envs/biotools/lib/python3.9/site-packages/csubst/main_analyze.py", line 267, in main_analyze
    g,cb = cb_search(g, b, S_tensor, N_tensor, id_combinations, write_cb=True)
  File "/opt/conda/envs/biotools/lib/python3.9/site-packages/csubst/main_analyze.py", line 32, in cb_search
    g,id_combinations = combination.get_node_combinations(g=g, target_nodes=g['target_id'],
  File "/opt/conda/envs/biotools/lib/python3.9/site-packages/csubst/combination.py", line 60, in get_node_combinations
    df_mmap = numpy.memmap(mmap_out, dtype=numpy.int32, shape=axis, mode='w+')
  File "/opt/conda/envs/biotools/lib/python3.9/site-packages/numpy/core/memmap.py", line 267, in __new__
    mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=start)
ValueError: cannot mmap an empty file
kfuku52 commented 1 year ago
CSUBST start: 2023-03-07 21:35:02.766194+00:00
csubst analyze start: 2023-03-07 21:35:02.770168+00:00
OS: Linux-3.10.0-1160.el7.x86_64-x86_64-with-glibc2.24
Python version: 3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:45:29)  [GCC 10.4.0]
CSUBST version: 1.3.4
CSUBST command: /opt/conda/envs/biotools/bin/csubst analyze --genetic_code 1 --infile_type iqtree --alignment_file ./OG0000336.iqtree.anc/csubst.fasta --rooted_tree_file ./OG0000336.iqtree.anc/csubst.nwk --iqtree_treefile ./OG0000336.iqtree.anc/csubst.treefile --iqtree_state ./OG0000336.iqtree.anc/csubst.state --iqtree_rate ./OG0000336.iqtree.anc/csubst.rate --iqtree_iqtree ./OG0000336.iqtree.anc/csubst.iqtree --iqtree_log ./OG0000336.iqtree.anc/csubst.log --iqtree_model ECMK07+F+R4 --iqtree_redo no --max_arity 10 --exhaustive_until 1 --cutoff_stat OCNany2spe,2.0|omegaCany2spe,5.0 --max_combination 10000 --fg_exclude_wg yes --fg_stem_only no --mg_sister no --exclude_sister_pair yes --ml_anc no --b yes --s no --cs no --cb yes --bs no --cbs no --calc_quantile no --omegaC_method submodel --asrv each --threads 2 --calibrate_longtail yes --float_type 32 --foreground foreground.txt
CSUBST working directory: /gfe_data/orthogroup/tmp/95_OG0000336
CSUBST bug report: https://github.com/kfuku52/csubst/issues
Reading and parsing input files.
Using internal node names and branch lengths in --iqtree_treefile and the root position in --rooted_tree_file.
IQ-TREE's intermediate files exist.
The model in the IQ-TREE's output (ECMK07+F+R4) matched --iqtree_model (ECMK07+F+R4). Skipping IQ-TREE.
Total branch length of --rooted_tree_file: 6.9328
Total branch length of --iqtree_treefile: 11.0784

Reading the state file: ./OG0000336.iqtree.anc/csubst.state

Instantaneous substitution rate matrix will be generated using the base model: ECMK07+F
Transition matrix will be generated using the model in the ancestral state reconstruction: ECMK07+F+R4
Applying estimated codon frequencies to obtain the instantaneous rate matrix.
Writing sequence alignment: csubst_alignment_codon.fa
Writing sequence alignment: csubst_alignment_aa.fa
Ancestral states were not estimated on the root node. Excluding sub-root nodes from the analysis.
TreeStyle and/or NodeStyle are not available in installed ete3. Plotting is skipped.
TreeStyle and/or NodeStyle are not available in installed ete3. Plotting is skipped.
TreeStyle and/or NodeStyle are not available in installed ete3. Plotting is skipped.
Generating memory map: dtype=float32, axis=(19, 1385, 1, 20, 20), path=/gfe_data/orthogroup/tmp/95_OG0000336/tmp.csubst.sub_tensor.N.mmap
Generating memory map: dtype=float32, axis=(19, 1385, 20, 6, 6), path=/gfe_data/orthogroup/tmp/95_OG0000336/tmp.csubst.sub_tensor.S.mmap
Branch lengths of the IQ-TREE output are rescaled to match observed-codon-substitutions/codon-site, rather than nucleotide-substitutions/codon-site.
Total branch length before rescaling: 11.078 nucleotide substitutions / codon site
Total S+N branch length after rescaling: 7.968 codon substitutions / codon site
Total S branch length after rescaling: 4.841 codon substitutions / codon site
Total N branch length after rescaling: 3.128 codon substitutions / codon site
Synonymous substitutions / tree = 6,632.4
Nonsynonymous substitutions / tree = 4,281.4
Synonymous substitutions / branch = 368.5
Nonsynonymous substitutions / branch = 237.9
Synonymous substitutions / site = 4.8
Nonsynonymous substitutions / site = 3.1
Elapsed time: 1.0 sec

Generating s table
Time elapsed for merging tables: 0 sec
Memory consumption of s table: 0.0 Mbytes (dtype=float64)
Elapsed time: 0.0 sec

Generating b table
Time elapsed for merging tables: 0 sec
Number of S_sub patterns among 19 branches=17, min=0.0, max=488.1
Number of N_sub patterns among 19 branches=17, min=0.0, max=363.0
Memory consumption of b table: 0.0 Mbytes (dtype=object)
Elapsed time: 0.0 sec

Arity = 2: Generating cb table
Arity = 2: Targeted search of foreground branch combinations
All branches: 18
Number of redundant branch combination unions: 0