Giter Club home page Giter Club logo

Comments (6)

jnuvenus avatar jnuvenus commented on July 26, 2024

@panoptikum Hello, I have used your function CreateNodes() to create nodes, but got into the debug mode. Then I tried your function hts(), also got into the debug mode. Could you give a detail example? Thanks.

from hts.

panoptikum avatar panoptikum commented on July 26, 2024

@jnuvenus Thanks for trying out my function. I forgot to remove a browser() within the function which was there for debug purposes. It should work with the above example now, but I can highlight the crucial code changes as well.
You have to source the whole hts.R file to ensure functionality or load my fork of HTS.

Let me know, if it works or not.

from hts.

jnuvenus avatar jnuvenus commented on July 26, 2024

@panoptikum Finally, I use hive sql to calculate the num of every level of the nodes, and then use R arrange() fun to sort them。

from hts.

panoptikum avatar panoptikum commented on July 26, 2024

@jnuvenus Well, I'm sure others would like to stay within R and this package, but I'm pleased to hear that you've found a working solution for you.

from hts.

jnuvenus avatar jnuvenus commented on July 26, 2024

@panoptikum Hello, I use CreateNodes() in your new hts() function,
cols <- c('yCN01_y755Y_y755AC','yCN01_y755Y_y755AG','yCN01_y023Y_y023Y00001','yCN02_y010A_y010AAC')
gtnode <- CreateNodes(bnames=cols, characters = c(1, 2, 1), sep="_")$nodes
then, I got result as follows,
[[1]]
[1] 2

[[2]]
yCN01 yCN02
3 1

[[3]]
yCN01y755Y yCN01y023Y yCN02y010A
2 1 1
This result have one error, the num of yCN01 should be 2.
So, I fixed the bug in cnt count part in your CreateNodes() ,
cnt <- sapply(x_1, function(z) {
vec1 <- sapply(bnames_split, function(i) {paste(c(paste(i[1:(x-1)], collapse = ""),i[x]), collapse = "")})
vec1 <- unique(vec1)
vec <- sapply(vec1, function(j){strsplit( j,"
")[[1]][1]==z})
sum(vec, na.rm = TRUE)
})
then I got result as follows,
[[1]]
[1] 2

[[2]]
yCN01 yCN02
2 1

[[3]]
yCN01y755Y yCN01y023Y yCN02y010A
2 1 1

Maybe you can try this fix on other examples.

from hts.

medoeje avatar medoeje commented on July 26, 2024

Is there any news in terms of this functionality?
I agree, it's so painful to prepare groups. I had to write some functions that make new column in a DF as a key with fixed length where it defines the length of each group.

If I have 3 groups it finds max symbol length of each column and add some symbols in the end of each row so that it has the same length as the longest in the column. Then it concatinates 3 colums, Pivot by the concatinated key to columns and passes to HTS also giving the length of each group (max character length).

from hts.

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.