-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfile_generator.py
More file actions
316 lines (281 loc) · 8.38 KB
/
file_generator.py
File metadata and controls
316 lines (281 loc) · 8.38 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
import os
# Base directory - CHANGE THIS TO YOUR PATH
base_dir = r"C:\Users\HOME\.vscode\Mini-Bio-Python-Projects"
# Define all phases with their projects
phases = {
"phase1_foundation": [
"dna_base_counter",
"gc_content_calc",
"dna_melting_temp",
"protein_charge_calc",
"codon_table_lookup",
"restriction_site_finder",
"dna_complement_generator",
"reverse_transcription",
"primer_dimer_detector",
"reading_frame_translator",
"snp_classifier",
"dna_motif_scorer",
"cell_division_timer",
"ph_buffer_calc",
"genetic_code_explorer"
],
"phase2_control": [
"sequence_alignment_scorer",
"phylogenetic_distance_matrix",
"orf_finder",
"dna_shuffle_simulator",
"codon_usage_bias",
"protein_property_profiler",
"genetic_drift_simulator",
"hardy_weinberg_tester",
"enzyme_kinetics_calc",
"dna_barcode_validator",
"gene_expression_simulator",
"pedigree_analysis",
"blast_hit_parser",
"vcf_info_extractor",
"fasta_header_parser"
],
"phase3_data_structures": [
"genome_feature_coords",
"protein_domain_parser",
"genetic_cross_simulator",
"restriction_map_generator",
"dna_assembly_simulator",
"primer_design_assistant",
"sanger_trace_simulator",
"allele_frequency_tracker",
"go_term_enrichment",
"msa_viewer",
"newick_tree_parser",
"protein_interaction_network",
"codon_pair_bias",
"genome_browser_mini_api",
"metabolic_pathway_sim"
],
"phase4_comprehensions": [
"fastq_quality_trimmer",
"gff3_extractor",
"vcf_filter_tool",
"bedtools_intersect",
"sam_flag_decoder",
"bam_depth_calc",
"fai_builder",
"multi_fasta_splitter",
"expression_matrix_norm",
"de_simulator",
"gwas_stats_cleaner",
"clinvar_annotator",
"ensembl_api_fetcher",
"pubmed_abstract_miner",
"sequence_logo_generator"
],
"phase5_numpy": [
"dna_signal_processor",
"protein_distance_matrix",
"ramachandran_plot",
"electrostatic_surface",
"md_trajectory_analyzer",
"hmm_cpg_islands",
"gmm_cell_clustering",
"diversity_index_calc",
"phylip_distance_tree",
"qtl_mapping_sim",
"neural_spike_analyzer",
"calcium_imaging_extractor",
"dna_melting_curve",
"binding_kinetics_fitter",
"cryoem_resolution_est"
],
"phase6_pandas": [
"tcga_data_harmonizer",
"drug_response_analyzer",
"sc_metadata_aggregator",
"maxquant_parser",
"metabolomics_peak_analyzer",
"lab_report_generator",
"epidemiological_tracer",
"clinical_trial_validator",
"biobank_tracker",
"multi_omics_integration"
],
"phase7_matplotlib": [
"genome_coverage_plotter",
"manhattan_plot_gen",
"volcano_plot_annotated",
"oncoprint_generator",
"phylo_tree_heatmap",
"flow_cytometry_gating",
"protein_structure_cartoon"
],
"phase8_ml": [
"dna_kmer_classifier",
"protein_ss_predictor",
"cancer_classifier",
"drug_property_predictor",
"survival_risk_stratifier",
"variant_pathogenicity",
"sc_cell_type_classifier",
"multimodal_outcome_predictor"
]
}
# Files to create in each project folder
project_files = [
"main.py",
"README.md",
"requirements.txt",
"data/.gitkeep",
"output/.gitkeep",
"tests/.gitkeep"
]
# Root level files
root_files = [
"README.md",
"roadmap.md",
".gitignore",
"setup.py",
"pyproject.toml"
]
# Create base directory
os.makedirs(base_dir, exist_ok=True)
# Create all directories and files
created_count = 0
for phase_name, projects in phases.items():
phase_path = os.path.join(base_dir, phase_name)
os.makedirs(phase_path, exist_ok=True)
for project in projects:
project_path = os.path.join(phase_path, project)
# Create project files
for file_path in project_files:
full_path = os.path.join(project_path, file_path)
dir_name = os.path.dirname(full_path)
# Create subdirectory if needed
if dir_name and not os.path.exists(dir_name):
os.makedirs(dir_name, exist_ok=True)
# Create file with UTF-8 encoding
if not file_path.endswith('.gitkeep'):
with open(full_path, 'w', encoding='utf-8') as f:
if file_path == "README.md":
f.write(f"# {project.replace('_', ' ').title()}\n\nProject description and documentation.\n")
elif file_path == "requirements.txt":
f.write("# Add project-specific dependencies here\n")
elif file_path == "main.py":
f.write(f'"""\n{project.replace("_", " ").title()}\n\nBiology-themed Python project.\n"""\n\ndef main():\n pass\n\nif __name__ == "__main__":\n main()\n')
else:
# Create .gitkeep file
with open(full_path, 'w', encoding='utf-8') as f:
pass
created_count += 1
# Create root level files with UTF-8 encoding
for root_file in root_files:
full_path = os.path.join(base_dir, root_file)
with open(full_path, 'w', encoding='utf-8') as f:
if root_file == "README.md":
f.write("""# Bio-AI 100 Python Projects
Complete biology-themed Python curriculum from beginner to pro.
## Structure
- **Phase 1**: Foundation (Projects 1-15)
- **Phase 2**: Control & Structure (Projects 16-30)
- **Phase 3**: Data Structures & Functions (Projects 31-45)
- **Phase 4**: Comprehensions & File Handling (Projects 46-60)
- **Phase 5**: NumPy & SciPy (Projects 61-75)
- **Phase 6**: Pandas & Data Analysis (Projects 76-85)
- **Phase 7**: Matplotlib & Seaborn (Projects 86-92)
- **Phase 8**: Scikit-Learn & ML (Projects 93-100)
## Quick Start
```bash
# Navigate to any project
cd phase1_foundation/dna_base_counter
# Install dependencies
pip install -r requirements.txt
# Run the project
python main.py
```
""")
elif root_file == "roadmap.md":
f.write("""# Project Roadmap
## Progress Tracker
| Phase | Projects | Status |
|-------|----------|--------|
| Phase 1: Foundation | 1-15 | [ ] Not Started |
| Phase 2: Control | 16-30 | [ ] Not Started |
| Phase 3: Data Structures | 31-45 | [ ] Not Started |
| Phase 4: Comprehensions | 46-60 | [ ] Not Started |
| Phase 5: NumPy | 61-75 | [ ] Not Started |
| Phase 6: Pandas | 76-85 | [ ] Not Started |
| Phase 7: Visualization | 86-92 | [ ] Not Started |
| Phase 8: ML | 93-100 | [ ] Not Started |
## Learning Path
1. Complete each phase in order
2. Build portfolio as you progress
3. Combine projects for capstone work
""")
elif root_file == ".gitignore":
f.write("""# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
venv/
.venv/
pip-log.txt
# Data files (keep structure, ignore large files)
*.fasta
*.fastq
*.bam
*.sam
*.vcf
*.gz
*.zip
*.tar
# Output
data/*
!data/.gitkeep
output/*
!output/.gitkeep
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
""")
elif root_file == "setup.py":
f.write("""from setuptools import setup, find_packages
setup(
name="bio-ai-100-projects",
version="1.0.0",
description="Biology-themed Python curriculum",
packages=find_packages(),
python_requires=">=3.8",
)""")
elif root_file == "pyproject.toml":
f.write("""[build-system]
requires = ["setuptools>=45", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "bio-ai-100-projects"
version = "1.0.0"
description = "Biology-themed Python curriculum from beginner to pro"
requires-python = ">=3.8"
dependencies = [
"numpy",
"pandas",
"matplotlib",
"seaborn",
"scipy",
"scikit-learn",
"biopython",
]
[tool.black]
line-length = 88
[tool.pytest.ini_options]
testpaths = ["tests"]""")
print(f"Created {len(phases)} phases with {sum(len(p) for p in phases.values())} projects")
print(f"Total files created: {created_count + len(root_files)}")
print("\nDone! Folder structure created successfully.")