Open tshauck opened 9 months ago
@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.
All have maps, but GFF is converted ok into a polars df, but not the latter to.