Comments (5)
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:
- 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
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.
@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 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 forrandom
.
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.
I think you answered my question here, I'm going to close this issue for now to cleanup your repo! Thanks
from biobear.
Thanks!
from biobear.
Related Issues (20)
- How to handle read options (e.g. like `ReadFastaOptions`)
- How to load pairs of FASTQ files from paired-end reads HOT 7
- Update https://www.wheretrue.dev/ w/ Trimming Example
- alternative for `seqkit locate` that can locate subsequences/motifs HOT 12
- Reduce Dependencies HOT 3
- merge paired-end sequences HOT 5
- Loading in of large BAM files HOT 5
- Integer Encoding
- Support reading BED files with less than 12 column. HOT 4
- name column in BED file is limited to 255 bytes. HOT 6
- Update user docs for new BED options HOT 1
- Investigate granges rust crate HOT 4
- Why is specifying the extension required when reading files? HOT 2
- Infer extension and compression from file path.
- Fastq files are not fully read HOT 10
- Why different handling between GFF and mzml/genbank in polars. HOT 4
- `FastaReader` returns empty pandas dataframe HOT 8
- Releases builds failing. HOT 1
- How to run polars dataframe methods on large FASTQ files in a memory efficient way HOT 5
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 biobear.