返回首页

[Bioinformatics]利用GEM-library创建基因组Mappability文件

  

现在测序应用越来越广泛,各种Seq满天飞,譬如ChIP-Seq, DNase-Seq等等。在align完测序的reads后,有些位置reads多有些位置reads 少。除了本身的生物特性外是否还与其他的因素有关呢?

当然最主要的因素应当是基因组序列本身,毕竟基因组不是简单的ACGT的完全随机。另外一个因素就是reads的长度。今天给大家介绍利用GEM-library(论文Derrien et al in 2012 [1],软件下载 [2])创建基因组Mappability文件。这个就是基于基因组本身创建出在特定条件下(譬如reads长度50bp,允许2个mismatch)基因组各位置unique reads的覆盖情况。

下面主要利用https://wiki.bits.vib.be/index.php/Create_a_mappability_track#cite_note-2 网站的基本方法来给大家介绍一下如何以酵母基因sacCer3为例生成Mappability文件。

 

1.下载参考数据

1.1 Download the yeast reference genome data from the UCSC table repository

We use below Kent tools (unix version from [4], also available for macOSX[5]) used by the UCSC team to produce the Genome browser system. Some of these tools should be present on your machine in order to repeat the code below.

 

  1. # create a folder to store all results 
  2. basefolder="~/Desktop/alignability/sacCer3_alignability" 
  3. mkdir –p ${basefolder} && cd ${basefolder} 
  4.   
  5. # download the 2bit file 
  6. wget http://hgdownload.soe.ucsc.edu/goldenPath/sacCer3/bigZips/sacCer3.2bit 
  7.   
  8. # extract the fasta data with Kent\'s \'twoBitToFa\' 
  9. twoBitToFa sacCer3.2bit SacCer3.fa 
  10.   
  11. # also create a two-column list of chromosomes names and sizes with Kent\'s \'faSize\' 
  12. faSize sacCer3.fa -detailed > sacCer3.sizes 

1.2 download additional SacCer3 annotations

