-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.py
46 lines (33 loc) · 1.67 KB
/
types.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
from pandera.typing import Series
import pandera as pa
from typing import Optional
# TODO: joint uniqueness, DNA characters
# currently handled in load_reference_dna
class ReferenceDna(pa.DataFrameModel):
source: Optional[Series[str]] = pa.Field(nullable=False, coerce=True)
name: Series[str] = pa.Field(nullable=False)
reference_dna: Series[str] = pa.Field(nullable=False)
# simulate based on reference sources
# could also be used to generate comparison of expected vs actual results
class SamplePlan(pa.DataFrameModel):
sample: Series[str] = pa.Field(nullable=False, coerce=True)
source: Series[str] = pa.Field(nullable=False, coerce=True)
coverage: Optional[Series[float]] = pa.Field(nullable=False, coerce=True)
# simulate based on input sequences
class DnaPlan(pa.DataFrameModel):
sample: Series[str] = pa.Field(nullable=False, coerce=True)
reference_dna: Series[str] = pa.Field(nullable=False, unique=True)
class Samples(pa.DataFrameModel):
sample: Series[str] = pa.Field(nullable=False, unique=True,
coerce=True)
fastq_name: Series[str] = pa.Field(nullable=False, unique=True,
coerce=True)
# build this by using config.yaml to parse ReferenceDna
class Designs(pa.DataFrameModel):
source: Optional[Series[str]] = pa.Field(nullable=False, coerce=True)
name: Series[str] = pa.Field(nullable=False, coerce=True)
class Candidates(pa.DataFrameModel):
read_index: Series[int] = pa.Field(nullable=False)
query: Series[str] = pa.Field(nullable=False)
reference: Series[str] = pa.Field(nullable=False)
reference_name: Series[str] = pa.Field(nullable=False)