Why different handling between GFF and mzml/genbank in polars.
tshauck opened this issue · 4 comments
All have maps, but GFF is converted ok into a polars df, but not the latter to.
- Genbank: List of structs... overall quiet complex :/ https://github.com/wheretrue/exon/blob/b2726a591294ff9b0b45e6632e28727eaa9bc1ce/exon/exon-genbank/src/config.rs#L22 .. maybe provide example unnest if possible
- mzml: map of structs... https://github.com/wheretrue/exon/blob/b2726a591294ff9b0b45e6632e28727eaa9bc1ce/exon/exon-mzml/src/config.rs#L92-L184
- GFF: map of string lists... https://github.com/wheretrue/exon/blob/b2726a591294ff9b0b45e6632e28727eaa9bc1ce/exon/exon-gff/src/config.rs#L67-L94
@tshauck have you seen https://github.com/BiocPy?
@abearab I've seen it, but not used it. I am a fan of those packages in R (e.g. granges). I also know there's some other analogues in Python for some of those bioconductor packages (e.g. AnnData).
I've seen it, but not used it. I am a fan of those packages in R (e.g. granges). I also know there's some other analogues in Python for some of those bioconductor packages (e.g. AnnData).
Yeah, I do like AnnData and scverse ecosystem a lot. However, a good implementation of granges for python has been missing for long time! I thought considering this granges can be very relevant to your implementation of annotation file formats (i.e. GTF, GFF, BED, BAM, etc.). This is just another suggestion, feel free to ignore it :)
100% -- you can actually do a little of granges stuff via SQL joins, but it's not quite as intuitive or as specialized to genomic intervals. E.g. say you ran bakta, and wanted to get CDSs where a spacer annotation is within 100bp of a CDS
WITH cds AS (
SELECT *
FROM gff_scan('bakta.gff')
WHERE type = 'cds'
), spacers AS (
SELECT *
FROM gff_scan('bakta.gff')
WHERE type = 'crispr-spacer'
)
SELECT *
FROM cds
JOIN spacers
ON spacers.start > (cds.start - 100) OR spacers.end < (cds.end - 100)
I would certainly like to make it easier to do more complex granges stuff.