GithubHelp home page GithubHelp logo

Comments (10)

Robaina avatar Robaina commented on August 11, 2024

Hi,

It seems like a new version of the library_pyfastx_ and a old index of the fasta file (created by pyfastx) could be the cause (see the post here: lmdu/pyfastx#9)

Please, check if you have an old index file for the "input_fasta" in the directory where you are currently working, if so delete it and try again (or start the program in a fresh, empty directory)

Let me know how it goes

from metatag.

gecko1990 avatar gecko1990 commented on August 11, 2024

Hi,

I tried to do so by removing everything in the folder (rm -rf *), but it didn't work. I also deleted my old environment and reinstalled from scratch to check if it was a version problem, but the problem persists

from metatag.

gecko1990 avatar gecko1990 commented on August 11, 2024

Update:

I tried the same procedure with a different gene (Amt, TIGRFAM TIGR00836) to check if it was related to the makedatabase_struct.py or the KEGG format. The error appears again:

(traits) rlaso@elbrus:/data/mcm/rlaso/Traits/Phylogenetic_trees/Nitrogen_cycle/Amt/data/reference_data_Amt_TIGR00836$ python3 /data/mcm/rlaso/Programs/TRAITS/code/makedatabase.py --in /data/mcm/databases/TRAITs_reference_database/final_ref_database.fasta --outdir /data/mcm/rlaso/Traits/Phylogenetic_trees/Nitrogen_cycle/Amt/data/reference_data_Amt_TIGR00836/ --hmm /data/mcm/rlaso/Traits/Phylogenetic_trees/Nitrogen_cycle/Amt/hmms/TIGR00836.1.HMM --relabel --prefix "ref_TIG"
* Making peptide-specific reference database...
Running Hmmer...
Parsing Hmmer output file...
Filtering Fasta...
RuntimeError: get seq count and length error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/mcm/rlaso/Programs/TRAITS/code/makedatabase.py", line 118, in <module>
    main()
  File "/data/mcm/rlaso/Programs/TRAITS/code/makedatabase.py", line 81, in main
    filterFASTAByHMM(
  File "/data/mcm/rlaso/Programs/TRAITS/code/phyloplacement/database/manipulation.py", line 118, in filterFASTAByHMM
    filterFASTAbyIDs(input_fasta, record_ids=hmmer_hits.id.values,
  File "/data/mcm/rlaso/Programs/TRAITS/code/phyloplacement/database/manipulation.py", line 76, in filterFASTAbyIDs
    fa = pyfastx.Fasta(input_fasta)
SystemError: <class 'Fasta'> returned a result with an error set

I guess that means the error is in the database or on my specific environment

from metatag.

gecko1990 avatar gecko1990 commented on August 11, 2024

In principle the md5sum is the correct one.
5fb8268b59b222a9cd035c46bcf4d031 final_ref_database.fasta

from metatag.

Robaina avatar Robaina commented on August 11, 2024

Hi @gecko1990 (sorry for the late reply),

It seems like a new version of the library_pyfastx_ and a old index of the fasta file (created by pyfastx) could be the cause (see the post here: lmdu/pyfastx#9)

Please, check if you have an old index file for the "input_fasta" in the directory where you are currently working, if so delete it and try again (or start the program in a fresh, empty directory)

Let me know how it goes

from metatag.

gecko1990 avatar gecko1990 commented on August 11, 2024

I tried that as referred here (#53 (comment)), but I am unsure what you mean with the working directory.

(traits) rlaso@elbrus:/data/mcm/rlaso/Traits/Phylogenetic_trees/Nitrogen_cycle/Nxr_Narg/data$ python3 /data/mcm/rlaso/Programs/TRAITS/code/makedatabase.py --in /data/mcm/databases/TRAITs_reference_database/final_ref_database.fasta --outdir /data/mcm/rlaso/Traits/Phylogenetic_trees/Nitrogen_cycle/Nxr_Narg/data/ --hmm /data/mcm/rlaso/Traits/Phylogenetic_trees/Nitrogen_cycle/Nxr_Narg/hmms/TIGR01580.1.HMM --relabel --prefix "ref_TIG"        * Making peptide-specific reference database...
Running Hmmer...
Parsing Hmmer output file...
Filtering Fasta...
RuntimeError: get seq count and length error

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/mcm/rlaso/Programs/TRAITS/code/makedatabase.py", line 118, in <module>
    main()
  File "/data/mcm/rlaso/Programs/TRAITS/code/makedatabase.py", line 81, in main
    filterFASTAByHMM(
  File "/data/mcm/rlaso/Programs/TRAITS/code/phyloplacement/database/manipulation.py", line 118, in filterFASTAByHMM
    filterFASTAbyIDs(input_fasta, record_ids=hmmer_hits.id.values,
  File "/data/mcm/rlaso/Programs/TRAITS/code/phyloplacement/database/manipulation.py", line 76, in filterFASTAbyIDs
    fa = pyfastx.Fasta(input_fasta)
SystemError: <class 'Fasta'> returned a result with an error set
(traits) rlaso@elbrus:/data/mcm/rlaso/Traits/Phylogenetic_trees/Nitrogen_cycle/Nxr_Narg/data$ ls
hmmer_output.txt

As I show here, once the error occurs, the only thing appearing in the working directory is the hmmer output

from metatag.

Robaina avatar Robaina commented on August 11, 2024

Hi, yes, sorry, I meant the directory where the input fasta is located, in your case:

/data/mcm/databases/TRAITs_reference_database/final_ref_database.fasta

Could you please check if there is any file ending in ".fxi", probably "final_ref_database.data.fxi"?

Thanks

from metatag.

gecko1990 avatar gecko1990 commented on August 11, 2024

Nothing at all. =(

(traits) rlaso@elbrus:/data/mcm/rlaso/Programs/TRAITS$ ls /data/mcm/databases/TRAITs_reference_database/
final_ref_database.fasta
(traits) rlaso@elbrus:/data/mcm/rlaso/Programs/TRAITS$ cd /data/mcm/databases/TRAITs_reference_database/
(traits) rlaso@elbrus:/data/mcm/databases/TRAITs_reference_database$ ls -a
.  ..  final_ref_database.fasta

from metatag.

gecko1990 avatar gecko1990 commented on August 11, 2024

Problem resolved. I didn't have writing permissions for the folder and the index could not be created

from metatag.

Robaina avatar Robaina commented on August 11, 2024

Alright, closing this issue then!

from metatag.

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.