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

scatter finds zero probes when using regions #457

Closed
ViktorHy opened this issue Jun 25, 2019 · 1 comment · Fixed by #536
Closed

scatter finds zero probes when using regions #457

ViktorHy opened this issue Jun 25, 2019 · 1 comment · Fixed by #536

Comments

@ViktorHy
Copy link

I have a problem with version 0.9.6. I can plot single chromosomes using the following command:

cnvkit.py scatter -s Sample.cn{s,r} -c 17 -o 17.png <- this works

But if I want to plot I defined area say

cnvkit.py scatter -s Sample.cn{s,r} -c 17:37000000-38000000 -o 17.png <- this doesn't

Showing 0 probes and 1 selected genes in region 17:35999999-39000000

Similarily if I try to plot only a selected gene.

cnvkit.py scatter -s Sample.cn{s,r} -g ERBB2

Showing 0 probes and 1 selected genes....

I tried with an older installation, version 0.9.1 and all the above commands works just fine

@tetedange13
Copy link
Contributor

tetedange13 commented Jan 27, 2020

Hi,


Had the same bug (CNVkit v0.9.6) and it seemed to come from a problem in _irange_simple() at this line:

yield (slice(start_idx, end_idx), start_val, end_val)

Possible fix:
yield (slice(table.index[start_idx], table.index[end_idx]), start_val, end_val)

Explanation (guessed):
The start_idx and and end_idx in the slice yielded are actually indexes relative to a subset of "table", created within idx_ranges():

table = table[table['chromosome'] == chrom]

The problem is that coming back to iter_ranges(), this slice is applied to the whole "table" (full size not subset), to yield a "subtable" object. The indexes being still relative, we catch a wrong region (often in chrom 1).

IMPORTANT EDIT:
My quick fix seems to bug during segmentation, as the "table" given is already subsetted by chromosome (so internal indexes have to be yield, no need to convert them back to "not internal" one).


Hope it helps. Best regards. Felix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants