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

odgi heaps for subsets of samples #505

Closed
mb47 opened this issue Jun 7, 2023 · 4 comments
Closed

odgi heaps for subsets of samples #505

mb47 opened this issue Jun 7, 2023 · 4 comments

Comments

@mb47
Copy link

mb47 commented Jun 7, 2023

Hi,

I would like to run odgi heaps on various subsets of samples in my graph, as opposed to running it for the full set of samples -- is this possible without having to generate new graphs altogether?

thanks
Micha

@AndreaGuarracino
Copy link
Member

Hi @mb47, this is possible with the following option:

 -b[FILE], --bed-targets=[FILE]    BED file over path space of the graph,
                                          describing a subset of the graph to
                                          consider.

You can use odgi path -lL ... to get an input BED file and grep only the paths that you want. Something like:

odgi heaps -i graph.og -b <(odgi paths -i graph.og -Ll | grep ... | awk -v OFS='\t' '{print($1,$2-1,$3)}')

@mb47
Copy link
Author

mb47 commented Jun 12, 2023

Hi Andrea,

thanks for pointing this out, I never saw this option.

I have tried this and for some reason I am getting an empty output file from odgi heaps (no error messages). I tried this with my own data and also the example data that ships with the odgi distribution. Perhaps a bug? Would be grateful if you could check this.

Here is what I tried with your example data:

  1. Extract five of the paths in the graph to file paths_test.txt (attached)
    paths_test.txt

  2. Create the BED file:

odgi paths \
-i DRB1-3123.og \
-Ll \
| grep -f paths_test.txt \
| awk -v OFS='\t' '{print($1,$2-1,$3)}' \
| sort \
> test.odgipaths.bed
  1. Run odgi heaps with the BED file passed in:
odgi heaps \
-i DRB1-3123.og \
-n 10 \
-b test.odgipaths.bed \
> test.heaps.txt

The output file (test.heaps.txt) only contains a header.

I am running odgi v0.8.2-0-g8715c55 from bioconda.

many thanks
Micha

@AndreaGuarracino
Copy link
Member

That's a problem with odgi heaps interface. Try to group paths by sample (-S) or haplotype (-H) and you will get an output. However, I've just pushed a fix (#509) to avoid empty output when no grouping is specified.

@mb47
Copy link
Author

mb47 commented Jun 14, 2023

Great - works like a charm now! Many thanks.

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