<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>生信菜鸟团 &#187; refseq</title>
	<atom:link href="http://www.bio-info-trainee.com/tag/refseq/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bio-info-trainee.com</link>
	<description>欢迎去论坛biotrainee.com留言参与讨论，或者关注同名微信公众号biotrainee</description>
	<lastBuildDate>Sat, 28 Jun 2025 14:30:13 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.33</generator>
	<item>
		<title>对snp进行注释并格式化输出</title>
		<link>http://www.bio-info-trainee.com/614.html</link>
		<comments>http://www.bio-info-trainee.com/614.html#comments</comments>
		<pubDate>Fri, 10 Apr 2015 01:25:01 +0000</pubDate>
		<dc:creator><![CDATA[ulwvfje]]></dc:creator>
				<category><![CDATA[基础数据库]]></category>
		<category><![CDATA[基础数据格式]]></category>
		<category><![CDATA[annovar]]></category>
		<category><![CDATA[ENSEMBL]]></category>
		<category><![CDATA[refseq]]></category>

		<guid isPermaLink="false">http://www.bio-info-trainee.com/?p=614</guid>
		<description><![CDATA[前面我已经讲了如何用annovar来把vcf格式的snp进行注释，注释之后大概是 &#8230; <a href="http://www.bio-info-trainee.com/614.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><b></b>前面我已经讲了如何用annovar来把vcf格式的snp进行注释，注释之后大概是这样的，每个snp位点的坐标，已经在哪个基因上面，都标的很清楚啦，。而且该突变是在哪个基因的哪个转录本的哪个外显子都一清二楚，更强大的是，还能显示是第几个碱基突变成第几个，同样氨基酸的突变情况也很清楚。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/04/对snp进行注释并格式化输出157.png"><img class="alignnone size-full wp-image-615" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/04/对snp进行注释并格式化输出157.png" alt="对snp进行注释并格式化输出157" width="554" height="246" /></a></p>
<p>但是这样不是很方便浏览具体突变情况，所以我写了一个脚本格式化该突变情况。</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/04/对snp进行注释并格式化输出196.png"><img class="alignnone size-full wp-image-616" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/04/对snp进行注释并格式化输出196.png" alt="对snp进行注释并格式化输出196" width="546" height="113" /></a></p>
<p>理论上是应该要做出上面这个样子，突变氨基酸前后各12个氨基酸都显示出来，突变的那个还要标红色突出显示！但是颜色控制很麻烦，我就没有做。效果如下</p>
<p><a href="http://www.bio-info-trainee.com/wp-content/uploads/2015/04/对snp进行注释并格式化输出270.png"><img class="alignnone size-full wp-image-617" src="http://www.bio-info-trainee.com/wp-content/uploads/2015/04/对snp进行注释并格式化输出270.png" alt="对snp进行注释并格式化输出270" width="554" height="362" /></a></p>
<p>实现这样的格式化输出有三个重点，首先是NM开头的refseq的ID号要转换为ensembl数据库的转录本ID号，还有找到该转录本的CDS序列，这个都需要在biomart里面转换，或者自己写脚本，然后就用脚本爬取即可！</p>
<p>代码如下</p>
<p>[perl]</p>
<p>open FH1,&quot;NM2ensembl.txt&quot;;</p>
<p>while(&lt;FH1&gt;){</p>
<p>chomp;</p>
<p>@F=split;</p>
<p>$hash_nm_enst{$F[4]}=$F[1] if $F[4];</p>
<p>}</p>
<p>open FH2,&quot;ENST.CDS.fa&quot;;</p>
<p>while($line=&lt;FH2&gt;){</p>
<p>chomp $line;</p>
<p>if ($line=~/&gt;/) {$key = (split /\|/,$line)[1];}</p>
<p>else {$hash_nucl{$key}.=$line;}</p>
<p>}</p>
<p>open FH3,&quot;ENST.protein&quot;;</p>
<p>while($line=&lt;FH3&gt;){</p>
<p>chomp $line;</p>
<p>if ($line=~/&gt;/) {$key = (split /\|/,$line)[1];}</p>
<p>else {$hash_prot{$key}.=$line;}</p>
<p>}</p>
<p>open FH4,&quot;raw.mutiple.txt&quot;;</p>
<p>$i=1;</p>
<p>while(&lt;FH4&gt;){</p>
<p>chomp;</p>
<p>@F=split;</p>
<p>@tmp=split/:/,$F[1];</p>
<p>/:exon(\d+):/;$exon=$1;</p>
<p>/(NM_\d+)/; $nm=$1;</p>
<p>$enst=$hash_nm_enst{$nm};</p>
<p>print &quot;$i.  $tmp[0] $F[0] the $exon -th exon(s) of $enst \n&quot;;</p>
<p>$i++;</p>
<p>$tmp[3]=~/(\d+)/;$num_nucl=$1;</p>
<p>$tmp[3]=~/&gt;([ATCG])/;$mutation_nucl=$1;</p>
<p>$tmp[4]=~/(\d+)/;$num_prot=$1;</p>
<p>$sequence=$hash_nucl{$enst};</p>
<p>$num_up=3*$num_prot-39;</p>
<p>$out_nucl=substr($sequence,$num_up,75);</p>
<p>print &quot;WT:$out_nucl\n  &quot;;</p>
<p>for(my $j=0; $j &lt; (length($out_nucl) - 2) ; $j += 3)</p>
<p>{print ' ';print $codon{substr($out_nucl,$j,3)} ;print ' ';}   </p>
<p>print &quot;\n&quot;;</p>
<p>$mutation_pos=$num_nucl-$num_up-1;</p>
<p>substr($out_nucl,$mutation_pos,1,$mutation_nucl) if ((length $out_nucl) == 75 );</p>
<p>print &quot;MU:$out_nucl\n  &quot;;</p>
<p>for(my $j=0; $j &lt; (length($out_nucl) - 2) ; $j += 3)</p>
<p>{print ' ';print $codon{substr($out_nucl,$j,3)} ;print ' ';}   </p>
<p>print &quot;\n&quot;;</p>
<p>print &quot;\n&quot;;</p>
<p>print &quot;\n&quot;;</p>
<p>}</p>
<p>[/perl]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bio-info-trainee.com/614.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
