PP2PG(Phasing pipeline based on two parental genomes)

这个软件好像都没有什么人用哎~
但是我今天用上了,为什么会用上呢,还不是在KB的组装那个三倍体的基因组,为了区分测序回来的那么那么多的reads都是属于谁家的!!!!
对于这个软件,需要一些依赖,不过基本上这些依赖我们早就用过了,也就不存在依赖不依赖的了吧~

需要的依赖环境

浅浅列举一下吧:做到这一步,这些软件还没有的话,有点说不过去吧?

1.  MUMmer Version:4.0.0beta2 ([https://github.com/mummer4/mummer](https://github.com/mummer4/mummer)) 
2.  Bismark Version:v0.22.1 ([https://github.com/FelixKrueger/Bismark](https://github.com/FelixKrueger/Bismark)) 
3.  minimap2 Version:2.17 ([https://github.com/lh3/minimap2](https://github.com/lh3/minimap2)) 
4.  HISAT2 Version:2.1.0 ([http://ccb.jhu.edu/software/hisat2/manual.shtml](http://ccb.jhu.edu/software/hisat2/manual.shtml)) 
5.  pysam Version:0.15.2 ([https://pypi.org/project/pysam/](https://pypi.org/project/pysam/)) 
6.  SAMtools Version:1.6 ([http://samtools.sourceforge.net/](http://samtools.sourceforge.net/)) 

Installation:

 git clone https://github.com/jia-wu-feng/PP2PG.git
 cd PP2PG
 chmod +X tool/phasing.py 

这是github上的一张流程介绍


image.png

Fig.1 The phasing pipeline based on two parental genomes (PP2PG). It mainly consists of four steps: (i) Mapping, (ii) SNP Calling, (iii) Phasing and (iv) Classification.
也就是包括四个步骤:(i)映射,(ii)SNP calling,(iii)评分和(iv)分类。

(i)mapping(四选一)

1.Iso-Seq /PicBio读取的类型使用 minimap2 软件进行对齐:

minimap2 -ax splice -uf --secondary=no -C5 -O6,24 -B4 --MD ref query > results.sam      

2.利用hisat2软件对RNA-Seq配对双末端读段的类型进行比对:

hisat2 --dta -k 1 -x genome_index -1 query_1 -2 query_2 -S out.sam

3.BS-Seq读取的类型使用Bismark软件进行对齐:

bismark --bowtie2 -genome genome_index -1 query_1 -2 query_2

4.Ribo-seq读取的类型使用Tophat2(Bowtie2)软件进行对齐:

tophat2 -N 2 -I 50000 -G gff_file/gtf_file -o prefix genome_index query

(ii) SNP Calling

nucmer --mum --maxgap=500 --mincluster=100 --prefix=g1_g2 g1_genome.fa g1_genome.fa

delta-filter -1 -q -r g1_g2.delta > g1_g2.filter.delta

show-snps -C -H -I -T -r -l g1_g2.filter.delta > g1_g2.snp

(iii) Scoring and Classification:

phasing.py --pt=<phase_type> --g1=<genome1_alignment> --g2=<genome2_alignment> 
           --snp=<snpfile> --gop1=<genome1_output_prefix> --gop2=<genome2_output_prefix>

4.Output file

Two genome-based alignment results file, containing 2 folders. One is the phasing results of g1 genome alignment, which includes: g1-synteny reads, g2-synteny reads, unknown reads, and reads that only mapped to the g1 genome (g1-only reads); the other is the phasing results of g2 genome alignment, which includes: g1-synteny reads, g2-synteny reads, unknown reads, and reads that only mapped to the g2 genome (g2-only reads).
两个基于基因组的比对结果文件,包含 2 个文件夹。 一个是g1基因组比对的阶段结果,其中包括:g1-synteny读段,g2-synteny读段,未知读段和仅映射到g1基因组的读段(仅g1读段);另一种是G2基因组比对的阶段结果,其中包括:G1-Synteny读段,G2-Synteny读段,未知读段和仅映射到G2基因组的读段(仅G2读段)。

g1_genome/g1reads.bam --- g1-synteny reads mapped to g1 genome
g1_genome/g2reads.bam --- g2-synteny reads mapped to g1 genome
g1_genome/unknowreads.bam --- unknown reads mapped to g1 genome
g1_genome/g1onlyreads.bam --- reads that only mapped to the g1 genome (g1-only reads)

g2_genome/g1reads.bam --- g1-synteny reads mapped to g2 genome
g2_genome/g2reads.bam --- g2-synteny reads mapped to g2 genome
g2_genome/unknowreads.bam --- unknown reads mapped to g2 genome
g2_genome/g2onlyreads.bam --- reads that only mapped to the g2 genome (g2-only reads)

g1_g2_Phasing_Report.txt --- Final Phasing Reads Report
g1_g2_Phasing_Report.txt ---最终阶段阅读报告

Example

==========================
Final Phasing Reads Report
==========================

Phasing Data Type:      Iso-Seq (PacBio Isoform Sequence).

Note: When calculating the Separation Rate, the reads which are unmapped in two parental genomes are discarded.

Type of reads:  Read Counts
MH63-synteny reads: 129
ZS97-synteny reads: 129
Unknown reads:  47
MH63-only reads:    2
ZS97-only reads:    3

Separation Rate:        83.23%

还是看看自己是怎么用的吧~~~

#  先划分参考的序列,
minimap2 -a -t 40 -x asm10 -m 50 --secondary=no A.contig.mmi m64189e_221213_192604.ccs.fasta >A.sam
minimap2 -a -t 40 -x asm10 -m 50 --secondary=no BB.contig.mmi m64189e_221213_192604.ccs.fasta >BB.sam
#sam文件实在是太占内存了,还是转为bam吧
samtools sort -@ 20 -O bam -o A.sorted.bam A.sam
samtools sort -@ 20 -O bam -o BB.sorted.bam BB.sam
#我就有比对质量高的reads的id
awk '$5 > 55 {print $1}' A.sorted.bam | sort -u > A.sorted.id
#把A和BB的sorted的id先取个交集
cat A.sorted.id BB.sorted.id | sort | uniq -c | awk '$1 == 2{print $2}' > A_BB.JJ.id
#再来取个差集
sort A.sorted.id A_BB.JJ.id A_BB.JJ.id > A.uniq.id
##all.reads.id - A_and_BB.uniq.id(取差集)
sort all.reads.id A_and_BB.uniq.id A_and_BB.uniq.id | uniq -u > unkown.reads.id
#提取unkown的reads序列
seqtk subseq ../ccs.fasta unkown.reads.id > unkown.reads.fa

上面的和这个软件没有什么关系,我就单纯想写,下面才是这个软件怎么用~~~

#step1.Mapping
minimap2 -ax splice -uf --secondary=no -C5 -O6,24 -B4 --MD -t 60 ../A.contig.fa unkown.reads.fa |samtools sort -@ 60 -O bam -o A.sorted.bam -
minimap2 -ax splice -uf --secondary=no -C5 -O6,24 -B4 --MD -t 60 ../BB.contig.fa unkown.reads.fa |samtools sort -@ 60 -O bam -o B.sorted.bam -

#Step2.SNP calling
nucmer --mum --maxgap=500 --mincluster=100 --prefix=A_BB -t 60 ../A.contig.fa ./BB.contig.fa
delta-filter -1 -q -r A_BB.delta > A_BB.filter.delta
show-snps -C -H -I -T -r -l A_BB.filter.delta > A_BB.snp

#step3.Scoring and Classification
/share/home/off/biosoft/PP2PG/tool/phasing.py --pt=Isoseq --g1=A.sorted.bam --g2=B.sorted.bam --snp=A_BB.snp --gop1=A.reads  --gop2=B.reads --st 60

我也在等结果!!!

参考资料

https://github.com/jia-wu-feng/PP2PG

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
禁止转载,如需转载请通过简信或评论联系作者。
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 199,711评论 5 468
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 83,932评论 2 376
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 146,770评论 0 330
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 53,799评论 1 271
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 62,697评论 5 359
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,069评论 1 276
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,535评论 3 390
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,200评论 0 254
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,353评论 1 294
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,290评论 2 317
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,331评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,020评论 3 315
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,610评论 3 303
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,694评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 30,927评论 1 255
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,330评论 2 346
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 41,904评论 2 341

推荐阅读更多精彩内容