Git Product home page Git Product logo

Comments (5)

iimog avatar iimog commented on June 5, 2024

This makes a lot of sense. I'll go for it. One thing I'm not sure about is whether to use the format "ambiguous". The json format is certainly not unique to AliTV. However, gggenomes currently doesn't support any other input data in json format. So I think we could interpret any json as AliTV for now but at the risk of having to move it to ambiguous later and breaking backwards compatibility. What do you think @thackl ?

from gggenomes.

iimog avatar iimog commented on June 5, 2024

Not sure what's going wrong here: https://github.com/iimog/gggenomes/tree/smart-alitv . The correct alitv functions are called but for some reason the map2_df fails to create the output table. I don't know why that happens and could not fix it. @thackl do you have any idea why that occurs. As you see, calling the read_alitv_genes function directly works fine.

> s <- read_seqs("https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json")
Reading as alitv:
* chloroplasts [https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json]
Error: Internal error in `vec_assign()`: `value` should have been recycled to fit `x`.
Run `rlang::last_error()` to see where the error occurred.

> rlang::last_error()
<error/rlang_error>
Internal error in `vec_assign()`: `value` should have been recycled to fit `x`.
Backtrace:
 1. gggenomes::read_seqs("https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json")
 2. purrr::map2_df(...)
 3. dplyr::bind_rows(res, .id = .id)
 4. vctrs::vec_rbind(!!!dots, .names_to = .id)
Run `rlang::last_trace()` to see the full context.

> f <- read_feats("https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json")
Reading as alitv:
* chloroplasts [https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json]
Error: Internal error in `vec_assign()`: `value` should have been recycled to fit `x`.
Run `rlang::last_error()` to see where the error occurred.

> l <- read_links("https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json")
Reading as alitv:
* chloroplasts [https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json]
Error: Internal error in `vec_assign()`: `value` should have been recycled to fit `x`.
Run `rlang::last_error()` to see where the error occurred.

> gggenomes:::read_alitv_genes("https://alitvteam.github.io/AliTV/d3/data/chloroplasts.json")
# A tibble: 101 x 5
   seq_id  start   end name  class
   <chr>   <int> <int> <chr> <chr>
 1 Cphe_gi 18916 19290 ycf4  ycf  
 2 Cphe_gi 38014 44974 ycf2  ycf  
 3 Cphe_gi 59962 60067 ycf1  ycf  
 4 Cphe_gi 89015 82055 ycf2  ycf  
 5 Evir_gi 22044 28695 ycf2  ycf  
 6 Evir_gi 67783 61132 ycf2  ycf  
 7 Lphi_gi 45475 45351 ycf3  ycf  
 8 Lphi_gi 44641 44411 ycf3  ycf  
 9 Lphi_gi 43675 43522 ycf3  ycf  
10 Lphi_gi 61418 61973 ycf4  ycf  
# … with 91 more rows

from gggenomes.

thackl avatar thackl commented on June 5, 2024

Yes, I think there is an issue with the format. Your second code line says Reading as alitv, which would call read_alitv but you probably want to have Reading as alitv_seqs to call read_alitv_seqs. I think you are currently feeding the output list of read_alitv directly to the map function in all three calls - always causing the same error.

That said, this kind of makes me wonder if the way I've said this up so far, actually makes sense - actually, I think it is definitely flawed. Obviously, it would make more sense to have the format for read_seqs("alitv.json") to be "alitv", and have the read_seqs function somehow add the right context... I need to think about this some more...

from gggenomes.

iimog avatar iimog commented on June 5, 2024

You were right. Calling alitv_seqs instead of alitv fixes it 🎉
At least for seqs and feats. Links are still interpreted as genes (as you already mentioned in the initial issue text). Anyway, I'll wait until you decided on how you want these smart functions to be handled. Should be straightforward for alitv then.

from gggenomes.

thackl avatar thackl commented on June 5, 2024

resolved by #37

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.