minimap2序列比对(pfar包可视化)

2022-03-20  本文已影响0人  小杜的生信筆記

前言

在前面的某一天,我无意间看到关于使用pfar可视化比对后的教程,感觉图还是比较好看的,因此,自己使用番茄基因组进行测试。理想是丰富的,但是现实是残酷的。两个番茄基因组的比较后最终的到22G的比对文件。emm。我看到后就感觉是没有戏的,但还是依旧进行后续的操作,直到今天,依旧是没有最终的结果。
后面我又试问自己,为什么要使用基因组的序列进行比较呢?原计划是想看两个基因组间的差异, 但............自己根据前面博主们的教程,重复代码。其次,也找相关的资料进行学习,比如minimap2的比对软件,‘pafr’R包的使用。这些软件在前面我都是不知道的,比对软件,我试用较多的是samtools软件,minimap2与samtools比对结果是一样一样的。
对于个人来说,目前学习生物信息学还是比较方便的,有很多的博主都会分享很多好的教程,非常的方便。但,也是比较困难的。为什么这样说呢,因为我们大多数人都是想把码直接粘贴复制过来,这样确实非常的方便。但,反问自己一句,粘贴复制以后你还记得吗?不会记得多少吧。我一直建议我们初学小白,要自己动手打码,一方面是让自己记码熟悉码,另一方面是为后期自己遇到报错问题做铺垫。
对于不是学生信的小白,只有不停的练习,你才有进步哦!!
骚年加油哦!!

--du


1 比对****序列准备

##基因组大小
> du -sh *

759M           Sl.fa
958M           Spenn.fasta

各个基因组的序列数量:

> grep ">" Sl.fa 


>SL4.0ch00
>SL4.0ch01
>SL4.0ch02
>SL4.0ch03
>SL4.0ch04
>SL4.0ch05
>SL4.0ch06
>SL4.0ch07
>SL4.0ch08
>SL4.0ch09
>SL4.0ch10
>SL4.0ch11
>SL4.0ch12 
>Spenn-ch00
>Spenn-ch01
>Spenn-ch02
>Spenn-ch03
>Spenn-ch04
>Spenn-ch05
>Spenn-ch06 

>Spenn-ch07
>Spenn-ch08
>Spenn-ch09
>Spenn-ch10
>Spenn-ch11
>Spenn-ch12

2. 使用minimap2进行比对

Minimap2是李恒大牛在2018年开发的针对于三代测序数据进行比对的工具。

<shape type="#_x0000_t75" filled="f" style="margin: 0px; padding: 0px; text-indent: 0px; left: 0px; width: 420pt; height: 246.075pt;"><imagedata title="rId21" style="margin: 0px; padding: 0px;"></imagedata></shape> image

优点:minimap2的优势是速度快。

缺点:耗费内存。

github_LH:lh3/minimap2: A versatile pairwise aligner for genomic and spliced nucleotide sequences (github.com);https://github.com/lh3/minimap2

image image
## 安装
conda search minimap2

conda install -y minimap2

minimap2 比对

minimap2 -ax asm5 Sl.fna Spenn.fna > SL_SPenn.paf
image

minimap2介绍

nanopore测序技术专题:minimap2比对

网址:nanopore测序技术专题(十八):minimap2比对 ;

https://zhuanlan.zhihu.com/p/92701077?fromvoterspage=true

image

序列比对

二代测序的核心步奏就是将测序得到的数据重新比对到基因组上,这个基因组可以是通过测序数据拼接得到的,也可以是近源参考序列。这个过程叫做短序列比对,也叫做“reads mapping”。由于测序数据本身就是从基因组上测到的,那么很显然还能定位回去。比对之后,相当于将测序数据与基因组数据组合在一起,那么整个数据分析所有的内容都打包到这个比对结果中了,后续所有的分析都将从这个文件中获取,例如可以知道每条序列的比对情况,也可以得到基因组上每个位点的细节信息,例如每个位点被测序了多少次,所有碱基是相同还是不同。

minimap2简介

二代测序时代利用bwa软件完成这个过程,而相比于illumina测序,nanopore的测序读长更长,测序错误更多,因此必须采取新的比对策略。这个时候,我们的大神级人物,bwa软件的作者李恒,紧跟技术发展趋势,及时开发除了适用于三代测序数据(pacbio,nanopore)的比对工具minimap。现在已更新到minimap2版本,minimap2与bwa必读策略不同,要适应长读长,高测序错误的数据。如果对比对原理算法感兴趣,可以查阅minimap的文献,对于很大一部分用户,了解如何使用工具即可。

minimap2安装

没错,利用minimap2将nanopore测序数据比对到参考序列上就是整个nanopore数据分析的核心,因为序列拼接当中要用到minimap2的比对,如果查看一些拼接软件的源代码,就会发现很多软件都要调用minimap(或者minimap2)比对。而对于变异检测,也是先利用将测序数据(fastq格式)与参考序列(fasta格式)进行比对,得到比对结果(bam格式)。然后在利用一些变异检测软件得到潜在变异结果(vcf格式)。软件的安装也非常容易,可以直接使用bioconda安装,也可以执行变异,推荐大家尝试下执行编译安装。

curl -L https://github.com/lh3/minimap2/releases/download/v2.17/minimap2-2.17_x64-linux.tar.bz2 
tar -jxvf minimap2-2.17_x64-linux.tar.bz2 
cd minimap2-2.17_x64-linux/
make
## 直接使用conda
conda install -y minimap2

软件使用案例

minimap2有多种比对功能,处理支持nanopre数据之外,还支持pacbio数据。比对模式可以是reads与reads之前比对,reads与基因组比对,基因组与基因组比对,以及短序列与基因组的比对,不同的比对有不同的作用,千万不能设置错误了。下面我们拿具体案例演示一下。
minimap2最常用的功能就是将测序数据比对到基因组上,这个过程与bwa比对类似,需要先建立索引,然后比对,最终得到sam格式的比对结果,如果熟悉bwa比对,那么这个操作就非常容易。
minimap2的比对输入文件为测序的reads,一般为fastq或者fasta格式,参考基因组,一般为fasta格式。minimap2可以输出paf格式以及sam格式,默认为paf格式。
第一步:建立索引

minimap2 -d co92.min co92.fna

第二步:比对

minimap2 -ax map-ont co92.min ../4.filter/clean.filtlong.fq.gz >s1037.sam

常用选项参数

主要分成五大类,索引(Indexing),回帖(Mapping),比对(Alignment),输入/输出(Input/Output),预设值(Preset)。
-x :非常中要的一个选项,软件预测的一些值,针对不同的数据选择不同的值
map-pb/map-ont: pb或者ont数据与参考序列比对;
ava-pb/ava-ont: 寻找pd数据或者ont数据之间的overlap关系;
asm5/asm10/asm20: 拼接结果与参考序列进行比对,适合~0.1/1/5% 序列分歧度;
splice: 长reads的切割比对
sr: 短reads比对
-d :创建索引文件名
-a :指定输出格式为sa格式,默认为PAF
-Q :sam文件中不输出碱基质量
-R :reads Group信息,与bwa比对中的-R一致
-t:线程数,默认为3

自己本人数据敲击结果

image

•结果文件非常的大,有22G,可想而知这个需要本地的电脑性能多大,因此不建议使用本地分析。


3 R语言可视化

比对结果,使用R包pafr进行可视化

注意:我们这里由于使用两个参考基因组进行比对,数据太大,最终还是不能进行可视化,还是按教程中所说的,使用pafr包中的数据进行进行可视化。

温馨提示:自己本地电脑不要轻易尝试大数据量的分析(尤其是机械硬盘的童鞋,你的硬盘会直接卡死的,或直接报废)。

OK!

————————————

导入相关的R包

## date: 2022.3.19

导入比对结果

df <- read_paf("D:\\Software Install\\R-4.1\\library\\pafr\\extdata\\fungi.paf")
> df %>%as.data.frame() %>%head()

   qname    qlen  qstart    qend strand  tname    tlen  tstart    tend nmatch   alen mapq    NM     ms     AS nn tp    cm
1 Q_chr1 627342040169594369152      - T_chr2 589359416366961988044349909353117   60  3208335984337271  0  P 33702
2 Q_chr1 627342056848416086379      - T_chr5 4620715  174028  567211379711414343   6034632302264333848  0  P 36435
3 Q_chr1 627342033491003725888      - T_chr2 589359422803152677081370043402876   6032833295596326118  0  P 35266
4 Q_chr1 627342049653585217172      - T_chr5 462071510989861354853250581256570   60  5989231517235520  0  P 23778
5 Q_chr1 627342052193275466197      - T_chr5 4620715  8506861095265237454253570   6016116212804213220  0  P 22842
6 Q_chr1 627342021397622372339      - T_chr2 589359435001943714260210968235303   6024335165723180683  0  P 20290
      s1   s2     dv
