Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bed file format issue with trailing comma in exons list #1222

Closed
gaitat opened this issue Nov 16, 2020 · 1 comment
Closed

bed file format issue with trailing comma in exons list #1222

gaitat opened this issue Nov 16, 2020 · 1 comment

Comments

@gaitat
Copy link

gaitat commented Nov 16, 2020

Regarding a bed file, there are cases where there is a trailing comma ',' at the end of the blockSizes and blockStarts.
This causes the following code in ucsc.js

    if (!(exonSizes.length === exonStarts.length && exonCount === exonSizes.length)) {
        return feature;
    }

to succeed ending prematurely the parsing of the exons.

If you think this is a valid issue, may I suggest changing

    const exonSizes = tokens[10].split(',');
    const exonStarts = tokens[11].split(',');

to

    const exonSizes = tokens[10].replace(/,$/, '').split(',');
    const exonStarts = tokens[11].replace(/,$/, '').split(',');

in order to eliminate the trailing comma ',' from the two lists.

@jrobinso
Copy link
Contributor

Yes, thank you for the fix.

jrobinso added a commit that referenced this issue Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants