<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://metabolomics.jp/mediawiki/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://metabolomics.jp/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Aritalab%3ALecture%2FNGS%2FUnix_commands%2FExamples</id>
		<title>Aritalab:Lecture/NGS/Unix commands/Examples - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://metabolomics.jp/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Aritalab%3ALecture%2FNGS%2FUnix_commands%2FExamples"/>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/NGS/Unix_commands/Examples&amp;action=history"/>
		<updated>2026-05-17T13:27:38Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/NGS/Unix_commands/Examples&amp;diff=314740&amp;oldid=prev</id>
		<title>Adm: Created page with &quot;==Set Operations== We assume two sets '''A''' and '''B''' whose elements are listed line by line.  *Set size: the number of elements in set A :&lt;tt&gt;wc -l A&lt;/tt&gt;  *Set inclusion...&quot;</title>
		<link rel="alternate" type="text/html" href="http://metabolomics.jp/mediawiki/index.php?title=Aritalab:Lecture/NGS/Unix_commands/Examples&amp;diff=314740&amp;oldid=prev"/>
				<updated>2015-11-09T07:23:49Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Set Operations== We assume two sets &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039; whose elements are listed line by line.  *Set size: the number of elements in set A :&amp;lt;tt&amp;gt;wc -l A&amp;lt;/tt&amp;gt;  *Set inclusion...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Set Operations==&lt;br /&gt;
We assume two sets '''A''' and '''B''' whose elements are listed line by line.&lt;br /&gt;
&lt;br /&gt;
*Set size: the number of elements in set A&lt;br /&gt;
:&amp;lt;tt&amp;gt;wc -l A&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Set inclusion: whether an element k is in set A&lt;br /&gt;
:&amp;lt;tt&amp;gt;$ grep -xc 'k' A &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Set equivalence between two sets A and B&lt;br /&gt;
:&amp;lt;tt&amp;gt;$ diff -q &amp;lt;(sort A | uniq) &amp;lt;(sort B | uniq)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Set union A &amp;amp;cup; B = C&lt;br /&gt;
:&amp;lt;tt&amp;gt;$ cat A B | sort | uniq &amp;gt; C&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Set intersection A &amp;amp;cap; B = C&lt;br /&gt;
:&amp;lt;tt&amp;gt;$ comm -12 &amp;lt;(sort A | uniq) &amp;lt;(sort B | uniq)&amp;lt;/tt&amp;gt;&lt;br /&gt;
:The 'comm -12' command outputs shared lines only. This command can be used to find the set inclusion (whether set A is a subset of B). The following option outputs lines only in the first file (set A), i.e., no output means that A is completely included B.&lt;br /&gt;
:&amp;lt;tt&amp;gt;$ comm -23 &amp;lt;(sort A | uniq) &amp;lt;(sort B | uniq)&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Arithmetics==&lt;br /&gt;
&lt;br /&gt;
* Simple arithmetic by the shell command echo &amp;quot;$(( ... ))&amp;quot; (no floating number)&lt;br /&gt;
:&amp;lt;tt&amp;gt;echo &amp;quot;$((12345 + 23456))&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Interactive mode of Perl&lt;br /&gt;
:&amp;lt;tt&amp;gt;perl -E &amp;quot;say 123 / 1.5&amp;quot;&amp;lt;/tt&amp;gt;&lt;/div&gt;</summary>
		<author><name>Adm</name></author>	</entry>

	</feed>