.PHONY: dev build webdev demobuild init publish_to_pypi

webdev:
	cd frontend && npm run dev

build:
	cd frontend && npm run build
	rm -rf dist
	rm -rf backend/makoview/static/
	mkdir -p backend/makoview/static
	mv frontend/dist/* backend/makoview/static/
	uv build

demobuild:
	cd frontend && ../scripts/make_demo_build.sh

dev: build
	uv run makoview serve \
		--gtf /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/references/gencode.v48.chr_patch_hapl_scaff.annotation.gtf.gz \
		--sites /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/results/differential/sites.duckdb \
		--fits /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/results/differential/model_calls.tsv \
		--genome /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/references/GRCh38.p14.genome.fa \
		--coverage /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/results/db/coverage.duckdb \
		--reads /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/results/db/reads.duckdb \
		--modified_prob_threshold 0.5

init:
	uv run makoview init \
		--gtf /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/references/gencode.v48.chr_patch_hapl_scaff.annotation.gtf.gz \
		--genome /data/gpfs/projects/punim0614/yulin/mako-tutorial-spartan-trace-v2/references/GRCh38.p14.genome.fa

publish_to_pypi: build
	uvx twine upload dist/*