Skip to content

Reading whole file or FileIO integration ? #17

Description

@jonathanBieler

In 99% of my use cases l just want to read the whole bed file and get a vector of records. Doing so requires quite a bit of boilerplate :

# Import the BED module.
using BED

# Open a BED file.
reader = open(BED.Reader, "data.bed")

# Iterate over records.
for record in reader
    # Do something on record (see Accessors section).
    chrom = BED.chrom(record)
    # ...
end

# Finally, close the reader.
close(reader)

Boilerplate that every user will have to write (possibly several times). In comparison in Python you can do pr.read_bed(path). This seems like an important usability issue.

The solution would either to add a internal BED.load("file.bed") or to integrate FileO interface. I don't have a strong preference but l would also do the same for other "small" (that typically fit in memory) file format like VCF so it would be better to be consistent about it. To note FileIO also has a streaming interface for large files, so it could also be used for bams and fastqs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I/OFile reading / writingenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions