diff --git a/README.md b/README.md new file mode 100644 index 0000000..c01f2b4 --- /dev/null +++ b/README.md @@ -0,0 +1,231 @@ +# Genomic Data Platform Template + +This repository serves as a template for creating integrated genomic data platforms with built-in genome browsers. It was originally developed for *Ostrea chilensis* (Chilean flat oyster) research but has been generalized for use with any species. + +## Features + +- 𧬠**Integrated Genome Browser**: Built-in JBrowse genome browser for interactive genomic data exploration +- π **Interactive Data Tables**: R-powered tables for annotations, BLAST results, and pathway data +- π¨ **Responsive Web Interface**: Clean, modern website built with Quarto +- π§ **Easy Customization**: Template-driven configuration system +- π± **Mobile Friendly**: Works on desktop and mobile devices +- π **GitHub Pages Ready**: Easy deployment to GitHub Pages + +## Technology Stack + +- **[Quarto](https://quarto.org/)**: Website generation and R integration +- **[JBrowse](https://jbrowse.org/)**: Genome browser component +- **R**: Data analysis and interactive tables +- **YAML**: Configuration management + +## Quick Start + +### 1. Prerequisites + +- [Quarto](https://quarto.org/docs/get-started/) (>= 1.0) +- [R](https://www.r-project.org/) (>= 4.0) with packages: + - `tidyverse` + - `DT` + - `readxl` + - `plotly` +- Python (>= 3.6) with `pyyaml` and `jinja2` + +### 2. Setup Your Project + +1. **Fork or clone this repository** + ```bash + git clone https://github.com/RobertsLab/OCEAN.git + cd OCEAN + ``` + +2. **Install Python dependencies** + ```bash + pip install pyyaml jinja2 + ``` + +3. **Configure your project** + + Copy and edit the configuration file: + ```bash + cp template-config.yml my-project-config.yml + ``` + + Edit `my-project-config.yml` with your species and project information: + ```yaml + # Project Information + project: + name: "MyGenome" + full_name: "My Species Genome Project" + description: "An integrated platform for my species research" + + # Species Information + species: + scientific_name: "Species scientificus" + common_name: "common species name" + description: "the common species" + emoji: "π§¬" + + # Update data sources with your URLs + data_sources: + nr_blast: "https://example.com/path/to/nr.csv" + uniprot: "https://example.com/path/to/uniprot.txt" + # ... etc + ``` + +4. **Generate your project files** + ```bash + python setup-template.py my-project-config.yml + ``` + +5. **Add your genomic data** + + Place your genome files in the appropriate directories: + ``` + docs/jbrowse/data/ + βββ v1/ + β βββ your-genome.fasta + β βββ your-genome.fasta.fai + β βββ genes.gff3 + β βββ annotations/ + βββ tracks/ + ``` + +6. **Build and preview** + ```bash + cd quarto + quarto preview + ``` + +### 3. Customize Further + +#### Website Styling +- Edit `quarto/styles.css` for custom styling +- Modify `quarto/_quarto.yml` for navigation and theme changes + +#### Genome Browser +- Update JBrowse configuration in `docs/jbrowse/config.json` +- Add track data to `docs/jbrowse/data/` +- Configure assemblies, annotations, and quantitative tracks + +#### Data Sources +- Update URLs in your config file to point to your data +- Modify R code in `explore.qmd` template for custom analysis + +## Configuration Reference + +### Project Settings +```yaml +project: + name: "ProjectName" # Short identifier + full_name: "Full Project Name" # Display name + description: "Project description" +``` + +### Species Information +```yaml +species: + scientific_name: "Genus species" + common_name: "common name" + description: "descriptive text" + emoji: "π§¬" # Optional branding emoji +``` + +### Data Sources +All data source URLs can be customized: +```yaml +data_sources: + nr_blast: "URL to BLAST results CSV" + uniprot: "URL to UniProt annotations" + pathways: "URL to pathway data" + gene_gff: "URL to gene annotations GFF" +``` + +### Population/Study Data +The template includes optional population study components: +```yaml +population_info: + enabled: true # Set to false to hide this section + title: "Population Information" + description: "Study description" + map_embed: "Google Maps embed URL" + locations: + - name: "Site 1" + salinity: "High" + # ... other characteristics +``` + +### JBrowse Configuration +Define genome assemblies and basic tracks: +```yaml +jbrowse: + version: "v3.6.4" + assemblies: + - name: "Assembly Name" + fasta_url: "URL to FASTA file" + fai_url: "URL to FASTA index" +``` + +## Directory Structure + +``` +your-project/ +βββ template-config.yml # Main configuration +βββ setup-template.py # Template processor +βββ templates/ # Template files +β βββ index.qmd.template +β βββ about.qmd.template +β βββ explore.qmd.template +β βββ _quarto.yml.template +β βββ jbrowse-config.json.template +βββ quarto/ # Generated Quarto source +β βββ index.qmd +β βββ about.qmd +β βββ explore.qmd +β βββ _quarto.yml +β βββ img/ +β βββ styles.css +βββ docs/ # Generated website + βββ index.html + βββ about.html + βββ jbrowse/ + β βββ config.json + β βββ data/ + β βββ index.html + βββ ... +``` + +## Deployment + +### GitHub Pages +1. Push your repository to GitHub +2. Enable GitHub Pages in repository settings +3. Set source to `/docs` folder +4. Your site will be available at `https://username.github.io/repository-name` + +### Manual Deployment +Build the site and deploy the `docs/` folder to any web server: +```bash +cd quarto +quarto render +# Upload docs/ folder to your web server +``` + +## Examples + +See the original OCEAN project configuration for a complete example of a working genomic data platform. + +## Contributing + +Feel free to submit issues and enhancement requests! This template is designed to be flexible and extensible. + +## License + +This template is provided under the same license as the original OCEAN project. + +## Citation + +If you use this template for your research, please cite the original OCEAN project and any relevant publications. + +--- + +**Need help?** Check the [Issues](https://github.com/RobertsLab/OCEAN/issues) page or submit a new issue with the `template` label. \ No newline at end of file diff --git a/TEMPLATE-GUIDE.md b/TEMPLATE-GUIDE.md new file mode 100644 index 0000000..09bc8a8 --- /dev/null +++ b/TEMPLATE-GUIDE.md @@ -0,0 +1,184 @@ +# Using OCEAN as a Template + +This directory contains the template system for creating new genomic data platforms based on the OCEAN architecture. + +## Quick Start for New Projects + +### 1. Copy and Configure + +```bash +# Copy the template configuration +cp template-config.yml my-species-config.yml + +# Edit the configuration for your species +vim my-species-config.yml +``` + +### 2. Key Configuration Sections + +#### Project Information +```yaml +project: + name: "YourProject" # Short name, used in code + full_name: "Your Species Genomics Platform" # Display name + description: "Brief description of your platform" +``` + +#### Species Information +```yaml +species: + scientific_name: "Genus species" + common_name: "common name" + description: "the [adjective] [common name]" # Used in sentences + emoji: "π§¬" # Optional branding emoji +``` + +#### Data Sources +Update all URLs to point to your data: +```yaml +data_sources: + nr_blast: "https://your-server.com/blast-results.csv" + uniprot: "https://your-server.com/uniprot-annotations.txt" + pathways: "https://your-server.com/pathway-data.csv" + gene_gff: "https://your-server.com/gene-annotations.gff3" +``` + +#### JBrowse Configuration +```yaml +jbrowse: + assemblies: + - name: "Your Assembly v1.0" + fasta_url: "https://your-server.com/genome.fasta" + fai_url: "https://your-server.com/genome.fasta.fai" +``` + +### 3. Generate Your Site + +```bash +# Install Python dependencies +pip install pyyaml jinja2 + +# Generate your project files +python setup-template.py my-species-config.yml + +# Copy your genome data files +mkdir -p docs/jbrowse/data/v1/ +cp your-genome-files/* docs/jbrowse/data/v1/ + +# Copy your images +cp your-logo.png quarto/img/ +``` + +### 4. Build and Test + +```bash +cd quarto +quarto preview # Test locally +quarto render # Build for deployment +``` + +## Template Customization + +### Adding New Data Sections + +1. Add data sources to your config: +```yaml +data_sources: + new_data_type: "https://your-server.com/new-data.csv" +``` + +2. Modify `templates/explore.qmd.template` to add R code for your new data. + +3. Regenerate with `python setup-template.py your-config.yml` + +### Customizing Population/Study Information + +The template includes a flexible population information section: + +```yaml +population_info: + enabled: true # Set to false to hide completely + title: "Population Information" # Customize section title + description: "Your study description" + + # Optional map + map_embed: "Google Maps embed URL" + + # Customizable location table + locations: + - name: "Site 1" + salinity: "High" + freshwater_input: "Low" + tidal_exchange: "High" + human_influence: "Low" +``` + +You can: +- Change column names by editing the template +- Add/remove columns as needed +- Disable the entire section with `enabled: false` + +### JBrowse Tracks + +The template creates basic gene, ncRNA, and repeat tracks. To add more: + +1. Add track data sources to your config +2. Edit `templates/jbrowse-config.json.template` +3. Add new track definitions following JBrowse v3 syntax + +### Styling and Branding + +- Update `quarto/styles.css` for custom CSS +- Replace `quarto/img/` files with your logos/images +- Modify the celebration message and platform features in your config + +## Example Configurations + +See the `examples/` directory for: +- `arabidopsis-config.yml` - Plant genomics example +- Additional species examples (add your own!) + +## File Structure After Setup + +``` +your-project/ +βββ template-config.yml # Original template config +βββ my-species-config.yml # Your customized config +βββ setup-template.py # Template processor +βββ templates/ # Template source files +βββ quarto/ # Generated Quarto source +β βββ index.qmd # Homepage +β βββ about.qmd # About page with species info +β βββ explore.qmd # Data exploration page +β βββ browse.qmd # Genome browser page +β βββ _quarto.yml # Quarto configuration +βββ docs/ # Generated website + βββ index.html + βββ jbrowse/ + β βββ config.json # JBrowse configuration + β βββ data/ # Your genome data files + βββ ... +``` + +## Tips for Success + +1. **Start Small**: Begin with basic gene and assembly data, add complexity later +2. **Test Early**: Use `quarto preview` to test changes immediately +3. **Version Control**: Commit your config files and generated templates +4. **Document Changes**: Keep notes on customizations for future reference +5. **Community**: Share your configurations as examples for others + +## Troubleshooting + +### Common Issues + +1. **Missing Dependencies**: Install Quarto, R packages, and Python modules +2. **Data URLs**: Ensure all data sources are publicly accessible +3. **File Paths**: Use absolute URLs for external data, relative paths for local files +4. **JBrowse Data**: Ensure FASTA files have corresponding .fai index files + +### Getting Help + +- Check the main README.md for general setup instructions +- Review example configurations in `examples/` +- Submit issues with the `template` label for template-specific problems \ No newline at end of file diff --git a/docs/jbrowse/config.json b/docs/jbrowse/config.json index 8590f7e..667a9d1 100644 --- a/docs/jbrowse/config.json +++ b/docs/jbrowse/config.json @@ -1,11 +1,12 @@ { "baseUrl": "jbrowse/", "assemblies": [ + { "name": "Assembly 1.0", "sequence": { "type": "ReferenceSequenceTrack", - "trackId": "custom_refseq", + "trackId": "assembly_1.0_refseq", "adapter": { "type": "IndexedFastaAdapter", "fastaLocation": { @@ -17,11 +18,12 @@ } } }, + { "name": "Och_HapA", "sequence": { "type": "ReferenceSequenceTrack", - "trackId": "hapa_refseq", + "trackId": "och_hapa_refseq", "adapter": { "type": "IndexedFastaAdapter", "fastaLocation": { @@ -32,29 +34,14 @@ } } } - }, - { - "name": "Och_HapB", - "sequence": { - "type": "ReferenceSequenceTrack", - "trackId": "hapb_refseq", - "adapter": { - "type": "IndexedFastaAdapter", - "fastaLocation": { - "uri": "https://gannet.fish.washington.edu/v1_web/owlshell/bu-github/OCEAN/docs/jbrowse/data/HapB/Och_HapB_assembly.fa" - }, - "faiLocation": { - "uri": "https://gannet.fish.washington.edu/v1_web/owlshell/bu-github/OCEAN/docs/jbrowse/data/HapB/Och_HapB_assembly.fa.fai" - } - } - } } + ], "tracks": [ { "type": "FeatureTrack", "trackId": "gene_annotations", - "name": "Gene Annotations", + "name": "Genes", "assemblyNames": ["Assembly 1.0"], "adapter": { "type": "Gff3Adapter", @@ -82,159 +69,12 @@ "uri": "https://gannet.fish.washington.edu/v1_web/owlshell/bu-github/OCEAN/docs/jbrowse/data/v1/repeat.gff3" } } - }, - { - "type": "QuantitativeTrack", - "trackId": "Pum_barcode02", - "name": "Pum_02", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Pum_barcode02.bw" } - }, - "color": "blue" - }, - { - "type": "QuantitativeTrack", - "trackId": "Pum_barcode12_1", - "name": "Pum_12_1", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Pum_barcode12_1.bw" } - }, - "color": "blue" - }, - { - "type": "QuantitativeTrack", - "trackId": "Pum_barcode13", - "name": "Pum_13", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Pum_barcode13.bw" } - }, - "color": "blue" - }, - { - "type": "QuantitativeTrack", - "trackId": "Pum_barcode13_1", - "name": "Pum_13_1", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Pum_barcode13_1.bw" } - }, - "color": "blue" - }, - { - "type": "QuantitativeTrack", - "trackId": "Qui_barcode01", - "name": "Qui_01", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Qui_barcode01.bw" } - }, - "color": "green" - }, - { - "type": "QuantitativeTrack", - "trackId": "Qui_barcode01_1", - "name": "Qui_01_1", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Qui_barcode01_1.bw" } - }, - "color": "green" - }, - { - "type": "QuantitativeTrack", - "trackId": "Qui_barcode02_1", - "name": "Qui_02_1", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Qui_barcode02_1.bw" } - }, - "color": "green" - }, - { - "type": "QuantitativeTrack", - "trackId": "Qui_barcode12", - "name": "Qui_12", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Qui_barcode12.bw" } - }, - "color": "green" - }, - { - "type": "QuantitativeTrack", - "trackId": "Rio_barcode03", - "name": "Rio_03", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Rio_barcode03.bw" } - }, - "color": "red" - }, - { - "type": "QuantitativeTrack", - "trackId": "Rio_barcode03_1", - "name": "Rio_03_1", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Rio_barcode03_1.bw" } - }, - "color": "red" - }, - { - "type": "QuantitativeTrack", - "trackId": "Rio_barcode14", - "name": "Rio_14", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Rio_barcode14.bw" } - }, - "color": "red" - }, - { - "type": "QuantitativeTrack", - "trackId": "Rio_barcode14_1", - "name": "Rio_14_1", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "data/v1/exp_01/Rio_barcode14_1.bw" } - }, - "color": "red" - }, - { - "type": "QuantitativeTrack", - "trackId": "SRR30335149", - "name": "SRR30335149", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "BigWigAdapter", - "bigWigLocation": { "uri": "https://gannet.fish.washington.edu/v1_web/owlshell/bu-github/OCEAN/docs/jbrowse/data/v1/SRR30335149.sorted.sp.bedGraph.bw" } - }, - "color": "purple" - }, + } + ], + "plugins": [ { - "type": "FeatureTrack", - "trackId": "deg_annotations", - "name": "DEG", - "assemblyNames": ["Assembly 1.0"], - "adapter": { - "type": "Gff3Adapter", - "gffLocation": { "uri": "data/v1/exp_01/DEG.gtf" } - } + "name": "UMDUrlPlugin", + "url": "umd_plugin.js" } ] } \ No newline at end of file diff --git a/examples/arabidopsis-config.yml b/examples/arabidopsis-config.yml new file mode 100644 index 0000000..b49483f --- /dev/null +++ b/examples/arabidopsis-config.yml @@ -0,0 +1,91 @@ +# Example Template Configuration for Arabidopsis thaliana +# This demonstrates how to adapt the platform for a different species + +# Project Information +project: + name: "ArabGenome" + full_name: "Arabidopsis thaliana Genomic Analysis Platform" + description: "An integrated web platform for plant genomics research" + +# Species Information +species: + scientific_name: "Arabidopsis thaliana" + common_name: "thale cress" + description: "the model plant organism" + emoji: "π±" + +# Website Configuration +website: + title: "ArabGenome" + theme: "flatly" + github_repo: "https://github.com/yourlab/arabgenome" + contact_message: "For questions or feedback, please submit an issue" + +# Genome Browser Configuration +jbrowse: + version: "v3.6.4" + assemblies: + - name: "TAIR10" + fasta_url: "https://www.arabidopsis.org/download_files/Genes/TAIR10_genome_release/TAIR10_chromosome_files/TAIR10_chr_all.fas" + fai_url: "https://www.arabidopsis.org/download_files/Genes/TAIR10_genome_release/TAIR10_chromosome_files/TAIR10_chr_all.fas.fai" + +# Data Sources - Update these URLs to your actual data +data_sources: + nr_blast: "https://example.com/data/arabidopsis_nr_blast.csv" + uniprot: "https://example.com/data/arabidopsis_uniprot.txt" + pathways: "https://example.com/data/arabidopsis_pathways.csv" + gene_gff: "https://www.arabidopsis.org/download_files/Genes/TAIR10_genome_release/TAIR10_gff3/TAIR10_GFF3_genes.gff" + + # Genome browser specific + gene_annotations: "data/TAIR10_genes.gff3" + ncrna_annotations: "data/TAIR10_ncrna.gff3" + repeat_annotations: "data/TAIR10_repeats.gff3" + +# Population/Study Information - Customize for your research +population_info: + enabled: true + title: "Ecotype Information" + description: "Analysis includes multiple Arabidopsis ecotypes from different geographic regions" + + # No map needed for this example + map_embed: "" + + locations: + - name: "Columbia (Col-0)" + salinity: "N/A" + freshwater_input: "Temperate climate" + tidal_exchange: "N/A" + human_influence: "Laboratory strain" + - name: "Landsberg erecta (Ler)" + salinity: "N/A" + freshwater_input: "European origin" + tidal_exchange: "N/A" + human_influence: "Wild collected" + - name: "Wassilewskija (Ws)" + salinity: "N/A" + freshwater_input: "European origin" + tidal_exchange: "N/A" + human_influence: "Wild collected" + + # Genetic relatedness + genetic_relatedness: + enabled: true + image_url: "https://example.com/arabidopsis_phylogeny.png" + +# Featured Views +featured_views: + - title: "Flowering Time Genes" + url: "jbrowse/?loc=Chr5:25000000-26000000" + - title: "Disease Resistance Cluster" + url: "jbrowse/?loc=Chr1:21000000-22000000" + +# Custom branding +branding: + logo_image: "img/arabidopsis.png" + celebration_message: "Explore the plant genome!" + platform_features: + - "𧬠Genome browser for *Arabidopsis thaliana*" + - "π Transcriptomic data" + - "π Interactive tools for gene expression and pathway analysis" + - "π§ Curated annotations including GO terms and metabolic pathways" + - "π Data sharing & collaboration hub for the plant research community" \ No newline at end of file diff --git a/quarto/_quarto.yml b/quarto/_quarto.yml index ae2b256..f86da4e 100644 --- a/quarto/_quarto.yml +++ b/quarto/_quarto.yml @@ -21,5 +21,4 @@ format: html: theme: simplex css: styles.css - toc: true \ No newline at end of file diff --git a/quarto/about.qmd b/quarto/about.qmd index a4baa36..e3e03b7 100644 --- a/quarto/about.qmd +++ b/quarto/about.qmd @@ -10,12 +10,17 @@ OCEAN is an integrated web platform dedicated to advancing research on *Ostrea chilensis*, the Chilean flat oyster. The platform offers:\ -⒠𧬠Genome browser for *O. chilensis*\ + +⒠𧬠Genome browser for {species.scientific_name}\ + β’ π Epigenetic data\ -β’ π Interactive tools for gene expression and regulatory region -analysis\ + +β’ π Interactive tools for gene expression and regulatory region analysis\ + β’ π§ Curated annotations including GO terms and pathway associations\ -β’ π Data sharing & collaboration hub for the oyster research community + +β’ π Data sharing & collaboration hub for the research community\ + ::: badges
@@ -29,26 +34,32 @@ analysis\
# Featured Genome Browser Views π
+
- ### [Gene Expression following Heat Exposure](https://robertslab.github.io/OCEAN/jbrowse/?session=share-bS-rRTROpE&password=r9vWX)
-
-- ### [DEG MSTRG.1743.1 zoom](https://oystergen.es/jbrowse/?session=share-fpBeSAviSo&password=scJyF)
+
+- ### [DEG MSTRG.1743.1 zoom](https://oystergen.es/jbrowse/?session=share-fpBeSAviSo&password=scJyF)
+
------------------------------------------------------------------------
+
# Population Information
## Site Location Information
Our focus to date is from oysters from three locales
-]{style="font-size: 1.1em;"}
:::
-For questions or feedback, [please submit an
-issue](https://github.com/RobertsLab/OCEAN/issues/new/choose) π§¬
+For questions or feedback, please submit an issue, [please submit an
+issue](https://github.com/RobertsLab/OCEAN/issues/new/choose) π§¬
\ No newline at end of file
diff --git a/setup-template.py b/setup-template.py
new file mode 100755
index 0000000..be0bdfc
--- /dev/null
+++ b/setup-template.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python3
+"""
+Template processor for genomic data platform
+Generates project files from templates and configuration
+"""
+
+import yaml
+import json
+import os
+import sys
+from pathlib import Path
+from jinja2 import Environment, FileSystemLoader, Template
+
+def load_config(config_path):
+ """Load YAML configuration file"""
+ with open(config_path, 'r') as f:
+ return yaml.safe_load(f)
+
+def process_template(template_path, output_path, config):
+ """Process a single template file"""
+ env = Environment(loader=FileSystemLoader(Path(template_path).parent))
+ template = env.get_template(Path(template_path).name)
+
+ # Render the template
+ rendered = template.render(**config)
+
+ # Write to output file
+ with open(output_path, 'w') as f:
+ f.write(rendered)
+
+ print(f"Generated: {output_path}")
+
+def setup_project(config_path):
+ """Set up a new project from templates"""
+ # Load configuration
+ config = load_config(config_path)
+
+ # Create directories
+ quarto_dir = Path("quarto")
+ docs_dir = Path("docs")
+ jbrowse_dir = docs_dir / "jbrowse"
+
+ quarto_dir.mkdir(exist_ok=True)
+ jbrowse_dir.mkdir(parents=True, exist_ok=True)
+
+ # Template mappings: (template_file, output_file)
+ templates = [
+ ("templates/index.qmd.template", "quarto/index.qmd"),
+ ("templates/about.qmd.template", "quarto/about.qmd"),
+ ("templates/explore.qmd.template", "quarto/explore.qmd"),
+ ("templates/browse.qmd.template", "quarto/browse.qmd"),
+ ("templates/_quarto.yml.template", "quarto/_quarto.yml"),
+ ("templates/jbrowse-config.json.template", "docs/jbrowse/config.json")
+ ]
+
+ # Process each template
+ for template_file, output_file in templates:
+ if Path(template_file).exists():
+ process_template(template_file, output_file, config)
+ else:
+ print(f"Warning: Template {template_file} not found")
+
+ print(f"\nProject setup complete! Website title: {config['website']['title']}")
+ print(f"Species: {config['species']['scientific_name']}")
+ print("\nNext steps:")
+ print("1. Update your data sources in template-config.yml")
+ print("2. Add your genome data files to docs/jbrowse/data/")
+ print("3. Build the website with: quarto render quarto/")
+
+def main():
+ if len(sys.argv) != 2:
+ print("Usage: python setup-template.py
+
+
+
+
+
+:::
+
+{{ website.contact_message }}, [please submit an
+issue]({{ website.github_repo }}/issues/new/choose) π§¬
\ No newline at end of file
diff --git a/templates/jbrowse-config.json.template b/templates/jbrowse-config.json.template
new file mode 100644
index 0000000..b42ec96
--- /dev/null
+++ b/templates/jbrowse-config.json.template
@@ -0,0 +1,63 @@
+{
+ "baseUrl": "jbrowse/",
+ "assemblies": [
+ {% for assembly in jbrowse.assemblies %}
+ {
+ "name": "{{ assembly.name }}",
+ "sequence": {
+ "type": "ReferenceSequenceTrack",
+ "trackId": "{{ assembly.name | lower | replace(' ', '_') }}_refseq",
+ "adapter": {
+ "type": "IndexedFastaAdapter",
+ "fastaLocation": {
+ "uri": "{{ assembly.fasta_url }}"
+ },
+ "faiLocation": {
+ "uri": "{{ assembly.fai_url }}"
+ }
+ }
+ }
+ }{% if not loop.last %},{% endif %}
+ {% endfor %}
+ ],
+ "tracks": [
+ {
+ "type": "FeatureTrack",
+ "trackId": "gene_annotations",
+ "name": "Genes",
+ "assemblyNames": ["{{ jbrowse.assemblies[0].name }}"],
+ "adapter": {
+ "type": "Gff3Adapter",
+ "gffLocation": { "uri": "{{ data_sources.gene_annotations }}" }
+ }
+ },
+ {
+ "type": "FeatureTrack",
+ "trackId": "ncrna_annotations",
+ "name": "ncRNA",
+ "assemblyNames": ["{{ jbrowse.assemblies[0].name }}"],
+ "adapter": {
+ "type": "Gff3Adapter",
+ "gffLocation": { "uri": "{{ data_sources.ncrna_annotations }}" }
+ }
+ },
+ {
+ "type": "FeatureTrack",
+ "trackId": "repeat_annotations",
+ "name": "Repeats",
+ "assemblyNames": ["{{ jbrowse.assemblies[0].name }}"],
+ "adapter": {
+ "type": "Gff3Adapter",
+ "gffLocation": {
+ "uri": "{{ data_sources.repeat_annotations }}"
+ }
+ }
+ }
+ ],
+ "plugins": [
+ {
+ "name": "UMDUrlPlugin",
+ "url": "umd_plugin.js"
+ }
+ ]
+}
\ No newline at end of file