You are on page 1of 3

Linux Cheat-sheet

# means comments, rest are all commands


pwd #present working directory (the directory you’re in)
ls #lists files and directories
ls –a #shows hidden files
ls –lh #shows details, such as file sizes
cd Desktop #changes current directory to Desktop
cd .. #Changes to one directory “higher”
cd / #changes to “root” directory
cd ~ #go to home directory
mkdir workshop #makes a new directory named workshop
rm workshop # removes directory if empty else use rm –r
nano text #creates, views/edits contents of file “text”
more text #see file “text” in screen-size chunks
less text #see file with arrows to move about (type :q to quit)
head text #see top of file “text”
tail text #see bottom of file “text”
cp text text1 #will copy contents of file text and save it as text1
cp text text #Try it, will curse you 
cp text test #creates copy of the file “text” in the dir test
#If there is no directory called test, creates the file test with contents as of
file text, If there is already a file called fred: it will be automatically over-written!
mv text test #Moves contents, except it deletes the original file
rm text #Deletes the file “text”. Forever.
gunzip xxx.gz #unzip a .gz compressed file
unzip xxx.zip #unzip a .zip compressed file
tar –xvf #un-tar a tar archive
man tar # will open tar manual and helps about program “tar”
top #see all system processes
ssh #open a remote, secure connection
ctrl-z #stop a program
kill %1 #get rid of it for good
grep this file.txt #finds lines matching “this” in file text
ftp #get a remote file

#How to run scripts/codes written in other languages like perl/python etc in linux
python myscript.py # runs a python script
Genome/Transcriptome Assembly using velvet

#Kmer Generation

velveth 31mer 31 -fastq -short chr22.fastq


#velveth is algorithm for hash/kmer generation in velvet program.

#foldername can be any output folder name in which you store data. If this name is not given file
will get stored in present directory.

#31 is kmer length. Velvet comes with by-default maximum 31kmer length. This can be changed
during installation.

#For velvet you need to tell the program file format & type of input file. So that it can distinguish
between different file formats.

#Making Contigs

velvetg 31mer

#velvetg is algorithm for making contigs in velvet program.

#min_contig_lgth this should must be greater than kmer length. So that contigs can be made using
overlaps.

RNASeq analysis (using Ubuntu linux)

How to run bowtie Aligner?

build indexes against which the alignments will be done

bowtie-build transcripts.txt my-indexes

#whatever you name it

Align the reads with indexes and store them in file alignments.sam

bowtie –S my-indexes mu1.txt > mu1.sam # will align mu1 reads to reference
(transcripts) and store it to file mu1.sam or whatever name you give it

bowtie my-indexes mu1.txt # writes results on screen

bowtie my-indexes mu2.txt > mu2.sam # will do the same for mu2 and so on.

Get read counts while using counter script (python code) ‘getCountMatrix.py’ as;
create a folder with name bowtieOutputs and place the aligned bowtie outputs (mu1.sam and
mu2.sam) in it.

Make sure that the getCountMatrix.py, GeneIDs.txt and bowtieOutputs (folder) are in the same
folder.

Issue the following command;

python getCounts.py

Nothing will be shown on shell but a file with name ‘countMatrix.txt’ will be created that store counts
of reads hitting to each gene.

Recheck some random gene counts and confirm it with actual sam output file.