%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% UTILITIES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Utilities}

\section{gene-info}

\textbf{gene-info} allows you to get information on one or 
several genes, given a series of query words. Queries are matched
against gene identifiers and gene names. Imperfect matches can be
specified by using regular expressions.

For example, to get all info about the yeast gene GAT1:

\begin{verbatim}
gene-info -org Saccharomyces_cerevisiae -q GAT1
\end{verbatim}

And to get all the purine genes from \textit{Escherichia coli}, type: 

\begin{verbatim}
gene-info -org Escherichia_coli_K_12_substr__MG1655_uid57779 -q 'pur.*'
\end{verbatim}

Note the use of quotes, which is necessary whenever the query contains
a *.

You can also combine several queries on the same command line, by
using reiteratively the -q option:

\begin{verbatim}
gene-info -org Escherichia_coli_K_12_substr__MG1655_uid57779 \
    -q 'met.*' -q 'thr.*' -q 'lys.*'
\end{verbatim}

\section{On-the-fly compression/uncompression}
All programs from \RSAT support automatic compression and
uncompression of gzip files. This can be very convenient when dealing
with big sequence files.

To compress the result of a query, simply add the extension
\texttt{.gz} to the output file name.

\begin{verbatim}
retrieve-seq -all -org Saccharomyces_cerevisiae \
        -from -1 -to -200 -noorf -format fasta \
        -o all_up200.fa.gz
\end{verbatim}

The result file is a compressed archive. Check its size with the
command 
\begin{verbatim}
ls -l
\end{verbatim}

Uncompress the file with the command 
\begin{verbatim}
gunzip all_up200.fa.gz
\end{verbatim}

The file has now lost the \texttt{.gz} extension. Check the size of the
uncompressed file.

Recompress the file with the command
\begin{verbatim}
gzip all_up200.fa
\end{verbatim}

Similarly, you can directly use a compressed archive as input for
\RSAT, it will be uncompressed on the fly, without occupying space on
the hard drive. For example :

\begin{verbatim}
dna-pattern -i all_up200.fa.gz -p GATAAG -c -th 3
\end{verbatim}

will return all the genes having at least three occurrences of the
motif \texttt{GATAAG} in their 200 bp upstream region.
