macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

インタラクティブな出版品質の合成 Figure作成webツール canvasDesigner2

 

 Scalable Vector Graphics (SVG) は、拡張可能なマークアップ言語 (XML) ベースのベクトル画像フォーマットであり、png, gif, jpg のような他の一般的な画像フォーマットのようにぼやけたピクセル化をすることなく、任意の解像度に拡張可能である。この形式は、計算生物学分野の多くのデータ解析ツール、特にR (R Core Team , 2014) や ggplot2 (Wickham, H, 2016) で採用されている最も広く使用されている画像出力の一つとなっている。さらに、SVGは、通常、D3(Bostock, M. et al. , 2011)やCoral(Metz KS. et al. , 2019)のようなバイオインフォマティクスツールのような多くのJavaScriptベースのプロットライブラリによってデフォルトの画像出力として設定されており、ChromeFirefoxSafari、MS Edgeのような最新のWebブラウザによって自然にレンダリングできる。
 論文図1に示されているようなマルチパネル高解像度プロットを構成することは、通常、様々なソースから個々のプロットを収集した後、控えめなプログラミングスキルを持つ科学者にとって課題となる。Microsoft Power Point のようなユーザーフレンドリーな商用ツールは、このようなプロットを配置するための実行可能なオプションとなり得るが、これらのツールは、SVG 形式の複雑なパスウェイマップを扱うことができないか、またはこの形式を
のように、低解像度でありながら、ときには不格好になることもある。
Web ベースのインタラクティブな図形設計ツールの試み(Zhang, B., 2018)に引き続き、ゲル画像のスキャニングなどの状況によっては、SVG 形式の取得が困難な場合があるため、canvasDesigner2 の入力形式を SVG のみから拡張した(論文Fig s1)。

 

help

canvasDesigner Demo Video

helpに用意されている2分程度の短い動画を見れば基本的な使い方はわかるようになっています。

 

Github

 

webサービス

https://baohongz.github.io/canvasDesigner2/ にアクセスする。 

f:id:kazumaxneo:20210223164540p:plain

 

3つのDemoが用意されている。

f:id:kazumaxneo:20210223165509p:plain

 

Demo1

f:id:kazumaxneo:20210223165533p:plain

左上のボタンを押すとサイズの調整ができるようになる。

f:id:kazumaxneo:20210223165851p:plain

 

それぞれの図の右上の青いマークをクリックすると、図全体を移動できる。

f:id:kazumaxneo:20210223170107p:plain

 

リンクがあるオブジェクトは、クリックしてリンク先にジャンプできる。

f:id:kazumaxneo:20210223170255p:plain

EphA2をクリックするとUniprotにジャンプした。

f:id:kazumaxneo:20210223170330p:plain

 

図1つの表示範囲を変えるには、コーナーにポインタを移動すると矢印アイコンに形が変化するので、その状態でドラッグする。

f:id:kazumaxneo:20210223170657p:plain

Eの図の表示範囲を大きくして、それから+マークで図を拡大表示した。

 

Demo2

f:id:kazumaxneo:20210223165549p:plain

 

Violin plot

f:id:kazumaxneo:20210223165607p:plain

インタラクティブに操作可能。

 

引用

canvasDesigner2: An enhanced interactive publication-quality composite figure designing tool

Kejie Li, Jessica Hurt, Christopher D. Whelan, Ravi Challa, Dongdong Lin, Baohong Zhang

BioRxiv, Posted March 05, 2020

ゲノム中のISエレメントを探す ISEScan

2021 8/7 コマンド修正

 

 ISEScanは、ゲノム中のIS(Insertion Sequence)エレメントを同定するためのPythonパイプラインである。完全なISエレメントを報告するか、完全なISエレメントと部分的なISエレメントの両方を報告するかのオプションがある。メテゲノムアセンブリに含まれるISエレメントの同定に使用する場合は、完全なISエレメントと部分的なISエレメントの両方を報告してみるのも良いかもしれない。ISEScanはデフォルトで完全なISエレメントと部分的なISエレメントの両方をレポートする。

 ISEScanはPython3で開発されている。1) ゲノム(またはメタゲノム)をfasta形式でスキャンし、2) ゲノムをプロテオームに予測/翻訳(FragGeneScanを使用)し、3) トランスポザーゼのあらかじめ構築されたpHMM(プロファイル隠れマルコフモデル)をプロテオームと照らし合わせて検索する(ISEScanに同梱されている2つのファイル、cluster.faa.hmmとcluster.single.faa)。 4) 次に、文献やデータベースで報告されている既知のISエレメントに共通する特徴に基づいて、同定されたトランスポザーゼ遺伝子を完全なIS(Insertion Sequence)エレメントに拡張し、5) 最後に、同定されたISエレメントをいくつかの結果ファイル(例えば、ISエレメントのリストを含むファイル、fasta形式のISエレメント配列を含むファイル、GFF3形式のアノテーションファイル)で報告する。

 

インストール

ubuntu18.04LTS でテストした。

Github

#conda、ここでは高速なmambaを使う (anaconda)
mamba install -c bioconda isescan -y

isescan.py -h

$ isescan.py -h

usage: isescan [-h] [--version] [--removeShortIS] [--no-FragGeneScan] --seqfile SEQFILE --output OUTPUT [--nthread NTHREAD]

 

ISEScan is a python pipeline to identify Insertion Sequence elements (both complete and incomplete IS elements) in genom. A typical invocation would be:

python3 isescan.py seqfile proteome hmm

 

- If you want isescan to report only complete IS elements, you need to set command line option --removeShortIS.

 

optional arguments:

-h, --help show this help message and exit

--version show program's version number and exit

--removeShortIS Remove incomplete (partial) IS elements which include IS element with length < 400 or single copy IS element without perfect TIR.

--no-FragGeneScan Use the annotated protein sequences in NCBI GenBank file (.gbk which must be in the same folder with genome sequence file), instead of the protein sequences predicted/translated by FragGeneScan. (Experimental feature!)

--seqfile SEQFILE Sequence file in fasta format, '' by default

--output OUTPUT Output directory, 'results' by default

--nthread NTHREAD Number of CPU cores used for FragGeneScan and hmmer, 1 by default.

 

 

実行方法

 ゲノムのfastaファイルを指定する。

isescan.py --seqfile NC_012624.fna --output results --nthread 8
  • --nthread   number of CPU cores used for FragGeneScan and hmmer. By default one will be used. 
  • --seqfile  Sequence file in fasta format, '' by default
  • --output   Output directory, 'results' by default

 

出力

f:id:kazumaxneo:20210222163410p:plain

  • xxx.fna.sum: 各ISファミリーのISコピーの要約
  • xxx.fna.raw: ISコピーの詳細、1行に1つのコピー
  • xxx.fna.gff: 各ISコピーとそのTIRのリスト、gff3フォーマット
  • xxx.fna.is.fna:各ISコピーのDNA配列、fasta形式
  • xxx.fna.orf.fna: 各ISコピーに含まれるTpase遺伝子(転移酵素遺伝子)のDNA配列、fasta形式
  • xxx.fna.orf.faa: 各ISコピーに含まれるTpaseのアミノ酸配列、fasta形式 

 

レポジトリにはxargsを使って複数のゲノムを順番に調べていく例が記載されています。確認してください。

引用

ISEScan: automated identification of insertion sequence elements in prokaryotic genomes
Zhiqun Xie, Haixu Tang
Bioinformatics, Volume 33, Issue 21, 01 November 2017, Pages 3340–3347

 

 

 

 

 

事前計算された植物の遺伝子ファミリーの系統樹 PhyloGenes

 

著者らは、シロイヌナズナや他のモデル生物から得られた遺伝子機能に関する知識を、他の植物種に正確かつ効率的に伝達できるようにすることを目指している。このような知識移転は、植物の系統における個々の遺伝子やゲノム全体の重複のために、植物においてはしばしば困難なことである。このような重複は、類似した配列を持ちながらも非常に発散性の高い機能を持つ関連遺伝子間の複雑な進化関係をもたらす。このような場合、機能推論には単純な配列類似度計算以上のものが必要となる。著者らは、植物遺伝子ファミリーの系統樹を事前に計算して表示するオンラインリソースPhyloGenes (phylogenes.org)を開発し、ファミリー内の個々の遺伝子の機能情報を実験的に検証した。40種の植物ゲノムと10種の非植物モデル生物を8,000以上の遺伝子ファミリーで表現している。種分化や複製などの進化イベントを遺伝子ツリー上に明示し、オルソログとパラログを区別できるようにしている。約6,000ファミリーには、実験的に検証されたGene Ontology (GO)の分子機能や生物学的プロセスの用語へのアノテーションが少なくとも1つ含まれている。PhyloGenesは、ツリー内の個々の遺伝子に関連する実験的に検証された遺伝子機能を表示することで、実験的に研究された遺伝子との進化的関係に基づいて、未解明の機能を持つ遺伝子の機能推論を、視覚的に追跡可能な方法で可能にしている。異なる機能を果たすように進化した遺伝子を含む多くのファミリーに対して、PhyloGenesは、実験的に特徴づけられていない遺伝子の最も可能性の高い機能を決定するための進化史の使用を容易にする。将来的には、植物遺伝子発現アトラスデータのような追加の遺伝子機能データセットを組み込むことで、このリソースをさらに充実させていく予定である。

 

 

 

help & Tutorial

https://conf.arabidopsis.org/display/PHGSUP

 

version3.0に含まれる植物種

f:id:kazumaxneo:20210221224650p:plain

 

webサービス

http://www.phylogenes.org/にアクセスする。

f:id:kazumaxneo:20210221215830p:plain

解説動画が用意されています。

 

 

遺伝子名やPANTHERのGene IDをタイプする。ここではチュートリアルで使用されているLOC107914949(Ammonium transporter)を中央のウィンドウ内か右上のウィンドウ内でタイプ。

f:id:kazumaxneo:20210221223257p:plain

 

 

結果が表示された。Eukaryotaの47 Organismsの227 genesがヒットしている。左がその遺伝子の系統樹で、右がリストになる。

f:id:kazumaxneo:20210221223416p:plain

検索した遺伝子はハイライト表示されている。

LEGENDにあるように、遺伝子ファミリーは、種分化、遺伝子重複、水平移動の過程でどのように進化してきたかを示す系統樹として表現されている。

f:id:kazumaxneo:20210221224619p:plain

 

 

系統樹と右の表は縦関係が固定されており、枝の右にあるリストが、その枝の情報になる。検索に使ったLOC107914949はGossypium hirsutum(綿)の遺伝子で、同じクレードに位置する遺伝子もGossypium hirsutumの遺伝子が中心になる。

f:id:kazumaxneo:20210221224021p:plain

系統樹が画面に収まりき去らない場合、上下左右にスクロールできるが、左右はドラッグで移動し、上下スクロールはマウスホイールで行う。マウスホイールで上下にスクロールした際は、系統樹と表がずれないようにどちらもスクロールされる。

 

表は横に長いため、4Kやウルトラワイドディスプレイでもないと1画面には収まりきらない。

f:id:kazumaxneo:20210221225648p:plain

 

他の実験のエビデンスがある遺伝子は試験管のマークがつく。identical protein

f:id:kazumaxneo:20210221225956p:plain

 

上の歯車マークをクリックすると表に表示する項目をカスタマイズできる。

f:id:kazumaxneo:20210221230038p:plain

 

系統樹のノードをクリックするとcollapseする。元に戻すにはもう一度クリックする。

f:id:kazumaxneo:20210221224522p:plain

 

系統樹のマークをクリックすると結果をCSVでダウンロードしたりできる。

f:id:kazumaxneo:20210221230246p:plain



 

引用

PhyloGenes: An online phylogenetics and functional genomics resource for plant gene function inference
Peifen Zhang Tanya Z. Berardini Dustin Ebert Qian Li Huaiyu Mi Anushya Muruganujan Trilok Prithvi Leonore Reiser Swapnil Sawant Paul D. Thomas Eva Huala
Plant Direct. 2020 Dec; 4(12)

陸域メタゲノムのキュレーションされたメタデータ公開リポジトリ TerrestrialMetagenomeDB

2022/06/25 タイトル変更

 

微生物群集の遺伝的可能性に着目したマイクロバイオーム研究(メタゲノム研究)は、微生物生態学の分野では標準的なものとなった。MG-RASTとSequence Read Archive (SRA)という2つの主要なメタゲノムリポジトリには、202,858以上の公開メタゲノムがあり、その数は指数関数的に増加している。しかし、データベースのマイニングは、誤ったアノテーション、誤解を招くようなデータ、分散化されたデータのために困難な場合がある。TerrestrialMetagenomeDBの主な目的は、研究者がメタアナリシスで新しいデータセットと比較できるような、興味のある陸域のメタゲノムを簡単に見つけることである。陸上メタゲノムは、海洋環境に属さないメタゲノムと定義した。また、テキストマイニングを用いてデータベースを作成し、バイオマスや物質など、陸域メタゲノムの環境的側面をよりよく文脈化するための潜在的な記述キーワードを付与した。本データベースには、SRAとMG-RASTの15 022件の陸域メタゲノムが収録されている。ダウンロード可能なデータ量は68Tbpになっている。合計で199の陸域用語が14のカテゴリに分類されている。これらのメタゲノムは、83の国、30のバイオマス、7つの主要な情報源にまたがっている。TerrestrialMetagenomeDBは、https://webapp.ufz.de/tmdb で公開されている。

 

 

 

Help

TerrestrialMetagenomeDBのHelpタブ参照

 

webサービス

https://webapp.ufz.de/tmdb/

f:id:kazumaxneo:20210221115039p:plain

 

COMPLETE DATASETを選択。TMDBがメタデータを整理している公開データのメタデータと、その公開サイトへのリンクが表示される。

f:id:kazumaxneo:20210221115846p:plain


様々な条件で絞り込むことができる。

Source DatabaseはMG-RASTかSRAを選択。

f:id:kazumaxneo:20210221115947p:plain

 

TMDB Material

f:id:kazumaxneo:20210221120112p:plain

 

シークエンシングリード数

f:id:kazumaxneo:20210221120149p:plain

配列数の少ないデータは、RAWデータではなく、アセンブル配列がデポジットされていることが関係している可能性がある。データセットが真のメタゲノムであることをより確実にしたい場合は、ベースペア数や配列数の範囲内でデータセットを選択するフィルターを使用する。例えば配列数が500万以上のデータセットのみを表示する(helpより)。

 

Sequencing Platform

f:id:kazumaxneo:20210221120223p:plain



TMDB Biome(ENVO term

f:id:kazumaxneo:20210221120423p:plain

 

Assembled

f:id:kazumaxneo:20210221120435p:plain

 

More filtersをクリックするとより詳細なフィルタ設定を追加できる。More filtersをクリック、

f:id:kazumaxneo:20210221121332p:plain

展開された。緯度経度、高さ(または深さ)、気温、pH、シークエンシングリードのパラメータなどが選択できる。

f:id:kazumaxneo:20210221121433p:plain

TMDBが(EnvOからの派生で)定義する様々なAttribute nameでフィルタリングできる。各属性の詳細はHELPタブの”7. What does each attribute of the database mean?”を参照して下さい。

 

Interactive mapタブ

f:id:kazumaxneo:20210221122548p:plain

 

インタラクティブマップでは、ユーザーはインタラクティブな方法で興味のある場所を直視することができる。

 

左側のマップツールバーから描画ツール(多角形または長方形)を選択し、興味のある地域を囲む。

f:id:kazumaxneo:20210221123031p:plain

 

囲んだ。選択したメタゲノムデータがマップの下に表示される。

f:id:kazumaxneo:20210221123332p:plain

Show filtersボタンでさらに絞り込むことができる。また、選択したメタデータcsvファイルとしてダウンロードできる。


インタラクティブマップからアクセスできるのは、有効な座標を持つメタゲノムのみであることに注意する。全てのデータは"Complete dataset "タブから確認する。

 

引用

TerrestrialMetagenomeDB: a public repository of curated and standardized metadata for terrestrial metagenomes
Felipe Borim Corrêa, João Pedro Saraiva, Peter F Stadler, Ulisses Nunes da Rocha
Nucleic Acids Research, Volume 48, Issue D1, 08 January 2020, Pages D626–D632

 

関連


CCSリードの精度を推定する Yak

Githubより

Yakは当初、2つの特定のユースケースのために開発された。1) CCSリードとアセンブリコンティグの塩基精度をロバストに推定すること、2) CCSリードの系統的なエラー率を調査することである。ショートリードのk-merスペクトラムと配列を比較したり、スペクトラムを比較したりすることで目標を達成する。リファレンスゲノムgrand truthデータは必要ない。

ベース精度の推定がトリッキーであることは注目に値する。精度がQ50に近づくと、ショートリード中のサンプルされていないk-merと誤ったk-merの両方がナイーブな推定器に干渉する可能性がある。Yakはこの問題に対処するために経験的モデルを導入した。その推定値は、カバレッジとショートリードの質の影響をあまり受けない。

 

インストール

macos10.14でビルドした。

Github

git clone https://github.com/lh3/yak
cd yak && make

#conda、ここでは高速なmambaを使う
mamba install -c bioconda yak -y

yak

$ yak

Usage: yak <command> <argument>

Command:

  count     count k-mers

  qv        evaluate quality values

  triobin   trio binning

  trioeval  evaluate phasing accuracy with trio

  inspect   k-mer hash tables

  version   print version number

yak count

$ yak count

Usage: yak count [options] <in.fa> [in.fa]

Options:

  -k INT     k-mer size [31]

  -p INT     prefix length [10]

  -b INT     set Bloom filter size to 2**INT bits; 0 to disable [0]

  -H INT     use INT hash functions for Bloom filter [4]

  -t INT     number of worker threads [4]

  -o FILE    dump the count hash table to FILE []

  -K INT     chunk size [100m]

Note: -b37 is recommended for human reads

yak qv

$ yak qv

Usage: yak qv [options] <kmer.hash> <seq.fa>

Options:

  -l NUM      min sequence length [0]

  -f FLOAT    min k-mer fraction [0.5]

  -e FLOAT    false positive rate [4e-05]

  -p          print QV for each sequence

  -t INT      number of threads [4]

  -K NUM      batch size [1g]

yak triobin -h

$ yak triobin -h

Usage: yak triobin [options] <pat.yak> <mat.yak> <seq.fa>

Options:

  -c INT     min occurrence [2]

  -d INT     mid occurrence [5]

  -t INT     number of threads [8]

yak trioeval -h

$ yak trioeval -h

Usage: yak trioeval [options] <pat.yak> <mat.yak> <seq.fa>

Options:

  -c INT     min occurrence [2]

  -d INT     mid occurrence [5]

  -n INT     min streak [2]

  -t INT     number of threads [8]

  -e         print error positions (out of order)

yak inspect -h

$ yak inspect -h

Usage: yak inspect [options] <in1.yak> [in2.yak]

Options:

  -m INT    max count (effective with in2.yak) [20]

Notes: when in2.yak is present, inspect evaluates the k-mer QV of in1.yak and

  the k-mer sensitivity of in2.yak.

yak version

$ yak version

0.1-r58-dirty

 

 

実行方法

1、k-merハッシュテーブルの構築

#assembly
yak count -K 1.5g -t 16 -o assembly.yak assembly.fa.gz

#single fastq(githubではCCS readsを例にしている,シングルトンk-merは除外)
yak count -b 37 -t 16 -o reads.yak reads.fq.gz

#paired-end fastq (シングルトンk-merは除外)
yak count -b37 -t32 -o sr.yak <(zcat sr*.fq.gz) <(zcat sr*.fq.gz)
  • -K   chunk size [100m]
  • -k   k-mer size [31]
  • -t    number of worker threads [4]
  • -b   set Bloom filter size to 2**INT bits; 0 to disable [0]
  • -o   dump the count hash table to FILE []

 

2、精度推定

yak qv -t32 -p -K3.2g -l100k sr.yak asm.fa.gz > asm-sr.qv.txt

 

3、k-merヒストグラムやk-merの保存

#k-mer histgram
yak inspect sr.yak > sr.hist

#k-mer配列プリント
yak inspect -p sr.yak > sr.kmers

 

引用

https://github.com/lh3/yak

 

関連


MetaRon

 

 細菌の遺伝子は環境刺激に反応して効率的に制御され、オペロンとして知られるユニークな遺伝子クラスターを形成している。このように、オペロンの参照情報や機能情報が不足しているため、オペロンの予測は困難である。
 本研究では、MetaRon(Metagenome and whole-genome opeRon prediction pipeline)を用いて、全ゲノムおよびメタゲノムのオペロンを同定した。この論文では、実験情報や機能情報がなくてもオペロンを同定することができる。メタゲノム上でのオペロンの同定には、実験情報や機能情報を必要としなかった。大腸菌MG1655、結核菌H37Rv、枯草菌16条)、鶏腸から抽出した大腸菌c20ドラフトゲノム、ヒト腸から抽出した145個の全ゲノムデータのmixtureを模擬した全ゲノムデータへの適用から始まり、最終的には145個の全メタゲノムデータサンプルへの適用が行われた。大腸菌全ゲノム(97.8%、94.1%、92.4%)、模擬ゲノム(93.7%、75.5%、88.1%)、大腸菌c20(87%、91%、88%)において、MetaRonは一貫して高いオペロン予測感度、特異性、精度を達成した。最後に、145のペアエンドヒト腸内メタゲノムサンプルから1,232,407のユニークなオペロンを同定した。また、2型糖尿病とマルトースホスホリラーゼ(K00691)、3-デオキシ-D-グリセロ-D-ガラクト-ノナン酸9-リン酸合成酵素(K21279)、および未同定タンパク質(K07101)との強い関連性も報告した。
 MetaRonを使用することで、既存の全ゲノムオペロン予測手法の顕著な2つの制限を取り除くことができた。また、その際には、そのデータを利用して、そのデータを用いて、そのデータを解析することも可能である。また、全ゲノムデータにおける二次代謝産物の傾向や病態発生における二次代謝産物の役割を表現するために、オペロンをサブセットとして利用することも実証している。メタゲノムのオペロンデータを用いて二次代謝の傾向を調べることで、データ量を大幅に削減し、より精度の高いデータを得ることができる。さらに、2型糖尿病(T2D)の発生に関連する代謝経路の同定は、ヒト腸内メタゲノム解析の別の次元を提示している。おそらく、この研究は、メタゲノムオペロンを予測し、疾患(この場合は2型糖尿病)に関連して詳細な解析を行うための最初の組織化された取り組みである。メタゲノムデータへのMetaRonの応用は、遺伝子制御や治療用メタゲノムの理解に有益なものとなるだろう。

 

 

インストール

ubuntu18.04LTSでmambaを使って依存ツールを導入後、”python setup.py install”を打って導入した。

依存

MetaRon requires:

* Python (2.7 )
* IDBA (iterative De Bruijn Graph De Novo Assembler) [conda install -c bioconda idba]
* Prodigal [conda install -c bioconda prodigal]
* BDGP: Neural Network Promoter Prediction 2.2
* antiSMASH: antibiotics & Secondary Metabolite Analysis Shell (Optional: required for downstream analysis only.)
* BOWTIE (Optional: only required for downstream analysis)

Github

mamba create -n metaron -y python=2.7
conda activate metaron
mamba install -c bioconda idba -y
mamba install -c bioconda/label/cf201901 antismash -y
mamba install -c bioconda bowtie -y
mamba install pathlib -y

#from github
git clone https://github.com/zaidissa/MetaRon.git
cd metaron-1.0
python setup.py install

#pypi (link)
pip install metaron

> metaron --help
usage: metaron [-h] [-n SAMPLE] [-p PROCESS] [-rt READ_TYPE] [-rl READ_LENGTH]
[-pe1 PAIRED_1] [-pe2 PAIRED_2] [-pm PAIRED_MERGED] [-i IGP]
[-j ISC] [-t TOOL] [-o OUTPUT]

optional arguments:
-h, --help show this help message and exit
-n SAMPLE, --sample SAMPLE
Sample name without any dot, underscore or dash
-p PROCESS, --process PROCESS
1. ago: assembly gene prediction and operon prediciton
2. op: operon prediction only. If 'ago', please
provide the following parameters:
-n,-rl,-rt,[-pe1,pe2|-pm],
-rt READ_TYPE, --read_type READ_TYPE
Enter read type. 'merge' if the reads are paired-end
in two file. 'paired' if the reads are paired-end in
one file.
-rl READ_LENGTH, --read_length READ_LENGTH
Enter 'l'if read length is longer than 128 bases and
'r' if read length is shorter than 128 bases
-pe1 PAIRED_1, --paired_1 PAIRED_1
Enter enter paired read file 1
-pe2 PAIRED_2, --paired_2 PAIRED_2
Enter enter paired read file 2
-pm PAIRED_MERGED, --paired_merged PAIRED_MERGED
Enter the paired end read file if both pairedend reads
are in one file
-i IGP, --igp IGP Select the gene prediction .tab file generated via
MetageneMark or Prodigal
-j ISC, --isc ISC Select the file containing all scaftigs
-t TOOL, --tool TOOL Enter 1 for MetaGeneMark, 2 for Prodigal
-o OUTPUT, --output OUTPUT
Enter output destination folder

 

 

データベース

cd metaron-1.0
tar -xvf NNPP2.2.tar
#configファイルに解凍したNNPP2.2のパスを記載する
vi config.txt

 

テストラン

fasterq-dump ERR022075 -e 8 -p
mkdir outdir
metaron --sample ERR022075 --process ago --read_type merge--read_length r --paired_1 ERR022075.1.fastq --paired_2 ERR022075.2.fastq --output
  •  -n SAMPLE, --sample SAMPLE    Sample name without any dot, underscore or dash
  • -p PROCESS, --process PROCESS
       ago: assembly gene prediction and operon prediciton
       op: operon prediction only. If 'ago', please provide the following parameters:
    -n,-rl,-rt,[-pe1,pe2|-pm],
  • -rt READ_TYPE, --read_type READ_TYPE    Enter read type. 'merge' if the reads are paired-end in two file. 'paired' if the reads are paired-end in one file.

 

ERR022075をダウンロードして使用したが、IDBAのランでエラーになる。解決したら追記します。

 

 

引用

Prediction and analysis of metagenomic operons via MetaRon: a pipeline for prediction of Metagenome and whole-genome opeRons

Syed Shujaat Ali Zaidi, Masood Ur Rehman Kayani, Xuegong Zhang, Younan Ouyang & Imran Haider Shamsi
BMC Genomics volume 22, Article number: 60 (2021)

 

効率的なゲノムファイル(FASTQ、SAM/BAM/CRAM、VCF、GVF、FASTA、PHYLIP、23andMe)の圧縮器 Genozip

2021 7/20 DocumentaitonのURL修正

2021 10/9 コマンド追記

2021 11/9 追記

 

 ゲノムデータのための汎用的で機能が充実した圧縮ソフトウェアであるGenozipを紹介する。Genozipは、汎用性(一般的なゲノムファイル形式をすべてサポート)、高圧縮率、高速性、機能性、拡張性の5つのコア機能を提供することで、ゲノム圧縮のための汎用ソフトウェアおよび開発フレームワークとして設計されている。

 Genozipは、FASTQ、SAM/BAM/CRAM、VCF、GVF、FASTA、PHYLIP、23andMeフォーマットなど、ゲノム研究で広く使われているゲノムデータフォーマットに対応した高性能圧縮を提供する。テスト結果は、Genozipが高速で、ファイルがすでに圧縮されている場合でも、大幅に改善された圧縮率を達成していることを示している。

 さらに、Genozipは、ファイルフォーマットに特化したセグメンタやデータタイプに特化したコーデックからGenozipフレームワークを分離して設計されている。これにより、Genozipは、研究者が将来的に追加のファイルフォーマットや、ファイル内のデータタイプやフィールドのための新しいコーデックのための圧縮を実装できる汎用圧縮プラットフォームになることを目指している。これにより、最終的には、ユーザーコミュニティによるこれらのアルゴリズムの認知度と採用率が向上し、この分野でのさらなる技術革新が加速することを期待している。

 GenozipはC言語で書かれている。コードはオープンソースで、GitHub (https://github.com/divonlan/genozip)で公開されている。このパッケージは非商用利用の場合は無料である。DockerHub上のDockerコンテナとして、またcondaパッケージマネージャを通じて配布されている。GenozipはLinuxMacWindowsでテストされている。

 

Documentaiton

https://genozip.readthedocs.io

 

  • Genozipはゲノムファイル用の圧縮機でFASTQ、SAM/BAM/CRAM、VCF/BCF、FASTA、GVF、Phylip、23andMeファイルを圧縮するように最適化されているが、ゲノムファイルだけでなく、あらゆるファイルを圧縮できる。すでに .gz .bz2 .xz で圧縮されている場合も圧縮できる。
  • 圧縮率は圧縮されるデータに依存する。通常、.bam を圧縮する場合は 1.5~3 倍、.fastq.gz ファイル (つまり既に圧縮されているファイルを圧縮する場合) では 2~5 倍、GT データのみを含む非圧縮の高サンプルカウント .vcf ファイルを圧縮する場合は最大 200 倍の圧縮率が期待できる。
  • 圧縮はロスレスで、解凍されたファイルは元のファイルと100%同じ。厳密なロスレス化の例外は --optimize オプションを使用した場合。
  • 元のファイルが BGZF で圧縮されていた場合、genounzip は解凍時に BGZF でファイルを再圧縮する(--plain が指定されていない時)。しかし、使用されているライブラリが異なるために、全く同じ BGZF 圧縮はできないことがある。

f:id:kazumaxneo:20210218233123p:plain

マニュアルより

 

2021 7/3 

Genozip v12のリリース。圧縮・解析機能の段階的な向上(RELEASE NOTES参照)に加えて、2つの大きな機能が追加された。1つ目はDual coordinate VCFのサポート。Dual coordinate VCF(link)は、例えばGRCh37とGRCh38のように、2つの座標系の座標を同時に含むVCFファイル。2つ目は、 kraken2を使ったBAMファイルのspeciesフィルタリング機能。バクテリアのリードを直接特定することで、ヒトゲノムデータからバクテリアの汚染をフィルタリングすることができる(詳細)。この機能はBAMファイル(FASTQだけではない)で動作するので、解析のどの時点でも使用することができる。

 

11/9 

new benchmarks of Genozip

https://genozip.readthedocs.io/benchmarks.html

 

インストール

ソースからのビルド推奨。(12.08はsegmentation errrorを起こしたので12.07をソースからビルド)

#Form github
git clone https://github.com/divonlan/genozip
make
requires: gcc or clang, make

#conda、ここでは高速なmambaを使う
mamba install -c conda-forge genozip -y

> genozip

$ genozip

 

Compress genomics files. Genozip can compress any file, but is optimally designed to compress the following file types:

   VCF/BCF, SAM/BAM/CRAM, FASTQ, FASTA, GVF and 23andMe

 

Usage: genozip [options]... [files or urls]...

 

One or more file names or URLs may be given, or if omitted, standard input is used instead

 

Supported input file types, as recognized by their listed filename extension(s): 

   FASTA:   fasta, fa, faa, ffn, fnn, fna (possibly .gz .bgz .bz2 .xz)

   FASTQ:   fastq, fq (possibly .gz .bgz .bz2 .xz)

   SAM:     sam (possibly .gz .bgz .bz2 .xz)

   BAM:     bam

   CRAM:    cram

   VCF:     vcf (possibly .gz .bgz .bz2 .xz)

   BCF:     bcf (possibly .gz .bgz)

   GVF:     gvf (possibly .gz .bgz .bz2 .xz)

   23andMe: genome*Full*.txt (possibly zip)

   Generic: any other file (possibly .gz .bgz .bz2 .xz)

 

Note: for comressing .bcf, .cram or .xz files requires bcftools, samtools or xz, respectively, to be installed, as does using --index

 

Examples: genozip sample.bam

          genozip sample.R1.fq.gz sample.R2.fq.gz --pair --reference hg19.ref.genozip -o sample.genozip          genozip --optimize -password 12345 ftp://ftp.ncbi.nlm.nih.gov/file2.vcf.gz

 

See also: genounzip genocat genols

 

Actions - use at most one of these actions:

   -d --decompress   Same as running genounzip. For more details, run: genounzip --help

 

   -l --list         Same as running genols. For more details, run: genols --help

 

   -h --help         <topic> Show this help page. Optional <topic> can be:

                     dev   - list of developer options

                     input - list of possible arguments of --input

 

   -L --license      Show the license terms and conditions for this product

 

   -V --version      Display version number

 

Flags:

   -i --input        <data-type>. data-type is one of the supported input file types listed above, examples: bam vcf.gz fq.xz. See "genozip --help=input" for full list of accepted file types

 

                     This flag should be used when redirecting input data with a < or |, or if the input file type cannot be determined by its file name

 

   -f --force        Force overwrite of the output file, or force writing .genozip data to standard output

 

   -^ --replace      Replace the source file with the result file, rather than leaving it unchanged

 

   -o --output       <output-filename>. This option can also be used to bind multiple input files into a single genozip file. The files can be later unbound with 'genounzip --unbind'. To bind files, they must be of the same type (VCF, SAM etc) and if they

                     are VCF files, they must contain the same samples. genozip takes advantage of similarities between the input files so that the bound file is usually smaller than the combined size of individually compressed files

 

      --best         Best compression, but slower than --fast mode. This is the default mode of genozip - this flag has no additional effect.

 

   -F --fast         Fast compression, but lower compression ratio than --best. Files compressed with this option also uncompress faster. Compressing with this option also consumes less memory.

 

   -p --password     <password>. Password-protected - encrypted with 256-bit AES

 

   -m --md5          Calculate the MD5 digest of the original textual file (vcf, sam...) instead of Adler32. The MD5 is also viewable with genols.

                     Note: for compressed files, e.g. myfile.vcf.gz or myfile.bam, the MD5 calculated is that of the original, uncompressed textual file - myfile.vcf or myfile.sam respectively.

 

   -I --input-size   <file size in bytes> genozip configures its internal data structures to optimize execution speed based on the file size. When redirecting the input file with < or |, genozip cannot determine its size, and this might result in slower

                     execution. This problem can be overcome by using this flag to inform genozip of the file size

 

   -q --quiet        Don't show the progress indicator or warnings

 

   -Q --noisy        The --quiet is turned on by default when outputting to the terminal. --noisy stops the suppression of warnings

 

   -t --test         After compressing normally, decompresss in memory (i.e. without writing the decompressed file to disk) - comparing the MD5 of the resulting textual (vcf, sam) decompressed file to that of the original textual file. This option also

                     activates --md5

 

   -@ --threads      <number>. Specify the maximum number of threads. By default, genozip uses all the threads it needs to maximize usage of all available cores

 

   -B --vblock       <number between 1 and 2048>. Set the maximum size of data (in megabytes) of the textual input (VCF, SAM, FASTQ etc) data that a thread processes at any given time. By default, Genozip sets this value dynamically based on the

                     characateristics of the file, and it is reported in --show-stats. Smaller values will result in faster subsetting with --regions and --grep, while larger values will result in better compression. Note that memory consumption of both

                     genozip and genounzip is linear with the vblock value used for compression

 

   -e --reference    <filename>.ref.genozip Use a reference file - this is a FASTA file genozipped with the --make-reference option. The same reference needs to be provided to genounzip or genocat.

                     While genozip is capabale of compressing without a reference, in the following cases providing a reference may result in better compression:

                     1. FASTQ files

                     2. SAM/BAM files

                     3. VCF files with significant REFALT content (see "% of zip" in --show-stats)

 

   -E --REFERENCE    <filename>.ref.genozip Similar to --reference, except genozip copies the reference (or part of it) to the output file, so there is no need to specify --reference in genounzip and genocat.

                     Note on using with --password: the copy of the reference file stored in the compressed file is never encrypted

 

   --make-reference  Compresss a FASTA file to be used as a reference in --reference or --REFERENCE. Ignored for non-FASTA files

 

   -w --show-stats   Show the internal structure of a genozip file and the associated compression stats

 

   -W --SHOW-STATS   Show more detailed stats

 

   --register        Register (or re-register) a non-commericial license to use genozip

 

FASTQ-specific options (ignored for other file types):

   -2 --pair         Compress pairs of paired-end FASTQ files, resulting in compression ratios better than compressing the files individually. When using this option, every two consecutive files on the file list should be paired-end FASTQ files with an

                     identical number of reads and consistent file names, and --reference or --REFERENCE must be specified. The resulting genozip file is a bound file. To display interleaved, use genocat --interleaved, and to unbind the genozip file back

                     to its original FASTQ files, use genounzip --unbind.

 

FASTA-specific options (ignored for other file types):

   --multifasta      All contigs in the FASTA file are variations of a the same contig (i.e. they are somewhat similar to each other). Genozip uses this information to improve the compression.

 

Optimizing:

   -9 --optimize     Modify the file in ways that are likely insignificant for analytical purposes, but significantly improve compression and somewhat improve the speed of genocat --regions. --optimize activates all these optimizations, or they can be

                     activated individually. These optimizations are:

 

   VCF optimizations: 

   --optimize-sort   - INFO subfields are sorted alphabetically.               Example: AN=21;AC=3 -> AC=3;AN=21

   --optimize-PL     - PL data: Phred values of over 60 are changed to 60.     Example: '0,18,270' -> '0,18,60'

   --optimize-GL     - GL data: Numbers are rounded to 2 significant digits.   Example: '-2.61618,-0.447624,-0.193264' -> '-2.6,-0.45,-0.19'

   --optimize-GP     - GP data: Numbers are rounded to 2 significant digits, as with GL.

   --optimize-VQSLOD - VQSLOD data: Number is rounded to 2 significant digits. Example: '-4.19494' -> '-4.2'

 

   SAM optimizations: 

   --optimize-QUAL   - The QUAL quality field and the secondary U2 quality field (if it exists), are modified to group quality scores into a smaller number of bins:

                       Quality scores of 2-9 are changed to 6; 10-19->15 ; 20-24->22 ; 25-29->27 ..... 85-89->87 ; 90-92->91 ; 93 unchanged

                       This assumes a standard Sanger format of Phred quality scores 0->93 encoded in ASCII 33->126

                       Note: this follows Illumina's quality bins for values up to Phred 39, and extends with additional similar bins for values of 40 and above common in some non-Illumina technologies: https://sapac.illumina.com/content/dam/illumina

                     -marketing/documents/products/technotes/technote_understanding_quality_scores.pdf

                       Example: 'LSVIHINKHK' -> 'IIIIFIIIFI'

   --optimize-ZM     - ZM:B:s data: negative Ion Torrent flow signal values are changed to zero, and positives are rounded to the nearest 10.

                       Example: '-20,212,427' -> '0,210,430'

 

   FASTQ optimizations: 

   --optimize-DESC   - Replaces the description line with '@filename:read_number'

                       Example: '@A00488:61:HMLGNDSXX:4:1101:1561:1000 2:N:0:CTGAAGCT+ATAGAGGC' -> '@sample.fq.gz:100' (100 is the read sequential number within this fastq file)

   --optimize-QUAL   - The quality data is optimized as described for SAM above

 

   GVF optimizations: 

   --optimize-sort   - Attributes are sorted alphabetically.                   Example: Notes=hi;ID=rs12 -> ID=rs12;Notes=hi

   --optimize-Vf     - Variant_freq data: Number is rounded to 2 significant digits. Example: '0.006351' -> '0.0064'

 

                     Note: due to these data modifications, files compressed with --optimize are NOT identical to the original file after decompression. For this reason, it is not possible to use this option in combination with --test or --md5

 

genozip is available for free for non-commercial use and some other limited use cases. See 'genozip -L for details'. Commercial use requires a commercial license

 

Citing: Lan, D., et al. Bioinformatics, Volume 36, Issue 13, July 2020, Pages 4091-4092

 

Bug reports and feature requests: bugs@genozip.com

Commercial license inquiries: sales@genozip.com

Requests for support for compression of additional public or proprietary genomic file formats: sales@genozip.com

 

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR

ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

> genocat

$ genocat

 

Print original genomic file(s) previously compressed with genozip

 

Usage: genocat [options]... [files]...

 

One or more file names must be given

 

See also: genozip genounzip genols

 

Reference-file related options:

   -e --reference    <filename>.ref.genozip Load a reference file prior to decompressing. Required for files compressed with --reference

 

                     When no non-reference file is specified, display the reference data itself. Typically used in combination with --regions

 

   -E --REFERENCE    <filename>.ref.genozip with no non-reference file specified. Display the reverse complement of the reference data itself. Typically used in combination with --regions

 

   --show-reference  Show the name and MD5 of the reference file that needs to be provided to uncompress this file

 

Subsetting options (options resulting in modified display of the data):

   --downsample      <rate> Show only one in every <rate> lines (or reads in the case of FASTQ). Other subsetting options, if any, will be applied to the surviving lines only.

 

   --interleaved     For FASTQ data compressed with --pair: Show every pair of paired-end FASTQ files with their reads interleaved: first one read of the first file, then a read from the second file, then the next read from the first file and so on.

 

   -r --regions      [^]chr|chr:pos|pos|chr:from-to|chr:from-|chr:-to|from-to|from-|-to|from+len[,...]

   VCF SAM FASTA     Show one or more regions of the file. Examples:

   GVF 23andMe                 genocat myfile.vcf.genozip -r22:1000-2000  (Positions 1000 to 2000 on contig 22)

   ref                         genocat myfile.sam.genozip -r22:1000+151   (151 bases, starting pos 1000, on contig 22)

                               genocat myfile.vcf.genozip -r-2000,2500-   (Two ranges on all contigs)

                               genocat myfile.sam.genozip -rchr21,chr22   (Contigs chr21 and chr22 in their entirety)

                               genocat myfile.vcf.genozip -r^MT,Y         (All contigs, excluding MT and Y)

                               genocat myfile.vcf.genozip -r^-1000        (All contigs, excluding positions up to 1000)

                               genocat myfile.fa.genozip  -rchrM          (Contig chrM)

                     Note: genozip files are indexed automatically during compression. There is no separate indexing step or separate index file

                     Note: Indels are considered part of a region if their start position is

                     Note: Multiple -r arguments may be specified - this is equivalent to chaining their regions with a comma separator in a single argument

                     Note: For FASTA files, only whole-contig regions are possible

 

   -s --samples      [^]sample[,...]

   VCF               Show a subset of samples (individuals). Examples:

                               genocat myfile.vcf.genozip -s HG00255,HG00256    (show two samples)

                               genocat myfile.vcf.genozip -s ^HG00255,HG00256   (show all samples except these two)

                     Note: This does not change the INFO data (including the AC and AN tags)

                     Note: sample names are case-sensitive

                     Note: Multiple -s arguments may be specified - this is equivalent to chaining their samples with a comma separator in a single argument

 

   -g --grep         <string> Show only records in which <string> is a case-sensitive substring of the description

   FASTQ FASTA

 

   --list-chroms     List the names of the chromosomes (or contigs) included in the file

   VCF SAM FASTA GVF 23andMe 

 

   -G --drop-genotypes Output the data without the samples and FORMAT column

   VCF

 

   -H --no-header    Don't output the header lines

 

   -1 --header-one   VCF: Output only the last line on the header (the line with the field and sample names)

   VCF FASTA         FASTA: Output the sequence name up to the first space or tab

 

   --header-only     Output only the header lines

 

   --GT-only         For samples, output only genotype (GT) data, dropping the other subfields

   VCF

 

   --sequential      Output in sequential format - each sequence in a single line

   FASTA

 

Translation options (options resulting convertion of the data from one format to another):

      --bam          (SAM and BAM only) Output as BAM.

                     Note: this option is implicit if --output specifies a filename ending with .bam

 

      --sam          (SAM and BAM only) Output as SAM. This option is the default in genocat on SAM and BAM data.

 

      --fastq        (SAM and BAM only) Output as FASTQ

                     The alignments are outputed as FASTQ reads in the order they appear in the SAM/BAM file. Alignments with FLAG 16 (reverse complimented) have their SEQ reverse complimented and their QUAL reversed. Alignments with FLAG 4 (unmapped) or

                     256 (secondary) are dropped. Alignments with FLAG 64 (or 128) (the first (or last) segment in the template) have a '1' (or '2') added after the read name. Usually, if the original order of the SAM/BAM file has not been tampered with,

                     this would result in a valid interleaved FASTQ file.

                     Note: this option is implicit if --output specifies a filename ending with .fq[.gz] or .fastq[.gz]

 

      --bcf          (VCF only) Output as BCF, using bcftools

                     Note: bcftools needs to be installed for this option to work

 

      --phylip       (FASTA only) Output a Multi-FASTA in Phylip format. All sequences must be the same length

 

      --fasta        (Phylip only) Output as Multi-FASTA

 

      --vcf          (23andMe only) Output as VCF. --vcf must be used in combination with --reference to specify the reference file as listed in the header of the 23andMe file (usually this is GRCh37)

                     Note: INDEL genotypes ('DD', 'DI', 'II') as well as uncalled sites ('--') are discarded

 

General options:

   -o --output       <output -filename>. Output to this filename instead of stdout

 

   -z --bgzf         <level>. Compress the output to the BGZF format (.gz extension) using libdeflate, at the compression level specified in the argument. Argument specifies the compression level from 0 (no compression) to 12 (best, yet slowest,

                     compression). If you're not sure what value to choose, 6 is a popular option.

                     Note: by default, genocat's output is not compressed. Unlike genounzip, genocat makes no attempt to reconstruct the compression level of the original file

 

   -p --password     Provide password to access file(s) that were compressed with --password

 

   -@ --threads      Specify the maximum number of threads. By default, genozip uses all the threads it needs to maximize usage of all available cores

 

   -x --index        Create an index file alongside the decompressed file, when combined with --output. The index file is created using 'samtools index' for SAM/BAM files, 'samtools faidx' for FASTA/FASTQ files and 'bcftools index' for VCF files. Other

                     file formats cannot be indexed

 

   -q --quiet        Don't show warnings

 

   -Q --noisy        The --quiet is turned on by default when outputting to the terminal. --noisy stops the suppression of warnings

 

   -w --show-stats   Show the internal structure of a genozip file and the associated compression stats

 

   -W --SHOW-STATS   Show more detailed stats

 

   -h --help         <topic> Show this help page. Optional <topic> can be:

                     dev - list of developer options

 

   -L --license      Show the license terms and conditions for this product

 

   -V --version      Display version number

 

Tip regarding using genozip files in a pipeline:

 

   Option 1: For tools that support input redirection - use a regular pipe. Example:

             genocat myfile.vcf.genozip | bcftools view -

 

   Option 2: For tools that don't support input redirection - use a named pipe. Example:

             mkfifo mypipe.vcf

             genocat myfile.vcf.genozip > mypipe.vcf &

             othertool mypipe.vcf

 

Citing: Lan, D., et al. Bioinformatics, Volume 36, Issue 13, July 2020, Pages 4091-4092

 

Bug reports and feature requests: bugs@genozip.com

Commercial license inquiries: sales@genozip.com

Requests for support for compression of additional public or proprietary genomic file formats: sales@genozip.com

 

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR

ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

> genounzip

$ genounzip

 

Uncompress genomic files previously compressed with genozip

 

Usage: genounzip [options]... [files]...

 

One or more file names must be given

Examples: genounzip file1.vcf.genozip file2.sam.genozip

          genounzip file.vcf.genozip --output file.vcf.gz

          genounzip bound.vcf.genozip --unbind

 

See also: genozip genocat genols

 

Options:

   -x --index        Create an index file alongside the decompressed file. The index file is created using 'samtools index' for SAM/BAM files, 'samtools faidx' for FASTA/FASTQ files and 'bcftools index' for VCF files. Other file formats cannot be indexed

 

   -c --stdout       Send output to standard output instead of a file

 

   -z --bgzf         <level>. Compress the output to the BGZF format (.gz extension) using libdeflate, at the compression level specified in the argument. Argument specifies the compression level from 0 (no compression) to 12 (best, yet slowest,

                     compression). If you're not sure what value to choose, 6 is a popular option.

                     Note: by default, absent this option, genozip will attempt to re-create the same BGZF compression as in the original file. Whether genozip succeeds in re-creating the exact same BGZF compression ratio depends on the compression library

                     used by the application that generated the original file.

 

      --no-PG        (SAM and BAM only) When converting a file from SAM to BAM or vice versa, Genozip normally adds a @PG line in the header. With this option, it doesn't

 

   -f --force        Force overwrite of the output file

 

   -^ --replace      Replace the source file with the result file, rather than leaving it unchanged

 

   -u --unbind[=prefix] Split a bound file back to its original components. If the '--unbind=prefix' form is used, a prefix is added to each file component. A prefix may include a directory.

 

   -o --output       <output-filename>. Output to this filename instead of the default one

 

   -e --reference    <filename>.ref.genozip Load a reference file prior to decompressing. Required for files compressed with --reference

 

   -p --password     <password>. Provide password to access file(s) that were compressed with --password

 

   -m --md5          Show the digest of the decompressed file - MD5 if the file was compressed with --md5 or --test and Adler32 if not.

                     Note: for compressed files, e.g. myfile.vcf.gz, the digest calculated is that of the original, uncompressed file. 

 

   -q --quiet        Don't show the progress indicator or warnings

 

   -Q --noisy        The --quiet is turned on by default when outputting to the terminal. --noisy stops the suppression of warnings

 

   -t --test         Decompress in memory (i.e. without writing the decompressed file to disk) and use the digest (MD5 or Adler32) to verify that the resulting decompressed file is identical to the original file.

 

   -@ --threads      <number>. Specify the maximum number of threads. By default, genozip uses all the threads it needs to maximize usage of all available cores

 

   -w --show-stats   Show the internal structure of a genozip file and the associated compression stats

 

   -W --SHOW-STATS   Show more detailed stats

 

   -h --help         <topic> Show this help page. Optional <topic> can be:

                     dev - list of developer options

 

   -L --license      Show the license terms and conditions for this product

 

   -V --version      Display version number

 

Translation options (options resulting convertion of the data from one format to another):

      --bam          (SAM and BAM only) Output as BAM.

                     Note: this option is implicit if --output specifies a filename ending with .bam

 

      --sam          (SAM and BAM only) Output as SAM. This option is the default in genocat on SAM and BAM data.

 

      --fastq        (SAM and BAM only) Output as FASTQ

                     The alignments are outputed as FASTQ reads in the order they appear in the SAM/BAM file. Alignments with FLAG 16 (reverse complimented) have their SEQ reverse complimented and their QUAL reversed. Alignments with FLAG 4 (unmapped) or

                     256 (secondary) are dropped. Alignments with FLAG 64 (or 128) (the first (or last) segment in the template) have a '1' (or '2') added after the read name. Usually, if the original order of the SAM/BAM file has not been tampered with,

                     this would result in a valid interleaved FASTQ file.

                     Note: this option is implicit if --output specifies a filename ending with .fq[.gz] or .fastq[.gz]

 

      --bcf          (VCF only) Output as BCF, using bcftools

                     Note: bcftools needs to be installed for this option to work

 

      --phylip       (FASTA only) Output a Multi-FASTA in Phylip format. All sequences must be the same length

 

      --fasta        (Phylip only) Output as Multi-FASTA

 

      --vcf          (23andMe only) Output as VCF. --vcf must be used in combination with --reference to specify the reference file as listed in the header of the 23andMe file (usually this is GRCh37)

                     Note: INDEL genotypes ('DD', 'DI', 'II') as well as uncalled sites ('--') are discarded

 

 

Citing: Lan, D., et al. Bioinformatics, Volume 36, Issue 13, July 2020, Pages 4091-4092

 

Bug reports and feature requests: bugs@genozip.com

Commercial license inquiries: sales@genozip.com

Requests for support for compression of additional public or proprietary genomic file formats: sales@genozip.com

 

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR

ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

> genols 

$ genols -h

 

View metadata of genomic files previously compressed with genozip

 

Usage: genols [options]... [files or directories]...

 

One or more file or directory names may be given, or if omitted, genols runs on the current directory

 

See also: genozip genounzip genocat

 

Options:

   -u --unbind       Show the components of bound files. This option is implied when running genols on a single file

 

   -b --bytes        Show sizes in bytes

 

   -q --quiet        Don't show warnings

 

   -h --help         Show this help page

 

   -L --license      Show the license terms and conditions for this product

 

   -V --version      Display version number

 

Citing: Lan, D., et al. Bioinformatics, Volume 36, Issue 13, July 2020, Pages 4091-4092

 

Bug reports and feature requests: bugs@genozip.com

Commercial license inquiries: sales@genozip.com

Requests for support for compression of additional public or proprietary genomic file formats: sales@genozip.com

 

THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR

ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 

 

 

実行方法

初回は端末上で非商用の利用であるかの確認と、ユーザー登録のためのメッセージが表示される。最後に登録するのメッセージが出る。登録しないと使用できない。

 

 fastqを圧縮する。--replaceをつけると元のファイルは消える。

genozip input.fastq --replace

#fastq.gzをさらに圧縮(データによっては2/3くらいになる)
genozip input.fq.gz

#複数ファイル(個別に圧縮される)
genozip fastq_dir/*.fq.gz
  • --replace      Replace the source file with the result file, rather than leaving it unchanged 
  • -F --fast Fast compression,   but lower compression ratio than --best. Files compressed with this option also uncompress faster. Compressing with this option also consumes less memory.
  • -p  --password <password>.  Password-protected - encrypted with 256-bit AES
  • -@ --threads <number>.  Specify the maximum number of threads. By default, genozip uses all the threads it needs to maximize usage of all available cores

input.fastq.genozipができる。gzip圧縮ファイルも.gzが消えてinput.fastq.genozipとして出力される。

 

解凍する。--replaceをつけると元のファイルは消える。gzip圧縮ファイルをさらに圧縮した場合も解凍するとraw  fastqに解凍される。

genounzip input.fastq.genozip --replace
  • -c --stdout    Send output to standard output instead of a file
  • --replace      Replace the source file with the result file, rather than leaving it unchanged

 

リファレンスゲノム(fasta)とそのリファレンスに対応するペアエンドfastqを圧縮する。 単体で行うより圧縮効率が高くなる(よりファイルサイズが小さくなる)。

#まずはリファレンスを圧縮(少し時間がかかるがリファレンスは1回圧縮すれば使い回せる)
genozip --make-reference genome.fasta
#=> genome.ref.genozipができる

#次にペアエンドfastqを圧縮、paired-end fastqとgenome.ref.genozipを指定する。
genozip -2 pair_1.fq pair_2.fq -e genome.ref.genozip
  • --make-reference   Compresss a FASTA file to be used as a reference in --reference or --REFERENCE. Ignored for non-FASTA files
  • -e --reference <filename>.  ref.genozip Use a reference file - this is a FASTA file genozipped with the --make-reference option. The same reference needs to be provided to genounzip or genocat.
    While genozip is capabale of compressing without a reference, in the following cases providing a reference may result in better compression:
    1. FASTQ files
    2. SAM/BAM files
    3. VCF files with significant REFALT content (see "% of zip" in --show-stats)

  • -E --REFERENCE <filename>.  ref.genozip Similar to --reference, except genozip copies the reference (or part of it) to the output file, so there is no need to specify --reference in genounzip and genocat.
    Note on using with --password: the copy of the reference file stored in the compressed file is never encrypted

  • -2 --pair   Compress pairs of paired-end FASTQ files, resulting in compression ratios better than compressing the files individually. When using this option, every two consecutive files on the file list should be paired-end FASTQ files with an identical number of reads and consistent file names, and --reference or --REFERENCE must be specified. The resulting genozip file is a bound file. To display interleaved, use genocat --interleaved, and to unbind the genozip file back to its original FASTQ files, use genounzip --unbind. 

pair_1+2.fastq.genozipが出力される。

 

Genozip圧縮ファイルのメタデータを確認する。

genols pair_1+2.fastq.genozip

 

2021 7/3

Dual coordinate VCFの作成。

genozip --chain mychain.chain.genozip mydata.vcf

 

 

fastqの例を書きましたが、他にもたくさんのファイルタイプやファイルタイプの組み合わせに対応しています。サポートされているファイルタイプの完全なリストは 'genozip --help=input'で確認できます。間違って2回紹介してしまいましたが、残しておきます。

引用

Genozip - A Universal Extensible Genomic Data Compressor
Divon Lan, Ray Tobler, Yassine Souilmi, Bastien Llamas Author Notes
Bioinformatics, Published: 15 February 2021

 

追記

2022/09

Genozip 14 - advances in compression of BAM and CRAM files
Divon Lan,  Bastien Llamas

bioRxiv, posted September 14, 2022

 

関連

 

自分用

カレント以下のfq.gzを全て圧縮

find . -name "*.fq.gz" -type f -print0 | while read -r -d '' file; do
genozip "$file" "--replace"; done