Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4c9da5b
Added all workflow files and logic
Felix-Kummer Oct 20, 2023
bd1195c
Finalized output structure and documentation
Felix-Kummer Nov 3, 2023
eae59d4
Made local modules emit versions
Felix-Kummer Nov 29, 2023
e2756fe
Fixed mosaic output.
Felix-Kummer Dec 4, 2023
d0e747c
Fixed nf-core lint warnings
Felix-Kummer Dec 4, 2023
30d36cb
Moved to a more stable version of FORCE
Felix-Kummer Jan 24, 2024
9beb427
Fixed publishDir for visualization processes
Felix-Kummer Jan 24, 2024
9dc069b
Added version number to nf-validation plugin
Felix-Kummer Feb 23, 2024
841399d
Removed unnecessary resource requests in modules.conf in favor of nf-…
Felix-Kummer May 10, 2024
8c1c9d9
fixed docker test failures in certain situations
Felix-Kummer May 16, 2024
6fb5757
Ensured that remaining tests run after a single test failure
Felix-Kummer May 17, 2024
edf0b33
Merge branch 'dev' into nf-core-template-merge-2.14.1
Felix-Kummer May 24, 2024
9b17ae7
Fixed indents in merge scripts
Felix-Kummer May 24, 2024
4ff325a
Merge pull request #6 from nf-core/nf-core-template-merge-2.14.1
Felix-Kummer May 28, 2024
665e862
Added appropriate raster comparisons for trend tif's to test.R
Felix-Kummer May 30, 2024
b4e8152
Increased robustness of test profile against FORCE-related flakiness
Felix-Kummer Jun 28, 2024
f292928
Removed only_tile parameter
Felix-Kummer Jun 28, 2024
52c93c9
Added new options for higher level processing and visualization.
Felix-Kummer Jul 24, 2024
a4d297f
Added test_full profile
Felix-Kummer Jul 31, 2024
b896dda
bumped version to 1.0.0
Felix-Kummer Jul 31, 2024
443ba0a
Implemented minor reviewer requests
Felix-Kummer Aug 7, 2024
3dca391
Added parameters to control publishing behavior for intermediate proc…
Felix-Kummer Aug 8, 2024
a5df347
Added descriptions to custom scripts.
Felix-Kummer Aug 8, 2024
2e208fc
Applied more minor changes requested by the reviewers
Felix-Kummer Aug 21, 2024
e5d4425
Reworked merge scripts
Felix-Kummer Aug 23, 2024
fd29a4b
Added authors and licenses to scripts
Felix-Kummer Aug 23, 2024
e042a1c
Removed unused sensors_level1 parameter
Felix-Kummer Aug 23, 2024
69fd493
Applied one-sentence-per-line-scheme in .md files
Felix-Kummer Aug 28, 2024
17db3ba
Removed unnecessarily ignored parameters in test profile
Felix-Kummer Aug 29, 2024
4a7518b
Improved parameter references in docs
Felix-Kummer Aug 29, 2024
4949334
Replaced retry strategies with error_retry label
Felix-Kummer Sep 6, 2024
d7ba83b
Adopted nf-core pseudo-standard directory structure for local modules
Felix-Kummer Sep 18, 2024
64c909a
Updated nf-core untar module
Felix-Kummer Sep 18, 2024
5e006c0
Enriched schema with patterns for parameters
Felix-Kummer Sep 18, 2024
980347f
Improved output documentation for tss files
Felix-Kummer Sep 18, 2024
e036cb3
Added date format to date parameters
Felix-Kummer Sep 18, 2024
7564dd6
Removed deprecated docker parameter
Felix-Kummer Sep 18, 2024
cd5fb92
Added tags to all modules
Felix-Kummer Sep 19, 2024
f12f0c9
Removed restrictions on FORCE thread numbers and corresponding parameter
Felix-Kummer Sep 26, 2024
7f7805b
Replaced usage of params in modules and subworkflows with channels
Felix-Kummer Sep 26, 2024
fd09671
Added more output channels to the top level workflow
Felix-Kummer Sep 26, 2024
a4d2e7f
Added automatic tarball extraction for input parameters
Felix-Kummer Sep 28, 2024
99ff909
Changed UNTAR container to its default container image
Felix-Kummer Oct 7, 2024
605f154
Changed force-pyramid to process a single file instead of groups of f…
Felix-Kummer Oct 11, 2024
e8731e1
Added missing description in the manifest scope.
Felix-Kummer Oct 14, 2024
ac70e35
Merge branch 'nf-core:dev' into dev
Felix-Kummer Oct 14, 2024
7d32cb3
Merge branch 'dev' into nf-core-template-merge-3.0.2
Felix-Kummer Oct 18, 2024
7e34131
Merge branch 'dev' into nf-core-template-merge-3.0.2
Felix-Kummer Oct 18, 2024
6fe422b
Merge pull request #10 from nf-core/nf-core-template-merge-3.0.2
Felix-Kummer Oct 18, 2024
b6c2e63
Merge remote-tracking branch 'origin/dev' into dev
Felix-Kummer Oct 18, 2024
22166e9
Updated input mimetype in schema
Felix-Kummer Oct 25, 2024
c822ba7
Added missing fields to schema
Felix-Kummer Oct 25, 2024
15e4c1e
Updated changelog
Felix-Kummer Oct 25, 2024
415edb4
Fixed some linter warnings
Felix-Kummer Oct 26, 2024
0585e5e
Replaced for-loops with GNU parallel
Felix-Kummer Oct 28, 2024
bd82d81
Migrated check result modules to nf-test
Felix-Kummer Nov 9, 2024
a8da0e3
Added parameter to disable all output publishing
Felix-Kummer Nov 11, 2024
e67107d
Fixed log output for preprocessing
Felix-Kummer Nov 13, 2024
88ea70f
Added pipeline-level nf-test tests
Felix-Kummer Nov 24, 2024
72996b1
Aligned run command in usage docs with other pipelines
Felix-Kummer Nov 26, 2024
ba1d17f
Updated nf-core workflows and modules
Felix-Kummer Nov 26, 2024
d8be4ef
Fix nf-test entry in .gitignore
Felix-Kummer Nov 26, 2024
3d64227
Fixed wrong pipeline version in usage.md
Felix-Kummer Nov 26, 2024
a651b55
Added concrete boolean values for parameters in usage.md
Felix-Kummer Nov 26, 2024
caee766
Merge pull request #9 from CRC-FONDA/dev
Felix-Kummer Nov 26, 2024
b877f51
Aligned Nextflow files with new language-server formatter
Felix-Kummer Dec 16, 2024
7b6d06b
Added diagram
Felix-Kummer Dec 16, 2024
3a5211c
Fixed minor issues in README.md
Felix-Kummer Dec 16, 2024
8f17143
Fixed minor issues in schema
Felix-Kummer Dec 16, 2024
4875e12
Removed some empty lines
Felix-Kummer Dec 16, 2024
e0377eb
Merge branch 'dev' of https://github.com/CRC-FONDA/nf-core-rangeland …
Felix-Kummer Dec 16, 2024
e90a0d1
Merge pull request #12 from CRC-FONDA/dev
Felix-Kummer Dec 16, 2024
a7d7c4c
Improved infrastructure-independence
Felix-Kummer Dec 18, 2024
ee02655
Merge branch 'nf-core:dev' into dev
Felix-Kummer Dec 18, 2024
c534f93
Disabled publishing of version.yml in visualization processes
Felix-Kummer Dec 19, 2024
7c9e49d
Merge pull request #13 from CRC-FONDA/dev
Felix-Kummer Dec 20, 2024
ba66df2
Merge branch 'TEMPLATE' of https://github.com/nf-core/rangeland into dev
Felix-Kummer Dec 20, 2024
7fd48d3
Merge branch 'nf-core:dev' into dev
Felix-Kummer Dec 20, 2024
bfabfee
Merge pull request #15 from CRC-FONDA/dev
Felix-Kummer Jan 3, 2025
b8cb370
Addressed final reviewer suggestion for version 1.0.0
Felix-Kummer Jan 17, 2025
f802267
Merge pull request #16 from CRC-FONDA/dev
Felix-Kummer Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/awsfulltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ jobs:

