44
55@unique
66class Channel (Enum ):
7+ """ idat probes measure either a red or green fluorescence.
8+ This specifies which to return within idat.py: red_idat or green_idat."""
79 RED = 'Red'
810 GREEN = 'Grn'
911
@@ -21,6 +23,13 @@ def is_red(self):
2123
2224@unique
2325class ProbeAddress (Enum ):
26+ """AddressA_ID and AddressB_ID are columns in the manifest csv that contain internal Illumina probe identifiers.
27+
28+ Type II probes use AddressA_ID; Type I uses both, because there are two probes, two colors.
29+
30+ probe intensities in .idat files are keyed to one of these ids, but processed data is always keyed to the
31+ IlmnID probe "names" -- so this is used in converting between IDs. It is used to define probe sets below
32+ in this probes.py"""
2433 A = 'A'
2534 B = 'B'
2635
@@ -33,6 +42,11 @@ def header_name(self):
3342
3443@unique
3544class ProbeType (Enum ):
45+ """ probes can either be type I or type II for CpG or Snp sequences. Control probes are used for background
46+ correction in different fluorescence ranges and staining efficiency.
47+ Type I probes record EITHER a red or a green value.
48+ Type II probes record both values together.
49+ NOOB uses the red fluorescence on a green probe and vice versa to calculate background fluorescence."""
3650 ONE = 'I'
3751 TWO = 'II'
3852 SNP_ONE = 'SnpI'
@@ -44,6 +58,9 @@ def __str__(self):
4458
4559 @staticmethod
4660 def from_manifest_values (name , infinium_type ):
61+ """ this function determines which of four kinds of probe goes with this name, using either
62+ the Infinium_Design_Type (I or II) or the name (starts with 'rs')
63+ and decides 'Control' is non of the above."""
4764 is_snp = name .startswith ('rs' )
4865
4966 if infinium_type == 'I' :
@@ -56,6 +73,7 @@ def from_manifest_values(name, infinium_type):
5673
5774
5875class Probe ():
76+ """ this doesn't appear to be instantiated anywhere in methylprep """
5977 __slots__ = [
6078 'address' ,
6179 'illumina_id' ,
@@ -69,6 +87,9 @@ def __init__(self, address, illumina_id, probe_type):
6987
7088
7189class ProbeSubset ():
90+ """ used below in probes.py to define sub-sets of probes:
91+ foreground-(red|green|all), or (un)methylated probes
92+ """
7293 __slots__ = [
7394 'data_channel' ,
7495 'probe_address' ,
@@ -104,6 +125,81 @@ def get_probe_details(self, manifest):
104125 )
105126
106127
128+ '''
129+ # notebook equivalent of SNP_PROBES below.
130+ #manifest = data_containers[0].manifest.data_frame
131+ #snpProbesI = manifest[manifest['probe_type']=='SnpI']
132+ #snpProbesI_Grn = snpProbesI[snpProbesI['Color_Channel']=='Grn']
133+ #snpProbesI_Red = snpProbesI[snpProbesI['Color_Channel']=='Red']
134+ #snpProbesII = manifest[manifest['probe_type']=='SnpII']
135+
136+ SNP_PROBES = (
137+ # SNP_II_PROBES
138+ ProbeSubset(
139+ data_channel=Channel.GREEN,
140+ probe_address=ProbeAddress.A,
141+ probe_channel=None,
142+ probe_type=ProbeType.SNP_TWO,
143+ ),
144+ # SNP_I_GREEN_PROBES
145+ ProbeSubset(
146+ data_channel=Channel.GREEN,
147+ probe_address=ProbeAddress.A,
148+ probe_channel=Channel.GREEN,
149+ probe_type=ProbeType.SNP_ONE,
150+ ),
151+ # SNP_I_RED_PROBES
152+ ProbeSubset(
153+ data_channel=Channel.RED,
154+ probe_address=ProbeAddress.B,
155+ probe_channel=Channel.RED,
156+ probe_type=ProbeType.SNP_ONE,
157+ )
158+ )
159+ '''
160+
161+ METHYLATED_SNP_PROBES = (
162+ ProbeSubset (
163+ data_channel = Channel .GREEN ,
164+ probe_address = ProbeAddress .A ,
165+ probe_channel = None ,
166+ probe_type = ProbeType .SNP_TWO ,
167+ ),
168+ ProbeSubset (
169+ data_channel = Channel .GREEN ,
170+ probe_address = ProbeAddress .B ,
171+ probe_channel = Channel .GREEN ,
172+ probe_type = ProbeType .SNP_ONE ,
173+ ),
174+ ProbeSubset (
175+ data_channel = Channel .RED ,
176+ probe_address = ProbeAddress .B ,
177+ probe_channel = Channel .RED ,
178+ probe_type = ProbeType .SNP_ONE ,
179+ ),
180+ )
181+
182+ UNMETHYLATED_SNP_PROBES = (
183+ ProbeSubset (
184+ data_channel = Channel .RED ,
185+ probe_address = ProbeAddress .A ,
186+ probe_channel = None ,
187+ probe_type = ProbeType .SNP_TWO ,
188+ ),
189+ ProbeSubset (
190+ data_channel = Channel .GREEN ,
191+ probe_address = ProbeAddress .A ,
192+ probe_channel = Channel .GREEN ,
193+ probe_type = ProbeType .SNP_ONE ,
194+ ),
195+ ProbeSubset (
196+ data_channel = Channel .RED ,
197+ probe_address = ProbeAddress .A ,
198+ probe_channel = Channel .RED ,
199+ probe_type = ProbeType .SNP_ONE ,
200+ ),
201+ )
202+
107203FG_GREEN_PROBE_SUBSETS = (
108204 ProbeSubset (
109205 data_channel = Channel .GREEN ,
0 commit comments