跳转至

nf-core

离线运行

以 atacseq 为例

加载软件并设置离线运行环境变量

$ module load nf-core/2.14.1 Singularity/3.7.3
$ export NXF_OFFLINE='true'
下载流程代码和 singularity 镜像,登录节点运行
$ export NXF_SINGULARITY_CACHEDIR=$HOME/sif/
$ nf-core download atacseq --force --outdir nf-core-atacseq
下载插件 nf-validation,并查看其版本,登录节点运行
$ nextflow plugin install nf-validation
$ ls -1 ~/.nextflow/plugins/
nf-validation-1.1.3
在配置文件中将 nf-validation 插件的版本固定,否则 nextflow run 运行报错 ERROR ~ Cannot find latest version of nf-validation plugin.

nextflow.config
// Nextflow plugins
plugins {
    id 'nf-validation@1.1.3' // Validation of pipeline parameters and creation of an input channel from a sample sheet
}
下载参考基因组和注释文件,登录节点运行
$ VERSION=108
$ wget -L ftp://ftp.ensembl.org/pub/release-$VERSION/fasta/homo_sapiens/dna/Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa.gz
$ wget -L ftp://ftp.ensembl.org/pub/release-$VERSION/gtf/homo_sapiens/Homo_sapiens.GRCh38.$VERSION.gtf.gz
$ gzip -d Homo_sapiens.GRCh38*.gz
运行 nf-core-atacseq 分析流程,使用作业调度系统放到计算节点运行。第一次运行时会根据使用的比对软件自行创建相应的索引文件,nf-core-atacseq 分析流程默认使用 BWA 比对,因此会创建 BWA 的索引文件,目录为 out/genome/index/bwa/
$ module load nf-core/2.14.1 Singularity/3.7.3
$ export NXF_OFFLINE='true'
$ export NXF_SINGULARITY_CACHEDIR=$HOME/sif/

$ nextflow run nf-core-atacseq/2_1_2/ --input samplesheet.csv --outdir out/  --fasta Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa --gtf Homo_sapiens.GRCh38.108.gtf --save_reference --read_length 150 -profile singularity
如果使用相同的基因组,后续运行该流程可以使用前面创建好的索引,以免重新创建索引,节省运行时间。相关参数见 https://nf-co.re/atacseq/2.1.2/parameters/
$ module load nf-core/2.14.1 Singularity/3.7.3
$ export NXF_OFFLINE='true'
$ export NXF_SINGULARITY_CACHEDIR=$HOME/sif/

$ nextflow run nf-core-atacseq/2_1_2/ --input samplesheet.csv --outdir out/  --fasta Homo_sapiens.GRCh38.dna_sm.primary_assembly.fa --gtf Homo_sapiens.GRCh38.108.gtf  --bwa_index out/genome/index/bwa/ --read_length 150 -profile singularity

报错

  • nextflow run 运行出现镜像无法下载的报错
    ERROR ~ Error executing process > 'NFCORE_RNASEQ:RNASEQ:FASTQ_QC_TRIM_FILTER_SETSTRANDEDNESS:FASTQ_FASTQC_UMITOOLS_TRIMGALORE:TRIMGALORE (3)'
    
    Caused by:
    Failed to pull singularity image
    command: singularity pull  --name depot.galaxyproject.org-singularity-trim-galore-0.6.7--hdfd78af_0.img.pulling.1725869859166 https://depot.galaxyproject.org/singularity/trim-galore:0.6.7--hdfd78af_0 > /dev/null
    status : 255
    message:
        FATAL:   Error making http request: Head "https://depot.galaxyproject.org/singularity/trim-galore:0.6.7--hdfd78af_0": dial tcp 128.118.250.14:443: connect: network is unreachable
    
    如果确认上面的配置步骤没问题,检查一下 nextflow.config 文件中是否已配置了镜像路径 singularity.cacheDir = "${projectDir}/../singularity-images/",如果有,注释这一行。nextflow 运行时优先使用 nextflow.config 中配置的镜像路径。另外注意下载的镜像有重命名后的软连接,一般以 quay.iodepot.galaxyproject.org 开头,否则也会出现镜像无法下载的报错。
    $ depot.galaxyproject.org-singularity-fastp-0.23.4--h5f740d0_0.img -> ./singularity-fastp-0.23.4--h5f740d0_0.img
    $ quay.io-singularity-fastp-0.23.4--h5f740d0_0.img -> ./singularity-fastp-0.23.4--h5f740d0_0.img
    

参考:

https://nf-co.re/docs/usage/getting_started/offline

https://maxulysse.github.io/2021/04/13/nf-core_offline-index/

https://blog.csdn.net/u011262253/article/details/107370353

本文阅读量  次
本站总访问量  次