Skip to content

Performance of readGAlignmentPairs with inter-chromosomal pairs #4

Description

@LTLA

I'm contemplating switching over csaw to use GenomicAlignments for BAM file access, rather than continuing to wrestle with Rhtslib and its poor documentation/unreliability on Windows.

I've been looking at the readGAlignments and readGAlignmentPairs functions, which should be swap-in replacements for my main internal BAM reading functions (see LTLA/csaw#4). Currently, csaw runs on sorted BAM files on a chromosome-by-chromosome basis, so I would be calling these functions with which= set to an interval spanning the current chromosome in each iteration.

However, I am concerned about the performance implications of readGAlignmentPairs's obligations to retrieve mates from other chromosomes. Even with indexing, this would seem to require a lot of additional file accesses that would be unnecessary for my use case.

Would it be worthwhile to add an option to ignore paired reads that are not on the same reference sequence? Alternatively, this could feasibly be part of an expanded suite of scanBamParam options based on the INS isize field, e.g., keeping only non-zero INS isize values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions