Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Possible code simplifications for SearchReadsExample #57

Open
cassiedoll opened this issue Dec 3, 2014 · 4 comments
Open

Possible code simplifications for SearchReadsExample #57

cassiedoll opened this issue Dec 3, 2014 · 4 comments

Comments

@cassiedoll
Copy link
Contributor

@pgrosu
Copy link

pgrosu commented Dec 3, 2014

The coverage buckets are precomputed? I know the end is fixed, but if the targetBucketWidth is changed, wouldn't that require new on-the-fly meanCoverage computations?

~p

@calbach
Copy link
Contributor

calbach commented Dec 3, 2014

Coverage is precomputed at various bucket widths. The targetBucketWidth is floored to the nearest precomputed bucket width and that's what gets returned. The minimum bucket width is chosen such that it's not too much more expensive to compute the coverage yourself, if finer granularity is needed, i.e. the smallest bucket (2048 bases) contains about one page of reads for a 100x coverage read group set.

This is documented here.

That said, I think counting coverage at a specific single position, or perhaps even for all single bases is still a useful example.

@pgrosu
Copy link

pgrosu commented Dec 3, 2014

Aha! Thanks CH for clarifying this for me. Yeah, I agree that in the future that type of granularity would help, but for now that the tried-and-true way of reads/search seems to work for <= 2048 base pairs. I tried that with a start and end = start+2048 with a pageSize of 3000, and I didn't get a nextPageToken at the end which is nice. And of course the trusted --count -1 never fails me, and seems to return a manageable number of reads:

$ java -jar genomics-tools-client-java-v1beta2.jar searchreads --read_group_set_id CMvnhpKTFhD04eLE-q2yxnU --start 2000000 --end 2002048 --reference_name 1 --count -1 --pretty_print --fields "alignments(fragmentName)" | grep fragmentName | wc -l
215
$

Thanks,
~p

@cassiedoll
Copy link
Contributor Author

(updated initial comment to remove the suggestion of deleting the coverage example)

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

No branches or pull requests

3 participants