File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ def fromdict(d):
41
41
return VcfFieldSummary (** d )
42
42
43
43
44
- @dataclasses .dataclass
44
+ @dataclasses .dataclass ( order = True )
45
45
class VcfField :
46
46
category : str
47
47
name : str
@@ -116,24 +116,24 @@ class VcfPartition:
116
116
)
117
117
118
118
119
- @dataclasses .dataclass
119
+ @dataclasses .dataclass ( order = True )
120
120
class Contig :
121
121
id : str
122
122
length : int = None
123
123
124
124
125
- @dataclasses .dataclass
125
+ @dataclasses .dataclass ( order = True )
126
126
class Sample :
127
127
id : str
128
128
129
129
130
- @dataclasses .dataclass
130
+ @dataclasses .dataclass ( order = True )
131
131
class Filter :
132
132
id : str
133
133
description : str = ""
134
134
135
135
136
- @dataclasses .dataclass
136
+ @dataclasses .dataclass ( order = True )
137
137
class IcfMetadata (core .JsonDataclass ):
138
138
samples : list
139
139
contigs : list
@@ -192,6 +192,14 @@ def fromdict(d):
192
192
d ["contigs" ] = [Contig (** cd ) for cd in d ["contigs" ]]
193
193
return IcfMetadata (** d )
194
194
195
+ def __eq__ (self , other ):
196
+ if not isinstance (other , IcfMetadata ):
197
+ return NotImplemented
198
+ return (sorted (self .samples ) == sorted (other .samples ) and
199
+ sorted (self .contigs ) == sorted (other .contigs ) and
200
+ sorted (self .filters ) == sorted (self .filters ) and
201
+ sorted (self .fields ) == sorted (self .fields ))
202
+
195
203
196
204
def fixed_vcf_field_definitions ():
197
205
def make_field_def (name , vcf_type , vcf_number ):
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ dependencies = [
23
23
# colouredlogs pulls in humanfriendly",
24
24
" cyvcf2" ,
25
25
" bed_reader" ,
26
+ " packaging" ,
26
27
]
27
28
requires-python = " >=3.9"
28
29
classifiers = [
You can’t perform that action at this time.
0 commit comments