小編寫這篇文章的主要目的,主要是給大家去做一個(gè)解答,解答的內(nèi)容,主要是實(shí)現(xiàn)GATK多線程加速,那么,具體的一個(gè)操作手法是什么呢?怎么去實(shí)現(xiàn)加速呢?下面就給大家詳細(xì)解答下。
GATK變異分析
對(duì)于大數(shù)據(jù)樣本可能會(huì)比較慢,因此可以按照染色體拆分后進(jìn)行多線程并行計(jì)算。
下面是我寫的一個(gè)python多線程腳本,僅供參考,拙劣之處敬請(qǐng)指正。
#!/usr/bin/python3 import _thread import os import threading import time muthreads=[] bam_file="a.mkdup.bam" out_file_prefix="flower" chr_list=["CHR01","CHR02","CHR03","CHR04","CHR05","CHR06","CHR07","CHR08","CHR09","CHR10","CHR11","CHR12","CHR13"] for chr in chr_list: threads_comonder_name="gatk HaplotypeCaller--intervals"+chr+"-R/mnt/j/BSA/02-read-align/Tifrunner2.fasta-I"+bam_file+"-ERC GVCF-O"+out_file_prefix+"-"+chr+".erc.g.vcf" muthreads.append(threads_comonder_name) exitFlag=0 class myThread(threading.Thread): def __init__(self,threadID,name,counter,comander): threading.Thread.__init__(self) self.threadID=threadID self.name=name self.counter=counter self.comander=comander def run(self): print("開始線程:"+self.name) print_time(self.name,self.counter,5,self.comander) print("退出線程:"+self.name) def print_time(threadName,delay,counter,comander): #while counter: if exitFlag: threadName.exit() time.sleep(delay) print(comander) os.system(comander)#調(diào)用操作系統(tǒng)命令行處理數(shù)據(jù) #counter-=1 #創(chuàng)建新線程 threadlist=[] for i,threadsnu in enumerate(muthreads[0:11]): print(i) print(threadsnu) threadsnew=myThread(1,"Thread-"+str(i),2,threadsnu) threadlist.append(threadsnew) #開啟新線程 for threads in threadlist: threads.start() for threads in threadlist: threads.join() print("運(yùn)行結(jié)束退出主線程")
下面的來自網(wǎng)絡(luò)未驗(yàn)證
多條染色體的同樣本的vcf文件合并
#for i in{1..22}X Y;do echo"-I final_chr$i.vcf"'';done #for i in{10..19}{1..9}M X Y;do echo"-I final_chr$i.vcf"'';done module load java/1.8.0_91 GATK=/home/jianmingzeng/biosoft/GATK/gatk-4.0.3.0/gatk $GATK GatherVcfs -I final_chr1.vcf -I final_chr2.vcf -I final_chr3.vcf -I final_chr4.vcf -I final_chr5.vcf -I final_chr6.vcf -I final_chr7.vcf -I final_chr8.vcf -I final_chr9.vcf -I final_chr10.vcf -I final_chr11.vcf -I final_chr12.vcf -I final_chr13.vcf -I final_chr14.vcf -I final_chr15.vcf -I final_chr16.vcf -I final_chr17.vcf -I final_chr18.vcf -I final_chr19.vcf -I final_chr20.vcf -I final_chr21.vcf -I final_chr22.vcf -I final_chrX.vcf -I final_chrY.vcf -O merge.vcf
合并的時(shí)候需要注意,vcf文件的順序跟每個(gè)vcf文件里面頭文件順序是相同的。
綜上所述,這篇文章就給大家介紹到這里了,希望可以給大家?guī)韼椭?/p>
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://www.ezyhdfw.cn/yun/128443.html
摘要:限制同時(shí)運(yùn)行線程數(shù)使用類就行,在內(nèi)部管理著一個(gè)計(jì)數(shù)器。當(dāng)計(jì)數(shù)器到時(shí),再調(diào)用就會(huì)阻塞,直到其他線程來調(diào)用,這樣就限制了同時(shí)運(yùn)行線程的數(shù)量。 事前最好了解一下什么是進(jìn)程,什么是線程,什么是GIL,本文不再贅述,直接介紹模塊的使用: 推薦1,推薦2,推薦3,更多自尋 普通的python爬蟲是單進(jìn)程單線程的,這樣在遇到大量重復(fù)的操作時(shí)就只能逐個(gè)進(jìn)行,我們就很難過了。舉個(gè)栗子:你有1000個(gè)...
摘要:阿里云基因數(shù)據(jù)服務(wù)不斷提升極致彈性的計(jì)算能力,和大規(guī)模并行處理能力,以及海量高速存儲(chǔ)來幫助基因公司快速自動(dòng)化處理每天幾十上百的下機(jī)數(shù)據(jù),并產(chǎn)通過標(biāo)準(zhǔn)產(chǎn)出高質(zhì)量的變異數(shù)據(jù)。 摘要:?一家大型基因測(cè)序功能公司每日會(huì)產(chǎn)生 10TB 到 100TB 的下機(jī)數(shù)據(jù),大數(shù)據(jù)生信分析平臺(tái)需要達(dá)到 PB 級(jí)別的數(shù)據(jù)處理能力。這背后是生物科技和計(jì)算機(jī)科技的雙向支撐:測(cè)序應(yīng)用從科研逐步走向臨床應(yīng)用,計(jì)算模...
摘要:宋體截止目前,已提供等不同語言的。為進(jìn)一步降低用戶的運(yùn)維人力投入,又推出了基于的命令行工具,提供輕量化的命令行調(diào)用方式并在開源。而控制臺(tái)一次最多允許創(chuàng)建臺(tái)云主機(jī),因此需要用戶進(jìn)行傻瓜式操作次。截止目前,UCloud已提供Python/Java/Golang等不同語言的API SDK。為進(jìn)一步降低用戶的運(yùn)維人力投入,又推出了基于Golang SDK的命令行工具CLI(Command Line ...
摘要:因?yàn)槟憧赡苄枰诠ぷ髦信c一些奇怪的人合作問題多線程使用。回答不允許真正意義上的多線程。在學(xué)習(xí)之前,很多人花了很多的時(shí)間在他們的多線程中遇到了瓶頸。 showImg(https://segmentfault.com/img/remote/1460000019609267); 介紹 隨著人工智能、機(jī)器學(xué)習(xí)、深度學(xué)習(xí)的發(fā)展,這個(gè)領(lǐng)域也正在不斷的進(jìn)入人們的眼簾,并且?guī)砹撕芏?、很大的工作機(jī)會(huì),...
閱讀 1066·2023-01-14 11:38
閱讀 1062·2023-01-14 11:04
閱讀 902·2023-01-14 10:48
閱讀 2378·2023-01-14 10:34
閱讀 1147·2023-01-14 10:24
閱讀 1026·2023-01-14 10:18
閱讀 654·2023-01-14 10:09
閱讀 733·2023-01-14 10:02