Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

S

showCazyPCazynome example

showCazyPCazynome(collect_cazy, des_cazy,col=3,nozero=TRUE, text=c("alpha_cazy_21.08.08", "alpha_cazy_11.02.09", "alpha_cazy_31.03.09", "alpha_cazy_07.04.09", "alpha_cazy_14.04.09", "alpha_cazy_14.04.09_10mu", "alpha_cazy_06.06.09", "alpha_cazy_16.06.09", "alpha_cazy_01.09.09", "gamma_cazy_21.08.08", "gamma_cazy_11.02.09", "gamma_cazy_31.03.09", "gamma_cazy_07.04.09", "gamma_cazy_14.04.09", "gamma_cazy_14.04.09_10mu", "gamma_cazy_06.06.09", "gamma_cazy_16.06.09", "gamma_cazy_01.09.09", "flavo_cazy_21.08.08", "flavo_cazy_11.02.09", "flavo_cazy_31.03.09", "flavo_cazy_07.04.09", "flavo_cazy_14.04.09", "flavo_cazy_14.04.09_10mu", "flavo_cazy_06.06.09", "flavo_cazy_16.06.09", "flavo_cazy_01.09.09", "rhodo_cazy_21.08.08", "rhodo_cazy_11.02.09", "rhodo_cazy_31.03.09", "rhodo_cazy_07.04.09", "rhodo_cazy_14.04.09", "rhodo_cazy_14.04.09_10mu", "rhodo_cazy_06.06.09", "rhodo_cazy_16.06.09", "rhodo_cazy_01.09.09", "pela_cazy_21.08.08", "pela_cazy_11.02.09", "pela_cazy_31.03.09", "pela_cazy_07.04.09", "pela_cazy_14.04.09", "pela_cazy_14.04.09_10mu", "pela_cazy_06.06.09", "pela_cazy_16.06.09", "pela_cazy_01.09.09", "rein_cazy_21.08.08", "rein_cazy_11.02.09", "rein_cazy_31.03.09", "rein_cazy_07.04.09", "rein_cazy_14.04.09", "rein_cazy_14.04.09_10mu", "rein_cazy_06.06.09", "rein_cazy_16.06.09", "rein_cazy_01.09.09", "sar92_cazy_21.08.08", "sar92_cazy_11.02.09", "sar92_cazy_31.03.09", "sar92_cazy_07.04.09", "sar92_cazy_14.04.09", "sar92_cazy_14.04.09_10mu", "sar92_cazy_06.06.09", "sar92_cazy_16.06.09", "sar92_cazy_01.09.09", "polar_cazy_21.08.08", "polar_cazy_11.02.09", "polar_cazy_31.03.09", "polar_cazy_07.04.09", "polar_cazy_14.04.09", "polar_cazy_14.04.09_10mu", "polar_cazy_06.06.09", "polar_cazy_16.06.09", "polar_cazy_01.09.09", "form_cazy_21.08.08", "form_cazy_11.02.09", "form_cazy_31.03.09", "form_cazy_07.04.09", "form_cazy_14.04.09", "form_cazy_14.04.09_10mu", "form_cazy_06.06.09", "form_cazy_16.06.09", "form_cazy_01.09.09", "ulvi_cazy_21.08.08", "ulvi_cazy_11.02.09", "ulvi_cazy_31.03.09", "ulvi_cazy_07.04.09", "ulvi_cazy_14.04.09", "ulvi_cazy_14.04.09_10mu", "ulvi_cazy_06.06.09", "ulvi_cazy_16.06.09", "ulvi_cazy_01.09.09"))
https://snipt.net/embed/110848667e5280a251ce89b2171cc7f0/
https://snipt.net/raw/110848667e5280a251ce89b2171cc7f0/
110848667e5280a251ce89b2171cc7f0
splus
S
1
2016-11-12T04:20:02
True
False
False
/api/public/snipt/37051/
showcazypcazynome-example
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>showCazyPCazynome<span class="p">(</span>collect_cazy<span class="p">,</span> des_cazy<span class="p">,</span>col<span class="o">=</span><span class="m">3</span><span class="p">,</span>nozero<span class="o">=</span><span class="kc">TRUE</span><span class="p">,</span> text<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="s">&quot;alpha_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;alpha_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;gamma_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;flavo_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;rhodo_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;pela_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;rein_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;sar92_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;polar_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;form_cazy_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;ulvi_cazy_01.09.09&quot;</span><span class="p">))</span> </span></pre></div> </td></tr></table>
cazy, r

