第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

一個按檢索條件從NCBI下載序列的Perl腳本

標(biāo)簽:
Java

NCBI我想大家是再熟悉不过的了,有时候我们需要按照自己的想法来下载一些序列在比对一下,网上也有很多点来点去的教程,但是面对数据量大一点的序列他们往往不太灵。

比如我们想下物种Phytophthora 的ITS1序列,在NCBI上输入Phytophthora ITS1 就可以了。然后把Search details里面的内容填到脚本相应的内容里面就好啦。

下载序列其实是一道填空题。

webp

#!/usr/bin/perl #use strict;######################################################## Application 3: Retrieving large datasets  # # Goal: Download all chimpanzee mRNA sequences in FASTA format (>50,000 sequences).#  # Solution: First use ESearch to retrieve the GI numbers for these sequences and post them on the History server, then use multiple EFetch calls to retrieve the data in batches of 500.#  # Input: $query – chimpanzee[orgn]+AND+biomol+mrna[prop]# # Output: A file named "chimp.fna" containing FASTA data.# #######################################################use LWP::Simple;

my ($query,$base,$url,$output,$web,$key,$count,$retmax);#$query = 'chimpanzee[orgn]+AND+biomol+mrna[prop]';$query = 'Phytophthora[Organism] AND ITS1[All Fields]';#assemble the esearch URL$base = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/";$url = $base."esearch.fcgi?db=nucleotide&term=$query&usehistory=y";print "$url","\n";  
#post the esearch URL$output = get($url);
die "Couldn't get it!" unless defined $output;  
#parse WebEnv, QueryKey and Count (# records retrieved)$web = $1 if ($output =~ /<WebEnv>(\S+)<\/WebEnv>/);$key = $1 if ($output =~ /<QueryKey>(\d+)<\/QueryKey>/);$count = $1 if ($output =~ /<Count>(\d+)<\/Count>/);  
#open output file for writingopen(OUT, ">Phytophthora_its.fna") || die "Can't open file!\n";  
#retrieve data in batches of 500$retmax = 500;for (my $retstart = 0; $retstart < $count; $retstart += $retmax) {
        my  $efetch_url = $base ."efetch.fcgi?db=nucleotide&WebEnv=$web";         $efetch_url .= "&query_key=$key&retstart=$retstart";         $efetch_url .= "&retmax=$retmax&rettype=fasta&retmode=text";
         my $efetch_out = get($efetch_url);         print OUT "$efetch_out";
}
close OUT;
这是之前在下载数据的时候遇到一个脚本,觉得挺方便的,在这里分享给大家,但是不知道作者谁了,该作



作者:周运来就是我
链接:https://www.jianshu.com/p/c9b8270ed86b


點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學(xué)

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消