更新Bioconductor包--update a Bioconductor package

A package belong to Bioconductor was updated (major revision) and released. I want to use the up to date package while in analysing. I am willing to use the new feature, so I need to update this package. I had tried many ways and many times, and finally found a possible way.

更新Bioconductor中的特定包到最新版本。需要首先更新R,其次更新Bioconductor,最终更新包。

1, First your should update your R version

1
2
sudo apt-get update
sudo apt-get install r-base

This will allow the latest Bioconductor to work compitablly.

2, Second update Bioconductor

1
2
3
>remove.packages("BiocInstaller")  
source("http://bioconductor.org/biocLite.R") 
biocLite()  

# this will fix an error: Error: Bioconductor version *** cannot be upgraded with R version *** # install latest BiocInstaller # update Bioconductor

3,Third update your target package

1
2
emove.packages("package-name")   
biocLite("package-name")  

# remove old version # install the latest version

思考--在比对时,关于是否将chr*_random和chrUn_*序列放在参考基因组中的思考

通常认为chr1-22,chrY,chrX和chrM为参考基因组序列,于是包括我在内的很多人,分别下载了25条染色体序列,合并成一个fasta文件,用bowtie2或者BWA构建index,用于下一步的read比对,然后是各种分析(包括突变、转录表达等)。

UCSC下载的HG19版本的整个参考基因组文件http://hgdownload.cse.ucsc.edu/goldenPath/hg19/bigZips/chromFa.tar.gz中,除还包括chr*random和chrUn序列(暂时理解为补丁序列,真实的补丁序列称呼常见assemble过程,见http://www.ncbi.nlm.nih.gov/projects/genome/assembly/grc/info/patches.shtml,有fix 和novel patch,这里我们现在只讨论chrrandom和chrUn*)。

The chr_random* sequences are unplaced sequence on those reference chromosomes.

The chrUn_* sequences are unlocalized sequences where the corresponding reference chromosome has not been determined.

当然如果DNA或RNA测序的read比对到chr*random 和 chrUn* 序列上,显示大多数人都不关注这些序列上信息,我想这也是很多人不把chr*random 和 chrUn* 放到参考基因组fasta文件中的原因。但是,chr*random 和 chrUn* 显然是存在的,只不过现在暂时没有确定位置或者后续用于基因组序列更正。

如果参考基因组序列中不包含chr*random 和 chrUn序列,那么原来属于chrrandom 和 chrUn的read则有可能比对到(不是一定)chr1-22,chrX,chrY上的相似区域(这些区域与chrrandom 和 chrUn*中的部分区域相似),造成假阳性比对,后续这些reads提供的信息都是不可靠的。

如果参考基因组序列中包含chr*random 和 chrUn序列,那么来自这些区域的reads则会正确的比对到这个地方,没有假阳性比对,只不过后续分析不需要考虑chrrandom 和 chrUn*即可。

1
2
3
4
假设有一条read来自chr1_random,
条件                                     比对结果             分析结果
基因组fa文件包含chr1_random序列          比对到chr1_random    后续不考虑
基因组fa文件中不包含chr1_random序列      比对到chr1           造成假阳性<

举个例子,以前,我们确认一个突变是否存在,看覆盖这个点的read上有多少突变的碱基,如果覆盖这个点的read本来属于chr*random 和 chrUn*序列的,但比对到这个地方,即使这个位点的突变碱基再多,也是个假阳性突变,影响后续分析。

Breakdancer------Error: no bams files in config file!

breakdancer在call structure variant的时候,生成的文件中只有一行报错的信息 Error: no bams files in config file!

这是因为breakdancer在call SV之前,要先生成配置文件cfg文件。生成cfg文件的依据,是统计bam文件中paired read的插入长度,read的平均长度等信息。如果bam文件中的read都不是配对的或者很少有配对的,在运行bam2cfg.pl时,就会生成空的配置文件,导致检测不出SV,报 Error: no bams files in config file! 错误。

解决方法:

1,准备正确的bam文件,确保足够的配对读长paired reads,以便生成cfg配置文件

2,同一批样本的插入长度,read平均长度等都差不多,可以将其他文件生成的cfg文件中的 map: 选项后改为你的bam文件。即利用其他bam文件生成的cfg文件,当作要检测SV的bam的配置。

Get the allele frequency of 1000 Genome subpopulation

在1000genome的FTP服务器上可以下载一个all的vcf文件,里面可以看到AFR, AMR, EAS, EUR, SAS人群的allele频率,但是该种族下面的亚群的频率信息需要在http://grch37.ensembl.org搜索得到,比如 http://grch37.ensembl.org/Homo_sapiens/Variation/Population?db=core;r=1:230845294-230846294;v=rs699;vdb=variation;vf=102788013 ,还有一种方式,就是下载包含所有样本的突变信息的VCF文件,利用vcftools计算。

The allele frequency of super population (AFR, AMR, EAS, EUR, SAS, see http://www.1000genomes.org/category/population/) can be obtained from all.vcf.

However, the allele population frequency in subpopulation is not well obtained.

One way is search the web http://grch37.ensembl.org by rs identifier, E.g. http://grch37.ensembl.org/Homo_sapiens/Variation/Population?db=core;r=1:230845294-230846294;v=rs699;vdb=variation;vf=102788013 .

Another way is calculated on your local machine. The following will introduce how to get allele frequency of CHB population in chr1 chromosome. CHB Han Chinese in Beijing