Skip to content
Snippets Groups Projects
Select Git revision
  • 231fd9e6a361a8095f07f32ce8c42b69f9409f8f
  • master default protected
  • dev
  • v2.0.0
  • v0.4.0
  • v0.3.0
  • v0.2.9
  • v0.2.8
  • v0.2.7
  • v0.2.6
  • v0.1.0
  • v0.2.5
  • v0.2.4
  • v0.2.3
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.2
18 results

fastqdump.nf

Blame
  • Forked from LBMC / nextflow
    940 commits behind the upstream repository.
    Laurent Modolo's avatar
    231fd9e6
    History
    fastqdump.nf 970 B
    /*
    * sra-tools :
    
    */
    
    /*                      fastq-dump
    * Imputs : srr list
    * Outputs : fastq files
    */
    
    params.list_srr = "$baseDir/data/SRR/*.txt"
    
    log.info "downloading list srr : ${params.list_srr}"
    
    Channel
      .fromPath( params.list_srr )
      .ifEmpty { error "Cannot find any bam files matching: ${params.list_srr}" }
      .splitCsv()
      .map { it -> it[0]}
      .set { SRR }
    
    //run is the column name containing SRR ids
    
    process fastq_dump {
      tag "$file_id"
      publishDir "results/download/fastq/${file_id}/", mode: 'copy'
    
      input:
        val file_id from SRR
    
      output:
        set file_id, "*.fastq" into fastq
    
      script:
    """
    #for test only 10000  reads are downloading with the option -N 10000 -X 20000
    fastq-dump --split-files --defline-seq '@\$ac_\$si/\$ri' --defline-qual "+" -N 10000 -X 20000 ${file_id}
    if [ -f ${file_id}_1.fastq ]
    then
      mv ${file_id}_1.fastq ${file_id}_R1.fastq
    fi
    if [ -f ${file_id}_2.fastq ]
    then
      mv ${file_id}_2.fastq ${file_id}_R2.fastq
    fi
    """
    }