Skip to content

ERROR in read_paf() with only one line in the PAF file #221

@lileiting

Description

@lileiting

Hi,

I found that if the PAF file has only one line, the read_paf() function will break with an error of Error in if (nrow(tag_mx_nr) == 0) { : argument is of length zero.

This was caused by this line

tag_mx_nr <- na.omit(unique(tag_mx[, 1:2]))

https://github.com/thackl/gggenomes/blob/daa8f87aa5080e88688b22db041f68ffb28f6fa5/R/read_paf.R#L78C33-L78C39

I suggest change it to

tag_mx_nr <- na.omit(unique(tag_mx[, 1:2, drop = FALSE]))

Thanks for developing the gggenomes package.

Leiting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions