Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dataDir = "/home/patel/pipelines"
- params.reads = "$dataDir/unmapped_{1,2}.fastq"
- params.genome = "$dataDir/genome.fasta"
- genome_file = file(params.genome)
- /*
- * Input read files
- */
- Channel
- .fromFilePairs(params.reads)
- .ifEmpty {error "Cannot find any reads matching: " }
- .into{ reads_STAR }
- process STAR_index {
- executor 'local'
- memory '32 GB'
- publishDir "$PWD", mode:'copy', overwrite: true
- input:
- file fasta from GENOME
- output:
- file "STAR_genome" into STAR_INDEX
- """
- mkdir -p STAR_genome
- STAR --runMode genomeGenerate \
- --genomeDir STAR_genome \
- --genomeSAindexNbases 3 \
- --genomeFastaFiles ${fasta}
- """
- }
- process STAR_mapping {
- executor 'local'
- memory '32 GB'
- tag $pair_id
- publishDir ${pair_id}
- input:
- set pair_id, file(reads) from reads_STAR
- file starIndex from STAR_INDEX
- output:
- set pair_id, file('Aligned.sortedByCoord.out.bam'), file('Aligned.sortedByCoord.out.bam.bai') into star_out_ch
- """
- STAR --genomeDir starIndex \
- --readFilesIn ${reads} \
- --outSAMstrandField intronMotif \
- --outSAMattributes All \
- --outFilterIntronMotifs RemoveNoncanonical \
- --outSAMtype BAM SortedByCoordinate
- """
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement