Coder Social home page Coder Social logo

Comments (4)

pditommaso avatar pditommaso commented on June 12, 2024

I think this is happening because you may have declared the build index process input as a channel. Since you want to build index just once you need to specify that input just as file reference.

Look for example how is declare genome_file in this process that's doing exactly what you are looking for.

from hack17-varcall.

cfpcxs avatar cfpcxs commented on June 12, 2024

Hello,

Thank you for your reply!
I think I made what you are saying, I have declared the build index input as a channel. Here is the part of my script that works for only one sample. Do you think I did something wrong?

Thank you for your attention

process buildIndex {
    executor "lsf"
    module "STAR/2.5.3a"
    publishDir params.outdir, mode: 'copy'

    input:
    file(genome) from genome_file 
    file(annot) from annotation_file

    output:
    file(indexDir) into genome_indexD 
    file(annot) into annotation_file2

"""
mkdir indexDir
STAR --runMode genomeGenerate --genomeDir indexDir --genomeFastaFiles ${genome} --sjdbGTFfile ${annot} --sjdbGTFtagExonParentTranscript Parent 
"""
 } 



/* Alignment with Star: Single Pass Mode: input are genome, genome index and fastqtrimmed data, output are BAM file*/

process alignment {
    executor "lsf"
    module "STAR/2.5.3a"
    module "picard-tools"
    publishDir params.outdir, mode: 'copy'

    input:
    file(index) from genome_indexD
    set pair_id, file(treads) from TrimmomaticPaired3 

    output:
    set pair_id, file("BAMD.*") into bam 
    
"""
mkdir BAMD.${pair_id}
STAR --genomeDir ${index} --outFileNamePrefix BAMD.${pair_id}/${pair_id}_ --readFilesCommand zcat --readFilesIn ${pair_id}.trimmomatic_1P.fq.gz ${pair_id}.trimmomatic_2P.fq.gz --chimSegmentMin 15 --chimJunctionOverhangMin 15 --alignMatesGapMax 20000 --alignIntronMax 20000 --outSAMtype BAM Unsorted --outSAMprimaryFlag AllBestScore --outSAMstrandField intronMotif --outFilterIntronMotifs RemoveNoncanonicalUnannotated --quantMode GeneCounts --outQSconversionAdd -31
"""
}

from hack17-varcall.

pditommaso avatar pditommaso commented on June 12, 2024

I have declared the build index input as a channel

No, it shouldn't be declared like a channel. It should be declared something like:

genome_file = file(params.genome)

from hack17-varcall.

Juke34 avatar Juke34 commented on June 12, 2024

doing file(index) from genome_indexD.collect() should work
The .collect() operator should mean that the channel isn't consumed and is used for every task of the process.

from hack17-varcall.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.