134049528250.0023
236863729250.0048
335950634650.0032
4240442   560.0039
523097712540.0039
620475832450.0067                                                                                                                                                                     
1                                                                                                                                                        11073M1I168M12D497M2D1652M6D712M1I48M3I29M7D6967M1I3094M11D121M1D1007M2I24M10D2221M1D1064M2I451M1I594M13D1001M2I38M1I253M10D529M9D2865M13D1087M9D2524M1I1933M7I39M3I84M1I23M3D513M8D148M6I10M1I190M1D2101M1I30M1I97M1I387M15D104M1I58M2D678M2D6M2D629M2D4389M2D2243M2D25M4I4572M18I31M1I59M4D52M2D163M8I479M3D27M3D18M1I445M5I1938M1D30M14I624M2I1642M11D30M2I5719M934I4841M2D11M5I168M4D442M35I194M1D150M2I28M1I244M1D785M1D1227M6D177M1I1280M2D342M1I23M2D100M12D209M18D72M24D1743M3D501M3D2179M18D224M9D210M2D747M4D2218M9I1779M13D272M1I1521M15I1783M1D515M5D604M5D7992M7D1117M7D3938M4D2262M229I10746M3D2071M3D510M6D90M1D366M1I1263M2I4658M2D6941M1D713M1I426M10I484M3D3626M27I1280M5I336M6D2409M11D2047M1D298M8D2194M1D3853M1I3302M1I3578M4D338M1I595M1I652M1I35M10I354M14D410M2I3417M4I283M1I2378M1I712M1I2451M1D352M2D428M14D45M9D694M1I65M1D1706M8D140M1D89M1I535M1I15M11D13M1D380M6D2986M21I3988M1I183M10D3918M1I3235M14I609M1I301M4D30M1D141M2I1398M4I163M18I841M1I607M2I2255M7D2372M10D269M7D749M1I2218M10D237M1D83M2I233M9I229M36D62M1D81M26I418M9I52M12D914M5D945M15D2479M6D406M14D58M36D150M1D152M8D2609M5D187M1I1886M11D1185M7D3942M3D315M1D226M10I1166M5I1121M2I341M15D1035M1I2081M2I339M108I1498M1D260M15D2013M6I671M3D32M1I148M1I16819M12D745M2I1788M4D3222M3I515M1D1191M15D537M4D82M2I219M2D1074M5D3992M1I61M6D27M1D549M81I290M1I2127M19D4617M10D3599M1I64M1D10266M2D639M5D438M10D434M1I3911M3I319M5D409M3D1223M4I483M1I1287M4I2160M12D4650M24D1320M1I5508M2D1223M9D1235M8I1207M7D1563M2I296M1I1268M1I2819M5D1798M1I34M1I663M13D526M7D1022M9D952M3D689M1I4543M14D588M2D24M4D4743M8D4029M10D616M5D2298M1I5986M1I2167M1D7042M
2                                                                                    9600M29D33M20D1261M14I261M7D58M1D218M8D367M6D1769M6I518M2D82M7D246M7D159M25D842M3D365M6D1556M5D521M1I171M3D1802M18I987M11D8885M7D321M13D6M2D54M17I2031M8D628M5D29M1D681M1D3545M36I2624M6D144M8D36M3D881M1I1572M2D1274M15I221M6I2166M2D7M8D2033M81I653M3I2141M2D36M11D501M24D2208M15D8922M8I504M1I264M1I28M9I1982M1I966M10D2687M1D4176M17D1417M1D94M12D819M4D387M12I166M3D1231M1I717M12D757M6I84M6I1328M3I6715M1I1487M63I4234M2D470M1D607M1D64M1I336M2D790M1I332M9I541M3I1723M10D503M3D879M1D32M4D161M3D8M2I59M2I146M1I55M2D126M2D2150M16I1178M5D1309M3D195M1I53M1I136M9D234M46I137M12742I21M1I565M1D831M8D79M7I327M6D98M27D14M4D23M7I601M1I188M1D60M39I17M3D10M11D134M11D42M2D354M6D126M1I347M10D202M1I1504M6D3151M7I1188M1I410M10I4045M20I545M2D594M10D759M12D896M2D154M1I1202M15I139M5I652M36I1159M18I5417M8I5744M2I835M1D254M2D193M7D291M22D324M14I295M1I59M7D1794M8D37M7D7001M3I1870M1D13M1I14M1I1568M1D2170M1D3627M5D1030M3I176M2D203M18D211M4D136M1D25M2I249M12I4M1I400M3I423M1I528M7D182M1I889M1I481M1I3278M12D371M3I380M10D485M1I566M8D449M1I1910M2D434M3D33M3D577M2D661M7D193M1I19M4D135M37D187M3D446M2D373M9D355M3D229M4D3288M11024D1552M21D737M9D2306M6D816M3I44M9D1516M1I181M2D77M1D1836M2D43M2D989M14D540M1I23M2D2240M14D5582M3D506M15D89M5D16M1D950M17D418M3I422M7D593M2D7M2D630M1D2364M4I1283M1D269M1I1573M12D20795M14D510M13D464M1D34M27I2962M11D31M1I994M4D131M3D1521M6I1656M1I83M1I1678M22D22M14D506M21I1099M5D2192M1I1513M3D118M1I2170M1I53M6I2053M1I3258M1D12M1I47M5D2172M7558I3727M2I807M4D2332M42D995M1D3142M3D2005M1I583M4D4216M1I68M1D3891M2I2523M4D5444M20D20000M1D438M40I664M1D2333M2D1538M57I2969M41I13098M3I227M1I36221M2I4871M1I39M5D114M1D151M59D53M42D5366M1I1920M2I8071M1I2215M656D750M
3 2740M4D1011M18D67M24D15836M12D3357M2D1861M11D306M14D494M3D1097M42I314M2D1901M1D616M7D12M2D819M5D585M3D3179M2D306M48D10029M1D7584M15D1824M9D336M60I856M1D395M4D322M12D35M36I2343M90I11M1I511M1I318M2I676M2I386M1D103M2D8M5I684M12D137M21D10878M10D4176M1D1665M1D292M3I448M7I809M1I112M1D58M4D5489M16D62M1D225M1I24M36D11M1D124M1I17M51D38M2I294M10I2793M1D297M19388D7M3D52M1I1999M1D84M1D43M1D1170M1D4501M18D922M1D449M12I561M14I945M3D1096M1D137M2I592M1I1384M54D1340M20D1377M3D11M1I7M2I260M11D235M11I3432M2I936M7D275M9I7577M1I2080M3D543M1I609M1I4226M1I187M4I38M1D3231M1D583M1D25M1I244M1D614M3I2M3I20M2D269M1I178M1D388M10I6M4D3M1I343M1D16M1D1345M1I4116M2D4M1D127M1I223M1D2869M7I1055M9I131M11D155M7I545M2D2993M41I220M8D2472M2I2243M1D218M3I219M1I31M1I153M1I1323M8I6522M1D9M4D2015M1I991M1D1672M11D511M7D822M14D1823M6D709M4I563M7D519M9D2741M2I64M13I57M2D1565M18D220M1D727M11D454M13D614M2D3036M29I8525M3I2154M1I139M2D216M1I1052M1I1731M1I492M1D265M3D2389M2I150M1D269M1D58M5D1056M18D2559M28I286M1I2931M1D65M4D1761M1D18M1D335M1D1824M3D167M3D2358M1D5M1D3516M10D1692M1I2566M1D654M8D663M1I311M1D21M1D1916M3I157M42D653M10D25M4D94M21D333M1I4024M7D7152M3I221M18I17M1I51M14D2955M2D300M1D111M1I6367M9D2987M2I379M2D5925M12D1640M1I2611M1I176M1I2526M3I259M2D111M1D3225M1I226M4D614M6D742M1I240M3D710M1D11399M1D1357M1I23M1I1147M1D991M2I89M2D102M12D5533M8D2001M3D885M2I742M1D473M4D3012M23D178M5D2435M18D1510M2I187M9D1737M5440I59M1I53M1D1670M13D31M8D1232M4D1446M7D3493M3I209M8I1276M5475D1140M24D215M17I396M6D4395M1D75M9D8M2D2220M1D31M1I12M8D140M6D236M3I2018M8I421M1D145M10D671M1I2483M1I2392M9I91M19D92M40D2438M1I3679M2I5574M21D4498M1D2079M1D224M1D34M8D43M36I3M36D8963M12I1838M14D1083M1D3075M1D46M1I3164M10D400M1I1169M2D616M1I4091M11D988M8D202M8D8M3D376M1I153M6D379M1I90M4D95M
4                                                                                                                                                                                                                                                                  2068M1I339M6I2565M1D568M2I647M6D77M3I2788M4D319M15I7388M1D1929M1I318M8D916M4I198M2D20M1I602M3I740M326D1268M27I6186M11D135M39D710M20I630M9D745M1D5390M1I1472M1I259M6D2970M12I1453M2D826M1I729M1D550M8D1667M1D80M1I49M7I108M10D652M2D3441M6D548M4I2253M6I689M10D336M143D5333M27D1644M2I428M4D6770M2D7381M1D1946M2D679M10D522M44I906M21D3941M2D230M1I68M4I88M1D3521M1I527M3D959M1I6349M5I346M1I7144M1I297M1I52M3D225M1I554M14I45M1D299M11D1438M8D63M1D3142M9D5128M20D356M10I2718M22I4192M7D3625M13I2890M6D44M8I482M6I209M2I508M1I65M1D150M32I209M4I810M2I1333M6D3308M4D355M11D656M9I2500M6D39M34D1276M3I256M1D134M90D1307M7D1055M16D356M10I147M2I312M1I11302M1I408M3D36M20D3180M2I471M1I21M2D3770M2I389M2I32M2D1433M27I1332M3D295M4D6M11D671M1D1591M9I387M3D1020M18I344M17D2045M2I269M28D1564M8D339M32I97M20D17M3D60M13D55M1I180M4I92M1I107M2I2412M3D352M2I228M2D404M1D16M2D99M2I125M6I1231M10I146M1I309M1I3393M1D384M10D22M4D18M1D15M2I30M5D5396M2I21M1I65M4D205M1I1992M32I348M1D3409M2D583M1I251M1I1398M4D151M2I148M2I2153M3I452M1D1126M1D1846M3D789M6I416M4D39M5D1205M9I932M24I292M97D74M2I6M6D2426M4I324M32D93M8I453M9I2490M2I1999M1D467M3D183M3D2492M7D22M4I759M1D583M1D52M60D58M2I33M28I173M1I4479M2I598M15D207M1D51M3I902M27I637M6I858M2I7M8I193M1I396M7I3795M52D18M16I285M1I93M10I59M3D194M3I42M1D1900M11I1921M3326D94M2I416M7D1784M3D2312M1I152M9D1523M3D1576M1D155M11D2173M2I128M12I594M9D3023M
5                                                                                                                                                                                                                                                                                                        1093M12I1176M1D244M11D2707M1I1986M20I156M1I103M3D124M42D8444M1I120M15D11M1D454M8I1250M30D1244M2I1873M1D118M1I315M3I312M3D4043M1I1137M1D1899M23D750M18I175M30I2410M1I19M3I98M6I886M6D13M1I16M20I1041M3D1116M10D394M2D2168M14D3252M6D535M10D3000M6D1920M1D162M1D305M8I520M1I129M2D41M8I3424M8D51M4I135M3I678M1I507M6D325M14D28M3I300M2I261M6D1815M1I2189M1D287M1D4813M2D6M5D140M2D134M20I606M6D359M1I145M4D1066M11D130M12D2717M14D947M26D1035M3D591M18I1188M2I1344M20I723M24D661M18I1927M15D1994M7D391M30D343M36D480M20D4146M8D143M1D978M9D306M9D1078M6D1047M50I23M13I169M6I8M2I56M1D2324M15D3901M1I2706M12D388M1I1348M1I739M19D1050M6I8M2I4968M3I454M4D7929M6I1492M9D91M1D194M1I285M7D7136M1I155M1D479M1D2302M15I1980M1D237M1D1119M8D2033M11D87M1I918M1D29M3D5241M9D150M4I605M12I1145M14I2231M1I599M1I426M1I228M5I675M1D2628M1D11M9D390M5D8108M4D5426M11D823M10D20M8D1293M1I132M36D246M4D119M64I142M1I1213M9D410M13I676M1D1088M11D733M32I819M1D453M13D198M1D5645M84I4364M1I290M5500D652M2I5156M1I33M109I2801M2I522M16D50M1D151M28I1409M1D178M13D253M1I1474M19D18M2I360M2I800M1I2600M18D295M20D582M5D1883M6I818M14D28M12I445M2D946M1D173M35D2062M1I14944M1I2562M1I9M3D11M1D243M1D81M1I1015M1I1483M1I362M6I1184M27D230M2I200M14D378M1D66M3D164M6D173M4D20M9D941M1I153M1D1195M2I2241M9I358M1I49M10I478M1I255M4I42M3D3700M8201I1803M9D897M1D228M1D26M263D293M1D74M
6                                                                                                                                                                                                                            977M1I6451M1I8266M1D5380M16D428M2I1494M1D410M18D126M1D3705M2I1038M18D995M11I149M1D265M5D827M3D1694M1I1619M11D42M37D576M8D4645M5D4889M3I54M7D80M1D3193M1I50M4I2696M4I4814M1D529M5D1451M1D89M5D501M2I3341M3D901M1I73M1D662M1I3788M1I388M2D11M1I2907M1D5M1I1289M4D16M5D325M1D4178M13I261M6I2M9D1334M12D443M1D1144M3D1580M20D306M9I1468M9I524M1I924M6D7916M2I866M3D348M1I5625M1D2204M4I2395M2133D12906M3I599M10D2989M2D1178M7D1015M1D41M4I156M3D1594M10D521M1I58M1D543M11D4516M3D140M3D3135M6I203M1D698M1D5481M18D256M3D45M11D85M4D131M9D3347M1D1040M5D122M2D42M6D692M4D4449M1D2253M10D5864M16D821M6D1009M1D71M1I1434M8D100M1I468M1I39M14D1815M6D327M1I115M1D1340M117I2676M8D2571M30I228M4D46M6D167M1I214M1D1664M5I140M52I55M2D13M6I225M46D101M1D293M13410I225M9D1915M18D81M24D6073M9D3031M1I4510M1D2692M1I304M1D1772M24D4704M3D1162M2I716M1I1357M1I306M1I13M1D1140M4D36M8D806M12D413M1I198M1D195M7508I91M14D6912M
  zd
