Categories
status

Quick fix of command line typo ^type^ …

Quick fix of command line typo

^typo^correct

This will replace the word ‘typo’ with ‘correct’ from the previous command line.
http://lifehacker.com/5698494/quickly-fix-command-line-mistakes-with-the–symbol

Categories
status

Find duplicates in MySQL SELECT col1, …

Find duplicates in MySQL

SELECT col1, col2, count(col3)
FROM t1
GROUP BY col1, col2
HAVING count(col3) > 1

Adapted from
http://support.microsoft.com/default.aspx?scid=kb;en-us;139444

Categories
status

Rewrapping in Vim gq or gw to stay…

Rewrapping in Vim

gq

or

gw

to stay at the word where the cursor was.

It will re-wrap the text depending on the textwidth or windowmargin value.

Categories
status

Another way of adjusting the spacing aft …

Another way of adjusting the spacing after line with stretched table
Use bookends package and \toprule, \midrule, and \bottomrule instead of \hline.

In premeble

\usepackage{booktabs}

In context

{table}[h]
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}} ccr}
\toprule
Site pattern & supported $T_i$ & count \\
\midrule
xxx & $T_0$ & 4 \\ 
xxy & $T_1$ & 3 \\ 
\bottomrule
\end{tabular*}
\caption{Table1}
\end{table}
Categories
status

Adjusting spacing after \hline in tabul …

Adjusting spacing after \hline in tabular environment

in preamble

\newcommand\tstrut{\rule{0pt}{2.4ex}}
\newcommand\bstrut{\rule[-1.0ex]{0pt}{0pt}}

in content

\begin{tabular}{ccc}
\hline\hline 
Head 1 & Head 2 & Head 3 \tstrut \bstrut \\
\hline
a1 & a2 & a3 \tstrut \\
b1 & b2 & b3 \\
c1 & c2 & c3 \\
d1 & d2 & d3 \bstrut \\
\hline\hline
\end{tabular}

https://www.msu.edu/~harris41/latex_tablespacing.html
http://stackoverflow.com/questions/696157/latex-hline-spacing

Categories
status

To find out what method is attached to a …

To find out what method is attached to an object in BioPerl during debugging, use ref commend.

>x ref($seq)

It’ll show the class where the object belongs to and search for the class.
Not so funny… Any other way?
NB. As it was said, the commend working during the debugging session; perl -d

Categories
status

Simple code example to retrieve annotati …

Simple code example to retrieve annotations

 1 #!/usr/bin/perl -w
  2     
  3 use strict;
  4 use Carp;
  5 use Bio::SeqIO;
  6 
  7 my $embl_file = shift;
  8 my $informat = "embl";
  9 
 10 my $seq_in = Bio::SeqIO -> new(-file => "<$embl_file",
 11                                -format => $informat)
 12                 or croak("File Open Error: $embl_file\n");
 13 
 14 while (my $seq = $seq_in->next_seq) {
 15 
 16 
 17 # ID
 18 $seq->primary_seq->display_id();
 19 # AC
 20 $seq->primary_seq->accession_number();
 21 
 22 # DE
 23 $seq->primary_seq->desc();
 24 
 25 # CC
 26 my $annotation = $seq->annotation();
 27 my @comments = $annotation->get_Annotations('comment');
 28 foreach my $comment (@comments){
 29     print $comment->as_text;
 30 }
 31 
 32 
 33     print "\n";
 34 }
 35 
 36 $seq_in->close() or croak("Close error: $embl_file\n");

Categories
status

Recursively cat all the txt files. fi …

Recursively cat all the txt files.

find . -name “*.txt” -print0 |xargs -0 cat
Got a clue here.

Categories
status

gff3 file format Make sure the fields a …

gff3 file format
Make sure the fields are separated by TAB.

The format consists of 9 columns, separated by tabs (NOT spaces).

http://www.sequenceontology.org/gff3.shtml

Categories
status

Change the output directory of pdflatex …

Change the output directory of pdflatex in TeXworks.
Go to Preferences -> Typesetting. Then select the tool you want to change in the Processing tools section. Click Edit and add the directory where the output goes by pressing + button.
NB. There is no aux directory option in pdflatex unlike latex. So the final pdf file as well as aux and log files will be in the output directory.
NB. The output directory option should be before the $fullname.

TeXworks Preference
-output-directory=$directory/temp