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-09-27T11:44:13
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 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

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-09-26T14:54:11
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 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-09-05T07:41:38
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 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 support@snipt.net.