Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

B1: plot gene cluster

myth edited this page Aug 28, 2019 · 4 revisions

background: if we want to show genes of two regions:chr1:1000-3000 and chr1:5000-8000.

$cd ClustersPloter
$sh ClustersPloter.sh
usage:
 sh ClustersPloter.sh track.list prefix outdir/ main.conf

any question, go to https://github.com/orangeSi/ClustersPloter/issues

So ClusterPloter need four arguments: track.list prefix outdir main.conf

  • track.list: format is like this
$echo -e "#track_name\tgff\tgenome_or_length\tchr_id\tstart\tend\tchr_id\tstart\tend\t..." > mytrack.list
$echo -e "mychr1\tchr1.gff\tchr1.fa.length\tchr1\t1000\t3000\tchr1\t5000\t8000" >>mytrack.list
$echo -e "chr1\t10000" >chr1.fa.length
$echo -e "chr1\tfake\tgene\t1300\t1600\t.\t+\t.\tID=gene1;xxx=yyy;" >chr1.gff
$echo -e "chr1\tfake\tgene\t1800\t2600\t.\t+\t.\tID=gene2;xxx=yyy;" >>chr1.gff
$echo -e "chr1\tfake\tgene\t5700\t6000\t.\t+\t.\tID=gene3;xxx=yyy;" >>chr1.gff
  • prefix: prefix of output file
  • outdir: outdir
  • main.conf: format is like this
$echo -e "feature_keywords = gene, " >mymain.conf
$echo -e "feature_setting = myfeature_setting.txt" >>mymain.conf

$echo -e "gene1\tfeature_color\tblue" >myfeature_setting.txt
$echo -e "gene3\tfeature_color\tblack" >>myfeature_setting.txt
$echo -e "gene2\tfeature_color\tgreen" >>myfeature_setting.txt

give a try now~

$cat mytrack.list 
#track_name  gff       genome_or_length  chr_id  start  end   chr_id  start  end   ...
mychr1       chr1.gff  chr1.fa.length    chr1    1000   3000  chr1    5000   8000

$cat chr1.gff
chr1  fake  gene  1300  1600  .  +  .  ID=gene1;xxx=yyy;
chr1  fake  gene  1800  2600  .  +  .  ID=gene2;xxx=yyy;
chr1  fake  gene  5700  6000  .  +  .  ID=gene3;xxx=yyy;

$cat chr1.fa.length
chr1	10000

$cat mymain.conf
feature_keywords = gene, 
feature_setting = myfeature_setting.txt

$cat myfeature_setting.txt
gene1	feature_color	blue
gene3	feature_color	black
gene2	feature_color	green


$sh ClustersPloter.sh mytrack.list out1 ./ mymain.conf

finished, no error~

Wed Aug 28 13:40:19 CST 2019
output is:
-rw-r--r-- 1 sikaiwei bc_mg 595K Aug 28 13:40 out1.html
-rw-r--r-- 1 sikaiwei bc_mg 3.0K Aug 28 13:40 out1.notitle.svg
-rw-r--r-- 1 sikaiwei bc_mg 3.3K Aug 28 13:40 out1.svg

## so now you get three files: out1.html/out1.notitle.svg/not1.svg

except feature_color, other atribution is ?

$echo -e "gene1\tfeature_color\tblue" >myfeature_setting.txt
$echo -e "gene3\tfeature_color\tblack" >>myfeature_setting.txt
$echo -e "gene2\tfeature_color\tgreen" >>myfeature_setting.txt
$echo -e "gene2\tfeature_label\tgreen" >>myfeature_setting.txt

$sh ClustersPloter.sh mytrack.list out1 ./ mymain.conf