Skip to content
Snippets Groups Projects
Commit 679706b7 authored by rlapar's avatar rlapar
Browse files

call gt sketch externally

parent a1b0117b
No related branches found
No related tags found
1 merge request!3Sketch external
......@@ -52,91 +52,11 @@ style =
max_show_width = nil,
},
--------------------------------------
domain = {
GAG = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0, alpha = 1.0},
fill = {red=0.0, green=1.0, blue=1.0, alpha = 5.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
domain_base = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0, alpha = 0.0},
fill = {red=0.0, green=0.0, blue=0.0, alpha = 0.1},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
LTR_finder_TE = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.3, green=0.3, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = false,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
LTR_PPT = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.4, green=0.5, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
LTR_PBS = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.4, green=0.5, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
GAG = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.3, green=0.3, blue=0.0},
fill = {red=0.5, green=0.2, blue=0.1, alpha = 5.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
......@@ -149,106 +69,10 @@ style =
},
--------------------------------------
AP = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.3, green=0.3, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
INT = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.3, green=0.3, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
RT = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.3, green=0.3, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
RNaseH = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.3, green=0.3, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
XX = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.5},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.3, green=0.3, blue=0.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
mRNA = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.4, green=0.5, blue=0.6},
style = "box",
-- Collapsing options
collapse_to_parent = false,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
exon = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.6, green=0.6, blue=0.9},
stroke_marked = {red=1.0, green=0.0, blue=0.0, alpha = 1.0},
fill = {red=0.5, green=1.0, blue=1.0, alpha = 5.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
......@@ -260,11 +84,11 @@ style =
max_show_width = nil,
},
--------------------------------------
CDS = {
INT = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.9, green=0.9, blue=0.2},
stroke_marked = {red=1.0, green=0.0, blue=0.0, alpha = 1.0},
fill = {red=0.0, green=1.0, blue=0.5, alpha = 5.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
......@@ -276,29 +100,13 @@ style =
max_show_width = nil,
},
--------------------------------------
TF_binding_site = {
RT = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.8, green=0.6, blue=0.6},
stroke_marked = {red=1.0, green=0.0, blue=0.0, alpha = 1.0},
fill = {red=1.0, green=0.0, blue=1.0, alpha = 5.0},
style = "box",
-- Collapsing options
collapse_to_parent = false,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
intron = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=1.0, green=1.0, blue=1.0},
style = "caret",
-- Collapsing options
collapse_to_parent = true,
split_lines = true,
-- Caption options
......@@ -308,43 +116,11 @@ style =
max_show_width = nil,
},
--------------------------------------
repeat_region = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.8, green=0.3, blue=0.3},
style = "box",
-- Collapsing options
collapse_to_parent = false,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = 0,
},
--------------------------------------
LTR_retrotransposon = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.8, green=0.5, blue=0.5},
style = "box",
-- Collapsing options
collapse_to_parent = false,
split_lines = true,
-- Caption options
max_capt_show_width= nil,
-- Display this track only if the viewport is not wider than this
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
long_terminal_repeat = {
RNaseH = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.9, green=0.9, blue=0.4},
stroke_marked = {red=1.0, green=0.0, blue=0.0, alpha = 1.0},
fill = {red=1.0, green=1.0, blue=0.0, alpha = 5.0},
style = "box",
-- Collapsing options
collapse_to_parent = true,
......@@ -355,15 +131,12 @@ style =
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
target_site_duplication = {
max_show_width = 0,
},
--------------------------------------
protein_match = {
domain_base = {
-- Color definitions
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 1.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0},
fill = {red=0.1, green=0.1, blue=0.5},
stroke = {red=0.0, green=0.0, blue=0.0, alpha = 0.0},
stroke_marked = {red=1.0, green=0.0, blue=0.0, alpha = 0.0},
fill = {red=0.0, green=0.0, blue=0.0, alpha = 0.1},
style = "box",
-- Collapsing options
collapse_to_parent = true,
......@@ -374,86 +147,7 @@ style =
-- number of nucleotides. Set to 0 to disable type track.
max_show_width = nil,
},
--------------------------------------
five_prime_cis_splice_site = {
collapse_to_parent = true,
},
--------------------------------------
five_prime_splice_site = {
collapse_to_parent = true,
},
--------------------------------------
three_prime_cis_splice_site = {
collapse_to_parent = true,
},
--------------------------------------
three_prime_splice_site = {
collapse_to_parent = true,
},
--------------------------------------
expressed_sequence_match = {
fill = {red=0.2, green=0.2, blue=0.8},
max_show_width = 10000,
max_num_lines = 10,
max_capt_show_width= 5000,
},
--------------------------------------
binding_site = {
fill = {red=0.7, green=0.2, blue=0.8},
max_show_width = 10000,
max_num_lines = 10,
max_capt_show_width= 10000,
},
--------------------------------------
SNP = {
fill = {red=0.1, green=0.8, blue=0.8},
max_show_width = 10000,
max_num_lines = 10,
max_capt_show_width= 10000,
},
--------------------------------------
deletion = {
fill = {red=0.1, green=0.8, blue=0.8},
max_show_width = nil,
max_num_lines = 10,
max_capt_show_width= 10000,
},
--------------------------------------
chromosome = {
fill = {red=0.1, green=0.8, blue=0.8},
max_show_width = nil,
max_num_lines = 10,
},
--------------------------------------
substitution = {
fill = {red=1.0, green=0.1, blue=0.05},
max_show_width = 10000,
max_num_lines = 10,
max_capt_show_width= 1000,
},
--------------------------------------
BED_feature = {
fill = {red=0.0, green=0.1, blue=0.0},
style = "box",
},
--------------------------------------
BED_thick_feature = {
fill = {red=0.0, green=0.5, blue=0.0},
style = "box",
collapse_to_parent = true,
},
--------------------------------------
BED_block = {
fill = {red=0.0, green=1.0, blue=0.0},
style = "box",
collapse_to_parent = true,
},
--------------------------------------
GC_content = {
-- this is for a custom track
stroke = {red=0.2, green=0.2, blue=1.0, alpha = 0.4},
},
--------------------------------------
---------------------------------------
-- Defines various format options for drawing.
format =
{
......
......@@ -18,6 +18,9 @@ def main(input_fasta):
print(e)
sys.exit(1)
if not os.path.exists('data'):
os.makedirs('data')
if not os.path.exists('tmp'):
os.makedirs('tmp')
......
ltr_finder_path = "/home/radovan/lexa/LTR_finder/ltr_finder"
ltr_finder_prosite_path = "/home/radovan/lexa/prosite"
ltr_finder_tRNAdb_path = "/home/radovan/lexa/LTR_finder/tRNAdb/Athal-tRNAs.fa"
ltr_finder_path = '/home/radovan/lexa/LTR_finder/ltr_finder'
ltr_finder_prosite_path = '/home/radovan/lexa/prosite'
ltr_finder_tRNAdb_path = '/home/radovan/lexa/LTR_finder/tRNAdb/Athal-tRNAs.fa'
ltr_finder_args = ['-l', '32']
ltr_finder_args += ['-S', '3']
......@@ -13,7 +13,13 @@ ltr_finder_args += ['-w', '2'] #don't change, parsing format needed!
ltr_finder_args += ['-a', ltr_finder_prosite_path]
ltr_finder_args += ['-s', ltr_finder_tRNAdb_path]
blastx_gydb_protein_db = "/home/radovan/lexa/blastDB/data/gydb_proteins.fa"
call_gt_sketch_externally = True
gt_sketch_path = 'gt'
gt_sketch_args = ['sketch']
gt_sketch_args += ['-width', '1400']
gt_sketch_args += ['-style', '/home/radovan/git/nested/gt.style']
blastx_gydb_protein_db = '/home/radovan/lexa/blastDB/data/gydb_proteins.fa'
blastx_args = {
'num_threads': 3,
'dbsize': 90000,
......
import pprint
import subprocess
import config
from BCBio import GFF
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.SeqFeature import SeqFeature, FeatureLocation
from gt.core import *
from gt.extended import *
from gt.annotationsketch import *
from gt.annotationsketch.custom_track import CustomTrack
from gt.core.gtrange import Range
try:
from gt.core import *
from gt.extended import *
from gt.annotationsketch import *
from gt.annotationsketch.custom_track import CustomTrack
from gt.core.gtrange import Range
except ImportError:
print 'Warning: Could not import gt, sketch needs to be called externally!'
#a contains b as subinterval
def contains(a,b):
......@@ -105,6 +110,11 @@ def createGFF(gene, nested):
def visualize(gene_id):
if config.call_gt_sketch_externally:
process = subprocess.Popen([config.gt_sketch_path] + config.gt_sketch_args + ['data/{}.png'.format(gene_id)] + ['data/{}.gff'.format(gene_id)])
return
#Visualize using python
#Style
style = Style()
style.load_file('gt.style')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment