Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 17:42

    pditommaso on master

    Add experimental fusion support… (compare)

  • 17:09

    pditommaso on master

    Wave plugin improvements Signe… (compare)

  • 15:58
    pditommaso closed #2982
  • 15:58

    pditommaso on master

    Add support for plugin provided… (compare)

  • 15:58

    pditommaso on 2982-allow-the-import-for-custom-function-from-plugin-extensions

    (compare)

  • 15:58
    pditommaso closed #3079
  • 15:25
    pditommaso synchronize #3079
  • 15:25

    pditommaso on 2982-allow-the-import-for-custom-function-from-plugin-extensions

    Improve name valid [ci fast] S… (compare)

  • 15:18
    pditommaso synchronize #3079
  • 15:18

    pditommaso on 2982-allow-the-import-for-custom-function-from-plugin-extensions

    Fix test Signed-off-by: Paolo … (compare)

  • 14:52
    pditommaso synchronize #3079
  • 14:52

    pditommaso on 2982-allow-the-import-for-custom-function-from-plugin-extensions

    More validation [ci fast] Sign… (compare)

  • 14:19
    pditommaso synchronize #3079
  • 14:19

    pditommaso on 2982-allow-the-import-for-custom-function-from-plugin-extensions

    wip Signed-off-by: Paolo Di To… wip Signed-off-by: Paolo Di To… Refactor [ci fast] Signed-off-… (compare)

  • 13:55
    pditommaso synchronize #3079
  • 13:55

    pditommaso on 2982-allow-the-import-for-custom-function-from-plugin-extensions

    Refactor and test fixes Signed… (compare)

  • 12:41
    pditommaso commented #3079
  • 12:35
    pditommaso synchronize #3079
  • 12:35

    pditommaso on 2982-allow-the-import-for-custom-function-from-plugin-extensions

    Add warning to env config docs … Update FileTransfer pool settin… Bump nf-amazon@1.9.0 Signed-of… and 24 more (compare)

  • Aug 05 19:38
    jorgeaguileraseqera synchronize #3079
arnaudbore
@arnaudbore
Hi Everyone,
I try to put process.cleanup = true in the config file as suggested here https://github.com/nextflow-io/nextflow/pull/2135/files but it does not seems to work (using nextflow-21.09.0-edge-all). I definitively does not understand how to use this option. Can somebody help me on this one ? Thank you in advance.
2 replies
Arijit Panda
@arpanda

Hi Everyone,
I am new to nextflow. So can someone help me to write nextflow code that processes multiple samples with multiple paired fastq files. Here is link my query that I posted in stack overflow. https://stackoverflow.com/questions/69702077/nextflow-how-to-process-multiple-samples .

I can process single sample at once but not all. Here is my code for processing single sample.

params.sampleName="sample1"
params.fastq_path = "data/${params.sampleName}/*{1,2}.fq.gz"

fastq_files = Channel.fromFilePairs(params.fastq_path)

params.ref = "ab.fa"
ref = file(params.ref)

process foo {
    input:
    set pairId, file(reads) from fastq_files

    output:

    file("${pairId}.bam") into bamFiles_ch

    script:
    """
    echo ${reads[0].toRealPath().getParent().baseName}
    bwa-mem2 mem -t 8 ${ref} ${reads[0].toRealPath()} ${reads[1].toRealPath()} | samtools sort -@8 -o ${pairId}.bam
    samtools index -@8 ${pairId}.bam
    """
}

process samToolsMerge {
    publishDir "./aligned_minimap/", mode: 'copy', overwrite: 'false'

    input:
    file bamFile from bamFiles_ch.collect()

    output:
    file("**")

    script:
    """
    samtools merge ${runString}.bam ${bamFile}
    samtools index -@ ${bamFile}
    """
}
image.png
James Mathews
@jimmymathews

The channel.fromPath function seems to accept only bonafide path strings or glob patterns.
How can one make a channel from a path string which is itself only known by looking inside another file?

process retrieve_another_filename {
    input:
    path metadata_file

    output:
    stdout emit: other_filename

    script:
    """
    cat $metadata_file
    """
}

process show_file_contents {
    input:
    path other_filename

    output:
    stdout emit: contents

    script:
    """
    cat $other_filename
    """
}

workflow {
    metadata_file_ch = channel.fromPath('metadata.txt')
    retrieve_another_filename(metadata_file_ch)
    retrieve_another_filename.out.other_filename.view()

    // another_file_ch = channel.fromPath(retrieve_another_filename.out. ... ) ?

    show_file_contents(another_file_ch)
    show_file_contents.out.contents.view()
}

(Note: Trying to be DSL2-compliant.)

2 replies
KyleStiers
@KyleStiers
Has anyone seen nextflow pipelines (potentially more frequently a problem in ones that run a lot or on a cron job) throw errors with the JDK? I see hs_err_pidxxxx.log files show up in the directories where I run them on a slurm cluster describing segfault/sigbus errors. I found this mentioned in #842 and tried changing the flag and sometimes it works to resolve the issue (but potentially at the cost of ruining resuming which I would like to retain), but sometimes it just changes the nature of the error slightly. Any input on this would be great. I'll post the full error in a thread reply to this so it doesn't take up all the space on the page...[repost, but still haven't found any solution]
3 replies
Adam Price
@price0416

I am trying to do something fairly basic, but can't work out the groovy/nextflow-ish way to do it. Fairly new to nextflow/groovy.

I have two channels that look like this:

samples = ["sample1_a", "sample1_b" "sample2_a", "sample2_b", "sample3_a"]
pairs = [ ["sample1_a", "sample1_b"] , ["sample2_a", "sample2_b"], ["sample3_a", "sample3_b"] ]`

I want to select from samples the ones that have both matching pairs. So in a pseudocode logic, i want to accomplish this:

validList = []
for (i in pairs.size()):
if (pairs[i][0] in samples && pairs[i][1] in samples)
validList.add(pairs[i][0])
validList.add(pairs[i][0])

I feel like there should be a pretty straightforward way to use .map or something to accomplish this. Any ideas?

1 reply
Somak Chowdhury
@somakchowdhury
nextflow runs the test profile using docker but when running with samples specified in a csv file it says no input file specified. Can some one suggest what is going wrong?
Benjamin Wingfield
@nebfield

I want to run mawk -f hello_world.awk , and hello_world.awk lives in bin/. What's the nextflowy-est way to do this? (I know it seems weird)

I want to explicitly call mawk for portability (the binary can live in different places) and to use extra arguments like -v. Shebangs aren't portable. Env won't take multiple parameters unless I'm over or under thinking things. At the minute I'm doing some weird shell magic

W. Lee Pang, PhD
@wleepang
Is there a way to get a workflow's session hash before it is run?
hukai916
@hukai916
Hi folks, can anyone explain to me why the following snippet won't print out the exit msg to the console? Basically, I have to comment out the TEST_MODULE() line, otherwise the "Error msg" won't be displayed to console.
nextflow.enable.dsl = 2

workflow {
    process TEST_MODULE {
      script:
      """
      echo "test" > test.txt
      """
    }

    TEST_MODULE()
    exit 1, "Error msg"
}
Greg Gavelis Code Portfolio
@ggavelis
Hi there, When troubleshooting caching issues--does anyone know how to parse the outputs of the -dump-hashes option?
(I'm trying to understand why only a minority of my outputs cache, even though they run successfully. )
The tips on the 'troubleshooting nextflow resume' page suggest running nextflow twice with the -dump-hashes option, then comparing the differences between the logfiles. But what are we looking for exactly? I do not see errors in either file.
First logfile: https://pastebin.com/MgPMWLxX
Second logfile: https://pastebin.com/XgBz3pHs
9 replies
emily-kawabata
@emily-kawabata
Hi everyone,
This is more of a general question but does anyone have any tips or recommendation on when you want to create and maintain a directory structure from the start of the script to the end?
For example, I am writing a script that fetches sequence files from database, run clustering on them, create directory for each cluster and have sequences in them, and finally annotate each files.
I don't know if it's ideal to input and output the entire base directory for every process in the script. Also, when I use the qualifier "each", the directory structure is lost and I would like to know how everyone is working around this.
2 replies
Paul Cantalupo
@pcantalupo
where does the nextflow log value called REVISION ID come from? How is it calculated?
shenkers
@shenkers

With DSL2 is there a way to make staging of files from S3 lazy? When I was working with vanilla nextflow I could get it to delay staging files until the process starts executing by taking a channel that contains S3 path strings and mapping it to file() in the input block of the process.

process example {
input:
  file('input.txt') from s3pathStrings.map{ file(it) }
....
}

with DSL2 it now looks like this:

data = s3pathStrings.map{ file(it) }

process example {
input:
  file('input.txt')
....
}

workflow{
  example(data)
}

In the first version (before DSL2) nextflow would schedule some concurrent tasks, and as those tasks execute it would trigger the staging of the remote files they needed for execution. In the DSL2 version all the files are staged in the top level scope, before any "example" tasks start executing.

Since from isn't part of DSL2 it doesn't seem that it is possible to use this trick any more. Is there another way to do this with DSL2? It was nice to have this behavior because if there are a lot of files to stage at the same time it sometimes causes s3 connections to time out. It was also a little nicer than limiting the parallel transfers because it helps prioritize which files to stage first to enable the first tasks to start executing more quickly.

LiterallyUniqueLogin
@LiterallyUniqueLogin

Hi all, new to next flow here. Two related questions:

I want the following in my config file:

process {
  publishDir {
    path = '.'
    mode = 'link'
    enabled = { task.ext.publish }
  }
}

So that I can turn on publication in my processes by just setting task.ext.publish to true or false, depending. (This way I don't have to respecify the path or link each time)

However, there are two issues: in the config file, it seems that task.ext.publish is interpreted as process.publishDir.task.ext.publish which isn't what I want. Also, I can't seem to set ext.publish from my process, the period in ext.publish true seems to be screwing things up.

Any advice? Thanks!

kojix2
@kojix2

Hi! When I try to run nf-core on my local PC after a long time, I get the following error. Does anyone know the cause?

nextflow run nf-core/rnaseq -profile test,docker -r 3.3

N E X T F L O W  ~  version 21.09.1-edge
Launching `nf-core/rnaseq` [disturbed_meucci] - revision: 8094c42add [3.3]

ERROR: Validation of pipeline parameters failed!


* --hostnames: expected type: String, found: JSONObject ({"cfc":[".hpc.uni-tuebingen.de"],"utd_sysbio":["sysbio.utdallas.edu"],"utd_ganymede":["ganymede.utdallas.edu"],"genouest":[".genouest.org"],"cbe":[".cbe.vbc.ac.at"],"genotoul":[".genologin1.toulouse.inra.fr",".genologin2.toulouse.inra.fr"],"crick":[".thecrick.org"],"uppmax":[".uppmax.uu.se"],"icr_davros":[".davros.compute.estate"],"imperial":[".hpc.ic.ac.uk"],"binac":[".binac.uni-tuebingen.de"],"imperial_mb":[".hpc.ic.ac.uk"]})
kojix2
@kojix2
By reinstalling Nextflow, the error no longer occurs. It may have something to do with the fact that I recently updated Ubuntu to 21.10.
I could not figure out how to uninstall Nextflow. So I simply ran the following command one more time. curl -s https://get.nextflow.io | bash Then I moved the created nextflow file to the path. Now it works properly.
maxulysse
@maxulysse:matrix.org
[m]
@kojix2 can you come over to the nf-core slack. I think I remember some discussion about this issue
maxulysse
@maxulysse:matrix.org
[m]
Nevermind, found the related issue: nf-core/tools#1304
1 reply
Jeffrey Massung
@massung

Is it possible for me to access the params such that I can write them as an output? In my particular workflow, several of the params used are things like "password needed to unzip file", which I'd like to save for posterity in the output location. I'm basically trying to do:

params_json = new JsonBuilder(params).toString()

process xxx {
    shell:
        '''echo !{params_json} > params.json'''
}

But it's not letting me. Is there some other nice way for me to do this?

9 replies
Juan MONROY-NIETO
@jmonroynieto
I've been using this as boilerplate code to find reads in the current directory. I would like to make it less verbose but that would need extended globbing and my initial tests have been unsuccessful even with all possible scaping sequences trying +([0-9]). How do you all deal with this?
Channel.fromFilePairs(["*_S[0-9]_L00[1-9]_{R1,R2}_001.fastq.gz",
                        "*_S[0-9][0-9]_L00[1-9]_{R1,R2}_001.fastq.gz",
                        "*_S[0-9][0-9][0-9]_L00[1-9]_{R1,R2}_001.fastq.gz",
                        "*_S[0-9][0-9][0-9][0-9]_L00[1-9]_{R1,R2}_001.fastq.gz"]).set { illumina_q }
Steven P. Vensko II
@spvensko_gitlab
Does nextflow clean -before <desired_run> delete the CACHED directories it utilized (if they are from an earlier run prior to <desired_run>?
xmzhuo
@xmzhuo

Hey all. I have trouble cat two files together under shell. Outside of nextflow run, everything work flawlessly.
shell:
'''
echo "read1: NA12878_S1_L001_R1_001.fastq.gz NA12878_S1_L002_R1_001.fastq.gz"
echo "read2: NA12878_S1_L001_R2_001.fastq.gz NA12878_S1_L002_R2_001.fastq.gz"
echo $(ls)
cat NA12878_S1_L001_R1_001.fastq.gz NA12878_S1_L002_R1_001.fastq.gz > read1.fastq.gz
cat NA12878_S1_L001_R2_001.fastq.gz NA12878_S1_L002_R2_001.fastq.gz > read2.fastq.gz
'''

Command exit status:
1

Command output:
read1: NA12878_S1_L001_R1_001.fastq.gz NA12878_S1_L002_R1_001.fastq.gz
read2: NA12878_S1_L001_R2_001.fastq.gz NA12878_S1_L002_R2_001.fastq.gz
NA12878_S1_L001_R1_001.fastq.gz NA12878_S1_L001_R2_001.fastq.gz NA12878_S1_L002_R1_001.fastq.gz NA12878_S1_L002_R2_001.fastq.gz

Command error:
cat: NA12878_S1_L001_R1_001.fastq.gz: No such file or directory
cat: NA12878_S1_L002_R1_001.fastq.gz: No such file or directory

13 replies
hukai916
@hukai916
Hello all,
Does anyone know if it is possible to mix more than one language in the script block? E.g. run a specific bash command first, then run the rest with Python? Thanks!
2 replies
Pavel Borobov
@blvp

Hi all, How much does it cost to run a workflow using tower and aws-batch + fsx lustre? I'm working on a customer project right now and want to evaluate this option. Perhaps some guidance to the documentation and pricing model is needed.
Using aws-batch mode with s3 only work directory is not very efficient.

What is the commercial license price

Steffen Fehrmann
@sfehrmann
:point_up: August 11, 2019 12:50 PM
Hi all, I'm looking for a method to convert paired end data from bcl2fastq process output into fastq file pair tuple. @happykhan's method is the only I found. Is there some more elegant way with DSL2? Currently I have a standard bcl2fastq process that emits *.fastq.gzand I can read in the sample sheet, but I'd need to match sample sheet names and filename. Is there some way to use something like the.fromFilePairs factory on an existing channel?
Ernesto Lowy
@elowy01
Hi, I've a question on a process using a Python block and emitting files in DSL2.
This is the workflow:
nextflow.enable.dsl=2
process createFiles {
    output:
    path("*.txt", emit: apath)

    script:
    """
    #!/usr/bin/env python

    filenames = ['a.txt', 'b.txt', 'c.txt']

    for f in filenames:
        with open(f, "w") as wf:
            wf.write("hello\\n")
        print(f)
    """
}
process printContent {
    input:
        path(x)

    script:
    """
    cat $x
    """
}

workflow {
    createFiles()
    printContent(createFiles.out.apath)
}
The first process (createFiles) creates the files and emit a channel with the paths of the created files using a Python block and the second (printContent) prints the contents of each file.
My question is:
When I run this workflow. I see the following information from NF:
executor >  local (2)
[67/0c496d] process > createFiles  [100%] 1 of 1 ✔
[1b/36a13c] process > printContent [100%] 1 of 1
Ernesto Lowy
@elowy01
And it seems that the three files generated by createFiles are emitted in a single channel and all files are taken together by printContent instead of being analysed in an independent printContent job each.
7 replies
Can you let me know how to analyse independently each of the files?
Thanks
Luca Cozzuto
@lucacozzuto
Hi @elowy01 :) you can either make the file names as a channel outside your block of code as suggested by @pcantalupo or use the flatten operator
Paul Cantalupo
@pcantalupo
@lucacozzuto where do you add flatten? Can you post the code? thank you
Luca Cozzuto
@lucacozzuto
here
workflow {
    createFiles()
    printContent(createFiles.out.apath.flatten())
}
Paul Cantalupo
@pcantalupo
ahh, I tried that but forgot the (). Thank you
4 replies
Luca Cozzuto
@lucacozzuto
Hi all, do you know how to change the behavior when uploading the bin to AWS ?
I found that soft links are not preserved and lost
I opened an issue but not sure though nextflow-io/nextflow#2427
Luca Cozzuto
@lucacozzuto
Well it looks like links are not possible in S3. Mmm
Luca Cozzuto
@lucacozzuto
Well another question. Is there any variable that nextflow sets when uploading the bin folder to S3? For accessing that folder from any process...
cc @pditommaso :)
John Ma
@JohnMCMa

Is it possible to create files with the native execution mode of a process? For example, I attempted the following:

process WRITE_FASTP_METRICS{
    input:
        val (rna_result)
        val (adt_result)
    output:
        path "fastp_metrics.csv"
    exec:
        write_out = file("fastp_metrics.csv")
        rna_result.forEach{key, value ->
            write_out << key << ',' << value << '\n'
        }
        adt_result.forEach{key, value ->
            write_out << key << ',' << value << '\n'
        }
}

But the fastp_metrics.csv is not created in the work directory, causing this error: Missing output file(s) ``fastp_metrics.csv`` expected by process ``WRITE_FASTP_METRICS (1)``

anoronh4
@anoronh4

i'm wondering if we can pass in a container as a variable, as i want to test the same process over various versions of a software. something like this:

process A {
container= container_label

input:
tuple val(container_label), path(inputFile)
...
}

this code did not work, however. can it be done in another way?

rpetit3
@rpetit3:matrix.org
[m]
You could make a parameter to do it at run time, something like
process A {
container= params.container_label

input:
path(inputFile)
...
}