- name: Launch workflow via Seqera Platform
uses: seqeralabs/action-tower-launch@v2
# TODO nf-core: You can customise AWS full pipeline tests as required
# Add full size test data (but still relatively small datasets for few samples)
# on the `test_full.config` test runs with only one set of parameters
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ testing/
testing*
*.pyc
null/
.nf-test*
1 change: 1 addition & 0 deletions .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ template:
outdir: .
skip_features:
- igenomes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something for the future, I guess you can also skip fastqc?

- fastqc
version: 1.0.0
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v1.0.0 - [date]
## v1.0.0 - [2025-01-17]

Initial release of nf-core/rangeland, created with the [nf-core](https://nf-co.re/) template.
First release of `nf-core/rangeland`.
This work is a continuation, and nf-core port, of the [original version of this pipeline](https://github.com/CRC-FONDA/FORCE2NXF-Rangeland).

### `Added`

Expand Down
12 changes: 10 additions & 2 deletions CITATIONS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# nf-core/rangeland: Citations

## [FORCE on Nextflow](https://www.informatik.hu-berlin.de/de/forschung/gebiete/wbi/research/publications/2021/force_nextflow.pdf/@@download/file/force_nextflow.pdf)

This paper describes technical details of deploying the FORCE tool in a Nextflow workflow. The workflow developed in this paper is the foundation for this nf-core pipeline.

> Lehmann, F., Frantz, D., Becker, S., Leser, U., Hostert, P. (2021). FORCE on Nextflow: Scalable Analysis of Earth Observation Data on Commodity Clusters. In CIKM Workshops.

## [nf-core](https://pubmed.ncbi.nlm.nih.gov/32055031/)

> Ewels PA, Peltzer A, Fillinger S, Patel H, Alneberg J, Wilm A, Garcia MU, Di Tommaso P, Nahnsen S. The nf-core framework for community-curated bioinformatics pipelines. Nat Biotechnol. 2020 Mar;38(3):276-278. doi: 10.1038/s41587-020-0439-x. PubMed PMID: 32055031.
Expand All @@ -10,9 +16,11 @@

## Pipeline tools

- [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)
- [FORCE](https://www.mdpi.com/2072-4292/11/9/1124)

> Frantz, D. (2019). FORCE—Landsat + Sentinel-2 Analysis Ready Data and Beyond. Remote Sensing, 11, 1124

> Andrews, S. (2010). FastQC: A Quality Control Tool for High Throughput Sequence Data [Online].- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/)
- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/)

> Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924.

Expand Down
90 changes: 57 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,41 @@

## Introduction

**nf-core/rangeland** is a bioinformatics pipeline that ...

<!-- TODO nf-core:
Complete this sentence with a 2-3 sentence summary of what types of data the pipeline ingests, a brief overview of the
major pipeline sections and the types of output it produces. You're giving an overview to someone new
to nf-core here, in 15-20 seconds. For an example, see https://github.com/nf-core/rnaseq/blob/master/README.md#introduction
-->

<!-- TODO nf-core: Include a figure that guides the user through the major workflow steps. Many nf-core
workflows use the "tube map" design for that. See https://nf-co.re/docs/contributing/design_guidelines#examples for examples. -->
<!-- TODO nf-core: Fill in short bullet-pointed list of the default steps in the pipeline -->1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/))2. Present QC for raw reads ([`MultiQC`](http://multiqc.info/))
**nf-core/rangeland** is a geographical best-practice analysis pipeline for remotely sensed imagery.
The pipeline processes satellite imagery alongside auxiliary data in multiple steps to arrive at a set of trend files related to land-cover changes. The main pipeline steps are:

1. Read satellite imagery, digital elevation model (dem), endmember definition, water vapor database (wvdb), datacube definition and area of interest definition (aoi)
2. Generate allow list and analysis mask to determine which pixels from the satellite data can be used
3. Preprocess data to obtain atmospherically corrected images alongside quality assurance information (aka. level 2 analysis read data)
4. Merge spatially and temporally overlapping preprocessed data
5. Classify pixels by applying linear spectral unmixing
6. Time series analyses to obtain trends in vegetation dynamics to derive level 3 data
7. Create mosaic and pyramid visualizations of the results
8. Version reporting with MultiQC ([`MultiQC`](http://multiqc.info/))

<p align="center">
<img title="nf-core/rangeland diagram" src="docs/images/rangeland_diagram.png" width=95%>
</p>

## Usage

> [!NOTE]
> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow.Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.

<!-- TODO nf-core: Describe the minimum required steps to execute the pipeline, e.g. how to prepare samplesheets.
Explain what rows and columns represent. For instance (please edit as appropriate):
> If you are new to Nextflow and nf-core, please refer to [this page](https://nf-co.re/docs/usage/installation) on how to set-up Nextflow. Make sure to [test your setup](https://nf-co.re/docs/usage/introduction#how-to-run-a-pipeline) with `-profile test` before running the workflow on actual data.

First, prepare a samplesheet with your input data that looks as follows:

`samplesheet.csv`:

```csv
sample,fastq_1,fastq_2
CONTROL_REP1,AEG588A1_S1_L002_R1_001.fastq.gz,AEG588A1_S1_L002_R2_001.fastq.gz
```

Each row represents a fastq file (single-end) or a pair of fastq files (paired end).

-->
To run, satellite imagery, water vapor data, a digital elevation model, endmember definitions, a datacube specification, and a area-of-interest specification are required as input data.
Please refer to the [usage documentation](https://nf-co.re/rangeland/usage) for details on the input structure.

Now, you can run the pipeline using:

<!-- TODO nf-core: update the following command to include all required parameters for a minimal example -->

```bash
nextflow run nf-core/rangeland \
-profile <docker/singularity/.../institute> \
--input samplesheet.csv \
--input <SATELLITE IMAGES> \
--dem <DIGITAL ELEVATION MODEL> \
--wvdb <WATER VAPOR DATA> \
--data_cube <DATA CUBE> \
--aoi <AREA OF INTEREST> \
--endmember <ENDMEMBER SPECIFICATION> \
--outdir <OUTDIR>
```

Expand All @@ -74,11 +68,34 @@ For more details about the output files and reports, please refer to the

## Credits

nf-core/rangeland was originally written by Fabian Lehmann, David Frantz, Felix Kummer.
The rangeland workflow was originally written by:

- [Fabian Lehmann](https://github.com/Lehmann-Fabian)
- [David Frantz](https://github.com/davidfrantz)

The original workflow can be found on [github](https://github.com/CRC-FONDA/FORCE2NXF-Rangeland).

Transformation to nf-core/rangeland was conducted by [Felix Kummer](https://github.com/Felix-Kummer).
nf-core alignment started on the [nf-core branch of the original repository](https://github.com/CRC-FONDA/FORCE2NXF-Rangeland/tree/nf-core).

We thank the following people for their extensive assistance in the development of this pipeline:

<!-- TODO nf-core: If applicable, make list of people who have also contributed -->
- [Fabian Lehmann](https://github.com/Lehmann-Fabian)
- [Katarzyna Ewa Lewinska](https://github.com/kelewinska).

## Acknowledgements

This pipeline was developed and aligned with nf-core as part of the [Foundations of Workflows for Large-Scale Scientific Data Analysis (FONDA)](https://fonda.hu-berlin.de/) initiative.

[![FONDA](docs/images/fonda_logo2_cropped.png)](https://fonda.hu-berlin.de/)

FONDA can be cited as follows:

> **The Collaborative Research Center FONDA.**
>
> Ulf Leser, Marcus Hilbrich, Claudia Draxl, Peter Eisert, Lars Grunske, Patrick Hostert, Dagmar Kainmüller, Odej Kao, Birte Kehr, Timo Kehrer, Christoph Koch, Volker Markl, Henning Meyerhenke, Tilmann Rabl, Alexander Reinefeld, Knut Reinert, Kerstin Ritter, Björn Scheuermann, Florian Schintke, Nicole Schweikardt, Matthias Weidlich.
>
> _Datenbank Spektrum_ 2021 doi: [10.1007/s13222-021-00397-5](https://doi.org/10.1007/s13222-021-00397-5)

## Contributions and Support

Expand All @@ -89,7 +106,7 @@ For further information or help, don't hesitate to get in touch on the [Slack `#
## Citations

<!-- TODO nf-core: Add citation for pipeline after first release. Uncomment lines below and update Zenodo doi and badge at the top of this file. -->
<!-- If you use nf-core/rangeland for your analysis, please cite it using the following doi: [10.5281/zenodo.XXXXXX](https://doi.org/10.5281/zenodo.XXXXXX) --><!-- TODO nf-core: Add bibliography of tools and data used in your pipeline -->
<!-- If you use nf-core/rangeland for your analysis, please cite it using the following doi: [10.5281/zenodo.XXXXXX](https://doi.org/10.5281/zenodo.XXXXXX) -->

An extensive list of references for the tools used by the pipeline can be found in the [`CITATIONS.md`](CITATIONS.md) file.

Expand All @@ -100,3 +117,10 @@ You can cite the `nf-core` publication as follows:
> Philip Ewels, Alexander Peltzer, Sven Fillinger, Harshil Patel, Johannes Alneberg, Andreas Wilm, Maxime Ulysse Garcia, Paolo Di Tommaso & Sven Nahnsen.
>
> _Nat Biotechnol._ 2020 Feb 13. doi: [10.1038/s41587-020-0439-x](https://dx.doi.org/10.1038/s41587-020-0439-x).

This pipeline is based one the publication listed below.
The publication can be cited as follows:

> **FORCE on Nextflow: Scalable Analysis of Earth Observation Data on Commodity Clusters**
>
> [Lehmann, F., Frantz, D., Becker, S., Leser, U., Hostert, P. (2021). FORCE on Nextflow: Scalable Analysis of Earth Observation Data on Commodity Clusters. In CIKM Workshops.](https://www.informatik.hu-berlin.de/de/forschung/gebiete/wbi/research/publications/2021/force_nextflow.pdf/@@download/file/force_nextflow.pdf)
46 changes: 46 additions & 0 deletions bin/merge_boa.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env Rscript

## Originally written by Felix Kummer and released under the MIT license.
## See git repository (https://github.com/nf-core/rangeland) for full license text.

# Script for merging bottom of atmosphere (boa) .tif raster files.
# This can improve the performance of downstream tasks.

require(terra)

args <- commandArgs(trailingOnly = TRUE)


if (length(args) < 3) {
stop("\nError: this program needs at least 3 inputs\n1: output filename\n2-*: input files", call.=FALSE)
}

fout <- args[1]
finp <- args[2:length(args)]

# Load input rasters
rasters <- lapply(finp, rast)

# Calculate the sum of non-NA values across all rasters
sum_rasters <- Reduce("+", lapply(rasters, function(x) {
x[is.na(x)] <- 0
return(x)
}))

# Calculate the number of values non-NA values for each cell
count_rasters <- Reduce("+", lapply(rasters, function(x) {
return(!is.na(x))
}))

# Calculate the mean raster
mean_raster <- sum_rasters / count_rasters

# Write the mean raster
writeRaster(mean_raster,
filename = fout,
datatype = "INT2S",
filetype = "GTiff",
gdal = c("COMPRESS=LZW", "PREDICTOR=2",
"NUM_THREADS=ALL_CPUS", "BIGTIFF=YES",
sprintf("BLOCKXSIZE=%s", ncol(mean_raster)),
sprintf("BLOCKYSIZE=%s", nrow(mean_raster))))
41 changes: 41 additions & 0 deletions bin/merge_qai.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env Rscript

## Originally written by Felix Kummer and released under the MIT license.
## See git repository (https://github.com/nf-core/rangeland) for full license text.

# Script for merging quality information (qai) .tif raster files.
# This can improve the performance of downstream tasks.

require(terra)

args <- commandArgs(trailingOnly = TRUE)


if (length(args) < 3) {
stop("\nError: this program needs at least 3 inputs\n1: output filename\n2-*: input files", call.=FALSE)
}

fout <- args[1]
finp <- args[2:length(args)]

# load raster files into single SpatRaster
rasters <- rast(finp)

# Merge rasters by maintaining the last non-NA value
merged_raster <- app(rasters, function(x) {
non_na_values <- na.omit(x)
if (length(non_na_values) == 0) {
return(1)
}
return(tail(non_na_values, 1)[1])
})

# Write merged raster
writeRaster(merged_raster,
filename = fout,
filetype = "GTiff",
datatype = "INT2S",
gdal = c("INTERLEAVE=BAND", "COMPRESS=LZW", "PREDICTOR=2",
"NUM_THREADS=ALL_CPUS", "BIGTIFF=YES",
sprintf("BLOCKXSIZE=%s", ncol(merged_raster)),
sprintf("BLOCKYSIZE=%s", nrow(merged_raster))))
Loading
Loading