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

Segspan for contiguous regions #10

Open
hemingur opened this issue Aug 11, 2020 · 4 comments
Open

Segspan for contiguous regions #10

hemingur opened this issue Aug 11, 2020 · 4 comments

Comments

@hemingur
Copy link

Dear GOR team,

I would like to suggest a new option for the SEGSPAN command to allow for joining intervals where both endpoints are included.
For example, if we call this option -c and have the data:

Chr Begin End
chr1 10 19
chr1 20 29

in file foo, then the command

gorpipe "gor foo | segspan -c"

would return:

Chr bpStart bpStop segCount
chr1 10 29 2

Thanks,
Gunnar

@vidarhr
Copy link
Contributor

vidarhr commented Aug 24, 2020

Thank you @hemingur for the suggestion. We will evaluate.

@gorfather
Copy link
Contributor

SEGSPAN does actually combine segments that are adjacent. In the example above, the segments are however not adjacent because segment notation in GOR is zero-based (to be compatible with UCSC data), hence base 19 is not part of segment 2.

From the GOR-help https://docs.gorpipe.org/joiningTables.html?highlight=ucsc
Segment ranges in GOR are zero-based UCSC style, e.g. (start,stop)=(100,200) denotes a genomic segment including bases 101-200, i.e. of length 100bp.

One could ask the question if we should support one-based segments. At present we don't but it might be worth having such option in few segment oriented commands (like SEGSPAN) or a configuration parameter to turn off zero-based.

@hemingur
Copy link
Author

Thanks for looking into this - I was actually aware that GOR was zero based. I probably was not clear enough in my comment earlier - by "both endpoints are included" I meant for SEGSPAN to behave as if the segments are one-based.

@gorfather
Copy link
Contributor

Yes - we should look into having an option to treat segments as one-based.

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

3 participants