Skip to content

Commit

Permalink
fixed version in container
Browse files Browse the repository at this point in the history
  • Loading branch information
msauria committed Oct 14, 2024
1 parent 4d51d3a commit 5190ea0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bin/find_stations.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ source(args[6])

library(lubridate)
#library(tidyverse)
library(dplyr)
library(tidyr)
library(readr)
library(stationaRy)
library(geosphere)
library(dplyr)

# args[1] = input dat#aframe
# args[2] = station dataframe
Expand Down
6 changes: 4 additions & 2 deletions env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1

USER root

RUN apt-get update && apt-get install -y procps && \
RUN apt-get update && apt-get install -y procps wget && \
apt-get clean

USER $MAMBA_USER

ENV PATH=/opt/conda/bin:/opt/conda/condabin:$PATH

RUN Rscript -e "install.packages('stationaRy', dependencies = TRUE, repos = 'http://cran.us.r-project.org')"
RUN Rscript -e "install.packages('lutz', dependencies = TRUE, repos = 'http://cran.us.r-project.org')"
RUN wget https://cran.r-project.org/src/contrib/Archive/stationaRy/stationaRy_0.4.1.tar.gz
RUN Rscript -e "install.packages('stationaRy_0.4.1.tar.gz', repos = NULL, type='source')"
4 changes: 3 additions & 1 deletion env/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ dependencies:
- r-downloader
- r-progress
- r-stringr
- r-plyr
- r-plyr
- r-leaflet
- r-magrittr
16 changes: 9 additions & 7 deletions main.nf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#! usr/bin/env nextflow

params.samples = "${workflow.projectDir}/test_data/wild_isolates.csv"
params.isd_inventory = "${workflow.projectDir}/isd-inventory.csv"

if (params.out == null){
params.outdir = noaa_analysis_${date}
params.outdir = "noaa_analysis_${params.day}"
} else {
params.outdir = params.out
}

if (params.help){
if (params.help | params.debug){
params.input = "${workflow.projectDir}/test_data/noaa_test.csv"
} else {
params.input = params.samples
Expand All @@ -19,8 +20,9 @@ if (params.help){

workflow {
Channel.fromPath(params.input) | split_WI
split_WI.out.flatten() | findStations
findStations.toSortedList() | joinData
split_WI.out.flatten()
.combine(Channel.of( params.isd_inventory) ) | findStations
findStations.out.toSortedList() | joinData
}
process split_WI {
label 'xs'
Expand Down Expand Up @@ -79,22 +81,22 @@ process findStations {
tag { wi_location }

input:
path(wi_location)
tuple path(wi_location), path(isd_inventory)

output:
path("*.noaa.tsv")


"""
Rscript --vanilla "${workflow.projectDir}/bin/find_stations.R" "${wi_location}" "${workflow.projectDir}/isd-inventory.csv" "${params.months}" "${params.events}" "${params.important_trait}" "${workflow.projectDir}/bin/get_isd_station_data_fix.R"
Rscript --vanilla "${workflow.projectDir}/bin/find_stations.R" "${wi_location}" "${isd_inventory}" "${params.months}" "${params.events}" "${params.important_trait}" "${workflow.projectDir}/bin/get_isd_station_data_fix.R"
"""

}


process joinData {
publishDir "${params.out}/", mode: 'copy'
publishDir "${params.outdir}/", mode: 'copy'

executor "local"
container null
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ profiles {

process {
cache = "lenient"
container = "andersenlab/noaa-nf:202410141550086c5701"
container = "andersenlab/noaa-nf:101424"
}

0 comments on commit 5190ea0

Please sign in to comment.