Comments (1)
If this is something you think would be reasonably straightforward I would be willing to draft a PR with some guidance on where to start.
Yes, give it a go! It's a loaded issue, consisting of four parts:
- the async alignment reader (#288),
- its builder (#288),
- the async alignment writer,
- and also its builder.
I recommend focusing on each individually, submitting a patch for review per part. It is a fair amount of work/code, but don't feel obligated to complete it all.
For the first part, I normalized the alignment format async reader methods, so you shouldn't have any problems outside of util. I also added an async variant format reader and builder to use as a reference.
Here are some instructions on how to proceed with the reader:
-
Add the alignment format dependencies (SAM, BAM, and CRAM) to the
async
feature innoodles-util/Cargo.toml
. These use the optional dependency feature syntax.noodles/noodles-util/Cargo.toml
Lines 23 to 28 in 782d892
-
Add the modules.
-
Implement
Reader<R>
. This will not use the I/O trait approach like the blocking version. Since well know all the format variants, use an enum instead. Feel free to start with the following scaffold.
//! Async alignment reader.
/// An async alignment reader.
pub enum Reader<R> {
/// SAM.
Sam(sam::r#async::io::Reader<R>),
/// BAM.
Bam(bam::r#async::io::Reader<R>),
/// CRAM.
Cram(cram::r#async::io::Reader<R>),
}
impl<R> Reader<R>
where
R: AsyncBufRead + Unpin,
{
/// Reads the SAM header.
pub async fn read_header(&mut self) -> io::Result<sam::Header> {
todo!()
}
/// Returns an iterator over records starting from the current stream position.
pub fn records<'r, 'h: 'r>(
&'r mut self,
header: &'h sam::Header,
) -> impl Stream<Item = io::Result<Box<dyn sam::alignment::Record>>> + 'r {
todo!()
}
}
Let me know if you have any further questions or issues.
from noodles.
Related Issues (20)
- Add Async GFF Reader and/or expose lazy record from string? HOT 2
- `gff::AsyncReader` gated by async feature HOT 2
- BCF and VCF `record_bufs` return different `RecordBuf`s HOT 2
- IUPAC codes in VCF REF field HOT 1
- Can support flush method on writer ? HOT 3
- BED name column limit HOT 1
- bgzf/async/reader: Add seeking to an uncompressed position
- How to write custom bam records HOT 1
- Help request: using the noodles async FASTQ writer with async compression without corrupting the output HOT 1
- QualityScore conversion from fastq HOT 2
- Create test SAM data HOT 2
- Performance question
- Explicitly state the indexing of alignment start and end HOT 1
- Trait bounds changes in noodles_sam 0.62.0 HOT 1
- sam/alignment/record/sequence: Add a method signature to return a single base at a given index HOT 3
- templeate_length() for long reads HOT 2
- Support fastq comments/attributes/metadata HOT 3
- Convenience methods for SAM records HOT 2
- gtf parse error HOT 1
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 noodles.