<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Related items]]></title>
	<link>https://bioinformaticsonline.com/related/42003?offset=80</link>
	<atom:link href="https://bioinformaticsonline.com/related/42003?offset=80" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/35176/perloneliner-for-bioinformatician</guid>
	<pubDate>Mon, 15 Jan 2018 04:57:40 -0600</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/35176/perloneliner-for-bioinformatician</link>
	<title><![CDATA[PerlOneLiner for Bioinformatician]]></title>
	<description><![CDATA[<p>FILE SPACING<br />------------</p><p># Double space a file<br />perl -pe '$\="\n"'<br />perl -pe 'BEGIN { $\="\n" }'<br />perl -pe '$_ .= "\n"'<br />perl -pe 's/$/\n/'<br />perl -nE 'say'</p><p># Double space a file, except the blank lines<br />perl -pe '$_ .= "\n" unless /^$/'<br />perl -pe '$_ .= "\n" if /\S/'</p><p># Triple space a file<br />perl -pe '$\="\n\n"'<br />perl -pe '$_.="\n\n"'</p><p># N-space a file<br />perl -pe '$_.="\n"x7'</p><p># Add a blank line before every line<br />perl -pe 's//\n/'</p><p># Remove all blank lines<br />perl -ne 'print unless /^$/'<br />perl -lne 'print if length'<br />perl -ne 'print if /\S/'</p><p># Remove all consecutive blank lines, leaving just one<br />perl -00 -pe ''<br />perl -00pe0</p><p># Compress/expand all blank lines into N consecutive ones<br />perl -00 -pe '$_.="\n"x4'</p><p># Fold a file so that every set of 10 lines becomes one tab-separated line<br />perl -lpe '$\ = $. % 10 ? "\t" : "\n"'</p><p><br />LINE NUMBERING<br />--------------</p><p># Number all lines in a file<br />perl -pe '$_ = "$. $_"'</p><p># Number only non-empty lines in a file<br />perl -pe '$_ = ++$a." $_" if /./'</p><p># Number and print only non-empty lines in a file (drop empty lines)<br />perl -ne 'print ++$a." $_" if /./'</p><p># Number all lines but print line numbers only non-empty lines<br />perl -pe '$_ = "$. $_" if /./'</p><p># Number only lines that match a pattern, print others unmodified<br />perl -pe '$_ = ++$a." $_" if /regex/'</p><p># Number and print only lines that match a pattern<br />perl -ne 'print ++$a." $_" if /regex/'</p><p># Number all lines, but print line numbers only for lines that match a pattern<br />perl -pe '$_ = "$. $_" if /regex/'</p><p># Number all lines in a file using a custom format (emulate cat -n)<br />perl -ne 'printf "%-5d %s", $., $_'</p><p># Print the total number of lines in a file (emulate wc -l)<br />perl -lne 'END { print $. }'<br />perl -le 'print $n=()=&lt;&gt;'<br />perl -le 'print scalar(()=&lt;&gt;)'<br />perl -le 'print scalar(@foo=&lt;&gt;)'<br />perl -ne '}{print $.'<br />perl -nE '}{say $.'</p><p># Print the number of non-empty lines in a file<br />perl -le 'print scalar(grep{/./}&lt;&gt;)'<br />perl -le 'print ~~grep{/./}&lt;&gt;'<br />perl -le 'print~~grep/./,&lt;&gt;'<br />perl -E 'say~~grep/./,&lt;&gt;'</p><p># Print the number of empty lines in a file<br />perl -lne '$a++ if /^$/; END {print $a+0}'<br />perl -le 'print scalar(grep{/^$/}&lt;&gt;)'<br />perl -le 'print ~~grep{/^$/}&lt;&gt;'<br />perl -E 'say~~grep{/^$/}&lt;&gt;'</p><p># Print the number of lines in a file that match a pattern (emulate grep -c)<br />perl -lne '$a++ if /regex/; END {print $a+0}'<br />perl -nE '$a++ if /regex/; END {say $a+0}'</p><p><br />CALCULATIONS<br />------------</p><p># Check if a number is a prime<br />perl -lne '(1x$_) !~ /^1?$|^(11+?)\1+$/ &amp;&amp; print "$_ is prime"'</p><p># Print the sum of all the fields on a line<br />perl -MList::Util=sum -alne 'print sum @F'</p><p># Print the sum of all the fields on all lines<br />perl -MList::Util=sum -alne 'push @S,@F; END { print sum @S }'<br />perl -MList::Util=sum -alne '$s += sum @F; END { print $s }'</p><p># Shuffle all fields on a line<br />perl -MList::Util=shuffle -alne 'print "@{[shuffle @F]}"'<br />perl -MList::Util=shuffle -alne 'print join " ", shuffle @F'</p><p># Find the minimum element on a line<br />perl -MList::Util=min -alne 'print min @F'</p><p># Find the minimum element over all the lines<br />perl -MList::Util=min -alne '@M = (@M, @F); END { print min @M }'<br />perl -MList::Util=min -alne '$min = min @F; $rmin = $min unless defined $rmin &amp;&amp; $min &gt; $rmin; END { print $rmin }'</p><p># Find the maximum element on a line<br />perl -MList::Util=max -alne 'print max @F'</p><p># Find the maximum element over all the lines<br />perl -MList::Util=max -alne '@M = (@M, @F); END { print max @M }'</p><p># Replace each field with its absolute value<br />perl -alne 'print "@{[map { abs } @F]}"'</p><p># Find the total number of fields (words) on each line<br />perl -alne 'print scalar @F'</p><p># Print the total number of fields (words) on each line followed by the line<br />perl -alne 'print scalar @F, " $_"'</p><p># Find the total number of fields (words) on all lines<br />perl -alne '$t += @F; END { print $t}'</p><p># Print the total number of fields that match a pattern<br />perl -alne 'map { /regex/ &amp;&amp; $t++ } @F; END { print $t }'<br />perl -alne '$t += /regex/ for @F; END { print $t }'<br />perl -alne '$t += grep /regex/, @F; END { print $t }'</p><p># Print the total number of lines that match a pattern<br />perl -lne '/regex/ &amp;&amp; $t++; END { print $t }'</p><p># Print the number PI to n decimal places<br />perl -Mbignum=bpi -le 'print bpi(n)'</p><p># Print the number PI to 39 decimal places<br />perl -Mbignum=PI -le 'print PI'</p><p># Print the number E to n decimal places<br />perl -Mbignum=bexp -le 'print bexp(1,n+1)'</p><p># Print the number E to 39 decimal places<br />perl -Mbignum=e -le 'print e'</p><p># Print UNIX time (seconds since Jan 1, 1970, 00:00:00 UTC)<br />perl -le 'print time'</p><p># Print GMT (Greenwich Mean Time) and local computer time<br />perl -le 'print scalar gmtime'<br />perl -le 'print scalar localtime'</p><p># Print local computer time in H:M:S format<br />perl -le 'print join ":", (localtime)[2,1,0]'</p><p># Print yesterday's date<br />perl -MPOSIX -le '@now = localtime; $now[3] -= 1; print scalar localtime mktime @now'</p><p># Print date 14 months, 9 days and 7 seconds ago<br />perl -MPOSIX -le '@now = localtime; $now[0] -= 7; $now[4] -= 14; $now[7] -= 9; print scalar localtime mktime @now'</p><p># Prepend timestamps to stdout (GMT, localtime)<br />tail -f logfile | perl -ne 'print scalar gmtime," ",$_'<br />tail -f logfile | perl -ne 'print scalar localtime," ",$_'</p><p># Calculate factorial of 5<br />perl -MMath::BigInt -le 'print Math::BigInt-&gt;new(5)-&gt;bfac()'<br />perl -le '$f = 1; $f *= $_ for 1..5; print $f'</p><p># Calculate greatest common divisor (GCM)<br />perl -MMath::BigInt=bgcd -le 'print bgcd(@list_of_numbers)'</p><p># Calculate GCM of numbers 20 and 35 using Euclid's algorithm<br />perl -le '$n = 20; $m = 35; ($m,$n) = ($n,$m%$n) while $n; print $m'</p><p># Calculate least common multiple (LCM) of numbers 35, 20 and 8<br />perl -MMath::BigInt=blcm -le 'print blcm(35,20,8)'</p><p># Calculate LCM of 20 and 35 using Euclid's formula: n*m/gcd(n,m)<br />perl -le '$a = $n = 20; $b = $m = 35; ($m,$n) = ($n,$m%$n) while $n; print $a*$b/$m'</p><p># Generate 10 random numbers between 5 and 15 (excluding 15)<br />perl -le '$n=10; $min=5; $max=15; $, = " "; print map { int(rand($max-$min))+$min } 1..$n'</p><p># Find and print all permutations of a list<br />perl -MAlgorithm::Permute -le '$l = [1,2,3,4,5]; $p = Algorithm::Permute-&gt;new($l); print @r while @r = $p-&gt;next'</p><p># Generate the power set<br />perl -MList::PowerSet=powerset -le '@l = (1,2,3,4,5); for (@{powerset(@l)}) { print "@$_" }'</p><p># Convert an IP address to unsigned integer<br />perl -le '$i=3; $u += ($_&lt;&lt;8*$i--) for "127.0.0.1" =~ /(\d+)/g; print $u'<br />perl -le '$ip="127.0.0.1"; $ip =~ s/(\d+)\.?/sprintf("%02x", $1)/ge; print hex($ip)'<br />perl -le 'print unpack("N", 127.0.0.1)'<br />perl -MSocket -le 'print unpack("N", inet_aton("127.0.0.1"))'</p><p># Convert an unsigned integer to an IP address<br />perl -MSocket -le 'print inet_ntoa(pack("N", 2130706433))'<br />perl -le '$ip = 2130706433; print join ".", map { (($ip&gt;&gt;8*($_))&amp;0xFF) } reverse 0..3'<br />perl -le '$ip = 2130706433; $, = "."; print map { (($ip&gt;&gt;8*($_))&amp;0xFF) } reverse 0..3'</p><p><br />STRING CREATION AND ARRAY CREATION<br />----------------------------------</p><p># Generate and print the alphabet<br />perl -le 'print a..z'<br />perl -le 'print ("a".."z")'<br />perl -le '$, = ","; print ("a".."z")'<br />perl -le 'print join ",", ("a".."z")'</p><p># Generate and print all the strings from "a" to "zz"<br />perl -le 'print ("a".."zz")'<br />perl -le 'print "aa".."zz"'</p><p># Create a hex lookup table<br />@hex = (0..9, "a".."f")</p><p># Convert a decimal number to hex using @hex lookup table<br />perl -le '$num = 255; @hex = (0..9, "a".."f"); while ($num) { $s = $hex[($num%16)&amp;15].$s; $num = int $num/16 } print $s'<br />perl -le '$hex = sprintf("%x", 255); print $hex'<br />perl -le '$num = "ff"; print hex $num'</p><p># Generate a random 8 character password<br />perl -le 'print map { ("a".."z")[rand 26] } 1..8'<br />perl -le 'print map { ("a".."z", 0..9)[rand 36] } 1..8'</p><p># Create a string of specific length<br />perl -le 'print "a"x50'</p><p># Create a repeated list of elements<br />perl -le '@list = (1,2)x20; print "@list"'</p><p># Create an array from a string<br />@months = split ' ', "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"<br />@months = qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/</p><p># Create a string from an array<br />@stuff = ("hello", 0..9, "world"); $string = join '-', @stuff</p><p># Find the numeric values for characters in the string<br />perl -le 'print join ", ", map { ord } split //, "hello world"'</p><p># Convert a list of numeric ASCII values into a string<br />perl -le '@ascii = (99, 111, 100, 105, 110, 103); print pack("C*", @ascii)'<br />perl -le '@ascii = (99, 111, 100, 105, 110, 103); print map { chr } @ascii'</p><p># Generate an array with odd numbers from 1 to 100<br />perl -le '@odd = grep {$_ % 2 == 1} 1..100; print "@odd"'<br />perl -le '@odd = grep { $_ &amp; 1 } 1..100; print "@odd"'</p><p># Generate an array with even numbers from 1 to 100<br />perl -le '@even = grep {$_ % 2 == 0} 1..100; print "@even"'</p><p># Find the length of the string<br />perl -le 'print length "one-liners are great"'</p><p># Find the number of elements in an array<br />perl -le '@array = ("a".."z"); print scalar @array'<br />perl -le '@array = ("a".."z"); print $#array + 1'</p><p><br />TEXT CONVERSION AND SUBSTITUTION<br />--------------------------------</p><p># ROT13 a string<br />'y/A-Za-z/N-ZA-Mn-za-m/'</p><p># ROT 13 a file<br />perl -lpe 'y/A-Za-z/N-ZA-Mn-za-m/' file</p><p># Base64 encode a string<br />perl -MMIME::Base64 -e 'print encode_base64("string")'<br />perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' file</p><p># Base64 decode a string<br />perl -MMIME::Base64 -le 'print decode_base64("base64string")'<br />perl -MMIME::Base64 -ne 'print decode_base64($_)' file</p><p># URL-escape a string<br />perl -MURI::Escape -le 'print uri_escape($string)'</p><p># URL-unescape a string<br />perl -MURI::Escape -le 'print uri_unescape($string)'</p><p># HTML-encode a string<br />perl -MHTML::Entities -le 'print encode_entities($string)'</p><p># HTML-decode a string<br />perl -MHTML::Entities -le 'print decode_entities($string)'</p><p># Convert all text to uppercase<br />perl -nle 'print uc'<br />perl -ple '$_=uc'<br />perl -nle 'print "\U$_"'</p><p># Convert all text to lowercase<br />perl -nle 'print lc'<br />perl -ple '$_=lc'<br />perl -nle 'print "\L$_"'</p><p># Uppercase only the first word of each line<br />perl -nle 'print ucfirst lc'<br />perl -nle 'print "\u\L$_"'</p><p># Invert the letter case<br />perl -ple 'y/A-Za-z/a-zA-Z/'</p><p># Camel case each line<br />perl -ple 's/(\w+)/\u$1/g'<br />perl -ple 's/(?&lt;!['])(\w+)/\u\1/g'</p><p># Strip leading whitespace (spaces, tabs) from the beginning of each line<br />perl -ple 's/^[ \t]+//'<br />perl -ple 's/^\s+//'</p><p># Strip trailing whitespace (space, tabs) from the end of each line<br />perl -ple 's/[ \t]+$//'</p><p># Strip whitespace from the beginning and end of each line<br />perl -ple 's/^[ \t]+|[ \t]+$//g'</p><p># Convert UNIX newlines to DOS/Windows newlines<br />perl -pe 's|\n|\r\n|'</p><p># Convert DOS/Windows newlines to UNIX newlines<br />perl -pe 's|\r\n|\n|'</p><p># Convert UNIX newlines to Mac newlines<br />perl -pe 's|\n|\r|'</p><p># Substitute (find and replace) "foo" with "bar" on each line<br />perl -pe 's/foo/bar/'</p><p># Substitute (find and replace) all "foo"s with "bar" on each line<br />perl -pe 's/foo/bar/g'</p><p># Substitute (find and replace) "foo" with "bar" on lines that match "baz"<br />perl -pe '/baz/ &amp;&amp; s/foo/bar/'</p><p># Binary patch a file (find and replace a given array of bytes as hex numbers)<br />perl -pi -e 's/\x89\xD8\x48\x8B/\x90\x90\x48\x8B/g' file</p><p><br />SELECTIVE PRINTING AND DELETING OF CERTAIN LINES<br />------------------------------------------------</p><p># Print the first line of a file (emulate head -1)<br />perl -ne 'print; exit'</p><p># Print the first 10 lines of a file (emulate head -10)<br />perl -ne 'print if $. &lt;= 10'<br />perl -ne '$. &lt;= 10 &amp;&amp; print'<br />perl -ne 'print if 1..10'</p><p># Print the last line of a file (emulate tail -1)<br />perl -ne '$last = $_; END { print $last }'<br />perl -ne 'print if eof'</p><p># Print the last 10 lines of a file (emulate tail -10)<br />perl -ne 'push @a, $_; @a = @a[@a-10..$#a]; END { print @a }'</p><p># Print only lines that match a regular expression<br />perl -ne '/regex/ &amp;&amp; print'</p><p># Print only lines that do not match a regular expression<br />perl -ne '!/regex/ &amp;&amp; print'</p><p># Print the line before a line that matches a regular expression<br />perl -ne '/regex/ &amp;&amp; $last &amp;&amp; print $last; $last = $_'</p><p># Print the line after a line that matches a regular expression<br />perl -ne 'if ($p) { print; $p = 0 } $p++ if /regex/'</p><p># Print lines that match regex AAA and regex BBB in any order<br />perl -ne '/AAA/ &amp;&amp; /BBB/ &amp;&amp; print'</p><p># Print lines that don't match match regexes AAA and BBB<br />perl -ne '!/AAA/ &amp;&amp; !/BBB/ &amp;&amp; print'</p><p># Print lines that match regex AAA followed by regex BBB followed by CCC<br />perl -ne '/AAA.*BBB.*CCC/ &amp;&amp; print'</p><p># Print lines that are 80 chars or longer<br />perl -ne 'print if length &gt;= 80'</p><p># Print lines that are less than 80 chars in length<br />perl -ne 'print if length &lt; 80'</p><p># Print only line 13<br />perl -ne '$. == 13 &amp;&amp; print &amp;&amp; exit'</p><p># Print all lines except line 27<br />perl -ne '$. != 27 &amp;&amp; print'<br />perl -ne 'print if $. != 27'</p><p># Print only lines 13, 19 and 67<br />perl -ne 'print if $. == 13 || $. == 19 || $. == 67'<br />perl -ne 'print if int($.) ~~ (13, 19, 67)'</p><p># Print all lines between two regexes (including lines that match regex)<br />perl -ne 'print if /regex1/../regex2/'</p><p># Print all lines from line 17 to line 30<br />perl -ne 'print if $. &gt;= 17 &amp;&amp; $. &lt;= 30'<br />perl -ne 'print if int($.) ~~ (17..30)'<br />perl -ne 'print if grep { $_ == $. } 17..30'</p><p># Print the longest line<br />perl -ne '$l = $_ if length($_) &gt; length($l); END { print $l }'</p><p># Print the shortest line<br />perl -ne '$s = $_ if $. == 1; $s = $_ if length($_) &lt; length($s); END { print $s }'</p><p># Print all lines that contain a number<br />perl -ne 'print if /\d/'</p><p># Find all lines that contain only a number<br />perl -ne 'print if /^\d+$/'</p><p># Print all lines that contain only characters<br />perl -ne 'print if /^[[:alpha:]]+$/</p><p># Print every second line<br />perl -ne 'print if $. % 2'</p><p># Print every second line, starting the second line<br />perl -ne 'print if $. % 2 == 0'</p><p># Print all lines that repeat<br />perl -ne 'print if ++$a{$_} == 2'</p><p># Print all unique lines<br />perl -ne 'print unless $a{$_}++'</p><p># Print the first field (word) of every line (emulate cut -f 1 -d ' ')<br />perl -alne 'print $F[0]'</p><p><br />HANDY REGULAR EXPRESSIONS<br />-------------------------</p><p># Match something that looks like an IP address<br />/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/<br />/^(\d{1,3}\.){3}\d{1,3}$/</p><p># Test if a number is in range 0-255<br />/^([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/</p><p># Match an IP address<br />my $ip_part = qr|([0-9]|[0-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])|;<br />if ($ip =~ /^($ip_part\.){3}$ip_part$/) {<br /> say "valid ip";<br />}</p><p># Check if the string looks like an email address<br />/\S+@\S+\.\S+/</p><p># Check if the string is a decimal number<br />/^\d+$/<br />/^[+-]?\d+$/<br />/^[+-]?\d+\.?\d*$/</p><p># Check if the string is a hexadecimal number<br />/^0x[0-9a-f]+$/i</p><p># Check if the string is an octal number<br />/^0[0-7]+$/</p><p># Check if the string is binary<br />/^[01]+$/</p><p># Check if a word appears twice in the string<br />/(word).*\1/</p><p># Increase all numbers by one in the string<br />$str =~ s/(\d+)/$1+1/ge</p><p># Extract HTTP User-Agent string from the HTTP headers<br />/^User-Agent: (.+)$/</p><p># Match printable ASCII characters<br />/[ -~]/</p><p># Match unprintable ASCII characters<br />/[^ -~]/</p><p># Match text between two HTML tags<br />m|&lt;strong&gt;([^&lt;]*)&lt;/strong&gt;|<br />m|&lt;strong&gt;(.*?)&lt;/strong&gt;|</p><p># Replace all &lt;b&gt; tags with &lt;strong&gt;<br />$html =~ s|&lt;(/)?b&gt;|&lt;$1strong&gt;|g</p><p># Extract all matches from a regular expression<br />my @matches = $text =~ /regex/g;</p><p><br />PERL TRICKS<br />-----------</p><p># Print the version of a Perl module<br />perl -MModule -le 'print $Module::VERSION'<br />perl -MLWP::UserAgent -le 'print $LWP::UserAgent::VERSION'</p>]]></description>
	<dc:creator>Shruti Paniwala</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/fun/view/14036/introduction-to-programming-write-short-programs-that-generate-graphics-and-animation</guid>
	<pubDate>Thu, 14 Aug 2014 23:29:04 -0500</pubDate>
	<link>https://bioinformaticsonline.com/fun/view/14036/introduction-to-programming-write-short-programs-that-generate-graphics-and-animation</link>
	<title><![CDATA[Introduction to programming. Write short programs that generate graphics and animation.]]></title>
	<description><![CDATA[<p>Introduction to programming. Write short programs that generate graphics and animation.</p><p>http://funprogramming.org/</p>]]></description>
	<dc:creator>Ram Yash Pal</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/26426/genome-browser-gbrowse</guid>
	<pubDate>Fri, 19 Feb 2016 09:22:43 -0600</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/26426/genome-browser-gbrowse</link>
	<title><![CDATA[Genome Browser : GBrowse]]></title>
	<description><![CDATA[<p>Generic Genome Browser Version 2: A Tutorial for Administrators</p>
<p>This is an extensive tutorial to take you through the main features and gotchas of configuring GBrowse as a server. This tutorial assumes that you have successfully set up Perl, GD, BioPerl and the other GBrowse dependencies. If you haven't, please see the <a href="http://gmod.org/wiki/GBrowse_2.0_HOWTO">GBrowse HOWTO</a> During most of the tutorial, we will be using the "in-memory" GBrowse database (no relational database required!) Later we will show how to set up a genome size database using the berkeleydb and MySQL adaptors.</p>
<p>More at http://elp.ucdavis.edu/tutorial/tutorial.html</p><p>Address of the bookmark: <a href="http://elp.ucdavis.edu/tutorial/tutorial.html" rel="nofollow">http://elp.ucdavis.edu/tutorial/tutorial.html</a></p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/34504/minion-gc-an-r-script-to-do-some-qc-on-minion-data</guid>
	<pubDate>Sun, 03 Dec 2017 15:19:18 -0600</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/34504/minion-gc-an-r-script-to-do-some-qc-on-minion-data</link>
	<title><![CDATA[MinION_GC: An R script to do some QC on MinION data]]></title>
	<description><![CDATA[<p><span>Other tools focus on getting data out of the fastq or fast5 files, which is slow and computationally intensive. The benefit of this approach is that it works on a single, small, .txt summary file. So it's a lot quicker than most other things out there: it takes about a minute to analyse a 4GB flowcell on my laptop.</span></p>
<p>https://github.com/roblanf/minion_qc</p><p>Address of the bookmark: <a href="https://github.com/roblanf/minion_qc" rel="nofollow">https://github.com/roblanf/minion_qc</a></p>]]></description>
	<dc:creator>Radha Agarkar</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/bookmarks/view/43859/mumco-is-a-simple-bash-script-that-uses-whole-genome-alignment-information-provided-by-mummer-v4-to-detect-variants</guid>
	<pubDate>Wed, 27 Apr 2022 04:34:12 -0500</pubDate>
	<link>https://bioinformaticsonline.com/bookmarks/view/43859/mumco-is-a-simple-bash-script-that-uses-whole-genome-alignment-information-provided-by-mummer-v4-to-detect-variants</link>
	<title><![CDATA[MUM&amp;Co is a simple bash script that uses Whole Genome Alignment information provided by MUMmer (v4) to detect variants.]]></title>
	<description><![CDATA[<p dir="auto">MUM&amp;Co is able to detect:<br>Deletions, insertions, tandem duplications and tandem contractions (&gt;=50bp &amp; &lt;=150kb)<br>Inversions (&gt;=1kb) and translocations (&gt;=10kb)</p><p>Address of the bookmark: <a href="https://github.com/SAMtoBAM/MUMandCo" rel="nofollow">https://github.com/SAMtoBAM/MUMandCo</a></p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/file/view/87/linux-cheat-sheet</guid>
	<pubDate>Tue, 09 Jul 2013 17:30:04 -0500</pubDate>
	<link>https://bioinformaticsonline.com/file/view/87/linux-cheat-sheet</link>
	<title><![CDATA[Linux Cheat Sheet]]></title>
	<description><![CDATA[<p><span>In an attempt to find a good Linux reference for bioinformatician and BOL readers, I was unsuccessful at finding a decent one on the Internet. So, we decided to make a cheat sheet for biological programmers.</span></p>]]></description>
	<dc:creator>Jitendra Narayan</dc:creator>
	<enclosure url="https://bioinformaticsonline.com/file/download/87" length="81260" type="application/pdf" />
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/9030/linux-ssh-client-commands-for-bioinformatics</guid>
	<pubDate>Thu, 13 Mar 2014 17:16:32 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/9030/linux-ssh-client-commands-for-bioinformatics</link>
	<title><![CDATA[Linux SSH Client Commands for Bioinformatics]]></title>
	<description><![CDATA[<p>Here come on let play with the following basic command line usage of the ssh client.<br /><br /><strong>1. Check your SSH Client Version:</strong><br /><br />Checking for your SSH client is very sare, but sometimes it may be necessary to identify the SSH client that you are currently running and it&rsquo;s corresponding version number. The SSh client can be identified as follows<br /><br />$ ssh -V<br />OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2013<br /><br />$ ssh -V<br />ssh: SSH Secure Shell 3.2.9.1 (non-commercial version) on i686-pc-linux-gnu<br /><br /><strong>2. Connect and login to remote host:</strong></p><p>The First time when you login to the remotehost from a localhost, it will display the host key not found message and you can give &ldquo;yes&rdquo; to continue. The host key of the remote host will be added under .ssh2/hostkeys directory of your home directory, as shown below.<br /><br />localhost$ ssh -l jit remotehost.example.com<br /><br />jit@remotehost.example.com password:</p><p>remotehost.example.com$</p><p>The Second time when you login to the remote host from the localhost, it will prompt only for the password as the remote host key is already added to the known hosts list of the ssh client.<br /><br />localhost$ ssh -l jit remotehost.example.com<br />jit@remotehost.example.com password: <br />remotehost.example.com$<br /><br />For some reason, if the host key of the remote host is changed after you logged in for the first time, you may get a warning message as shown below. This could be because of various reasons such as 1) Sysadmin upgraded/reinstalled the SSH server on the remote host 2) someone is doing malicious activity etc., The best possible action to take before saying &ldquo;yes&rdquo; to the message below, is to call your sysadmin and identify why you got the host key changed message and verify whether it is the correct host key or not.<br /><br />localhost$ ssh -l jit remotehost.example.com<br /><br />jit @remotehost.example.com's password: <br />remotehost$<br /><br /><strong>4. Debug SSH Client:</strong><br /><br />Sometimes it is necessary to view debug messages to troubleshoot any SSH connection issues. For this purpose, pass -v (lowercase v) option to the ssh as shown below.<br /><br />Example without debug message:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost$ ssh -l jit remotehost.example.com<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; warning: Connecting to remotehost.example.com failed: No address associated to the name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost$</p><p>Example with debug message:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; locaclhost$ ssh -v -l jit remotehost.example.com<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; debug: SshConfig/sshconfig.c:2838/ssh2_parse_config_ext: Metaconfig parsing stopped at line 3.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; debug: SshConfig/sshconfig.c:637/ssh_config_set_param_verbose: Setting variable 'VerboseMode' to 'FALSE'.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; debug: SshConfig/sshconfig.c:3130/ssh_config_read_file_ext: Read 17 params from config file.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; debug: Ssh2/ssh2.c:1707/main: User config file not found, using defaults. (Looked for '/home/jit/.ssh2/ssh2_config')<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; debug: Connecting to remotehost.example.com, port 22... (SOCKS not used)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; warning: Connecting to remotehost.example.com failed: No address associated to</p><p><strong>5. Escape Character: (Toggle SSH session, SSH session statistics etc.)</strong><br /><br />Escape character ~ get&rsquo;s SSH clients attention and the character following the ~ determines the escape command.<br />Toggle SSH Session: When you&rsquo;ve logged on to the remotehost using ssh from the localhost, you may want to come back to the localhost to perform some activity and go back to remote host again. In this case, you don&rsquo;t need to disconnect the ssh session to the remote host. Instead follow the steps below.</p><p>i. Login to remotehost from localhost: localhost$ssh -l jit remotehost<br />ii. Now you are connected to the remotehost: remotehost$<br />iii. To come back to the localhost temporarily, type the escape character ~ and Control-Z. When you type ~ you will not see that immediately on the screen until you press and press enter. So, on the remotehost in a new line enter the following key strokes for the below to work: ~<br /><br />&nbsp;&nbsp;&nbsp; remotehost$ ~^Z<br />&nbsp;&nbsp;&nbsp; [1]+&nbsp; Stopped&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssh -l jit remotehost<br />&nbsp;&nbsp;&nbsp; localhost$</p><p>iv. Now you are back to the localhost and the ssh remotehost client session runs as a typical unix background job, which you can check as shown below:<br /><br />&nbsp;&nbsp;&nbsp; localhost$ jobs<br />&nbsp;&nbsp;&nbsp; [1]+&nbsp; Stopped&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ssh -l jit remotehost<br /><br />v. You can go back to the remote host ssh without entering the password again by bringing the background ssh remotehost session job to foreground on the localhost<br /><br />&nbsp;&nbsp;&nbsp; localhost$ fg %1<br />&nbsp;&nbsp;&nbsp; ssh -l jit remotehost<br />&nbsp;&nbsp;&nbsp; remotehost$</p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/9639/find-certain-filesdocuments-in-linux-os</guid>
	<pubDate>Sun, 06 Apr 2014 23:56:18 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/9639/find-certain-filesdocuments-in-linux-os</link>
	<title><![CDATA[Find certain files/documents in Linux OS]]></title>
	<description><![CDATA[<p>As bioinformatician I know the fact that we usually handle the large dataset and lost in the huge numbers of files and folders. In order to search the missing file a strong search command is required. The Linux Find Command is one of the most important and much used command in Linux sytems. Find command used to search and locate list of files and directories based on conditions you specify for files that match the arguments. Find can be used in variety of conditions like you can find files by permissions, users, groups, file type, date, size and other possible criteria.<br /><br />Through this article we are sharing our day-to-day Linux find command experience and its usage in the form of examples. In this article we will show you the most used 35 Find Commands examples in Linux. We have divided the section into Five parts from basic to advance usage of find command.</p><p><strong>Part I &ndash; Basic Find Commands for Finding Files with Names</strong><br />1. Find Files Using Name in Current Directory<br /><br />Find all the files whose name is gene.txt in a current working directory.<br /><br /># find . -name gene.txt<br /><br />./gene.txt<br /><br />2. Find Files Under Home Directory<br /><br />Find all the files under /home directory with name gene.txt.<br /><br /># find /home -name gene.txt<br /><br />/home/gene.txt<br /><br />3. Find Files Using Name and Ignoring Case<br /><br />Find all the files whose name is gene.txt and contains both capital and small letters in /home directory.<br /><br /># find /home -iname gene.txt<br /><br />./gene.txt<br />./Gene.txt<br /><br />4. Find Directories Using Name<br /><br />Find all directories whose name is Gene in / directory.<br /><br /># find / -type d -name Gene<br /><br />/Gene<br /><br />5. Find fasta Files Using Name<br /><br />Find all php files whose name is gene.fasta in a current working directory.<br /><br /># find . -type f -name gene.fasta<br /><br />./gene.fasta<br /><br />6. Find all PHP Files in Directory<br /><br />Find all fasta files in a directory.<br /><br /># find . -type f -name "*.fasta"<br /><br />./gene.fasta<br />./cancer.fasta<br />./allgene.fasta<br /><br /><strong>Part II &ndash; Find Files Based on their Permissions</strong><br />7. Find Files With 777 Permissions<br /><br />Find all the files whose permissions are 777.<br /><br /># find . -type f -perm 0777 -print<br /><br />8. Find Files Without 777 Permissions<br /><br />Find all the files without permission 777.<br /><br /># find / -type f ! -perm 777<br /><br />9. Find SGID Files with 644 Permissions<br /><br />Find all the SGID bit files whose permissions set to 644.<br /><br /># find / -perm 2644<br /><br />10. Find Sticky Bit Files with 551 Permissions<br /><br />Find all the Sticky Bit set files whose permission are 551.<br /><br /># find / -perm 1551<br /><br />11. Find SUID Files<br /><br />Find all SUID set files.<br /><br /># find / -perm /u=s<br /><br />12. Find SGID Files<br /><br />Find all SGID set files.<br /><br /># find / -perm /g+s<br /><br />13. Find Read Only Files<br /><br />Find all Read Only files.<br /><br /># find / -perm /u=r<br /><br />14. Find Executable Files<br /><br />Find all Executable files.<br /><br /># find / -perm /a=x<br /><br />15. Find Files with 777 Permissions and Chmod to 644<br /><br />Find all 777 permission files and use chmod command to set permissions to 644.<br /><br /># find / -type f -perm 0777 -print -exec chmod 644 {} \;<br /><br />16. Find Directories with 777 Permissions and Chmod to 755<br /><br />Find all 777 permission directories and use chmod command to set permissions to 755.<br /><br /># find / -type d -perm 777 -print -exec chmod 755 {} \;<br /><br />17. Find and remove single File<br /><br />To find a single file called gene.txt and remove it.<br /><br /># find . -type f -name "gene.txt" -exec rm -f {} \;<br /><br />18. Find and remove Multiple File<br /><br />To find and remove multiple files such as .fa or .gb, then use.<br /><br /># find . -type f -name "*.fa" -exec rm -f {} \;<br /><br />OR<br /><br /># find . -type f -name "*.gb" -exec rm -f {} \;<br /><br />19. Find all Empty Files<br /><br />To file all empty files under certain path.<br /><br /># find /tmp -type f -empty<br /><br />20. Find all Empty Directories<br /><br />To file all empty directories under certain path.<br /><br /># find /tmp -type d -empty<br /><br />21. File all Hidden Files<br /><br />To find all hidden files, use below command.<br /><br /># find /tmp -type f -name ".*"<br /><br /><strong>Part III &ndash; Search Files Based On Owners and Groups</strong><br />22. Find Single File Based on User<br /><br />To find all or single file called gene.txt under / root directory of owner root.<br /><br /># find / -user root -name gene.txt<br /><br />23. Find all Files Based on User<br /><br />To find all files that belongs to user Rahul under /home directory.<br /><br /># find /home -user rahul<br /><br />24. Find all Files Based on Group<br /><br />To find all files that belongs to group Developer under /home directory.<br /><br /># find /home -group developer<br /><br />25. Find Particular Files of User<br /><br />To find all .txt files of user Rahul under /home directory.<br /><br /># find /home -user rahul -iname "*.txt"<br /><br /><strong>Part IV &ndash; Find Files and Directories Based on Date and Time</strong><br />26. Find Last 50 Days Modified Files<br /><br />To find all the files which are modified 50 days back.<br /><br /># find / -mtime 50<br /><br />27. Find Last 50 Days Accessed Files<br /><br />To find all the files which are accessed 50 days back.<br /><br /># find / -atime 50<br /><br />28. Find Last 50-100 Days Modified Files<br /><br />To find all the files which are modified more than 50 days back and less than 100 days.<br /><br /># find / -mtime +50 &ndash;mtime -100<br /><br />29. Find Changed Files in Last 1 Hour<br /><br />To find all the files which are changed in last 1 hour.<br /><br /># find / -cmin -60<br /><br />30. Find Modified Files in Last 1 Hour<br /><br />To find all the files which are modified in last 1 hour.<br /><br /># find / -mmin -60<br /><br />31. Find Accessed Files in Last 1 Hour<br /><br />To find all the files which are accessed in last 1 hour.<br /><br /># find / -amin -60<br /><br /><strong>Part V &ndash; Find Files and Directories Based on Size</strong><br />32. Find 50MB Files<br /><br />To find all 50MB files, use.<br /><br /># find / -size 50M<br /><br />33. Find Size between 50MB &ndash; 100MB<br /><br />To find all the files which are greater than 50MB and less than 100MB.<br /><br /># find / -size +50M -size -100M<br /><br />34. Find and Delete 100MB Files<br /><br />To find all 100MB files and delete them using one single command.<br /><br /># find / -size +100M -exec rm -rf {} \;<br /><br />35. Find Specific Files and Delete<br /><br />Find all .gb files with more than 10MB and delete them using one single command.<br /><br /># find / -type f -name *.gb -size +10M -exec rm {} \;</p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/pages/view/11735/search-shell-command-history</guid>
	<pubDate>Thu, 12 Jun 2014 17:43:34 -0500</pubDate>
	<link>https://bioinformaticsonline.com/pages/view/11735/search-shell-command-history</link>
	<title><![CDATA[Search Shell Command History]]></title>
	<description><![CDATA[<p>We use couple of hundreads of command in daily basis. Most of them are actually repeated several time. The question remain open how do I search old command history under bash shell and modify or reuse it? <br /><br />Now a days almost all modern shell allows you to search command history if enabled by user. Use history command to display the history list with line numbers. Lines listed with with a * have been modified by user.</p><p><br /><strong>Shell history search command</strong><br /><br />Type history at a shell prompt:<br />$ history</p><p>It will display the list of all used commandline history with an serial number.<br /><br />To search particular command, enter:<br />$ history | grep command-name<br />$ history | egrep -i 'scp|ssh|ftp'<br />Emacs Line-Edit Mode Command History Searching<br /><br />To get previous command containing string, hit [CTRL]+[r] followed by search string:<br /><br />(reverse-i-search): <br /><br />To get previous command, hit [CTRL]+[p]. You can also use up arrow key.<br /><br />CTRL-p<br /><br />To get next command, hit [CTRL]+[n]. You can also use down arrow key.<br /><br />CTRL-n<br /><br /></p><p><strong>fc command</strong></p><p>Apart from hostory command there are fc command to extract the command from history. The fc stands for either "find command" or "fix command.</p><p>For example list last 10 command, enter:<br />$ fc -l 10<br />To list commands 130 through 150, enter:<br />$ fc -l 130 150<br />To list all commands since the last command beginning with ssh, enter:<br />$ fc -l ssh<br />You can edit commands 1 through 5 using vi text editor, enter:<br />$ fc -e vi 1 5</p><p><strong>Delete command history</strong><br /><br />The -c option causes the history list to be cleared by deleting all of the entries:<br />$ history -c</p>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/blog/view/37627/setting-python-version-as-default-on-linux</guid>
	<pubDate>Tue, 04 Sep 2018 10:15:47 -0500</pubDate>
	<link>https://bioinformaticsonline.com/blog/view/37627/setting-python-version-as-default-on-linux</link>
	<title><![CDATA[Setting python version as default on Linux]]></title>
	<description><![CDATA[<p>If you have a later version than 2.6 you'll need to set 2.6 as the default Python. Later versions would be 2.7 and 3.1; see what you have by typing</p><pre>python -V
</pre><p><span>at the terminal. For purposes of this example we'll assume you have 3.1 installed. You'll next need to execute the following commands:</span></p><p>&nbsp;</p><pre>sudo apt-get install python2.6 idle-python2.6
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.1 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 10
sudo update-alternatives --config python
</pre><p>This last command will allow you to choose which version of python to use by default. If you have done everything above correctly, python2.6 should already be set as the default. If it is not, choose it to be the default. From now on, running python should start version 2.6.</p><div><p>Undoing These Changes</p><p>In some cases (e.g., installing or updating certain packages), you'll get an error message if you've run the commands above. To update these packages, you'll have to temporarily undo these changes. Here's how to do that:</p><pre>sudo update-alternatives --remove-all python
sudo ln -s python3.1 /usr/bin/python
</pre><p>Once you're done updating these packages, execute the commands at the top to set python2.6 as the default again.</p></div>]]></description>
	<dc:creator>Rahul Nayak</dc:creator>
</item>

</channel>
</rss>