Giter VIP home page Giter VIP logo

Comments (5)

tshauck avatar tshauck commented on July 17, 2024 1

Regrettably one cannot write files yet. I need to finish supporting reading CRAM files, then the next major thing is supporting file output.

Glad the random sort worked, I'd just mention two things that may help in the future:

  1. the BAM reader uses projection pushdown meaning that if you only want certain columns, if you specify only those columns in the query, only those fields will be deserialized from the BAM file which can really speed things up
  2. SELECT * FROM bam_scan('file.bam') WHERE RANDOM() < .05 might be another good option if you want a proportion of the data and not a specific LIMIT cound. That wouldn't require a SORT and thus could return the data in a single scan.

from biobear.

tshauck avatar tshauck commented on July 17, 2024

@abearab Hey, I think you were very close... could you try, ORDER BY RANDOM(), though I don't think you can set the seed if that's critical.

Also, I should make this clearer, but biobear leverages Apache DataFusion for general purpose SQL functions, standard joins, etc, and you can see info about which functions are available here: https://arrow.apache.org/datafusion/user-guide/sql/index.html (in addition to the specialized ones I've added like reverse_complement). E.g. the docs for random.

from biobear.

abearab avatar abearab commented on July 17, 2024

@abearab Hey, I think you were very close... could you try, ORDER BY RANDOM(), though I don't think you can set the seed if that's critical.

I see, thanks for the correction. I just tried it and it's seems it's working now.

Also, I should make this clearer, but biobear leverages Apache DataFusion for general purpose SQL functions, standard joins, etc, and you can see info about which functions are available here: https://arrow.apache.org/datafusion/user-guide/sql/index.html (in addition to the specialized ones I've added like reverse_complement). E.g. the docs for random.

Cool, I'll look into datafusion docs. Thanks

One question: how can I write bam files after I made these kind of manipulation?

from biobear.

abearab avatar abearab commented on July 17, 2024

I think you answered my question here, I'm going to close this issue for now to cleanup your repo! Thanks

from biobear.

tshauck avatar tshauck commented on July 17, 2024

Thanks!

from biobear.

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.