メインコンテンツへスキップ

ngsfetchによるfastqファイルの高速ダウンロード

    下記にて紹介されていたのでメモ。

    ・aria2を使って並列ダウンロードを行うことにより高速化
    ・md5sumでダウンロードしたファイルが破損していないか検証
    ・ダウンロードに失敗した場合は自動再ダウンロード
    ・ダウンロードしたfastqは既にgzip圧縮されている
    これらの点から有用と考え、導入してみることにした。

    ダウンロードとインストール

    pip install ngsfetch

    基本的な使い方

    ヘルプ

    usage: ngsfetch [-h] [-i ID] [-o OUTPUT] [-p PROCESSES] [--attempts ATTEMPTS] [-v]
    
    ngsfetch v0.1.1 - fast retrieval of metadata and fastq files with ffq and aria2c
    
    optional arguments:
      -h, --help            show this help message and exit
      -i ID, --id ID        ID of the data to fetch
      -o OUTPUT, --output OUTPUT
                            Output directory
      -p PROCESSES, --processes PROCESSES
                            Number of processes to use (up to 16)
      --attempts ATTEMPTS   Number of attempts to fetch metadata and fastq files
      -v, --verbose         Increase verbosity

    基本コマンド

    ngsfetch -i SRRxxxxxx (SRAアクセッション番号) -o ./ (ここではカレントディレクトリに設定) -p 8

    複数ファイルを自動ダウンロード

    while read line
    do ngsfetch -i ${line} -o ./ -p 8
    done < srr.list

    使ってみたところ、fasterq-dump+pigzの数倍以上早く処理が進んでいる気がした。大変気に入ったので、今後はこれを使っていきたい。

    あなたへのおすすめ