Hi I'm pretty new to Nextflow and Nf Core Modules....
# modules
a
Hi I'm pretty new to Nextflow and Nf Core Modules. I used the 'nf-core modules install fastp' command to download the fastp module. And in my script, I have include { FASTP } from './modules/nf-core/fastp/main'. The process that runs the script is just fastp --help and I get this error: Command error: .command.sh: line 2: fastp: command not found. I'm not sure why because I did the same for fasterq and was able to successfully import it.
Copy code
#!/usr/bin/env nextflow

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

include { SRATOOLS_FASTERQDUMP } from './modules/nf-core/sratools/fasterqdump/main'
include { FASTP } from './modules/nf-core/fastp/main'

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PROCESSES FOR WORKFLOW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

// Fetch SRA data and convert to FastQ format
process getSRA {
    publishDir 'results', mode: 'copy'

    input:
        // Receive SRA accessions from the channel
        val accession

    output:
        path "SRA/${accession}", emit: sra_dir
        path "RawReads/${accession}_1.fastq", emit: read1
        path "RawReads/${accession}_2.fastq", emit: read2

    script:
    """
    # Create directories for the accession and raw reads
    mkdir -p SRA/
    mkdir -p RawReads/

    # Fetch the SRA data using prefetch
    prefetch "${accession}" --output-directory "SRA/"

    # Convert the SRA file to FastQ using fasterq-dump
    fasterq-dump "${accession}" --outdir "RawReads/" --split-files --skip-technical
    """
}

// Trim the FastQ reads using fastp
process trim {
    publishDir 'results', mode: 'copy'
    container 'nfcore/fastp:latest'

    input:
        path read1
        path read2

    output:
        path "CleanedReads/${read1.baseName}.R1.trimmed.fq.gz", emit: trimmed_read1
        path "CleanedReads/${read2.baseName}.R2.trimmed.fq.gz", emit: trimmed_read2

    script:
    """

    fastp --help
    """
}




/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    RUN MAIN WORKFLOW
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

workflow {
    // Define the SRA accession
    SRA_acc = Channel.of("SRR1556296")  // You can modify these accessions as needed

    // Fetch SRA data for each accession
    sra_outputs = getSRA(SRA_acc)

    // Extract read1 and read2 from the output of getSRA
    read1 = sra_outputs.read1
    read2 = sra_outputs.read2

    // Now, run the trimming process on the fetched FastQ files
    trimmed_reads = trim(read1, read2)
}
a
It doesn’t look like you are using the actual modules here? The error looks like it comes from your own
trim
module and not from anything to do with
nf-core
. That module has a container:
container 'nfcore/fastp:latest'
but I don’t know if that’s a real container or if you are even running with a container engine