Loading...
 

Plotting NGS data using Circos - Basic Tutorial

1. Circos version

This tutorial is tested working with Circos version 0.69-6

Please check your current version using the below command;

circos -V

 

6TUNcSM3sEXVHbap7AsYWuBlC-Llrl21vXI52TFVxNW_VhuSGLG4ynSQa1MqoGYtT2eyKDNNps_RPzt7oYc7Usd4GH3Hg9H5lrGsYbNSvvqYUF3z3crOxsZ49-oHde6hVZrRAhfS

All the input files used in this tutorial and the final output files are included in the myplot.tar.gz file available at this link.

2. Karyotype

2.1. Create a folder for your plot (example ‘myplot’).

2.2. Within the ‘myplot’ folder, create a karyotype file (in plain text) with contents describing your genomes chromosomes, contigs etc. In this tutorial we are creating a file named ‘karyotype.microbe.txt’, with the following contents, describing a bacterial genome with single chromosome and its start - end position.

SR8PN5cD9EBDyzDFEVTeItI2fVNUsmmILN-z0GbNC6pzBVaKeBVJ3884VA9W_Gc0mtIA_YUe41BFDFaFioyp7QGj70BpvCpSA32Iqn1PMZShC-d2Jvsd7U0siq7175Pqit1mTj5c

Check out this circos documentation for more info on karyotypes.

3. Ideogram

3.1. Within the ‘myplot’ folder, create an ideogram file (in plain text) with contents describing how you want to represent (show) your chromosome that is described in your karyotype (#2.2). In this tutorial we are creating an ideogram file named ‘ideogram.conf’, with the following contents (screenshot below), describing various ideogram formats like spacing, thickness, label etc.

dDkmNVOk2H05pBEEkFnJs4Dq-xgdiH5bzz3vvtMEU3u4K4Htj3rFJMiXGxglgQnoU4ip52Mm8toklvejGZHAZwKJ_2nsppyWibznEX1SYJXwSyc9lzhKLCiCAP_v7b_gNyPpuy7Z

Check out this circos documentation for more info on ideograms

4. circos.conf

4.1. In the ‘myplot’ folder, create a plain text file, with following contents (shown in below screenshot) and save it as ‘circos.conf’. This is the main circos configuration file that would generate your image, when passed to the circos program. At the minimum, this configuration file specifies the following;

  1. The name and location of the karyotype file

  2. The name and location of the ideogram file

  3. The name and location of the colors, image and housekeeping configuration files

9iPW3THfN2l0XIH6oWpnm1us2zqVM2LJxRFW0yGtvtSknJbs_JsCHVoFMcUANFOgd-SWV4jRBiAQEXsJgQ6ES-8SuBEgOzEQAvDmhyubBYxYwAlTNVb4-2YXYEGNSPIcctBGuS5J

 

Check out this circos documentation link for more info on describing this configuration file.

5. First plot

5.1. With circos.conf, karyotype.microbe.txt and ideogram.conf in the myplot folder, start a shell terminal, change to the myplot directory and run the circos program using the below command;

circos -conf circos.conf

MgTH7msIAAqPKtaRbxRXV57r1O8Hl1jclddG8vBYsR9UZrAKqin6Riez7Tg5stK91ToyYXIq_hlFM_WGA0hfF1U_sBxhcNvebH7qizO8g-SJRh6K8aNGaLhs0X-yRnvxj9Fmsgsy

 

5.2. If everything goes well, you will see the messages as shown in the above screenshot. The myplot folder will now have your image created and stored as circos.png and circos.svg.

 

DW4VoQPA3RPfktRT8O9f71644U0RnfHdVATwQ5OjyiFYB7qbzXgNEcLTkjWAkcowq6n2XgOs37pnPasRGBIo5QRGWQHNGQNGzoF0laRDtlbVg3jLzOi0uyYbNZi4EaILfpsOTJlr

6. Add Ticks

6.1. To add ticks and the corresponding labels, create a ticks.conf text file in the myplot directory and include it in the circos.conf file. The ticks.conf specifies three ticks in this tutorial, along with the fourth tick adding the suffix ‘kb’ to the label. The first tick is not labeled. Run the circos with this updated circos.conf file to generate the following updated image (part of the image shown below)...

nXdnG7VdPiX1Aqhftosu2skU0znt653L8gOyaAsudmlrObJtLTArN4yTxc2mfIXHf3ECUAMjLtyGE3f2LQMbXhaIGOb3Bh5_7_E4ZYsf3J31JsZq7MaAwU6VW3vyblux4osGgZEw

 

Check out this circos documentation link for more info on ticks and labels

7. Add tiles

7.1. Create a text file with following contents, describing different regions of the chromosome you would like to highlight. Save the file as ‘microbe.tile.txt’, in the myplot folder;

F9HRyL4RgrXZLPx4hNgp8qGW8VnMERLirvK8Vekza4ZKRwppIFClg1NDdEy8xMqtScbBc9lp541OvV9gnNvyDhdP76c8duYrD_jPCJADd-oiDst4A1wOtFf2Fca20kB4R1jel653

7.2. Update the circos.conf file by including a plots block, describing how to plot the tiles and their colors, as shown below;

A04LEzE0E-mTAlU1E9NQuSDmqno9Lvum2BU95LD1Ee4KDBqYKhC39QoW9xkwMsp7LxioU8lGrFBtIHpdrPhiBv6H74ABWkxtA6GmeIP6skEG4pWazuQ5UkcS0aONWZ2Uhr1zF5Ps

7.3. Running the circos with the updated plots block will produce the below image;

 

Bf6WurIILa-IGGEf2lEfGoN1Ym1tFmUliIjwbI33194J0rCaSn_rlk8k5O2AOth2HAFsulkwa0luBW53S_gsPCuyXwRHiwmovWljhvV1Y3gM5UCsfhMwDz4bHlRJ7X4_9xfIxLWo

 

8. Add tile labels

8.1. Create a microbe.labels.txt file in the myplot folder, with contents defining labels for the previously described tiles, as shown below;

CfR6LdZM-1otThqr1QPZlg2hfgw93YUsBMAljxu16hsLX7VbY848D3ota6H_rVTeOY4Wa8vCgoa8lzI5FbA0AQKk0cj1zUBt7Yc0-cfbTBNHQK1X_qblcZmJts4JmNQDAd-gnd2G

 

8.2. Update the circos.conf file with the below plot block to add labels to the tiles.

 


type  = text
file  = microbe.labels.txt
color = black
r1    = 0.83r+200p
r0    = 0.83r
label_size = 50p
label_font = bold
label_parallel = yes
label_center = yes
padding    = 1p
rpadding   = 1p
label_snuggle        = yes
max_snuggle_distance = 2r
snuggle_sampling     = 1
snuggle_tolerance    = 0.25r
snuggle_link_overlap_test      = yes
snuggle_link_overlap_tolerance = 2p
snuggle_refine                 = yes

 

8.3. Run circos with the updated circos.conf file to generate the below image;

 

BE9aaq_5UX-vy5q6V3jpryp6rai_rjxIMA-0Jt3ckXBNdKpVuWuYC8At4gvszkyF9lqGbW5mgib1enK69IUYP2jQoB8BZqVY_I_KngnRolcChC_RIOsamsyWNKbqnb2BcE3mT6HB

 

Check out this circos documentation link for more info on tiles.

9. Data track 1

9.1. Place your cleaned data file, ‘GSE67221_MukB_22deg_20r_WTCTRL_peaks.txt’, in this tutorial, in the myplot folder.

9.2. Update the circos.conf file by including the below plot block, to plot the peaks data as histograms;

bAr1IoBxA46xNBE4yjIWLtK2UIMr5TFoeZoZ9JmmnLSlJlQEdoZ7z1M6Kenf4O3-1KBB9VRKmCO8tOAUvKZycIhkPUyMWsb5SLQ892pNe6FWu-EbcARcLmwh0pxAXKNTRlxGJb83

9.3. Run circos with the updated circos.conf file, to generate the image with data histogram

10. Data track 2

10.1. Include the below plot block in the circos.conf file, to add another track of data (‘GSE67221_MatP_37deg_20r_WTCTRL_peaks.txt’) to the previous image;

X3eqJz-2ijWblL-pSodZn45nl1wMwbK1pNTf0y7qKM_fwyPfbYnKMPoHHrnK6WUd6MfjKSp489qzOzEjLVtHP1_bjsENGidGA40MV7LnTHnoccZ5Jj_VT8vl1Byef7pwOajTxkBk

10.2. Run circos with the updated circos.conf file to generate the below final image;

 

 

YEyrPuNUxKFHiTp3TOYmTv7sEY70pVz2vwrxeqEw4g87joCCb77-_TzHpuVjhtVL_Xw7B_m67N555gMXUTJ2lWxlBroJu1m2APDUXxnndi_a41ePkcAY4rTCPZmFN3_nLIUuxyvV

 

Check out this circos documentation for more info on plots.