Python interface?
See original GitHub issueI was wondering - is there a good way to call umi_tools methods directly from a python script, rather than through the executable?
I have a python script in which I collect a set of reads at a given position and then want to do things with them based on their UMI groups. At the moment I do this by first running umi_tools group
on the BAM file (using the adjacency method), reading the grouped BAM file in my script and extracting the UMI group tag from that.
However, it would be much more convenient if I could simply read the original BAM file, extract the raw UMI sequences myself, and then simply call umi_tools to do the adjacency grouping.
Looking at your code it seems like I might be able to do something similar to this: https://github.com/CGATOxford/UMI-tools/blob/master/umi_tools/group.py#L510
Eg.
import umi_tools.network
processor = umi_tools.network.UMIClusterer('adjacency')
umi_groups = processor(umi_raw_seqs, umi_raw_counts)
Where umi_raw_seqs
is my list of UMIs at a given location and umi_raw_counts
a dict of their counts. I would then assume I would get back a list of UMI groups with the raw UMIs in each.
Is that correct?
It would be great if there was an official interface for this though, in particular since I’d want to be sure that this doesn’t get broken with the next update.
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
We are expecting to release 0.5 tomorrow! 😁
This is perfect, thank you very much @TomSmithCGAT @IanSudbery!