Comments (9)
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.
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.
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' with
read_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.
from gggenomes.
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.
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.
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.
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.
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)
- Show y-axis for geom_wiggle() and offset geom_feat() HOT 1
- ggsave throws error in example code HOT 8
- Gff not recognized HOT 6
- Error in eval(`_inherit`, env, NULL): object 'Guides' not found. HOT 1
- Error in guides$setup(scales, aesthetics, default = params$guide_default %||% : attempt to apply non-function HOT 1
- unexpected error on example data HOT 1
- Incorrect labels for scale with large sequences HOT 1
- read_feats error HOT 4
- Multiple coverage tracks supported? HOT 4
- How can I change the distance (spacer) between different seqs? HOT 2
- Calculate coordinates from gff file with genes in different directions HOT 1
- Error when loading emales.fna with https://github.com/thackl/gggenomes/blob/HEAD/vignettes/emales.Rmd HOT 1
- Generate blast links with NCBI blast, easy to use row.names() HOT 1
- Changing start site of seq track and keeping layout. HOT 4
- markdown expressions in geom_gene_text HOT 1
- Combination plots with ggtree possible? HOT 1
- Two tibble gff3 files appear empty when loading in. HOT 3
- geom_link() is not working properly HOT 4
- gggenomes works in webR
- CRAN policy violation - fail gracefully on unavailable internet resources HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gggenomes.