S

create the master matrix

1
2
3
4
5
6
7
8
des_cazy <- as.character(cazy.annotation$GeneFamily)

des_list <- list(des_21.08.08, des_11.02.09, des_31.03.09, des_07.04.09, des_14.04.09, des_14.04.09_10mu, des_06.06.09, des_16.06.09, des_01.09.09, des_sargasso, des_polynesia, des_galapagos, des_floreana, des_indian, des_indian_2, des_indian_3, des_block, des_madagascar, des_delaware, des_fundy, des_chesapeake, des_gatun, des_panama)

master <- showProportion(des_list, des_cazy,nozero=TRUE, text=c("des_21.08.08", "des_11.02.09", "des_31.03.09", "des_07.04.09", "des_14.04.09", "des_14.04.09_10mu", "des_06.06.09", "des_16.06.09", "des_01.09.09", "des_sargasso", "des_polynesia", "des_galapagos", "des_floreana", "des_indian", "des_indian_2", "des_indian_3", "des_block", "des_madagascar", "des_delaware", "des_fundy", "des_chesapeake", "des_gatun", "des_panama"))


heatmap.2(data.matrix(master), col=greenred(20),trace="none",dendrogram="none",Rowv=FALSE,Colv=FALSE,margin=c(3,10))
https://snipt.net/embed/220acda2211baae782e3f4533a0cfb99/
https://snipt.net/raw/220acda2211baae782e3f4533a0cfb99/
220acda2211baae782e3f4533a0cfb99
splus
S
8
2016-11-17T17:53:35
True
False
False
/api/public/snipt/36699/
create-the-master-matrix
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>des_cazy <span class="o">&lt;-</span> <span class="kp">as.character</span><span class="p">(</span>cazy.annotation<span class="o">$</span>GeneFamily<span class="p">)</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>des_list <span class="o">&lt;-</span> <span class="kt">list</span><span class="p">(</span>des_21.08.08<span class="p">,</span> des_11.02.09<span class="p">,</span> des_31.03.09<span class="p">,</span> des_07.04.09<span class="p">,</span> des_14.04.09<span class="p">,</span> des_14.04.09_10mu<span class="p">,</span> des_06.06.09<span class="p">,</span> des_16.06.09<span class="p">,</span> des_01.09.09<span class="p">,</span> des_sargasso<span class="p">,</span> des_polynesia<span class="p">,</span> des_galapagos<span class="p">,</span> des_floreana<span class="p">,</span> des_indian<span class="p">,</span> des_indian_2<span class="p">,</span> des_indian_3<span class="p">,</span> des_block<span class="p">,</span> des_madagascar<span class="p">,</span> des_delaware<span class="p">,</span> des_fundy<span class="p">,</span> des_chesapeake<span class="p">,</span> des_gatun<span class="p">,</span> des_panama<span class="p">)</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>master <span class="o">&lt;-</span> showProportion<span class="p">(</span>des_list<span class="p">,</span> des_cazy<span class="p">,</span>nozero<span class="o">=</span><span class="kc">TRUE</span><span class="p">,</span> text<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="s">&quot;des_21.08.08&quot;</span><span class="p">,</span> <span class="s">&quot;des_11.02.09&quot;</span><span class="p">,</span> <span class="s">&quot;des_31.03.09&quot;</span><span class="p">,</span> <span class="s">&quot;des_07.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;des_14.04.09&quot;</span><span class="p">,</span> <span class="s">&quot;des_14.04.09_10mu&quot;</span><span class="p">,</span> <span class="s">&quot;des_06.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;des_16.06.09&quot;</span><span class="p">,</span> <span class="s">&quot;des_01.09.09&quot;</span><span class="p">,</span> <span class="s">&quot;des_sargasso&quot;</span><span class="p">,</span> <span class="s">&quot;des_polynesia&quot;</span><span class="p">,</span> <span class="s">&quot;des_galapagos&quot;</span><span class="p">,</span> <span class="s">&quot;des_floreana&quot;</span><span class="p">,</span> <span class="s">&quot;des_indian&quot;</span><span class="p">,</span> <span class="s">&quot;des_indian_2&quot;</span><span class="p">,</span> <span class="s">&quot;des_indian_3&quot;</span><span class="p">,</span> <span class="s">&quot;des_block&quot;</span><span class="p">,</span> <span class="s">&quot;des_madagascar&quot;</span><span class="p">,</span> <span class="s">&quot;des_delaware&quot;</span><span class="p">,</span> <span class="s">&quot;des_fundy&quot;</span><span class="p">,</span> <span class="s">&quot;des_chesapeake&quot;</span><span class="p">,</span> <span class="s">&quot;des_gatun&quot;</span><span class="p">,</span> <span class="s">&quot;des_panama&quot;</span><span class="p">))</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a> </span><span id="L-8"><a name="L-8"></a>heatmap.2<span class="p">(</span><span class="kp">data.matrix</span><span class="p">(</span>master<span class="p">),</span> col<span class="o">=</span>greenred<span class="p">(</span><span class="m">20</span><span class="p">),</span>trace<span class="o">=</span><span class="s">&quot;none&quot;</span><span class="p">,</span>dendrogram<span class="o">=</span><span class="s">&quot;none&quot;</span><span class="p">,</span>Rowv<span class="o">=</span><span class="kc">FALSE</span><span class="p">,</span>Colv<span class="o">=</span><span class="kc">FALSE</span><span class="p">,</span>margin<span class="o">=</span><span class="kt">c</span><span class="p">(</span><span class="m">3</span><span class="p">,</span><span class="m">10</span><span class="p">))</span> </span></pre></div> </td></tr></table>
r