Get the SGD gene table as well as the GC distribution across the whole genome from the UCSC-table (http://genome.ucsc.edu/cgi-bin/hgTables[6]).

注意:the chromosome names should be identical between the 2bit-fasta and the gene table in order for IGV to display them together

 

  1. # create a folder to store all results 
  2. basefolder="~/Desktop/alignability/sacCer3_alignability" 
  3. mkdir –p ${basefolder} && cd ${basefolder} 
  4.   
  5. # get the sgdGene table for other purposes (this is not a BED file) 
  6. wget http://hgdownload.soe.ucsc.edu/goldenPath/sacCer3/database/sgdGene.txt.gz 
  7.   
  8. # also get it in the BED-format \' SacCer3_sgdGenes.bed\' using the Table browser (see screen-shot below) 
  9.   
  10. # get and adapt GC% data in variable steps 
  11. wget http://hgdownload.soe.ucsc.edu/goldenPath/sacCer3/gc5Base/sacCer3.gc5Base.varStep.txt.gz 
  12.   
  13. # the file: sacCer3.gc5Base.varStep.txt.gz is the raw data used to encode 
  14. # the gc5Base track on sacCer3.  This file was produced from the sacCer3.2bit 
  15. # sequence with the kent source tree utility hgGcPercent (see below) 

 

1.3 create a 5base step file from the variable step with Kent\'s hgGcPercent

We can produce the GC% wig file directly from the 2bit genome and name it slightly differently to the downloaded version.

 

  1. # create a folder to store all results 
  2. basefolder="~/Desktop/alignability/sacCer3_alignability" 
  3. mkdir –p ${basefolder} && cd ${basefolder} 
  4.   
  5. hgGcPercent -wigOut \ 
  6.     -doGaps \ 
  7.     -file=stdout \ 
  8.     -win=5 \ 
  9.     sacCer3 \ 
  10.     sacCer3.2bit | \ 
  11.     gzip > sacCer3.gc5Base.varStep.wig.gz 

1.4 create a bigwig version for rapid visualization

The wigToBigWig command is somehow sensitive to complex fasta headers. If you Fasta sequences have long names including spaces and \':\', you should better simplify it and keep only one word like \'1\' or \'chr1\' to avoid problems at this stage

 

  1. # create a folder to store all results 
  2. basefolder="~/Desktop/alignability/sacCer3_alignability" 
  3. mkdir –p ${basefolder} && cd ${basefolder} 
  4.   
  5. wigToBigWig <(bgzip -cd sacCer3.gc5Base.varStep.wig.gz) \ 
  6.     sacCer3.sizes sacCer3.gc5Base.bw 

2 Install and run the GEM library tools

Tools were obtained and installed as described in http://algorithms.cnag.cat/wiki/GEM:Installation_instructions[7] (the core-2 version GEM-binaries-Linux-x86_64-core_2-20130406-045632.tbz2 was used on the local machine!)

 there is not yet a version for apple OSX and the source is not available to build locally

2.1 create a \'gem\' index

 

  1. # create a folder to store all results 
  2. basefolder="~/Desktop/alignability/sacCer3_alignability" 
  3. mkdir –p ${basefolder} && cd ${basefolder} 
  4.   
  5. pref="sacCer3" 
  6. reference="sacCer3.fa" 
  7. idxpref="sacCer3_index" 
  8. thr=8; # use 8 cores 
  9.   
  10. gem-indexer -T ${thr} -c dna -i {reference} -o ${idxpref} 
  1. #结果文件 
  2. -rw-rw-r--  1 splaisan splaisan  35M Dec 18 14:15 SacCer3_index.gem 
  3. -rw-rw-r--  1 splaisan splaisan 1.9K Dec 18 14:15 SacCer3_index.log 

2.2 compute Alignability for several K-mer lengths

The created index can now be used to compute mapability across the full genome. The alignability / mappability is computed for kmers between 50 and 250 bases by steps of 50 bases and the results are immediately converted to WIG and BigWIG format for IGV visualization.

2.3 create for 5 different read sizes

We selected increasing sizes corresponding to read material available on public repositories like SRA and showing the effect of read size on the uniqueness of subsequent short read alignment.

our tracks are based on single-end reads, paired reads are obviously more easily uniquely mapped due to their increased span size that can reach-out from difficult regions

The wigToBigWig command is somehow sensitive to complex fasta headers. If you Fasta sequences have long names including spaces and \':\', you should better simplify it and keep only one word like \'1\' or \'chr1\' to avoid problems at this stage

 

  1. # create a folder to store all results 
  2. basefolder="~/Desktop/alignability/sacCer3_alignability" 
  3. mkdir –p ${basefolder} && cd ${basefolder} 
  4.   
  5. pref="sacCer3" 
  6. idxpref="sacCer3_index" 
  7. thr=8; # use 8 cores 
  8.   
  9. for kmer in $(seq 50 50 250); do 
  10.   
  11.   # compute mappability data 
  12.   gem-mappability -T ${thr} -I ${idxpref}.gem -l ${kmer} -o ${pref}_${kmer} 
  13.   
  14.   # convert results to wig and bigwig 
  15.   gem-2-wig -I ${idxpref}.gem -i ${pref}_${kmer}.mappability -o ${pref}_${kmer} 
  16.   wigToBigWig ${pref}_${kmer}.wig ${pref}.sizes ${pref}_${kmer}.bw 
  17.   
  18. done 

 

 
 
 

 

说明:

在利用gem-mappability生成文件的时候reads长度一般可以选择36,59,75,100。这些是目前illumina机器测序的主要长度。实际应用可以按照自己的需要来选择参数-l。

3. Visualize results in IGV

A screen-shot is provided to illustrate the results using IGV and the Broad sacCer3 loaded genome. Other yeast genomes available in IGV include:

Other strains are available from:

Reads for yeast genome can be obtained from the Sanger institute at:

利用GEM-library创建基因组Mappability文件

Legend:

  • top track represents gene density across the genome for SGD genes
  • next 5 tacks show alignability / mappability for increasing kmer length.
  • bottom track shows GC% across the genome in 5base bins (scale set between 30 and 50)

 

参考:

  1. Thomas Derrien, Jordi Estellé, Santiago Marco Sola, David G Knowles, Emanuele Raineri, Roderic Guigó, Paolo Ribeca . Fast computation and applications of genome mappability. 
  2.  http://algorithms.cnag.cat/wiki/The_GEM_library
  3.  http://hgdownload.soe.ucsc.edu/goldenPath/sacCer3
  4. http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64
  5. http://hgdownload.cse.ucsc.edu/admin/exe/macOSX.i386"
  6.  http://genome.ucsc.edu/cgi-bin/hgTables
  7. http://algorithms.cnag.cat/wiki/GEM:Installation_instructions
  8. http://genomevolution.org/wiki/index.php/SGRP:_Sanger_Institute_Yeast_Genomes
  9. http://genomevolution.org/CoGe/services/JBrowse/service.pl/sequence/9136
  10. http://www.sanger.ac.uk/research/projects/genomeinformatics/sgrp.html

生物信息学教程、软件下载:https://pan.baidu.com/s/1ZjqiffHQFBSf1hJV9TMNfg 

相关参考
------分隔线----------------------------
推荐内容
关注微信
Ads