-
Notifications
You must be signed in to change notification settings - Fork 1
/
colored_kDataFrame.py
95 lines (67 loc) · 2.66 KB
/
colored_kDataFrame.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
from kProcessor.kDataFrame import kDataFrame
class colored_kDataFrame(kDataFrame):
"""colored_kDataFrame class
.. note:: the colored_kDataFrame Inherits all the functions from :class:`kProcessor.kDataFrame` plus other new functions.
*Introduction*:
- The colored_kDataFrame class holds the Kmers colors instead of their count.
- The **color** is an integer represents the targets which contains that kmer.
Example:
**color:** ``1``: represents the transcripts ``transcript_A`` , ``transcript_B`` and ``transcript_C``
**color:** ``2``: represents the transcripts ``transcript_A`` , ``transcript_B``
**kmer:** ``ACTGATCGATCGTACGAC`` has the **color** `2`, that means it's found in both `transcript_A` and `transcript_B`
**kmer:** ``ATAAGCATTTACAGCAAT`` has the **color** `1`, that means it's found in both `transcript_A` , `transcript_B` and `transcript_C`
"""
pass
def getColor(self, kmer):
"""
Get the color of the kmer
:param kmer: Kmer string
:type kmer: str
:return: The color of the kmer
:rtype: int
"""
pass
def getKmerSource(self, kmer):
"""
Get all sample IDs that contains that kmer.
:param kmer: Kmer string
:type kmer: str
:return: List of all samples IDs associated with that kmer.
:rtype: list
"""
def getKmerSourceFromColor(self, color):
"""
Get all sample IDs that contains that kmer.
:param color: Kmer color
:type color: int
:return: List of all samples IDs associated with that color.
:rtype: list
"""
def names_map(self):
"""
Get the names map dictionary that represents sample ID as key and its group name as value.
:return: names map dictionary.
:rtype: dict
"""
def inverse_names_map(self):
"""
Get the names map dictionary that represents group name as key and its sample ID as value.
:return: inverse names map dictionary.
:rtype: dict
"""
@staticmethod
def load(prefix):
"""
Load colored_kDataFrame file from disk.
:param prefix: file path
:type prefix: string
:return: Colored kDataFrame that has been serialized on disk.
:rtype: :class:`kProcessor.colored_kDataFrame`
"""
pass
def get_kDataFrame(self):
"""
Get the kDataFrame object that holds the kmers alongside their colors.
:return: the embedded kDataFrame inside the colored_kDataFrame.
:rtype: :class:`kProcessor.kDataFrame`
"""