Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

workflow.py 3.5 KB

You have to be logged in to leave a comment. Sign In
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
  1. """
  2. Classes that are helpers for the yspecies workflows
  3. Classes:
  4. Enums
  5. Locations
  6. """
  7. from enum import Enum, auto
  8. class Normalize(Enum):
  9. log2 = "log2"
  10. standardize = "standardize"
  11. clr = "clr"
  12. class AnimalClass(Enum):
  13. Mammalia = "Mammalia"
  14. mammals = "Mammalia"
  15. Aves = "Aves"
  16. birds = "Aves"
  17. Reptilia = "Reptilia"
  18. reptiles = "Reptilia"
  19. Coelacanthi = "Coelacanthi"
  20. Teleostei = "Teleostei"
  21. bone_fish = "Teleostei"
  22. @staticmethod
  23. def tsv():
  24. return [cl.name.capitalize()+".tsv" for cl in AnimalClass]
  25. class Orthology(Enum):
  26. one2one = "one2one"
  27. one2many = "one2many"
  28. one2many_directed = "one2many_directed"
  29. one2oneplus_directed = "one2oneplus_directed"
  30. many2many = "many2many"
  31. all = "all"
  32. class CleaningTarget(Enum):
  33. expressions = "expressions"
  34. genes = "genes"
  35. from pathlib import Path
  36. class Locations:
  37. class Genes:
  38. def __init__(self, base: Path):
  39. self.dir: Path = base
  40. self.genes = self.dir
  41. self.by_class = self.dir / "by_animal_class"
  42. self.all = self.dir / "all"
  43. self.genes_meta = self.dir / "reference_genes.tsv"
  44. class Expressions:
  45. def __init__(self, base: Path):
  46. self.dir = base
  47. self.expressions = self.dir
  48. self.by_class: Path = self.dir / "by_animal_class"
  49. class Input:
  50. class Annotations:
  51. class Genage:
  52. def __init__(self, base: Path):
  53. self.dir = base
  54. self.orthologs = Locations.Genes(base / "genage_orthologs")
  55. self.conversion = self.dir / "genage_conversion.tsv"
  56. self.human = self.dir / "genage_human.tsv"
  57. self.models = self.dir / "genage_models.tsv"
  58. def __init__(self, base: Path):
  59. self.dir = base
  60. self.genage = Locations.Input.Annotations.Genage(self.dir / "genage")
  61. def __init__(self, base: Path):
  62. self.dir = base
  63. self.intput = self.dir
  64. self.genes: Locations.Genes = Locations.Genes(self.dir / "genes")
  65. self.expressions: Locations.Expressions = Locations.Expressions(self.dir / "expressions")
  66. self.species = self.dir / "species.tsv"
  67. self.samples = self.dir / "samples.tsv"
  68. self.annotations = Locations.Input.Annotations(self.dir / "annotations")
  69. class Interim:
  70. def __init__(self, base: Path):
  71. self.dir = base
  72. self.selected = self.dir / "selected"
  73. class Output:
  74. class External:
  75. def __init__(self, base: Path):
  76. self.dir: Path = base
  77. self.linear = self.dir / "linear"
  78. self.shap = self.dir / "shap"
  79. self.causal = self.dir / "causal"
  80. def __init__(self, base: Path):
  81. self.dir = base
  82. self.external = Locations.Output.External(self.dir / "external")
  83. self.intersections = self.dir / "intersections"
  84. self.optimization = self.dir / "optimization"
  85. def __init__(self, base: str):
  86. self.base: Path = Path(base)
  87. self.data: Path = self.base / "data"
  88. self.dir: Path = self.base / "data"
  89. self.input: Locations.Input = Locations.Input(self.dir / "input")
  90. self.interim: Locations.Interim = Locations.Interim(self.dir / "interim")
  91. self.output: Locations.Output = Locations.Output(self.dir / "output")
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...