-
Notifications
You must be signed in to change notification settings - Fork 868
Add force-tile-extent module #8635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Felix-Kummer
wants to merge
3
commits into
nf-core:master
Choose a base branch
from
CRC-FONDA:force-tile-extent
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+266
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM quay.io/nfcore/force:3.8.01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
process FORCE_TILEEXTENT { | ||
tag "${aoi.simpleName}" | ||
label 'process_single' | ||
|
||
container "nf-core/force:3.8.01" | ||
|
||
input: | ||
path aoi | ||
path "tmp/datacube-definition.prj" | ||
path shapefile_dbf | ||
path shapefile_prj | ||
path shapefile_shx | ||
|
||
output: | ||
path "tile_allow.txt", emit: tile_allow | ||
path "versions.yml" , emit: versions | ||
|
||
when: | ||
task.ext.when == null || task.ext.when | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
""" | ||
force-tile-extent -d tmp/ -a tile_allow.txt $aoi | ||
rm -r tmp | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
force: \$(force-tile-extent -v) | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
""" | ||
touch tile_allow.txt | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
force: \$(force-tile-extent -v) | ||
END_VERSIONS | ||
""" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json | ||
name: "force_tileextent" | ||
description: | | ||
Compute valid tiles for a given datacube definition and area of interest. | ||
This list can be used by downstream analysis tasks to limit processing to the area of interest when satellite data covers a larger region. | ||
keywords: | ||
- satellite data | ||
- extent | ||
- tile | ||
- datacube | ||
tools: | ||
- "force": | ||
description: | | ||
A all-in-one tool for processing satellite data. | ||
Specialized on medium resolution data such as Landsat or Sentinel imagery. | ||
homepage: "https://davidfrantz.github.io/code/force/" | ||
documentation: "https://force-eo.readthedocs.io/en/latest/index.html" | ||
tool_dev_url: "https://github.com/davidfrantz/force" | ||
doi: "10.3390/rs11091124" | ||
licence: ["GPL-3.0"] | ||
identifier: "" | ||
|
||
input: | ||
- - aoi: | ||
type: file | ||
description: Vector file (either shapefile geometry or geopackage) defining the area of interest. | ||
pattern: "*.{shp,gpkg}" | ||
- - tmp/datacube-definition.prj: | ||
type: file | ||
description: Datacube file in FORCE format defining the properties of the targeted datacube. | ||
pattern: "*.{prj}" | ||
- - shapefile_dbf: | ||
type: file | ||
description: Optional attribute table for shapefiles. Required if aoi is a shapefile. | ||
pattern: "*.{dbf}" | ||
- - shapefile_prj: | ||
type: file | ||
description: Optional projection for shapefiles. Required if aoi is a shapefile. | ||
pattern: "*.{prj}" | ||
- - shapefile_shx: | ||
type: file | ||
description: Optional shape index for shapefiles. Required if aoi is a shapefile. | ||
pattern: "*.{shx}" | ||
|
||
output: | ||
- tile_allow: | ||
- "tile_allow.txt": | ||
type: file | ||
description: List of allowed datacube tiles. Each line contains an tile identifier. | ||
pattern: "tile_allow.txt" | ||
- versions: | ||
- "versions.yml": | ||
type: file | ||
description: File containing software versions | ||
pattern: "versions.yml" | ||
|
||
authors: | ||
- "@Felix-Kummer" | ||
maintainers: | ||
- "@Felix-Kummer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
nextflow_process { | ||
|
||
name "Test Process FORCE_TILEEXTENT" | ||
script "../main.nf" | ||
process "FORCE_TILEEXTENT" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "force" | ||
tag "force/tileextent" | ||
|
||
test("force-tile-extent - gpkg") { | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = file(params.modules_testdata_base_path + "earth_sciences/vector/gpkg/crete.gpkg") | ||
input[1] = file(params.modules_testdata_base_path + "earth_sciences/datacubes/datacube-definition.prj") | ||
input[2] = [] | ||
input[3] = [] | ||
input[4] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("force-tile-extent - shp") { | ||
|
||
config "./nextflow.shp.config" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = file(params.modules_testdata_base_path + "/earth_sciences/vector/shp/denmark.shp") | ||
input[1] = file(params.modules_testdata_base_path + "/earth_sciences/datacubes/datacube-definition.prj") | ||
input[2] = file(params.modules_testdata_base_path + "/earth_sciences/vector/shp/denmark.dbf") | ||
input[3] = file(params.modules_testdata_base_path + "/earth_sciences/vector/shp/denmark.prj") | ||
input[4] = file(params.modules_testdata_base_path + "/earth_sciences/vector/shp/denmark.shx") | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("force-tile-extent - gpkg - stub") { | ||
|
||
options "-stub" | ||
|
||
when { | ||
process { | ||
""" | ||
input[0] = file(params.modules_testdata_base_path + "earth_sciences/vector/gpkg/crete.gpkg") | ||
input[1] = file(params.modules_testdata_base_path + "earth_sciences/datacubes/datacube-definition.prj") | ||
input[2] = [] | ||
input[3] = [] | ||
input[4] = [] | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"force-tile-extent - gpkg": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
"tile_allow.txt:md5,3428a70fcfcfb2ce50e5c65e369fbf75" | ||
], | ||
"1": [ | ||
"versions.yml:md5,6b3d57b4f9567d44e502036809c80e2f" | ||
], | ||
"tile_allow": [ | ||
"tile_allow.txt:md5,3428a70fcfcfb2ce50e5c65e369fbf75" | ||
], | ||
"versions": [ | ||
"versions.yml:md5,6b3d57b4f9567d44e502036809c80e2f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "25.04.2" | ||
}, | ||
"timestamp": "2025-06-13T15:16:51.909565499" | ||
}, | ||
"force-tile-extent - gpkg - stub": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
"tile_allow.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
], | ||
"1": [ | ||
"versions.yml:md5,6b3d57b4f9567d44e502036809c80e2f" | ||
], | ||
"tile_allow": [ | ||
"tile_allow.txt:md5,d41d8cd98f00b204e9800998ecf8427e" | ||
], | ||
"versions": [ | ||
"versions.yml:md5,6b3d57b4f9567d44e502036809c80e2f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "25.04.2" | ||
}, | ||
"timestamp": "2025-06-13T15:17:23.741824063" | ||
}, | ||
"force-tile-extent - shp": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
"tile_allow.txt:md5,f194cf6f608930e6dc31f59453f7ae02" | ||
], | ||
"1": [ | ||
"versions.yml:md5,6b3d57b4f9567d44e502036809c80e2f" | ||
], | ||
"tile_allow": [ | ||
"tile_allow.txt:md5,f194cf6f608930e6dc31f59453f7ae02" | ||
], | ||
"versions": [ | ||
"versions.yml:md5,6b3d57b4f9567d44e502036809c80e2f" | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.9.2", | ||
"nextflow": "25.04.2" | ||
}, | ||
"timestamp": "2025-06-13T15:17:15.400884563" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
process { | ||
// this is required because the module needs all shapefile files in the same directory | ||
stageInMode = 'copy' | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be added to
skip_nf_test.json
? It seems like you havenf-tests
setupThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is within the
conda
scope. The tool in this module is not available on conda. Thus, we skip the tests with theconda
profile.