Skip to content
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

Sanitize path #1568

Closed
maxulysse opened this issue Jun 18, 2024 · 4 comments
Closed

Sanitize path #1568

maxulysse opened this issue Jun 18, 2024 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@maxulysse
Copy link
Member

Description of the bug

params.outdir + "/path/output/"

->

file(params.outdir + "/path/output/").toUriString()

Command used and terminal output

No response

Relevant files

No response

System information

No response

@maxulysse maxulysse added the bug Something isn't working label Jun 18, 2024
@adamrtalbot
Copy link
Contributor

For context, the bug is that sometimes the path is resolved to include a double slash. This breaks certain filesystems:

e.g.

params.outdir = '/output/`

params.outdir + /path/ = /output//path/

Using file operations will solve this: https://www.nextflow.io/docs/latest/script.html#opening-files

Options:
file(params.outdir).resolve("path")
file(params.outdir) / "path"
file("${params.outdir}/path") <- path object
file("${params.outdir}/path").toUriString() <- string object

@maxulysse maxulysse added this to the 3.5 milestone Jun 18, 2024
@FriederikeHanssen FriederikeHanssen self-assigned this Jul 1, 2024
@FriederikeHanssen
Copy link
Contributor

After the recent dicussions, do we still want to fix this here or rather wait for a nextflow fix? This applies to virtually all nf-core pipelines and how they specify the outdir in modules.config

Related issue: #1580

@FriederikeHanssen
Copy link
Contributor

fixed by nextflow as far as I can tell. Any remaining issues are in nf-validation

@allyssonallan
Copy link

allyssonallan commented Jan 28, 2025

igenomes_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'

Using test profile:

  1. I am getting this error related to the double slash.
    `igenomes_base = 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/'``

  2. After changing to /data without the end slash, I am getting this error related to the addresses that changed in https://github.com/nf-core/test-datasets/tree/modules/data:

ERROR ~ Validation of pipeline parameters failed!

 -- Check '.nextflow.log' file for details
The following invalid input values have been detected:

* --mappability (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/Control-FREEC/out100m2_hg38.gem): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/Control-FREEC/out100m2_hg38.gem' does not exist
* --germline_resource_tbi (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/af-only-gnomad.hg38.vcf.gz.tbi): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/af-only-gnomad.hg38.vcf.gz.tbi' does not exist
* --fasta_fai (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.fasta.fai): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.fasta.fai' does not exist
* --known_indels (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/Mills_and_1000G_gold_standard.indels.hg38,beta/Homo_sapiens_assembly38.known_indels.vcf.gz): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/Mills_and_1000G_gold_standard.indels.hg38,beta/Homo_sapiens_assembly38.known_indels.vcf.gz' does not exist
* --known_indels_tbi (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz.tbi): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/Mills_and_1000G_gold_standard.indels.hg38.vcf.gz.tbi' does not exist
* --ngscheckmate_bed (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/NGSCheckMate/SNP_GRCh38_hg38_wChr.bed): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/NGSCheckMate/SNP_GRCh38_hg38_wChr.bed' does not exist
* --fasta (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.fasta): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Sequence/WholeGenomeFasta/Homo_sapiens_assembly38.fasta' does not exist
* --known_snps_tbi (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000G_omni2.5.hg38.vcf.gz.tbi): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000G_omni2.5.hg38.vcf.gz.tbi' does not exist
* --germline_resource (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/af-only-gnomad.hg38.vcf.gz): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/af-only-gnomad.hg38.vcf.gz' does not exist
* --known_snps (https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000G_omni2.5.hg38.vcf.gz): the file or directory 'https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/Homo_sapiens/GATK/GRCh38/Annotation/GATKBundle/1000G_omni2.5.hg38.vcf.gz' does not exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants