{"id":2366,"date":"2015-09-19T02:34:57","date_gmt":"2015-09-18T18:34:57","guid":{"rendered":"http:\/\/www.chenlianfu.com\/?p=2366"},"modified":"2015-09-19T04:46:23","modified_gmt":"2015-09-18T20:46:23","slug":"%e9%80%9a%e8%bf%87wig%e6%a0%bc%e5%bc%8f%e5%b0%86%e8%bd%ac%e5%bd%95%e7%bb%84%e6%95%b0%e6%8d%ae%e5%b1%95%e7%a4%ba%e5%88%b0gbrowse2%e4%b8%ad","status":"publish","type":"post","link":"http:\/\/www.chenlianfu.com\/?p=2366","title":{"rendered":"\u901a\u8fc7WIG\u683c\u5f0f\u5c06\u8f6c\u5f55\u7ec4\u6570\u636e\u5c55\u793a\u5230Gbrowse2\u4e2d"},"content":{"rendered":"<h1>1. WIG\u683c\u5f0f\u4ecb\u7ecd<\/h1>\n<p><a href=\"http:\/\/genome.ucsc.edu\/goldenPath\/help\/wiggle.html\" target=\"_blank\">WIG\u683c\u5f0f(Wiggle Track Format)<\/a>\uff0c\u53ef\u7528\u4e8e\u5c06\u8f6c\u5f55\u7ec4\u6570\u636e\u8fdb\u884c\u53ef\u89c6\u5316\u5c55\u793a\u3002bigWig\u683c\u5f0f\u5219\u662fWIG\u683c\u5f0f\u7684\u4e8c\u8fdb\u5236\u65b9\u5f0f\uff0c\u53ef\u4ee5\u4f7f\u7528wigToBigWig\u5c06WIG\u683c\u5f0f\u8f6c\u6362\u6210BigWig\u683c\u5f0f\u3002<br \/>\n\u4e00\u4e2a WIG \u683c\u5f0f\u5b9e\u4f8b\u6587\u4ef6\uff1a<\/p>\n<pre>\r\ntrack type=wiggle_0 name=\"sampleA1\" description=\"RNA-Seq read counts of species A\"\r\nvariableStep chrom=chr01 span=10\r\n10001    13\r\n10011    15\r\n10021    12\r\nfixedStep chrom=chr01 start=100031 step=10 span=10\r\n17\r\n15\r\n20\r\n<\/pre>\n<p>\u5982\u4e0a\u4f8b\u5b50\uff0c\u67092\u4e2a\u6ce8\u610f\u70b9\uff1a<\/p>\n<pre>\r\n1. \u7b2c\u4e00\u884c\u5fc5\u987b\u5982\u7406\u793a\u4f8b\u4e2d\u683c\u5f0f\u3002\u53ea\u6709name\u548cdescription\u8fd9\u4e24\u4e2a\u53c2\u6570\u7684\u503c\u53ef\u4ee5\u968f\u610f\u586b\u5199\u3002\r\n2. \u6709\u4e24\u79cd\u65b9\u6cd5\u8fdb\u884c\u6570\u636e\u63cf\u8ff0\u3002\u5206\u522b\u662fvariableStep\u548cfixedStep\u3002\u524d\u8005\u6570\u636e\u5185\u5bb9\u75282\u884c\u8868\u793a\uff0c\u540e\u8005\u6570\u636e\u90e8\u5206\u4ec5\u75281\u884c\u8868\u793a\u3002\r\n3. \u8fd9\u4e24\u79cd\u65b9\u6cd5\u7684\u51e0\u4e2a\u53c2\u7d20\u610f\u4e49\u4e3a\uff1a\r\n    chrom    \u8bbe\u7f6e\u5e8f\u5217\u540d\r\n    start    fixStep\u4e2dLocus\u7684\u8d77\u59cb\u4f4d\u7f6e\r\n    step     fixStep\u4e2dLocus\u7684\u6b65\u8fdb\r\n    span     \u4e00\u4e2a\u6570\u636e\u5bf9\u5e94\u78b1\u57fa\u6570\u76ee\r\n<\/pre>\n<h1>2. \u5c06Bam\u6587\u4ef6\u8f6c\u6362\u6210WIG\u6587\u4ef6\u5e76\u8fdb\u884c\u538b\u7f29<\/h1>\n<p>\u4f7f\u7528bam2wig\u547d\u4ee4\u5c06bam\u6587\u4ef6\u8f6c\u6362\u6210wig\u6587\u4ef6\u3002bam2wig\u547d\u4ee4\u53ef\u4ee5\u6765\u81ea\u4e8eAugustus\u8f6f\u4ef6\u3002<\/p>\n<pre>\r\n$ bam2wig sampleA1.tophat.bam > sampleA1.wig\r\n<\/pre>\n<p>\u8be5wig\u6587\u4ef6\u7684span\u53c2\u6570\u503c\u4e3a1\u3002\u56e0\u6b64\uff0c\u5f53\u57fa\u56e0\u7ec4\u8d8a\u5927\uff0c\u5219wig\u6587\u4ef6\u8d8a\u5927\u3002\u53ef\u4ee5\u8003\u8651\u8bbe\u7f6espan\u7684\u503c\u4e3a10\uff0c\u80fd\u6709\u6548\u51cf\u5c0fwig\u6587\u4ef6\u7684\u5927\u5c0f\u3002\u4f8b\u5982\u7f16\u5199\u5982\u4e9bperl\u7a0b\u5e8f\u8fdb\u884c\u538b\u7f29wig\u6587\u4ef6\u3002<\/p>\n<pre>\r\n#!\/usr\/bin\/perl\r\nuse strict;\r\n\r\nmy $usage = &lt;&lt;USAGE;\r\nUsage:\r\n    perl $0 RNA-Seq.wig &gt RNA-Seq.cutdown.wig\r\nUSAGE\r\nif (@ARGV==0){die $usage}\r\n\r\nopen IN, $ARGV[0] or die $!;\r\n\r\n$_ = <>;\r\nprint;\r\n\r\nmy $locus = 1;\r\nmy $count = 0;\r\nwhile (<IN>) {\r\n    if (m\/^variableStep\/) {\r\n        $count = int(($count + 0.5) \/ 10);\r\n        print \"$locus\\t$count\\n\" if $count > 0;\r\n        s\/$\/ span=10\/;\r\n        print;\r\n        $locus = 1;\r\n    }\r\n    else {\r\n        if (m\/(\\d+)\\s+(\\d+)\/) {\r\n            my ($num1, $num2) = ($1, $2);\r\n            if ($num1 >= $locus + 10) {\r\n                $count = int(($count + 0.5) \/ 10);\r\n                print \"$locus $count\\n\" if $count > 0;\r\n                $locus = $num1;\r\n                $count = 0;\r\n            }\r\n            $count += $num2;\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<h1>3. \u5c06wig\u6587\u4ef6\u8f6c\u6362\u6210wig binary\u6587\u4ef6\u548c\u4e00\u4e2agff3\u6587\u4ef6<\/h1>\n<p>\u4f7f\u7528Gbrowse2\u6240\u5e26\u547d\u4ee4 wiggle2gff3.pl \u5c06wig\u6587\u4ef6\u8f6c\u6362\u6210wig binary\u6587\u4ef6\u548c\u4e00\u4e2agff3\u6587\u4ef6\u3002\u6bcf\u4e2a\u57fa\u56e0\u7ec4\u5e8f\u5217\u5f97\u5230\u4e00\u4e2a\u4e8c\u8fdb\u5236\u683c\u5f0f\u7684wig\u6587\u4ef6\u3002\u540c\u65f6\u751f\u6210\u4e00\u4e2agff3\u6587\u4ef6\u3002\u8be5gff3\u6587\u4ef6\u6307\u5411\u6240\u6709\u7684wig binary\u6587\u4ef6\u3002<\/p>\n<pre>\r\n$ mkdir $PWD\/gbrowse_track_of_RNA_seq\r\n$ wiggle2gff3.pl --source=sampleA1 --method=RNA_Seq --path=$PWD\/gbrowse_track_of_RNA_seq --trackname=track_A1 sampleA1.wig > sampleA1.gff3\r\n<\/pre>\n<h1>4. \u5bfc\u5165gff3\u6587\u4ef6\u5230\u6570\u636e\u5e93\uff0c\u5e76\u914d\u7f6eGbrowse\u914d\u7f6e\u6587\u4ef6<\/h1>\n<p>\u5bfc\u5165gff3\u6587\u4ef6<\/p>\n<pre>\r\n$ bp_seqfeature_load.pl -a DBI::mysql -d gbrowse2_species -u train -p 123456 sampleA1.gff3\r\n<\/pre>\n<p>\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre>\r\n[RNA_Seq_sampleA1_xyplot]\r\nfeature        = RNA_Seq:sampleA1\r\nglyph          = wiggle_xyplot\r\ngraph_type     = boxes\r\nheight         = 50\r\nscale          = right\r\ndescription    = 1\r\ncategory       = RNA-Seq:sampleA1\r\nkey            = Transcriptional Profile\r\n\r\n[RNA_Seq_sampleA1_density]\r\nfeature        = RNA_Seq:sampleA1\r\nglyph          = wiggle_density\r\nheight         = 30\r\nbgcolor        = blue\r\ndescription    = 1\r\ncategory       = RNA-Seq:sampleA1\r\nkey            = Transcriptional Profile\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. WIG\u683c\u5f0f\u4ecb\u7ecd WIG\u683c\u5f0f(Wiggle Track Format)\uff0c\u53ef\u7528 &hellip; <a href=\"http:\/\/www.chenlianfu.com\/?p=2366\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/2366"}],"collection":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2366"}],"version-history":[{"count":2,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/2366\/revisions"}],"predecessor-version":[{"id":2368,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=\/wp\/v2\/posts\/2366\/revisions\/2368"}],"wp:attachment":[{"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2366"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chenlianfu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}