Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
aokad committed Jul 5, 2016
2 parents f0ea90b + 3c73061 commit 7d83d3b
Show file tree
Hide file tree
Showing 18 changed files with 178 additions and 34 deletions.
125 changes: 125 additions & 0 deletions config_template/genomon_v2_0_0.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#
# $Id: genomon_v2_0_0.cfg 117 2016-06-29 01:43:38Z aokada $
#

###################### general
[style]
path =
remarks =

###################### mutation
[mut]
use_gene_rate = 0
limited_genes =
#nouse_genes = NONE,-
#limited_funcs = UTR3,UTR5,downstream,exonic,intergenic,intronic,ncRNA_exonic,ncRNA_intronic,ncRNA_splicing,splicing,upstream
nouse_funcs =
#func_colors = UTR3:red:pink, UTR5:blue

### special item
# {#number_gene}
# {#number_id}
# {#number_mutaion_all}
# {#number_mutaion_id}
# {#number_mutaion_gene}
# {#number_item}

tooltip_format_checker_title1 = ID:{id}
tooltip_format_checker_title2 = gene:{gene}
tooltip_format_checker_partial = type[{func}], Chr:{chr}, Start:{start}, End:{end}, [{ref} -----> {alt}]
tooltip_format_gene_title : gene:{gene}, {#number_mutaion_gene}
tooltip_format_gene_partial : func:{func}, {#number_item}({#number_item/#number_id*100:.2}%)
tooltip_format_id_title = ID:{id}, {#number_mutaion_id}
tooltip_format_id_partial = func:{func}, {#number_item}

### sample for subplot
# [mut_subplot_type1_1]
# title = bam's average depth
# path = /path/to/file1
# sept = ,
# header = True
# comment = #
# col_value = average_depth
# col_ID = id
# mode = gradient
# name_set = MIN:min, MAX:max
#
# [mut_subplot_type2_1]
# title = Clinical Gender
# path = /path/to/file2
# sept = ,
# header = True
# comment =
# col_value = gender
# col_ID = barcode
# mode = fix
# name_set = 0:Male:blue, 1:Female:red, 2:Unknown:gray
#
# [mut_subplot_type2_2]
# title = Clinical Age
# path = /path/to/file3
# sept = ,
# header = True
# comment =
# col_value = age
# col_ID = barcode
# mode = range
# name_set = 0:0-19, 20:20-39, 40:40-59, 60:60over

[result_format_mutation]
suffix = _genomon_mutations.result.txt

sept = \t
header = False
comment = #
sept_func = ";"
sept_gene = ";"

# column index (required)
col_func = 5
col_gene = 6

# column index (option)
col_opt_chr = 0
col_opt_start = 1
col_opt_end = 2
col_opt_ref = 3
col_opt_alt = 4

[merge_format_mutation]
lack_column_complement = NA
sept = ,

###################### sv
[genome]
path =

[sv]
use_chrs = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,X,Y
snippet_threshold = 1000
snippet_sv_type = inversion

[result_format_sv]
suffix = .genomonSV.result.txt

sept = \t
header = False
comment = #

# column index (required)
col_chr1 = 0
col_break1 = 1
col_chr2 = 3
col_break2 = 4

# column index (option)
col_opt_dir1 = 2
col_opt_dir2 = 5
col_opt_type = 7
col_opt_gene_name1 = 8
col_opt_gene_name2 = 9

[merge_format_sv]
lack_column_complement = NA
sept = ,

4 changes: 2 additions & 2 deletions config_template/genomon_v2_0_5_v2_0_4.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: paplot.cfg 109 2016-06-02 06:59:42Z aokada $
# $Id: genomon_v2_0_5_v2_0_4.cfg 119 2016-07-05 05:04:33Z aokada $
#

###################### general
Expand All @@ -14,7 +14,7 @@ limited_genes =
#nouse_genes = -

#limited_funcs =
nouse_funcs = (blank),unknown,synonymous_SNV
nouse_funcs = _blank_,unknown,synonymous_SNV
func_colors = stopgain:#E85299,frameshift_deletion:#F39600,frameshift_insertion:#E60011,nonframeshift_deletion:#9CAEB7,nonframeshift_insertion:#009943,nonsynonymous_SNV:#00ADA6,splicing:#D7C447,stoploss:#6BBB5A

### special item
Expand Down
4 changes: 2 additions & 2 deletions config_template/genomon_v2_2_0_merge.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: paplot.cfg 111 2016-06-08 02:04:29Z aokada $
# $Id: genomon_v2_2_0_merge.cfg 119 2016-07-05 05:04:33Z aokada $
#

###################### general
Expand All @@ -14,7 +14,7 @@ limited_genes =
#nouse_genes = -

#limited_funcs =
nouse_funcs = (blank),unknown,synonymous_SNV
nouse_funcs = _blank_,unknown,synonymous_SNV
func_colors = stopgain:#E85299,frameshift_deletion:#F39600,frameshift_insertion:#E60011,nonframeshift_deletion:#9CAEB7,nonframeshift_insertion:#009943,nonsynonymous_SNV:#00ADA6,splicing:#D7C447,stoploss:#6BBB5A

### special item
Expand Down
4 changes: 2 additions & 2 deletions config_template/genomon_v2_3_0_merge.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: paplot.cfg 111 2016-06-08 02:04:29Z aokada $
# $Id: genomon_v2_3_0_merge.cfg 119 2016-07-05 05:04:33Z aokada $
#

###################### general
Expand All @@ -14,7 +14,7 @@ limited_genes =
#nouse_genes = -

#limited_funcs =
nouse_funcs = (blank),unknown,synonymous_SNV
nouse_funcs = _blank_,unknown,synonymous_SNV
func_colors = stopgain:#E85299,frameshift_deletion:#F39600,frameshift_insertion:#E60011,nonframeshift_deletion:#9CAEB7,nonframeshift_insertion:#009943,nonsynonymous_SNV:#00ADA6,splicing:#D7C447,stoploss:#6BBB5A

### special item
Expand Down
2 changes: 1 addition & 1 deletion example/example.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: example.cfg 113 2016-06-10 08:41:34Z aokada $
# $Id: example.cfg 117 2016-06-29 01:43:38Z aokada $
#

###################### general
Expand Down
2 changes: 1 addition & 1 deletion pa_plot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Created on Wed Dec 02 17:43:52 2015

@author: okada

$Id: pa_plot 111 2016-06-08 02:04:29Z aokada $
$Id: pa_plot 117 2016-06-29 01:43:38Z aokada $
"""

def main():
Expand Down
4 changes: 2 additions & 2 deletions paplot.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: paplot.cfg 111 2016-06-08 02:04:29Z aokada $
# $Id: paplot.cfg 119 2016-07-05 05:04:33Z aokada $
#

###################### general
Expand All @@ -14,7 +14,7 @@ limited_genes =
#nouse_genes = -

#limited_funcs =
#nouse_funcs = (blank),unknown,synonymous_SNV
#nouse_funcs = _blank_,unknown,synonymous_SNV
#func_colors = stopgain:#E85299,frameshift_deletion:#F39600,frameshift_insertion:#E60011,nonframeshift_deletion:#9CAEB7,nonframeshift_insertion:#009943,nonsynonymous_SNV:#00ADA6,splicing:#D7C447,stoploss:#6BBB5A

### special item
Expand Down
2 changes: 1 addition & 1 deletion paplot.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: paplot
Version: 0.3.0release
Version: 0.3.1release
Summary: parser result files created by genomon
Home-page: https://github.com/Genomon-Project/paplot.git
Author: aokada
Expand Down
11 changes: 6 additions & 5 deletions paplot/mut.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: mut.py 114 2016-06-14 02:08:37Z aokada $
$Id: mut.py 119 2016-07-05 05:04:33Z aokada $
"""

########### js template
Expand Down Expand Up @@ -693,6 +693,7 @@ def genes_list(colmun, colmun_f, colmun_id, funcs, Ids, config):

genes.append(key)

genes.sort()
return genes

def funcs_list(colmun, config):
Expand Down Expand Up @@ -851,21 +852,21 @@ def convert_tojs(input_file, output_file, positions, config):
func = df.data[f][func_pos]
df.data[f][func_pos] = func.replace(" ", "_")
if func == "":
df.data[f][func_pos] = "(blank)"
df.data[f][func_pos] = "_blank_"

[funcs, colors_n, colors_h] = funcs_list(df.column(cols_di["func"]), config)

# ID list
Ids = []
for row in df.data:
iid = row[df.name_to_index("id")]
iid = row[df.name_to_index(cols_di["id"])]
if iid != "": Ids.append(iid)
Ids = list(set(Ids))
Ids.sort()

genes = genes_list(df.column(cols_di["gene"]), \
df.column(cols_di["func"]), \
df.column(df.name_to_index("id")), \
df.column(cols_di["id"]), \
funcs, Ids, config)

option_keys = cols_di.keys()
Expand Down Expand Up @@ -895,7 +896,7 @@ def convert_tojs(input_file, output_file, positions, config):
mutations = {}
tooltips = {}
for row in df.data:
iid = row[df.name_to_index("id")]
iid = row[df.name_to_index(cols_di["id"])]
if iid == "": continue

if (iid in mutations) == False:
Expand Down
20 changes: 15 additions & 5 deletions paplot/qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: qc.py 114 2016-06-14 02:08:37Z aokada $
$Id: qc.py 118 2016-07-05 02:05:54Z aokada $
"""

def convert_tojs(input_file, output_file, positions, config):
Expand Down Expand Up @@ -42,13 +42,23 @@ def convert_tojs(input_file, output_file, positions, config):
continue

data = line.split(sept)

item_text = "{"

items = {}
str_list = []
for i in range(len(data)):
if names[header[i]] == "id":
item_text += names[header[i]] + ':"' + data[i] + '",'
str_list.append(names[header[i]])

items[names[header[i]]] = data[i]

keys = items.keys()
keys.sort()
item_text = "{"
for key in keys:
if key in str_list:
item_text += key + ':"' + items[key] + '",'
else:
item_text += names[header[i]] + ':' + data[i] + ','
item_text += key + ':' + items[key] + ','

data_text += item_text + "},\n"

Expand Down
2 changes: 1 addition & 1 deletion paplot/run_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: run_conf.py 81 2016-04-07 08:31:10Z aokada $
$Id: run_conf.py 117 2016-06-29 01:43:38Z aokada $
"""
prog = "pa_plot conf"

Expand Down
4 changes: 2 additions & 2 deletions paplot/run_mut.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: run_mut.py 106 2016-05-25 08:54:02Z aokada $
$Id: run_mut.py 116 2016-06-29 01:34:43Z aokada $
"""
prog = "pa_plot mutation"

Expand All @@ -14,7 +14,7 @@ def main(argv):
import paplot.mut as mut
import paplot.prep as prep
import argparse

parser = argparse.ArgumentParser(prog = prog)

parser.add_argument("--version", action = "version", version = tools.version_text())
Expand Down
2 changes: 1 addition & 1 deletion paplot/run_qc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: run_qc.py 84 2016-04-22 00:43:25Z aokada $
$Id: run_qc.py 117 2016-06-29 01:43:38Z aokada $
"""
prog = "pa_plot qc"

Expand Down
2 changes: 1 addition & 1 deletion paplot/run_sv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: run_sv.py 84 2016-04-22 00:43:25Z aokada $
$Id: run_sv.py 117 2016-06-29 01:43:38Z aokada $
"""
prog = "pa_plot sv"

Expand Down
9 changes: 6 additions & 3 deletions paplot/subcode/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: tools.py 109 2016-06-02 06:59:42Z aokada $
$Id: tools.py 118 2016-07-05 02:05:54Z aokada $
"""

def config_getboolean(config, section, item):
Expand Down Expand Up @@ -77,12 +77,15 @@ def get_inputlist(pattern):
import glob

inputs = pattern.lstrip("'").lstrip('"').rstrip("'").rstrip('"').split(",")

all_list = []
for item in inputs:
all_list.extend(glob.glob(win_to_unix(item).lstrip(" ").rstrip(" ")))

input_list = list(set(all_list))
input_list.sort()

return list(set(all_list))
return input_list

def get_section(mode):
section_in = ""
Expand Down
2 changes: 1 addition & 1 deletion paplot/sv.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@author: okada
$Id: sv.py 114 2016-06-14 02:08:37Z aokada $
$Id: sv.py 117 2016-06-29 01:43:38Z aokada $
"""

########### js template
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# $Id: setup.cfg 37 2016-02-16 05:19:48Z aokada $
# $Id: setup.cfg 118 2016-07-05 02:05:54Z aokada $
#

[egg_info]
Expand Down
Loading

0 comments on commit 7d83d3b

Please sign in to comment.