GithubHelp home page GithubHelp logo

Comments (1)

ivagljiva avatar ivagljiva commented on July 26, 2024 1

Hi @natalia-rodilla,

Thank you very much for the detailed report and the test case. I was able to reproduce your error on my system.

As you have discerned already, it seems to be a bug that happens only when there is a single genome in a given cluster. This is where it is failing in the genomesimilarity.py code:

if len(cluster) == 1:
      return cluster[0]

The problem is that the pick_representative_with_largest_Qscore() function (in which this code is), seems to expect that the cluster variable is a list, when in fact it is a set.

The very simple fix was to cast cluster to a list before trying to extract the sole element, which I implemented in commit fbc6cf3 .

This is the output I get on your test set after running with the fixed code in the development branch of anvi'o:

Run mode .....................................: fastANI

CITATION
===============================================
Anvi'o will use 'fastANI' by Jain et al. (DOI: 10.1038/s41467-018-07641-9) to
compute ANI. If you publish your findings, please do not forget to properly
credit their work.

[fastANI] Kmer size ..........................: 16
[fastANI] Fragment length ....................: 3,000
[fastANI] Min fraction of alignment ..........: 0.25
[fastANI] Num threads to use .................: 1
[fastANI] Log file path ......................: /var/folders/nc/7dlw5z2j16q3s14586qddwl8nhxpgh/T/tmpeywzl020

fastANI similarity metric ....................: calculated
Number of genomes considered .................: 7
Number of redundant genomes ..................: 5
Final number of dereplicated genomes .........: 2

ANI RESULTS
===============================================
* Matrix and clustering of 'ani' written to output directory
* Matrix and clustering of 'alignment fraction' written to output directory
* Matrix and clustering of 'mapping fragments' written to output directory
* Matrix and clustering of 'total fragments' written to output directory

* Cleaning up the temp directory (you can use `--debug` if you would like to keep
  it for testing purposes)

The similarity scores output gets written, and the resulting representative genomes for each cluster in derep99Q_test10/GENOMES/ are BA_92.fa and UW8_POB.fa. :)

So if you were to install anvio-dev by following the instructions here: https://anvio.org/install/linux/dev/
and pull the latest commits to the repository, you will be able to run this program without this error.

from anvio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.