1 NA
2 NA
3  2
4  2
5  1
6NA

绘制共线性的点图

###绘制共线性的点图
pdf("共线性的点图.pdf", width = 8, height = 8)
dotplot(df)
dev.off()
image

覆盖度

函数plot_coverage提供了一个有用的方法来查看一个给定的基因组有多少被包含在基因组排列中。默认情况下,它将目标染色体中的每个序列显示为一个矩形框,阴影区域代表目标基因组中被包含在比对中的部分。

p1 <- plot_coverage(df)
p2 <- plot_coverage(df,fill = 'qname')
p2
p3 <- plot_coverage(df, fill = 'qname')+
  scale_fill_brewer(palette = 'Set1')
##
pdf("覆盖度.pdf",  width = 8, height = 6)
p1 + p2 + theme(legend.position = 'none')+
  p3 + theme(legend.position = 'none')

dev.off()

image image

pafr代码部分来自:

image


image

Pafr官方文档:

https://cran.r-project.org/web/packages/pafr/vignettes/Introductiontopafr.html

image

点图:

ggplot(df, aes(alen, dv)) + 

  geom_point(alpha=0.6, colour="steelblue", size=2) + 

  scale_x_continuous("Alignment length (kb)", label =  function(x) x/ 1e3) +
  scale_y_continuous("Per base divergence") + 

  theme_pubr()
image

我们可以看到,有许多短的排列组合,其中一些是非常分歧的。但是也有一些非常长的排列,所有这些排列都显示出高度的相似性。因为pafr对象实际上是一个数据框架,我们可以再次使用标准的R函数来检查或分析它。例如,我们可以计算以查询基因组中每个序列为特征的排列的平均分歧水平。 改变点阵图中序列的顺序默认的图是相当稀疏的,每个对齐的片段显示为一条暗线,查询和目标基因组中的序列边界显示为虚线。dotplot的附加参数让我们可以修改该图。例如,我们可以为每个查询和目标序列添加标签(labelseqs),并改变目标序列的出现顺序。因为这里产生的点阵图是一个ggplot对象,我们也可以使用themebw()来改变图的主题。

dotplot(df, label_seqs = TRUE, order_by = 'qstart') + theme_bw()
参数:
参数order_by有三个可能的值。size","qstart "或 "supported"。
Size"(默认值)只是将查询序列和目标序列从大到小排列。
qstart "保持查询序列按大小排序,但按目标序列与查询序列的匹配程度重新排列。

image

小杜的生信筆記”公众号、知乎、简书平台,主要发表或收录生物信息学的教程,以及基于R的分析和可视化(包括数据分析,图形绘制等);分享感兴趣的文献和学习资料!

上一篇下一篇

猜你喜欢

热点阅读