Giter Site home page Giter Site logo

Comments (2)

fischuu avatar fischuu commented on August 13, 2024

Hi,
targetScan() returns actually a matrix with 4 columns and maxOut rows (i.e. in your case a 5x4 matrix) for each miRNA. However, mapply tries to simplify the output by default, meaning it tries to create a single matrix and/or vector for all the joint calls.

Of course, in your case this is not possible and you would like to keep the list of matrices (=each list item represents the output matrix per miRNA), so you need to set SIMPLIFY=FALSE (this option is really capitalised...).

So, the complete command that should do what you want is

test <- mapply(targetScan, mirna=c("hsa-miR-99b-5p", "hsa-miR-99b-3p", "hsa-miR-99a-5p"),
               species = "Human", 
               release = "7.2", 
               maxOut = 5, 
               SIMPLIFY=FALSE)

Here, you can also rely on the recycling of vectors in R, so the input for species, release and maxOut does not need to be repeated. I hope this helps, in case you need more help, please let me know.

I took this issue also as motivation to rewrite the function such that it accepts vectors as input in mirna to avoid this problem in the future.

Now, with the latest package version here in the main branch those both calls work:

targetScan(mirna="hsa-miR-99a-5p", species = "Human", release = "7.2", maxOut = 5)

and

targetScan(mirna=c("hsa-miR-99b-5p", "hsa-miR-99b-3p", "hsa-miR-99a-5p"), 
           species = "Human", 
           release = "7.2",
           maxOut = 5)

from hoarder.

compbiolover avatar compbiolover commented on August 13, 2024

Thanks @fischuu!
I just installed the new version and it works perfectly. Thanks for clarifying the point about mapply. I am still getting use to thinking about problems in R terms.

from hoarder.

Related Issues (6)

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.