S

split meta_13 into individual data frame

1
2
3
4
5
6
spl <- function(col) {
	value <- meta_13[col]
	name <- meta_13$CAZy
	
	return (data.frame(name,value))
}
https://snipt.net/embed/59ecdd168b4e49a55d5c608ea56c2956/
https://snipt.net/raw/59ecdd168b4e49a55d5c608ea56c2956/
59ecdd168b4e49a55d5c608ea56c2956
splus
S
6
2016-12-06T20:53:10
True
False
False
/api/public/snipt/36695/
split-meta_13-into-individual-data-frame
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>spl <span class="o">&lt;-</span> <span class="kr">function</span><span class="p">(</span><span class="kp">col</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> value <span class="o">&lt;-</span> meta_13<span class="p">[</span><span class="kp">col</span><span class="p">]</span> </span><span id="L-3"><a name="L-3"></a> name <span class="o">&lt;-</span> meta_13<span class="o">$</span>CAZy </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a> <span class="kr">return</span> <span class="p">(</span><span class="kt">data.frame</span><span class="p">(</span>name<span class="p">,</span>value<span class="p">))</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
cazy, r

S

destructive cazy proportion

1
2
3
4
5
6
7
des_proportion <- function (obj) {
	
	des_temp <- obj[grep("GH\\d+|CE\\d+|PL\\d+",obj$CAZy),]
	value <- 100*des_temp$count/sum(des_temp$count)
	name <- des_temp$CAZy
	return (data.frame(name, value))
}
https://snipt.net/embed/f8da8a3eba326ae455f6546b054c5272/
https://snipt.net/raw/f8da8a3eba326ae455f6546b054c5272/
f8da8a3eba326ae455f6546b054c5272
splus
S
7
2016-12-03T16:27:41
True
False
False
/api/public/snipt/36694/
destructive-cazy-proportion
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>des_proportion <span class="o">&lt;-</span> <span class="kr">function</span> <span class="p">(</span>obj<span class="p">)</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a> des_temp <span class="o">&lt;-</span> obj<span class="p">[</span><span class="kp">grep</span><span class="p">(</span><span class="s">&quot;GH\\d+|CE\\d+|PL\\d+&quot;</span><span class="p">,</span>obj<span class="o">$</span>CAZy<span class="p">),]</span> </span><span id="L-4"><a name="L-4"></a> value <span class="o">&lt;-</span> <span class="m">100</span><span class="o">*</span>des_temp<span class="o">$</span>count<span class="o">/</span><span class="kp">sum</span><span class="p">(</span>des_temp<span class="o">$</span>count<span class="p">)</span> </span><span id="L-5"><a name="L-5"></a> name <span class="o">&lt;-</span> des_temp<span class="o">$</span>CAZy </span><span id="L-6"><a name="L-6"></a> <span class="kr">return</span> <span class="p">(</span><span class="kt">data.frame</span><span class="p">(</span>name<span class="p">,</span> value<span class="p">))</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
cazy, r
Copyrighted, illegal, or inappropriate content? Email [email protected].