perl怎么对组装结果中GAP左右批量设计引物
perl怎么对组装结果中GAP左右批量设计引物
本文小编为大家详细介绍“perl怎么对组装结果中GAP左右批量设计引物”,内容详细,步骤清晰,细节处理妥当,希望这篇“perl怎么对组装结果中GAP左右批量设计引物”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。
#!/usr/bin/perl-wusestrict;useCwdqw(abs_pathgetcwd);useGetopt::Long;useData::Dumper;useFindBinqw($Bin$Script);useFile::Basenameqw(basenamedirname);useBio::SeqIO;my$BEGIN_TIME=time();my$version="1.0";#------------------------------------------------------------------#GetOptions#------------------------------------------------------------------my($fa,$flank,$epcrfa,$od,$cut,$outprefix,$PRIMER_NUM_RETURN,$PRIMER_OPT_SIZE,$PRIMER_MIN_SIZE,$PRIMER_MAX_SIZE,$PRIMER_PRODUCT_SIZE_RANGE,$PRIMER_MAX_NS_ACCEPTED);GetOptions("help|?"=>\&USAGE,"fa=s"=>\$fa,"flank=s"=>\$flank,"PRIMER_MIN_SIZE=s"=>\$PRIMER_MIN_SIZE,"PRIMER_OPT_SIZE=s"=>\$PRIMER_OPT_SIZE,"PRIMER_MAX_SIZE=s"=>\$PRIMER_MAX_SIZE,"PRIMER_NUM_RETURN=s"=>\$PRIMER_NUM_RETURN,"PRIMER_PRODUCT_SIZE_RANGE=s"=>\$PRIMER_PRODUCT_SIZE_RANGE,"epcrfa=s"=>\$epcrfa,"od=s"=>\$od,"prefix=s"=>\$outprefix,)or&USAGE;&USAGEunless($fa);subUSAGE{my$usage=<<"USAGE";Program:$0Version:$versionContact:huang2002003\@126.comDiscription:Usage:Options:-faInputfafile,forced-flank100cut100-PRIMER_MIN_SIZE18Minimumacceptablelengthofaprimer.Mustbegreaterthan0andlessthanorequaltoPRIMER_MAX_SIZE-PRIMER_OPT_SIZE20Optimumlength(inbases)ofaprimer.Primer3willattempttopickprimersclosetothislength.-PRIMER_MAX_SIZE23Maximumacceptablelength(inbases)ofaprimer.Currentlythisparametercannotbelargerthan35.Thislimitisgovernedbymaximumoligosizeforwhichprimer3'smelting-temperatureisvalid.-PRIMER_PRODUCT_SIZE_RANGE100-300Theassociatedvaluesspecifythelengthsoftheproductthattheuserwantstheprimerstocreate,andisaspaceseparatedlistofelementsoftheform-PRIMER_NUM_RETURN1Totalnumprimertosearch-epcrfarunE-PCRtofiltermultimappedprimers;required;-odKeyofoutputdir,defaultcwd;-prefixdefoultdemo;-hHelpUSAGEprint$usage;exit1;}$PRIMER_MIN_SIZE||=18;$PRIMER_OPT_SIZE||=20;$PRIMER_MAX_SIZE||=23;$PRIMER_NUM_RETURN||=1;$PRIMER_MAX_NS_ACCEPTED||=1;$PRIMER_PRODUCT_SIZE_RANGE||="100-300";$od||=getcwd;$flank||=100;$od=abs_path($od);unless(-d$od){mkdir$od;}$outprefix||="SSR";$fa=abs_path($fa);$epcrfa||=$fa;$epcrfa=abs_path($epcrfa);#################################################################my%ref=();my%ref_len=();my$in=Bio::SeqIO->new(-file=>"$fa",-format=>'Fasta');while(my$seq=$in->next_seq()){$ref{$seq->id}=$seq;$ref_len{$seq->id}=$seq->length;}$in->close();############findSSRbymisa#######################print"perl/biosoft/MISA/my_misa1.pl$fa$od/$outprefix.misa$od/$outprefix.misa.statistics\n";system("perl/biosoft/MISA/my_misa1.pl$fa$od/$outprefix.misa$od/$outprefix.misa.statistics");###########################primerdesign###############################openIN,"$od/$outprefix.misa"ordie"$!";openOUT,">$od/primer3.input"ordie"$!";my%ssr_pos=();#ssr相关信息my%SSR=();#SSRtypewhile(my$line=){chomp$line;my@tmp=split(/\t/,$line);nextif($tmp[0]eq"ID");my$ID="$tmp[0]_$tmp[5]_$tmp[6]_$tmp[4]";$ssr_pos{$ID}="$tmp[0]\t$tmp[5]\t$tmp[6]\t$tmp[4]\t$tmp[2]";my$seq=&get_target_fa($tmp[0],$tmp[5]-$flank,$tmp[6]+$flank);#print$seq."\n";my$tar=0;if(($tmp[5]-$flank)<=0){$tar=$tmp[5];}else{$tar=$flank;}if($seq){$SSR{$ID}=$tmp[3];printOUT"SEQUENCE_ID=$ID\n";printOUT"SEQUENCE_TEMPLATE=$seq\n";printfOUT("SEQUENCE_TARGET=%d,%d\n",$tar+1,$tmp[4]);printOUT"SPRIMER_TASK=pick_detection_primers\n";printOUT"PRIMER_PICK_LEFT_PRIMER=1\n";printOUT"PRIMER_PICK_RIGHT_PRIMER=1\n";printOUT"PRIMER_NUM_RETURN=$PRIMER_NUM_RETURN\n";printOUT"PRIMER_MAX_END_STABILITY=250\n";printOUT"PRIMER_MIN_SIZE=$PRIMER_MIN_SIZE\n";printOUT"PRIMER_OPT_SIZE=$PRIMER_OPT_SIZE\n";printOUT"PRIMER_MAX_SIZE=$PRIMER_MAX_SIZE\n";printOUT"PRIMER_MAX_NS_ACCEPTED=1\n";printOUT"PRIMER_MIN_GC=40.0\nPRIMER_MAX_GC=60.0\n";printOUT"PRIMER_PRODUCT_SIZE_RANGE=$PRIMER_PRODUCT_SIZE_RANGE\n";printfOUT("SEQUENCE_INTERNAL_EXCLUDED_REGION=%d,%d\n",$tar+1,$tmp[4]);printOUT"=\n";}}close(OUT);close(IN);print"/biosoft/Primer3/primer3-2.3.7/src/primer3_core-p3_settings_file=/biosoft/Primer3/primer3-2.3.7/default_settings.txt-output=$od/$outprefix.primers$od/primer3.input\n";system("/biosoft/Primer3/primer3-2.3.7/src/primer3_core-p3_settings_file=/biosoft/Primer3/primer3-2.3.7/default_settings.txt-output=$od/$outprefix.primers$od/primer3.input");###############################e-PCR#####################my%Pseq=();$/="=\n";openIN,"$od/$outprefix.primers"ordie"$!";openOUT,">$od/$outprefix.primers.xls"ordie"$!";printOUT"#SEQUENCE_ID\tPRIMER_LEFT_SEQUENCE\tPRIMER_RIGHT_SEQUENCE\tPRIMER_PAIR_PRODUCT_SIZE\tPRIMER_LEFT_TM\tPRIMER_RIGHT_TM\tPRIMER_LEFT_GC_PERCENT\tPRIMER_RIGHT_GC_PERCENT\tSSR\tSSR_TYPE\n";while(my$line=){chomp$line;my@field=split(/\n/,$line);my%primers=&get_hash(@field);nextif!defined($primers{"PRIMER_PAIR_NUM_RETURNED"})or$primers{"PRIMER_PAIR_NUM_RETURNED"}==0;if($primers{"PRIMER_PAIR_NUM_RETURNED"}>=1){formy$i(0..($primers{"PRIMER_PAIR_NUM_RETURNED"}-1)){$Pseq{"$primers{SEQUENCE_ID}"}{$i}=[$primers{"PRIMER_LEFT_${i}_SEQUENCE"},$primers{"PRIMER_RIGHT_${i}_SEQUENCE"}];printOUTjoin("\t",("$primers{SEQUENCE_ID}_${i}",$primers{"PRIMER_LEFT_${i}_SEQUENCE"},$primers{"PRIMER_RIGHT_${i}_SEQUENCE"},$primers{"PRIMER_PAIR_${i}_PRODUCT_SIZE"},$primers{"PRIMER_LEFT_${i}_TM"},$primers{"PRIMER_RIGHT_${i}_TM"},$primers{"PRIMER_LEFT_${i}_GC_PERCENT"},$primers{"PRIMER_RIGHT_${i}_GC_PERCENT"},$SSR{$primers{"SEQUENCE_ID"}}))."\n";}}}$/="\n";close(OUT);print"/biosoft/e-PCR/Linux-x86_64/e-PCR-w9-f1-m100$od/$outprefix.primers.xlsD=100-400$epcrfaN=1G=1T=3>$od/$outprefix.epcr.out\n";system("/biosoft/e-PCR/Linux-x86_64/e-PCR-w9-f1-m100$od/$outprefix.primers.xlsD=100-400$epcrfaN=1G=1T=3>$od/$outprefix.epcr.out");######################################################################################openIN,"$od/$outprefix.epcr.out"ordie"$!";openOUT,">$od/$outprefix.primers.result.xls"ordie"$!";my%P=();while(my$line=){chomp$line;my@tmp=split(/\t/,$line);nextif$tmp[6]+$tmp[7]>1;$tmp[5]=~s#/.*$##;my$ssr_id=$tmp[1];my$num=0;($ssr_id,$num)=($ssr_id=~/(.*)_(\d+)$/);$P{$tmp[1]}{"$tmp[1]_$tmp[3]_$tmp[4]"}=[$tmp[1],$ssr_pos{$ssr_id},$Pseq{$ssr_id}{$num}->[0],$Pseq{$ssr_id}{$num}->[1],$tmp[5],@tmp[6..$#tmp]];}close(IN);printOUT"#GAP_ID\tCHR\tGAP_START\tGAP_END\tGAP_LENGTH\tGAP_TYPE\tPRIMER_LEFT_SEQUENCE\tPRIMER_RIGHT_SEQUENCE\tPRIMER_PAIR_PRODUCT_SIZE/PREDICT_RANGE\tMISM\tGAPS\tPRIMER_LEFT_TM\tPRIMER_RIGHT_TM\tPRIMER_LEFT_GC_PERCENT\tPRIMER_RIGHT_GC_PERCENT\tGAP\n";openOUT1,">$od/$outprefix.NOprimers.result.xls"ordie"$!";formy$id(sortkeys%SSR){formy$i(0..($PRIMER_NUM_RETURN-1)){if(exists$P{"${id}_$i"}){my@ps=(keys%{$P{"${id}_$i"}});if(@ps==1){printOUTjoin("\t",@{$P{"${id}_$i"}{$ps[0]}})."\n";}}else{printOUT1"${id}notprimers\n";}}}close(OUT);close(OUT1);openOUT,">$od/readme.txt"ordie"$!";my$readme=<<"README";建议使用editplus打开本文件;*primers.result.xls#SEQUENCE_ID--引物ID(命名规则:GAP所在来源序列_GAP所在位置start_GAP所在位置end_GAP长度_备用引物编号;)PRIMER_LEFT_SEQUENCE--左引物PRIMER_RIGHT_SEQUENCE--右引物PRIMER_PAIR_PRODUCT_SIZE/PREDICT_RANGE--MISM--Totalnumberofmismatchesfortwoprimers(ePCR)GAPS--Totalnumberofgapsfortwoprimers(ePCR)PRIMER_LEFT_TM--退火温度PRIMER_RIGHT_TM--退火温度PRIMER_LEFT_GC_PERCENT--GC含量PRIMER_RIGHT_GC_PERCENT--GC含量GAP--GAP类型方法:2.提取GAP左右及其左右序列,用primer3设计引物[2]3.用Epcr,在fasta上电子PCR,去除有多处比较的引物,保证引物扩增的特异性[3][1]MISA:ExploitingESTdatabasesforthedevelopmentandcharacterizationofgene-derivedSSR-markersinbarley(HordeumvulgareL.).[2]Primer3:UntergasserA,CutcutacheI,KoressaarT,YeJ,FairclothBC,RemmM,RozenSG(2012)Primer3-newcapabilitiesandinterfaces.NucleicAcidsResearch40(15):e115[3]http://www.ncbi.nlm.nih.gov/tools/epcr/READMEprintOUT$readme;close(OUT);################################################################################subget_hash{my@info=@_;my%result=();formy$i(@info){nextif$i=~/^\s*$/;my($k,$v)=split(/=/,$i);$result{$k}=$v;}return%result;}subget_target_fa(){my$id=shift;my$posU=shift;my$posD=shift;if($posU<=0){$posU=1;}my$seqobj=$ref{$id};my$len=$ref_len{$id};return$seqobj->subseq($posU,$len)if$posD>$len;my$tri="";$tri=$seqobj->subseq($posU,$posD);return$tri;}
读到这里,这篇“perl怎么对组装结果中GAP左右批量设计引物”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注恰卡编程网行业资讯频道。
推荐阅读
-
牵引力教育 你的PHP真的学好了?
PHP:HypertextPreprocessorPHP是一种HTML内嵌式的语言(类似IIS上的ASP...
-
PHP代码优化技巧总结
-
关于php免费学的几个网站?从初级到高级使用的资料
php的一个定义PHP又名超文本预处理器,是一种通用开源脚本语言。PHP主要适用于Web开发领域,语法吸收了C语言、Ja...
-
PHP到底能做什么,我大学里怎么没有PHP这科
-
perl如何提取GFF中所有转录本的位置信息
perl如何提取GFF中所有转录本的位置信息本篇内容主要讲解“pe...
-
perl怎么从gff文件中提取对应转录本ID的基因结构信息
perl怎么从gff文件中提取对应转录本ID的基因结构信息本篇内容...
-
perl如何分离NR NT库
perl如何分离NRNT库这篇文章主要为大家展示了“perl如何...
-
perl对应的gff文件格式是什么
perl对应的gff文件格式是什么本文小编为大家详细介绍“perl...
-
perl怎么提取基因组所有基因的启动子序列
perl怎么提取基因组所有基因的启动子序列这篇“perl怎么提取基...
-
perl怎么画韦恩图
perl怎么画韦恩图本篇内容主要讲解“perl怎么画韦恩图”,感兴...