Skip to content

add generic and track comment support for BED files #188

@owlang

Description

@owlang

Current behavior of tools reading BED file typically crashes out if the BED parser encounters an unexpected number of tokens as is often the case for # "comment" lines and track name=... comment lines. We don't want it to crash out and ignore these comment lines instead

See examples:
https://genome.ucsc.edu/FAQ/FAQformat.html#format1

browser position chr7:127471196-127495720
browser hide all
track name="ItemRGBDemo" description="Item RGB demonstration" visibility=2 itemRgb="On"
chr7    127471196  127472363  Pos1  0  +  127471196  127472363  255,0,0
chr7    127472363  127473530  Pos2  0  +  127472363  127473530  255,0,0
chr7    127473530  127474697  Pos3  0  +  127473530  127474697  255,0,0
...

Add support to skip lines beginning with browser, track, or # when reading BED files. No need to copy these headers when writing to BED files.

Affected Tools:

  • BED to GFF
  • Sort BED
  • Expand BED
  • Tag Pileup
  • DNAShape From BED
  • Peak Align
  • Filter BED
  • FRiX Calculator
  • Chr Name Converter
  • FASTA Extract

...check for others I may have missed in this list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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