Skip to content

Commit ad944a7

Browse files
committed
Fix CRLF line endings in shell scripts
1 parent 5826a6a commit ad944a7

4 files changed

Lines changed: 435 additions & 435 deletions

File tree

run-analysis-cs.sh

Lines changed: 133 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,133 @@
1-
#!/bin/bash
2-
# DNA Barcoding Analysis - Simple Workflow (Codespaces Version)
3-
# Copy your .ab1 files to data/student_sequences/ then run this script
4-
5-
set -e
6-
7-
# Suppress Python deprecation warnings (BioPython pairwise2)
8-
export PYTHONWARNINGS="ignore::DeprecationWarning"
9-
10-
OUTPUT_DIR="results/my_analysis"
11-
12-
# Create output directories automatically
13-
mkdir -p results/my_analysis/{01_qc,02_consensus,03_alignment,04_phylogeny,05_blast}
14-
mkdir -p results/lab_analysis
15-
16-
# Start logging
17-
LOG_FILE="results/my_analysis/student.log"
18-
exec > >(tee "$LOG_FILE") 2>&1
19-
echo "=== Student Analysis Pipeline Started ==="
20-
echo "☁️ Environment: GitHub Codespaces"
21-
echo "📝 Log file: $LOG_FILE"
22-
echo ""
23-
24-
# Show beautiful welcome banner using Rich
25-
python3 modules/show_welcome.py --welcome --mode analysis
26-
27-
echo ""
28-
echo "REQUIREMENTS:"
29-
echo " 1. Your .ab1 files must be in: data/student_sequences/"
30-
echo " 2. You must have completed the tutorial first: ./tutorial-cs.sh"
31-
echo ""
32-
echo "Starting analysis..."
33-
34-
# Show Step 1 banner
35-
python3 modules/show_welcome.py --step 1
36-
37-
python3 modules/01_quality_control/qc_chromatograms.py \
38-
data/student_sequences/ \
39-
$OUTPUT_DIR/01_qc/
40-
41-
echo "✓ Step 1 complete!"
42-
43-
# Show Step 2 banner
44-
python3 modules/show_welcome.py --step 2
45-
46-
python3 -W ignore::DeprecationWarning modules/02_consensus/create_consensus.py \
47-
$OUTPUT_DIR/01_qc/passed_sequences.fasta \
48-
$OUTPUT_DIR/02_consensus/ \
49-
--pairs-only 2>&1 | grep -v "BiopythonDeprecationWarning\|Bio.pairwise2\|warnings.warn"
50-
51-
echo "✓ Step 2 complete!"
52-
53-
# Show Step 3 banner
54-
python3 modules/show_welcome.py --step 3
55-
56-
cat $OUTPUT_DIR/02_consensus/consensus_sequences.fasta \
57-
data/reference_sequences/socal_mosquitoes.fasta \
58-
> $OUTPUT_DIR/02_consensus/combined_with_references.fasta
59-
60-
NUM_SEQS=$(grep -c "^>" $OUTPUT_DIR/02_consensus/combined_with_references.fasta)
61-
echo "Combined $NUM_SEQS sequences (your samples + references)"
62-
63-
echo "✓ Step 3 complete!"
64-
65-
# Show Step 4 banner
66-
python3 modules/show_welcome.py --step 4
67-
68-
echo ""
69-
70-
# Alignment
71-
python3 modules/03_alignment/align_sequences.py \
72-
$OUTPUT_DIR/02_consensus/combined_with_references.fasta \
73-
$OUTPUT_DIR/03_alignment/
74-
75-
echo ""
76-
# Tree
77-
python3 modules/04_phylogeny/build_tree.py \
78-
$OUTPUT_DIR/03_alignment/aligned_sequences.fasta \
79-
$OUTPUT_DIR/04_phylogeny/
80-
81-
echo "✓ Step 4 complete!"
82-
83-
# Show Step 5 banner
84-
python3 modules/show_welcome.py --step 5
85-
86-
python3 modules/05_identification/identify_species.py \
87-
$OUTPUT_DIR/02_consensus/consensus_sequences.fasta \
88-
$OUTPUT_DIR/05_blast/
89-
90-
echo "✓ Step 5 complete!"
91-
92-
# Show Step 6 banner
93-
python3 modules/show_welcome.py --step 6
94-
95-
echo "Generating lab analysis report (extraction, PCR, sequencing results)..."
96-
echo ""
97-
98-
cd modules/06_lab_data_analysis
99-
python3 plot_extraction.py && \
100-
python3 plot_quality.py && \
101-
python3 plot_pcr.py && \
102-
python3 plot_sequencing.py && \
103-
python3 plot_teams.py && \
104-
python3 generate_report.py
105-
cd ../..
106-
107-
echo "✓ Step 6 complete!"
108-
109-
# Show completion banner using Rich
110-
python3 modules/show_welcome.py --complete
111-
112-
echo ""
113-
echo "Your results are in: $OUTPUT_DIR/"
114-
echo ""
115-
echo " 01_qc/ - Quality control report"
116-
echo " 02_consensus/ - Consensus sequences"
117-
echo " 03_alignment/ - Sequence alignment"
118-
echo " 04_phylogeny/ - Phylogenetic tree"
119-
echo " 05_blast/ - Species identification"
120-
echo ""
121-
echo "Lab analysis report: results/lab_analysis/"
122-
echo ""
123-
echo "Open these files:"
124-
echo "$OUTPUT_DIR/01_qc/qc_report.html"
125-
echo "$OUTPUT_DIR/04_phylogeny/tree.png"
126-
echo "$OUTPUT_DIR/05_blast/identification_report.html"
127-
echo " • results/lab_analysis/lab_report.html"
128-
echo ""
129-
echo "=== Student Analysis Pipeline Completed ==="
130-
131-
# Clean ANSI color codes from log file for readability in text editors
132-
sed 's/\x1b\[[0-9;]*m//g' "$LOG_FILE" > "${LOG_FILE}.clean" && mv "${LOG_FILE}.clean" "$LOG_FILE"
133-
echo "Log saved to: $LOG_FILE"
1+
#!/bin/bash
2+
# DNA Barcoding Analysis - Simple Workflow (Codespaces Version)
3+
# Copy your .ab1 files to data/student_sequences/ then run this script
4+
5+
set -e
6+
7+
# Suppress Python deprecation warnings (BioPython pairwise2)
8+
export PYTHONWARNINGS="ignore::DeprecationWarning"
9+
10+
OUTPUT_DIR="results/my_analysis"
11+
12+
# Create output directories automatically
13+
mkdir -p results/my_analysis/{01_qc,02_consensus,03_alignment,04_phylogeny,05_blast}
14+
mkdir -p results/lab_analysis
15+
16+
# Start logging
17+
LOG_FILE="results/my_analysis/student.log"
18+
exec > >(tee "$LOG_FILE") 2>&1
19+
echo "=== Student Analysis Pipeline Started ==="
20+
echo "☁️ Environment: GitHub Codespaces"
21+
echo "📝 Log file: $LOG_FILE"
22+
echo ""
23+
24+
# Show beautiful welcome banner using Rich
25+
python3 modules/show_welcome.py --welcome --mode analysis
26+
27+
echo ""
28+
echo "REQUIREMENTS:"
29+
echo " 1. Your .ab1 files must be in: data/student_sequences/"
30+
echo " 2. You must have completed the tutorial first: ./tutorial-cs.sh"
31+
echo ""
32+
echo "Starting analysis..."
33+
34+
# Show Step 1 banner
35+
python3 modules/show_welcome.py --step 1
36+
37+
python3 modules/01_quality_control/qc_chromatograms.py \
38+
data/student_sequences/ \
39+
$OUTPUT_DIR/01_qc/
40+
41+
echo "✓ Step 1 complete!"
42+
43+
# Show Step 2 banner
44+
python3 modules/show_welcome.py --step 2
45+
46+
python3 -W ignore::DeprecationWarning modules/02_consensus/create_consensus.py \
47+
$OUTPUT_DIR/01_qc/passed_sequences.fasta \
48+
$OUTPUT_DIR/02_consensus/ \
49+
--pairs-only 2>&1 | grep -v "BiopythonDeprecationWarning\|Bio.pairwise2\|warnings.warn"
50+
51+
echo "✓ Step 2 complete!"
52+
53+
# Show Step 3 banner
54+
python3 modules/show_welcome.py --step 3
55+
56+
cat $OUTPUT_DIR/02_consensus/consensus_sequences.fasta \
57+
data/reference_sequences/socal_mosquitoes.fasta \
58+
> $OUTPUT_DIR/02_consensus/combined_with_references.fasta
59+
60+
NUM_SEQS=$(grep -c "^>" $OUTPUT_DIR/02_consensus/combined_with_references.fasta)
61+
echo "Combined $NUM_SEQS sequences (your samples + references)"
62+
63+
echo "✓ Step 3 complete!"
64+
65+
# Show Step 4 banner
66+
python3 modules/show_welcome.py --step 4
67+
68+
echo ""
69+
70+
# Alignment
71+
python3 modules/03_alignment/align_sequences.py \
72+
$OUTPUT_DIR/02_consensus/combined_with_references.fasta \
73+
$OUTPUT_DIR/03_alignment/
74+
75+
echo ""
76+
# Tree
77+
python3 modules/04_phylogeny/build_tree.py \
78+
$OUTPUT_DIR/03_alignment/aligned_sequences.fasta \
79+
$OUTPUT_DIR/04_phylogeny/
80+
81+
echo "✓ Step 4 complete!"
82+
83+
# Show Step 5 banner
84+
python3 modules/show_welcome.py --step 5
85+
86+
python3 modules/05_identification/identify_species.py \
87+
$OUTPUT_DIR/02_consensus/consensus_sequences.fasta \
88+
$OUTPUT_DIR/05_blast/
89+
90+
echo "✓ Step 5 complete!"
91+
92+
# Show Step 6 banner
93+
python3 modules/show_welcome.py --step 6
94+
95+
echo "Generating lab analysis report (extraction, PCR, sequencing results)..."
96+
echo ""
97+
98+
cd modules/06_lab_data_analysis
99+
python3 plot_extraction.py && \
100+
python3 plot_quality.py && \
101+
python3 plot_pcr.py && \
102+
python3 plot_sequencing.py && \
103+
python3 plot_teams.py && \
104+
python3 generate_report.py
105+
cd ../..
106+
107+
echo "✓ Step 6 complete!"
108+
109+
# Show completion banner using Rich
110+
python3 modules/show_welcome.py --complete
111+
112+
echo ""
113+
echo "Your results are in: $OUTPUT_DIR/"
114+
echo ""
115+
echo " 01_qc/ - Quality control report"
116+
echo " 02_consensus/ - Consensus sequences"
117+
echo " 03_alignment/ - Sequence alignment"
118+
echo " 04_phylogeny/ - Phylogenetic tree"
119+
echo " 05_blast/ - Species identification"
120+
echo ""
121+
echo "Lab analysis report: results/lab_analysis/"
122+
echo ""
123+
echo "Open these files:"
124+
echo "$OUTPUT_DIR/01_qc/qc_report.html"
125+
echo "$OUTPUT_DIR/04_phylogeny/tree.png"
126+
echo "$OUTPUT_DIR/05_blast/identification_report.html"
127+
echo " • results/lab_analysis/lab_report.html"
128+
echo ""
129+
echo "=== Student Analysis Pipeline Completed ==="
130+
131+
# Clean ANSI color codes from log file for readability in text editors
132+
sed 's/\x1b\[[0-9;]*m//g' "$LOG_FILE" > "${LOG_FILE}.clean" && mv "${LOG_FILE}.clean" "$LOG_FILE"
133+
echo "Log saved to: $LOG_FILE"

0 commit comments

Comments
 (0)