Skip to content

Commit 7ea9830

Browse files
committed
Fixed eCDF groupings, moved enums to separate files
1 parent d7cae01 commit 7ea9830

10 files changed

+359
-170
lines changed

.gitignore

+200-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,200 @@
1-
.idea/workspace.xml
2-
scRNA_seq/__pycache__/
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
db.sqlite3
60+
61+
# Flask stuff:
62+
instance/
63+
.webassets-cache
64+
65+
# Scrapy stuff:
66+
.scrapy
67+
68+
# Sphinx documentation
69+
docs/_build/
70+
71+
# PyBuilder
72+
target/
73+
74+
# Jupyter Notebook
75+
.ipynb_checkpoints
76+
77+
# IPython
78+
profile_default/
79+
ipython_config.py
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# Environments
91+
.env
92+
.venv
93+
env/
94+
venv/
95+
ENV/
96+
env.bak/
97+
venv.bak/
98+
99+
# Spyder project settings
100+
.spyderproject
101+
.spyproject
102+
103+
# Rope project settings
104+
.ropeproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/
111+
.dmypy.json
112+
dmypy.json
113+
114+
# Pyre type checker
115+
.pyre/
116+
117+
118+
# Created by https://www.gitignore.io/api/pycharm
119+
# Edit at https://www.gitignore.io/?templates=pycharm
120+
121+
### PyCharm ###
122+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
123+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
124+
125+
# User-specific stuff
126+
.idea/**/workspace.xml
127+
.idea/**/tasks.xml
128+
.idea/**/usage.statistics.xml
129+
.idea/**/dictionaries
130+
.idea/**/shelf
131+
132+
# Generated files
133+
.idea/**/contentModel.xml
134+
135+
# Sensitive or high-churn files
136+
.idea/**/dataSources/
137+
.idea/**/dataSources.ids
138+
.idea/**/dataSources.local.xml
139+
.idea/**/sqlDataSources.xml
140+
.idea/**/dynamic.xml
141+
.idea/**/uiDesigner.xml
142+
.idea/**/dbnavigator.xml
143+
144+
# Gradle
145+
.idea/**/gradle.xml
146+
.idea/**/libraries
147+
148+
# Gradle and Maven with auto-import
149+
# When using Gradle or Maven with auto-import, you should exclude module files,
150+
# since they will be recreated, and may cause churn. Uncomment if using
151+
# auto-import.
152+
# .idea/modules.xml
153+
# .idea/*.iml
154+
# .idea/modules
155+
156+
# CMake
157+
cmake-build-*/
158+
159+
# Mongo Explorer plugin
160+
.idea/**/mongoSettings.xml
161+
162+
# File-based project format
163+
*.iws
164+
165+
# IntelliJ
166+
out/
167+
168+
# mpeltonen/sbt-idea plugin
169+
.idea_modules/
170+
171+
# JIRA plugin
172+
atlassian-ide-plugin.xml
173+
174+
# Cursive Clojure plugin
175+
.idea/replstate.xml
176+
177+
# Crashlytics plugin (for Android Studio and IntelliJ)
178+
com_crashlytics_export_strings.xml
179+
crashlytics.properties
180+
crashlytics-build.properties
181+
fabric.properties
182+
183+
# Editor-based Rest Client
184+
.idea/httpRequests
185+
186+
# Android studio 3.1+ serialized cache file
187+
.idea/caches/build_file_checksums.ser
188+
189+
### PyCharm Patch ###
190+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
191+
192+
# *.iml
193+
# modules.xml
194+
# .idea/misc.xml
195+
# *.ipr
196+
197+
# Sonarlint plugin
198+
.idea/sonarlint
199+
200+
# End of https://www.gitignore.io/api/pycharm

preprocessing.py

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import os
2-
from scrap_viz import Gene_Expression_Dataset
32
import sys
43

4+
import scrap_viz
5+
from scrap_viz import Gene_Expression_Dataset
6+
from scrap_viz import Data_Mode
7+
from scrap_viz import Transformation_Method
8+
from scrap_viz import Normalization_Method
9+
510

611
dataset_path = os.getcwd()
712

@@ -13,23 +18,22 @@
1318
gene_expression_dataset.filter_low_gene_counts(5)
1419

1520
print("Normalizing...")
16-
gene_expression_dataset.normalize_cells(
17-
Gene_Expression_Dataset.Data_Mode.READS_PER_MILLION_TRANSCRIPTS)
18-
gene_expression_dataset.normalize_genes(
19-
Gene_Expression_Dataset.Normalization_Method.SQUARE_ROOT)
21+
gene_expression_dataset.normalize_cells(Data_Mode.READS_PER_MILLION_TRANSCRIPTS)
22+
gene_expression_dataset.normalize_genes(Normalization_Method.SQUARE_ROOT,
23+
use_normalized=True)
2024

2125
print("Transforming...")
2226
gene_expression_dataset.transform(
23-
Gene_Expression_Dataset.Transformation_Method.PCA, num_dimensions=30,
27+
Transformation_Method.PCA, num_dimensions=30,
2428
use_normalized=True)
2529
gene_expression_dataset.transform(
26-
Gene_Expression_Dataset.Transformation_Method.NMF, num_dimensions=30,
30+
Transformation_Method.NMF, num_dimensions=30,
2731
use_normalized=True)
2832
gene_expression_dataset.transform(
29-
Gene_Expression_Dataset.Transformation_Method.SVD, num_dimensions=30,
33+
Transformation_Method.SVD, num_dimensions=30,
3034
use_normalized=True)
3135
gene_expression_dataset.transform(
32-
Gene_Expression_Dataset.Transformation_Method.TSNE, num_dimensions=2,
36+
Transformation_Method.TSNE, num_dimensions=2,
3337
use_normalized=True)
3438

3539
gene_expression_dataset.save(pipeline_name)

scrap_viz/Clustering_Method.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import Enum
2+
3+
4+
class Clustering_Method(Enum):
5+
K_MEANS = 0
6+
GMM = 1
7+
MAX_FEATURE = 2

scrap_viz/Data_Mode.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from enum import Enum
2+
3+
4+
class Data_Mode(Enum):
5+
READ_COUNT = 0
6+
READS_PER_MILLION_TRANSCRIPTS = 1
7+
GENE_PROBABILITIES = 2

0 commit comments

Comments
 (0)