Git Product home page Git Product logo

Comments (9)

Rikkiff avatar Rikkiff commented on September 25, 2024 1

I think that I found a way around it. Instead of read_fasta, I used read_fai on the .fai index of the fasta file, and I get the required tibble, and I could generate the visualisation. One column is missing, the "file_id", but that could be easily added. I had to use the fasta index that I manually downloaded, as it seems to not be available via ex():

read_fai("C:/Users/Dean Mckeown/Downloads/emales/emales/emales.fna.seqkit.fai")

A tibble: 33 × 3 seq_id seq_desc length 1 BVI_023A emale_type=EMALE05 is_typespecies=FALSE 19600 2 Cflag_131 emale_type=EMALE03 is_typespecies=FALSE 32544 3 RCC970_025 emale_type=EMALE05 is_typespecies=FALSE 20006 4 RCC970_122 emale_type=EMALE04 is_typespecies=FALSE 5473 5 BVI_055A emale_type=EMALE02 is_typespecies=FALSE 23989 6 BVI_055B emale_type=EMALE04 is_typespecies=TRUE 19849 7 Cflag_215 emale_type=EMALE04 is_typespecies=FALSE 12202 8 RCC970_016A emale_type=EMALE03 is_typespecies=TRUE 19438 9 RCC970_016B emale_type=EMALE01 is_typespecies=FALSE 20152 10 E4-10_053 emale_type=EMALE05 is_typespecies=FALSE 19840 # ℹ 23 more rows # ℹ Use print(n = ...) to see more rows

See my earlier post for the same solution :)

from gggenomes.

iimog avatar iimog commented on September 25, 2024

This is strange. Can you confirm that this returns a tibble with 6 rows:

read_seqs(ex("emales/emales.fna"))

If so, can you share your fasta file so I can have a look what's going wrong?

from gggenomes.

dmckeow avatar dmckeow commented on September 25, 2024

I am having the same issue using the emales example data. The resulting tibble has no information in it:
Reading in gff information works though

read_seqs(ex("emales/emales.fna"))

Reading'fasta' withread_seq_len():

* file_id: emales [C:/Users/Dean Mckeown/AppData/Local/R/win-library/4.2/gggenomes/extdata/emales/emales.fna]
# A tibble: 0 × 4
# ℹ 4 variables: file_id , seq_id , seq_desc , length

from gggenomes.

Rikkiff avatar Rikkiff commented on September 25, 2024

from gggenomes.

iimog avatar iimog commented on September 25, 2024

Thank you for checking. I can reproduce the problem on my Windows machine. On Linux it works as expected. My first guess, line endings, does not seem to cause the issue. I'll dig into it.

from gggenomes.

iimog avatar iimog commented on September 25, 2024

Sequences from fasta are internally processed by gggenomes via the perl script exec/seq-len. The problem is, that perl is not available on Windows by default. I'm not sure whether it would work if perl were available. The way it is invoked might not work on Windows at all. So the problem is not related to any specific fasta file. I don't see an easy fix to make the perl script working across platforms. It is probably easier to implement this functionality in R or using an R dependency (e.g. seqinr). What is your opinion @thackl ?

from gggenomes.

dmckeow avatar dmckeow commented on September 25, 2024

I think that I found a way around it.
Instead of read_fasta, I used read_fai on the .fai index of the fasta file, and I get the required tibble, and I could generate the visualisation. One column is missing, the "file_id", but that could be easily added.
I had to use the fasta index that I manually downloaded, as it seems to not be available via ex():

read_fai("C:/Users/Dean Mckeown/Downloads/emales/emales/emales.fna.seqkit.fai")

# A tibble: 33 × 3
seq_id seq_desc length

1 BVI_023A emale_type=EMALE05 is_typespecies=FALSE 19600
2 Cflag_131 emale_type=EMALE03 is_typespecies=FALSE 32544
3 RCC970_025 emale_type=EMALE05 is_typespecies=FALSE 20006
4 RCC970_122 emale_type=EMALE04 is_typespecies=FALSE 5473
5 BVI_055A emale_type=EMALE02 is_typespecies=FALSE 23989
6 BVI_055B emale_type=EMALE04 is_typespecies=TRUE 19849
7 Cflag_215 emale_type=EMALE04 is_typespecies=FALSE 12202
8 RCC970_016A emale_type=EMALE03 is_typespecies=TRUE 19438
9 RCC970_016B emale_type=EMALE01 is_typespecies=FALSE 20152
10 E4-10_053 emale_type=EMALE05 is_typespecies=FALSE 19840
# ℹ 23 more rows
# ℹ Use print(n = ...) to see more rows

from gggenomes.

iimog avatar iimog commented on September 25, 2024

Thank you, @Rikkiff and @dmckeow, for documenting your workarounds. I still hope to fix the read_seqs function on Windows or at least issue a warning rather than just returning an empty tibble.

from gggenomes.

iimog avatar iimog commented on September 25, 2024

read_seqs is implemented in R in the latest release (that is also available on CRAN 🎉). So this should no longer be an issue.

from gggenomes.

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.