Solution
/*
* Process 1C: Create the genome index file for STAR
*/
process '1C_prepare_star_genome_index' {
input:
file(genome) from genome_file (1)
output:
file(genome_dir) into genome_dir_ch (2)
script:
"""
mkdir genome_dir (3)
STAR --runMode genomeGenerate \
--genomeDir genome_dir \
--genomeFastaFiles ${genome} \
--runThreadN ${task.cpus}
"""
}
| 1 | Take as input the genome file from genome_file. |
| 2 | The output is a file* called genome_dir and is added into a channel called genome_dir_ch. You can call the channel whatever you wish. |
| 3 | Creates the output directory that will contain the resulting STAR genome index. |
| * The file in this case is a directory however it makes no difference. |