billzt / MiFish

This is the command line version of MiFish pipeline. It can also be used with any other eDNA meta-barcoding primers
https://mitofish.aori.u-tokyo.ac.jp/mifish/
GNU General Public License v3.0
13 stars 3 forks source link

mifish crashes when a group has been skipped #9

Closed cement-head closed 11 months ago

cement-head commented 11 months ago

I am using three groups; this sample <Sample 21_Pt4_LO_S1> in the first group has only 27 reads and is skipped during initial processing.

Sample 21_Pt4_LO_S_1_ Step 0: Decompress
Sample 21_Pt4_LO_S_1_ Step 1: filter the quality of FASTQ and merge Pair-End Reads
Sample 21_Pt4_LO_S_1_ Step 2: filter read length and remove primers
Sample 21_Pt4_LO_S_1_ has not passed read length filter. Only has 27 reads. Skip

Later, the pipeline crashes:

Traceback (most recent call last):
  File "/home/cbfgws6/miniconda3/envs/MiFish/bin/mifish", line 33, in <module>
    sys.exit(load_entry_point('mifish', 'console_scripts', 'mifish')())
  File "/home/cbfgws6/MiFish/mifish/cmd/mifish.py", line 76, in main
    pipeline.runMiFish(data_dir=args.seq_dir, data_dir_other_groups=data_dir_other_groups, \
  File "/home/cbfgws6/MiFish/mifish/core/pipeline.py", line 397, in runMiFish
    json.dump(stat.eco_diversity(workdir, group_to_sample), fp=out_handle, indent=4)
  File "/home/cbfgws6/MiFish/mifish/core/stat.py", line 79, in eco_diversity
    with open(f'{workdir_sample}/04_blast/{sample_name}.json') as handle:
FileNotFoundError: [Errno 2] No such file or directory: 'output/WTRBA-YEARS/MiFishResult/Sample-21_Pt4_LO_S_1_/04_blast/21_Pt4_LO_S_1_.json'

It is true that there is no JSON file, as it was skipped. The pipeline should figure this out, or at least not crash, and move on to the next sample.

The immediate workaround would be to remove this sample (or any samples that are "SKIPPED" from the analysis/pipeline.

billzt commented 11 months ago

Sorry, please clone the latest repo and try again.

cement-head commented 11 months ago

@billzt I download (cloned) the repo on Sept 28th, 2023 - have their been updates since?


Nevermind, I see that there's been a patch - I'll try it now.

cement-head commented 11 months ago

okay - works! Thanks!