AmpliconSuite / AmpliconSuite-pipeline

A quickstart tool for AmpliconArchitect. Performs all preliminary steps (alignment, CNV calling, seed interval detection) required prior to running AmpliconArchitect. Previously called PrepareAA.
Other
48 stars 25 forks source link

Amplicon Classifier error in grouped analysis mode using mamba installed pipeline #50

Closed bweasels closed 5 months ago

bweasels commented 5 months ago

It seems like compute_f_from_AA_graph function in the amplicon classifier part of the pipeline might have something up with it as it is consistently throwing the following error:

home/bkw2118/miniforge3/envs/ampsuite/lib/python3.10/site-packages/ampclasslib/amplicon_classifier.py -i /mnt/data/bkw2118/EAC_quant/820979bae_AAOut/B1_1/B1_1_classification/B1_1.input --ref GRCh38 -o /mnt/data/bkw2118/EAC_quant/820979bae_AAOut/B1_1/B1_1_classification/B1_1 --report_complexity
reading /mnt/data/bkw2118/refGenome/data_repo/GRCh38/Genes_hg38.gff
read 22998 genes

B1_1 amplicon100
Traceback (most recent call last):
  File "/home/bkw2118/miniforge3/envs/ampsuite/lib/python3.10/site-packages/ampclasslib/amplicon_classifier.py", line 1149, in <module>
    run_classification(segSeqD, cycleList, cycleCNs)
  File "/home/bkw2118/miniforge3/envs/ampsuite/lib/python3.10/site-packages/ampclasslib/amplicon_classifier.py", line 797, in run_classification
    fb_edges, fb_readcount, fb_prop, maxCN, tot_over_min_cn = compute_f_from_AA_graph(graphFile, args.add_chr_tag)
ValueError: not enough values to unpack (expected 5, got 4)

I'm using the mamba version of the pipeline, (AmpliconSuite-pipeline version 1.2.1) - please let me know if you need any more info to help figure this out.

jluebeck commented 5 months ago

Hi Ben, thanks much for reaching out. This issue should have been patched in version 1.2.1 of the pipeline.

I am wondering if perhaps you have a slightly older version of AC on your system that it is reading from? For instance, if you do echo $AC_SRC does anything appear?

If this is the case, can you please then do cd $AC_SRC and then git pull origin main ? Alternatively, you can remove the $AC_SRC bash variable from your .bashrc, source ~/.bashrc and run again (the mamba/conda installed version of the pipeline will then default to its own version of AC).

If you do not have an $AC_SRC variable concurrently set, then can you please do amplicon_classifier.py -v and share the output?

Sorry for the issues and please let me know if this is not resolved by the steps above, Jens

bweasels commented 5 months ago

Hi Jens, Thanks so much for the quick reply! My $AC_SRC is /home/bkw2118/miniforge3/envs/ampsuite/lib/python3.10/site-packages/ampclasslib. Of note, when I installed the package (on Saturday I believe), the command source install.sh --finalize_only from the mamba install instructions set my $AA_SRC and $AC_SRC to /AmpliconArchitect/ampliconarchitectlib/ and /AmpliconArchitect/ampclasslib/, (or something similar... I overwrote it so I forget the exact path) so I had to manually find the scripts that were supposed to be in those folders and set the $AA_SRC and $AC_SRC manually. The AA scripts were in the ...miniforge3/envs/ampsuite/lib/python3.10/site-packages/ampliconarchitectlib/ folder, but the AC scripts were in ...miniforge3/envs/ampsuite/bin. I ended up moving them to the site-packages/ampclasslib/ directory to mirror the AA scripts. There are unfortunately no git repos associated with those directories (bin or site-packages), so I can't pull. Maybe the bioconda or conda-forge is a bit behind the most recent release or something? My amplicon_classifier.py -v is 1.1.0 If it would help, I can remove my environment and do a clean install to get the accurate paths of all the files. Thanks again for the speedy help, and I hope this isn't too much of a bother. -Ben

jluebeck commented 5 months ago

Hi Ben,

Thanks for the info this is really helpful. This bug you encountered exists in AC v1.1.0, but it has been fixed in AC v1.1.1, which is what is packaged with AmpliconSuite-pipeline v1.2.1. Can you perhaps wipe the installation of this package from your system and go with a fresh install?

Jens

bweasels commented 5 months ago

Ah I figured it out, and it is a bit embarrassing. I hadn't updated my conda installation since ~2 weeks ago, so it was pulling from an older version of the package instead of the newest one. amplicon_classifier.py -v is now returning 1.1.1 Thanks again for helping! I'll restart my batch job and hopefully it all runs smoothly!! -Ben

jluebeck commented 5 months ago

No worries at all! I need to make sure I am not pushing out buggy builds in the future :) Cheers, Jens