From d3d39d4f79dadc0b26c6af46926064e8167eb90d Mon Sep 17 00:00:00 2001 From: Carlos Date: Thu, 27 Aug 2026 22:10:43 +0200 Subject: [PATCH] Subir archivos a "/" --- LICENSE | 2 +- Makefile | 105 ++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 93 insertions(+), 14 deletions(-) diff --git a/LICENSE b/LICENSE index 889bb30..cd2b71b 100644 --- a/LICENSE +++ b/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/Makefile b/Makefile index e27bca9..3232f84 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,97 @@ -ARTICLE_FILE ?= MSI_julia-python_mapping.md -OUTFILE_PREFIX ?= MSI_julia-python_mapping-natbib -DEFAULT_EXTENSIONS ?= pdf -LATEX_TEMPLATE ?= pandoc-acs-latex-template.latex +.PHONY: build build-cpu run run-cpu shell shell-cpu \ + pipeline run-dataset \ + step1 step2 step3 step4 step5 step6 step7 \ + plot-spectra clean clean-all -all: $(OUTFILE_PREFIX).pdf +# ============================================================ +# Build +# ============================================================ +build: + docker compose build msi-pipeline-gpu -$(OUTFILE_PREFIX).pdf: $(ARTICLE_FILE) - pandoc -s --pdf-engine=pdflatex --template=$(LATEX_TEMPLATE) --biblatex -o $(OUTFILE_PREFIX).latex $(ARTICLE_FILE) - pdflatex $(OUTFILE_PREFIX).latex - biber $(OUTFILE_PREFIX).bcf - pdflatex $(OUTFILE_PREFIX).latex - pdflatex $(OUTFILE_PREFIX).latex +build-cpu: + docker compose build msi-pipeline-cpu +# ============================================================ +# Run (all datasets) +# ============================================================ +run: + docker compose run --rm msi-pipeline-gpu bash run_full_pipeline.sh + +run-cpu: + docker compose run --rm msi-pipeline-cpu bash run_full_pipeline.sh + +# ============================================================ +# Run single dataset +# ============================================================ +run-dataset: + @if [ -z "$(D)" ]; then echo "Usage: make run-dataset D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu bash run_full_pipeline.sh $(D) + +# ============================================================ +# Interactive shell +# ============================================================ +shell: + docker compose run --rm msi-pipeline-gpu bash + +shell-cpu: + docker compose run --rm msi-pipeline-cpu bash + +pipeline: + @if [ -z "$(D)" ]; then echo "Usage: make pipeline D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu bash run_full_pipeline.sh $(D) + +# ============================================================ +# Individual pipeline steps (for re-running after changes) +# ============================================================ +step1: # Julia preprocessing + @if [ -z "$(D)" ]; then echo "Usage: make step1 D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu julia --threads auto --project=/app/environment \ + /app/scripts/julia/julia_msi_bridge.jl /app/datasets/$(D) $(D) + +step2: # SimCLR training + @if [ -z "$(D)" ]; then echo "Usage: make step2 D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu python3 /app/scripts/python/CNN_proof_1.py $(D) + +step3: # Clustering evaluation + @if [ -z "$(D)" ]; then echo "Usage: make step3 D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu python3 /app/scripts/python/evaluate_clustering.py $(D) + +step4: # t-SNE + @if [ -z "$(D)" ]; then echo "Usage: make step4 D=Datura_leaf K=5"; exit 1; fi + docker compose run --rm msi-pipeline-gpu python3 /app/scripts/python/graph_tsne_msi.py $(D) $(K) + +step5: # Validation + @if [ -z "$(D)" ]; then echo "Usage: make step5 D=Datura_leaf K=5"; exit 1; fi + docker compose run --rm msi-pipeline-gpu python3 /app/scripts/python/quantitative_validation.py $(D) $(K) + +step6: # Galleries + @if [ -z "$(D)" ]; then echo "Usage: make step6 D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu python3 /app/scripts/python/visualize_clusters.py $(D) + +step7: # Mass spectra + @if [ -z "$(D)" ]; then echo "Usage: make step7 D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu julia --project=/app/environment \ + /app/scripts/julia/plot_mass_spectra.jl $(D) + +# ============================================================ +# Plots +# ============================================================ +plot-spectra: + @if [ -z "$(D)" ]; then echo "Usage: make plot-spectra D=Datura_leaf"; exit 1; fi + docker compose run --rm msi-pipeline-gpu julia --project=/app/environment \ + /app/scripts/julia/plot_mass_spectra.jl $(D) + +# ============================================================ +# Cleanup (outputs only; datasets are symlinked and never removed) +# ============================================================ clean: - rm -f $(OUTFILE_PREFIX).* - + rm -rf outputs/ion_images/* + rm -rf outputs/ion_images_viridis/* + rm -rf outputs/figures/* + rm -rf outputs/models/* + rm -rf outputs/*/figures + rm -rf outputs/*/galleries +clean-all: clean + docker system prune -a --volumes -f \ No newline at end of file