-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic_usage.py
More file actions
96 lines (72 loc) · 2.29 KB
/
basic_usage.py
File metadata and controls
96 lines (72 loc) · 2.29 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
#!/usr/bin/env python3
"""
Basic usage examples for UMI RNA Simulator
This script demonstrates common simulation scenarios with synthetic data.
"""
from umi_simulator import BulkRNAUMISimulator
def basic_simulation():
"""Basic simulation with default parameters"""
print("Example 1: Basic Simulation")
print("-" * 60)
simulator = BulkRNAUMISimulator(
n_genes=1000,
total_molecules=10000,
random_seed=42
)
simulator.run_simulation(output_prefix="output/basic")
def high_amplification():
"""Simulation with high PCR amplification"""
print("\nExample 2: High PCR Amplification")
print("-" * 60)
simulator = BulkRNAUMISimulator(
n_genes=1000,
total_molecules=10000,
pcr_cycles=15,
pcr_efficiency=0.85,
random_seed=42
)
simulator.run_simulation(output_prefix="output/high_pcr")
def target_read_count():
"""Simulation using target read count instead of molecules"""
print("\nExample 3: Target Read Count Mode")
print("-" * 60)
print("Requesting 50,000 final reads...")
print("Simulator will back-calculate required initial molecules\n")
simulator = BulkRNAUMISimulator(
n_genes=1000,
target_reads=50000,
pcr_cycles=10,
pcr_efficiency=0.7,
random_seed=42
)
simulator.run_simulation(output_prefix="output/target_reads")
def paired_end_reads():
"""Simulation with paired-end reads"""
print("\nExample 4: Paired-End Sequencing")
print("-" * 60)
simulator = BulkRNAUMISimulator(
n_genes=1000,
total_molecules=10000,
paired_end=True,
fragment_length=300,
read_length=75,
pcr_cycles=10,
random_seed=42
)
simulator.run_simulation(output_prefix="output/paired_end")
print("\nCreates two files:")
print(" - output/paired_end_R1.fastq.gz (forward reads)")
print(" - output/paired_end_R2.fastq.gz (reverse reads)")
if __name__ == '__main__':
import os
os.makedirs('output', exist_ok=True)
print("="*70)
print("UMI RNA Simulator - Basic Examples")
print("="*70)
basic_simulation()
high_amplification()
target_read_count()
paired_end_reads()
print("\n" + "="*70)
print("All examples completed!")
print("="*70)