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左右批量设计引物”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注恰卡编程网行业资讯频道。

perl怎么对组装结果中GAP左右批量设计引物

发布于 2022-03-18 22:46:57
收藏
分享
海报
0 条评论
35
上一篇:bioperl怎么处理fasta和fastq序列 下一篇:UML建模中如何创建活动图
目录

    0 条评论

    本站已关闭游客评论,请登录或者注册后再评论吧~

    忘记密码?

    图形验证码