annotate read2mut.py @ 5:d9cbf833624e draft

planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author mheinzl
date Tue, 27 Oct 2020 12:46:55 +0000
parents 386438cd4c3b
children 11a2a34f8a2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
1 #!/usr/bin/env python
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
2
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
3 """read2mut.py
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
4
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
5 Author -- Gundula Povysil
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
6 Contact -- povysil@bioinf.jku.at
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
7
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
8 Looks for reads with mutation at known
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
9 positions and calculates frequencies and stats.
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
10
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
11 ======= ========== ================= ================================
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
12 Version Date Author Description
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
13 0.2.1 2019-10-27 Gundula Povysil -
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
14 ======= ========== ================= ================================
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
15
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
16
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
17 USAGE: python read2mut.py --mutFile DCS_Mutations.tabular --bamFile Interesting_Reads.trim.bam
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
18 --inputJson tag_count_dict.json --sscsJson SSCS_counts.json
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
19 --outputFile mutant_reads_summary_short_trim.xlsx --thresh 10 --phred 20 --trim 10 --chimera_correction
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
20
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
21 """
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
22
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
23 from __future__ import division
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
24
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
25 import argparse
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
26 import itertools
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
27 import json
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
28 import operator
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
29 import os
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
30 import re
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
31 import sys
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
32
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
33 import numpy as np
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
34 import pysam
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
35 import xlsxwriter
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
36
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
37 def make_argparser():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
38 parser = argparse.ArgumentParser(description='Takes a tabular file with mutations, a BAM file and JSON files as input and prints stats about variants to a user specified output file.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
39 parser.add_argument('--mutFile',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
40 help='TABULAR file with DCS mutations.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
41 parser.add_argument('--bamFile',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
42 help='BAM file with aligned raw reads of selected tags (FASTQ created by mut2read.py - trimming with Trimmomatic - alignment with bwa).')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
43 parser.add_argument('--inputJson',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
44 help='JSON file with data collected by mut2read.py.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
45 parser.add_argument('--sscsJson',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
46 help='JSON file with SSCS counts collected by mut2sscs.py.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
47 parser.add_argument('--outputFile',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
48 help='Output xlsx file of mutation details.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
49 parser.add_argument('--thresh', type=int, default=0,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
50 help='Integer threshold for displaying mutations. Only mutations occuring less than thresh times are displayed. Default of 0 displays all.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
51 parser.add_argument('--phred', type=int, default=20,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
52 help='Integer threshold for Phred score. Only reads higher than this threshold are considered. Default 20.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
53 parser.add_argument('--trim', type=int, default=10,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
54 help='Integer threshold for assigning mutations at start and end of reads to lower tier. Default 10.')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
55 parser.add_argument('--chimera_correction', action="store_true",
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
56 help='Count chimeric variants and correct the variant frequencies.')
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
57 return parser
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
58
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
59
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
60 def safe_div(x, y):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
61 if y == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
62 return None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
63 return x / y
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
64
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
65
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
66 def read2mut(argv):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
67 parser = make_argparser()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
68 args = parser.parse_args(argv[1:])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
69 file1 = args.mutFile
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
70 file2 = args.bamFile
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
71 json_file = args.inputJson
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
72 sscs_json = args.sscsJson
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
73 outfile = args.outputFile
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
74 thresh = args.thresh
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
75 phred_score = args.phred
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
76 trim = args.trim
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
77 chimera_correction = args.chimera_correction
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
78
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
79 if os.path.isfile(file1) is False:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
80 sys.exit("Error: Could not find '{}'".format(file1))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
81 if os.path.isfile(file2) is False:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
82 sys.exit("Error: Could not find '{}'".format(file2))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
83 if os.path.isfile(json_file) is False:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
84 sys.exit("Error: Could not find '{}'".format(json_file))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
85 if thresh < 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
86 sys.exit("Error: thresh is '{}', but only non-negative integers allowed".format(thresh))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
87 if phred_score < 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
88 sys.exit("Error: phred is '{}', but only non-negative integers allowed".format(phred_score))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
89 if trim < 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
90 sys.exit("Error: trim is '{}', but only non-negative integers allowed".format(thresh))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
91
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
92 with open(file1, 'r') as mut:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
93 mut_array = np.genfromtxt(mut, skip_header=1, delimiter='\t', comments='#', dtype=str)
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
94
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
95 # load dicts
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
96 with open(json_file, "r") as f:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
97 (tag_dict, cvrg_dict) = json.load(f)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
98
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
99 with open(sscs_json, "r") as f:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
100 (mut_pos_dict, ref_pos_dict) = json.load(f)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
101
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
102 # read bam file
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
103 # pysam.index(file2)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
104 bam = pysam.AlignmentFile(file2, "rb")
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
105
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
106 # 4. create mut_dict
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
107 mut_dict = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
108 mut_read_pos_dict = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
109 mut_read_dict = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
110 reads_dict = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
111 if mut_array.shape == (1, 13):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
112 mut_array = mut_array.reshape((1, len(mut_array)))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
113
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
114 for m in range(0, len(mut_array[:, 0])):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
115 print(str(m + 1) + " of " + str(len(mut_array[:, 0])))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
116 chrom = mut_array[m, 1]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
117 stop_pos = mut_array[m, 2].astype(int)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
118 chrom_stop_pos = str(chrom) + "#" + str(stop_pos)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
119 ref = mut_array[m, 9]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
120 alt = mut_array[m, 10]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
121 mut_dict[chrom_stop_pos] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
122 mut_read_pos_dict[chrom_stop_pos] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
123 reads_dict[chrom_stop_pos] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
124
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
125 for pileupcolumn in bam.pileup(chrom.tostring(), stop_pos - 2, stop_pos, max_depth=100000000):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
126 if pileupcolumn.reference_pos == stop_pos - 1:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
127 count_alt = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
128 count_ref = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
129 count_indel = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
130 count_n = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
131 count_other = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
132 count_lowq = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
133 n = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
134 print("unfiltered reads=", pileupcolumn.n, "filtered reads=", len(pileupcolumn.pileups),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
135 "difference= ", len(pileupcolumn.pileups) - pileupcolumn.n)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
136 for pileupread in pileupcolumn.pileups:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
137 n += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
138 if not pileupread.is_del and not pileupread.is_refskip:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
139 tag = pileupread.alignment.query_name
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
140 nuc = pileupread.alignment.query_sequence[pileupread.query_position]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
141 phred = ord(pileupread.alignment.qual[pileupread.query_position]) - 33
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
142 if phred < phred_score:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
143 nuc = "lowQ"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
144 if tag not in mut_dict[chrom_stop_pos]:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
145 mut_dict[chrom_stop_pos][tag] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
146 if nuc in mut_dict[chrom_stop_pos][tag]:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
147 mut_dict[chrom_stop_pos][tag][nuc] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
148 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
149 mut_dict[chrom_stop_pos][tag][nuc] = 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
150 if tag not in mut_read_pos_dict[chrom_stop_pos]:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
151 mut_read_pos_dict[chrom_stop_pos][tag] = np.array(pileupread.query_position) + 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
152 reads_dict[chrom_stop_pos][tag] = len(pileupread.alignment.query_sequence)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
153 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
154 mut_read_pos_dict[chrom_stop_pos][tag] = np.append(
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
155 mut_read_pos_dict[chrom_stop_pos][tag], pileupread.query_position + 1)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
156 reads_dict[chrom_stop_pos][tag] = np.append(
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
157 reads_dict[chrom_stop_pos][tag], len(pileupread.alignment.query_sequence))
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
158 if nuc == alt:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
159 count_alt += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
160 if tag not in mut_read_dict:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
161 mut_read_dict[tag] = {}
5
d9cbf833624e planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 4
diff changeset
162 mut_read_dict[tag][chrom_stop_pos] = (alt, ref)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
163 else:
5
d9cbf833624e planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 4
diff changeset
164 mut_read_dict[tag][chrom_stop_pos] = (alt, ref)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
165 elif nuc == ref:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
166 count_ref += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
167 elif nuc == "N":
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
168 count_n += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
169 elif nuc == "lowQ":
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
170 count_lowq += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
171 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
172 count_other += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
173 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
174 count_indel += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
175 print("coverage at pos %s = %s, ref = %s, alt = %s, other bases = %s, N = %s, indel = %s, low quality = %s\n" % (pileupcolumn.pos, count_ref + count_alt, count_ref, count_alt, count_other, count_n, count_indel, count_lowq))
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
176
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
177 for read in bam.fetch(until_eof=True):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
178 if read.is_unmapped:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
179 pure_tag = read.query_name[:-5]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
180 nuc = "na"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
181 for key in tag_dict[pure_tag].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
182 if key not in mut_dict:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
183 mut_dict[key] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
184 if read.query_name not in mut_dict[key]:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
185 mut_dict[key][read.query_name] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
186 if nuc in mut_dict[key][read.query_name]:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
187 mut_dict[key][read.query_name][nuc] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
188 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
189 mut_dict[key][read.query_name][nuc] = 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
190 bam.close()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
191
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
192 # 5. create pure_tags_dict
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
193 pure_tags_dict = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
194 for key1, value1 in sorted(mut_dict.items()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
195 i = np.where(np.array(['#'.join(str(i) for i in z)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
196 for z in zip(mut_array[:, 1], mut_array[:, 2])]) == key1)[0][0]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
197 ref = mut_array[i, 9]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
198 alt = mut_array[i, 10]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
199 pure_tags_dict[key1] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
200 for key2, value2 in sorted(value1.items()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
201 for key3, value3 in value2.items():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
202 pure_tag = key2[:-5]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
203 if key3 == alt:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
204 if pure_tag in pure_tags_dict[key1]:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
205 pure_tags_dict[key1][pure_tag] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
206 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
207 pure_tags_dict[key1][pure_tag] = 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
208
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
209 # 6. create pure_tags_dict_short with thresh
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
210 if thresh > 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
211 pure_tags_dict_short = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
212 for key, value in sorted(pure_tags_dict.items()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
213 if len(value) < thresh:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
214 pure_tags_dict_short[key] = value
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
215 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
216 pure_tags_dict_short = pure_tags_dict
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
217
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
218 # 7. output summary with threshold
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
219 workbook = xlsxwriter.Workbook(outfile)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
220 ws1 = workbook.add_worksheet("Results")
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
221 ws2 = workbook.add_worksheet("Allele frequencies")
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
222 ws3 = workbook.add_worksheet("Tiers")
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
223
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
224 format1 = workbook.add_format({'bg_color': '#BCF5A9'}) # green
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
225 format2 = workbook.add_format({'bg_color': '#FFC7CE'}) # red
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
226 format3 = workbook.add_format({'bg_color': '#FACC2E'}) # yellow
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
227
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
228 header_line = ('variant ID', 'tier', 'tag', 'mate', 'read pos.ab', 'read pos.ba', 'read median length.ab',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
229 'read median length.ba', 'DCS median length',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
230 'FS.ab', 'FS.ba', 'FSqc.ab', 'FSqc.ba', 'ref.ab', 'ref.ba', 'alt.ab', 'alt.ba',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
231 'rel. ref.ab', 'rel. ref.ba', 'rel. alt.ab', 'rel. alt.ba',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
232 'na.ab', 'na.ba', 'lowq.ab', 'lowq.ba', 'trim.ab', 'trim.ba',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
233 'SSCS alt.ab', 'SSCS alt.ba', 'SSCS ref.ab', 'SSCS ref.ba',
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
234 'in phase', 'chimeric tag')
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
235 ws1.write_row(0, 0, header_line)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
236
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
237 counter_tier11 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
238 counter_tier12 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
239 counter_tier21 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
240 counter_tier22 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
241 counter_tier23 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
242 counter_tier24 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
243 counter_tier31 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
244 counter_tier32 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
245 counter_tier41 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
246 counter_tier42 = 0
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
247 #if chimera_correction:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
248 # counter_tier43 = 0
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
249 counter_tier5 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
250
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
251 row = 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
252 tier_dict = {}
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
253 chimera_dict = {}
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
254 for key1, value1 in sorted(mut_dict.items()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
255 counts_mut = 0
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
256 chimeric_tag_list = []
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
257 chimeric_tag = {}
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
258 if key1 in pure_tags_dict_short.keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
259 i = np.where(np.array(['#'.join(str(i) for i in z)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
260 for z in zip(mut_array[:, 1], mut_array[:, 2])]) == key1)[0][0]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
261 ref = mut_array[i, 9]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
262 alt = mut_array[i, 10]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
263 dcs_median = cvrg_dict[key1][2]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
264 whole_array = pure_tags_dict_short[key1].keys()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
265
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
266 tier_dict[key1] = {}
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
267 values_tier_dict = [("tier 1.1", 0), ("tier 1.2", 0), ("tier 2.1", 0), ("tier 2.2", 0), ("tier 2.3", 0), ("tier 2.4", 0), ("tier 3.1", 0), ("tier 3.2", 0), ("tier 4.1", 0), ("tier 4.2", 0), ("tier 5", 0)]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
268 for k, v in values_tier_dict:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
269 tier_dict[key1][k] = v
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
270
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
271 used_keys = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
272 if 'ab' in mut_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
273 sscs_mut_ab = mut_pos_dict[key1]['ab']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
274 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
275 sscs_mut_ab = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
276 if 'ba' in mut_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
277 sscs_mut_ba = mut_pos_dict[key1]['ba']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
278 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
279 sscs_mut_ba = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
280 if 'ab' in ref_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
281 sscs_ref_ab = ref_pos_dict[key1]['ab']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
282 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
283 sscs_ref_ab = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
284 if 'ba' in ref_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
285 sscs_ref_ba = ref_pos_dict[key1]['ba']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
286 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
287 sscs_ref_ba = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
288 for key2, value2 in sorted(value1.items()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
289 add_mut14 = ""
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
290 add_mut23 = ""
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
291 if (key2[:-5] in pure_tags_dict_short[key1].keys()) and (key2[:-5] not in used_keys) and (key1 in tag_dict[key2[:-5]].keys()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
292 if key2[:-5] + '.ab.1' in mut_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
293 total1 = sum(mut_dict[key1][key2[:-5] + '.ab.1'].values())
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
294 if 'na' in mut_dict[key1][key2[:-5] + '.ab.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
295 na1 = mut_dict[key1][key2[:-5] + '.ab.1']['na']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
296 # na1f = na1/total1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
297 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
298 # na1 = na1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
299 na1 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
300 if 'lowQ' in mut_dict[key1][key2[:-5] + '.ab.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
301 lowq1 = mut_dict[key1][key2[:-5] + '.ab.1']['lowQ']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
302 # lowq1f = lowq1 / total1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
303 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
304 # lowq1 = lowq1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
305 lowq1 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
306 if ref in mut_dict[key1][key2[:-5] + '.ab.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
307 ref1 = mut_dict[key1][key2[:-5] + '.ab.1'][ref]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
308 ref1f = ref1 / (total1 - na1 - lowq1)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
309 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
310 ref1 = ref1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
311 if alt in mut_dict[key1][key2[:-5] + '.ab.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
312 alt1 = mut_dict[key1][key2[:-5] + '.ab.1'][alt]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
313 alt1f = alt1 / (total1 - na1 - lowq1)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
314 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
315 alt1 = alt1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
316 total1new = total1 - na1 - lowq1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
317 if (key2[:-5] + '.ab.1') in mut_read_dict.keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
318 k1 = mut_read_dict[(key2[:-5] + '.ab.1')].keys()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
319 add_mut1 = len(k1)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
320 if add_mut1 > 1:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
321 for k, v in mut_read_dict[(key2[:-5] + '.ab.1')].items():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
322 if k != key1:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
323 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
324 if len(add_mut14) == 0:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
325 add_mut14 = new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
326 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
327 add_mut14 = add_mut14 + ", " + new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
328 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
329 k1 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
330 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
331 total1 = total1new = na1 = lowq1 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
332 ref1 = alt1 = ref1f = alt1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
333 k1 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
334
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
335 if key2[:-5] + '.ab.2' in mut_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
336 total2 = sum(mut_dict[key1][key2[:-5] + '.ab.2'].values())
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
337 if 'na' in mut_dict[key1][key2[:-5] + '.ab.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
338 na2 = mut_dict[key1][key2[:-5] + '.ab.2']['na']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
339 # na2f = na2 / total2
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
340 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
341 # na2 = na2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
342 na2 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
343 if 'lowQ' in mut_dict[key1][key2[:-5] + '.ab.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
344 lowq2 = mut_dict[key1][key2[:-5] + '.ab.2']['lowQ']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
345 # lowq2f = lowq2 / total2
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
346 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
347 # lowq2 = lowq2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
348 lowq2 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
349 if ref in mut_dict[key1][key2[:-5] + '.ab.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
350 ref2 = mut_dict[key1][key2[:-5] + '.ab.2'][ref]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
351 ref2f = ref2 / (total2 - na2 - lowq2)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
352 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
353 ref2 = ref2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
354 if alt in mut_dict[key1][key2[:-5] + '.ab.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
355 alt2 = mut_dict[key1][key2[:-5] + '.ab.2'][alt]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
356 alt2f = alt2 / (total2 - na2 - lowq2)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
357 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
358 alt2 = alt2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
359 total2new = total2 - na2 - lowq2
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
360 if (key2[:-5] + '.ab.2') in mut_read_dict.keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
361 k2 = mut_read_dict[(key2[:-5] + '.ab.2')].keys()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
362 add_mut2 = len(k2)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
363 if add_mut2 > 1:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
364 for k, v in mut_read_dict[(key2[:-5] + '.ab.2')].items():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
365 if k != key1:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
366 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
367 if len(add_mut23) == 0:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
368 add_mut23 = new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
369 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
370 add_mut23 = add_mut23 + ", " + new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
371 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
372 k2 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
373 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
374 total2 = total2new = na2 = lowq2 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
375 ref2 = alt2 = ref2f = alt2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
376 k2 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
377
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
378 if key2[:-5] + '.ba.1' in mut_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
379 total3 = sum(mut_dict[key1][key2[:-5] + '.ba.1'].values())
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
380 if 'na' in mut_dict[key1][key2[:-5] + '.ba.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
381 na3 = mut_dict[key1][key2[:-5] + '.ba.1']['na']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
382 # na3f = na3 / total3
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
383 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
384 # na3 = na3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
385 na3 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
386 if 'lowQ' in mut_dict[key1][key2[:-5] + '.ba.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
387 lowq3 = mut_dict[key1][key2[:-5] + '.ba.1']['lowQ']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
388 # lowq3f = lowq3 / total3
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
389 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
390 # lowq3 = lowq3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
391 lowq3 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
392 if ref in mut_dict[key1][key2[:-5] + '.ba.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
393 ref3 = mut_dict[key1][key2[:-5] + '.ba.1'][ref]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
394 ref3f = ref3 / (total3 - na3 - lowq3)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
395 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
396 ref3 = ref3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
397 if alt in mut_dict[key1][key2[:-5] + '.ba.1'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
398 alt3 = mut_dict[key1][key2[:-5] + '.ba.1'][alt]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
399 alt3f = alt3 / (total3 - na3 - lowq3)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
400 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
401 alt3 = alt3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
402 total3new = total3 - na3 - lowq3
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
403 if (key2[:-5] + '.ba.1') in mut_read_dict.keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
404 add_mut3 = len(mut_read_dict[(key2[:-5] + '.ba.1')].keys())
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
405 if add_mut3 > 1:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
406 for k, v in mut_read_dict[(key2[:-5] + '.ba.1')].items():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
407 if k != key1 and k not in k2:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
408 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
409 if len(add_mut23) == 0:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
410 add_mut23 = new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
411 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
412 add_mut23 = add_mut23 + ", " + new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
413 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
414 total3 = total3new = na3 = lowq3 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
415 ref3 = alt3 = ref3f = alt3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
416
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
417 if key2[:-5] + '.ba.2' in mut_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
418 total4 = sum(mut_dict[key1][key2[:-5] + '.ba.2'].values())
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
419 if 'na' in mut_dict[key1][key2[:-5] + '.ba.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
420 na4 = mut_dict[key1][key2[:-5] + '.ba.2']['na']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
421 # na4f = na4 / total4
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
422 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
423 # na4 = na4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
424 na4 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
425 if 'lowQ' in mut_dict[key1][key2[:-5] + '.ba.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
426 lowq4 = mut_dict[key1][key2[:-5] + '.ba.2']['lowQ']
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
427 # lowq4f = lowq4 / total4
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
428 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
429 # lowq4 = lowq4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
430 lowq4 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
431 if ref in mut_dict[key1][key2[:-5] + '.ba.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
432 ref4 = mut_dict[key1][key2[:-5] + '.ba.2'][ref]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
433 ref4f = ref4 / (total4 - na4 - lowq4)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
434 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
435 ref4 = ref4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
436 if alt in mut_dict[key1][key2[:-5] + '.ba.2'].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
437 alt4 = mut_dict[key1][key2[:-5] + '.ba.2'][alt]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
438 alt4f = alt4 / (total4 - na4 - lowq4)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
439 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
440 alt4 = alt4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
441 total4new = total4 - na4 - lowq4
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
442 if (key2[:-5] + '.ba.2') in mut_read_dict.keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
443 add_mut4 = len(mut_read_dict[(key2[:-5] + '.ba.2')].keys())
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
444 if add_mut4 > 1:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
445 for k, v in mut_read_dict[(key2[:-5] + '.ba.2')].items():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
446 if k != key1 and k not in k1:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
447 new_mut = str(k).split("#")[0] + "-" + str(int(str(k).split("#")[1]) + 1) + "-" + v[1] + "-" + v[0]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
448 if len(add_mut14) == 0:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
449 add_mut14 = new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
450 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
451 add_mut14 = add_mut14 + ", " + new_mut
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
452 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
453 total4 = total4new = na4 = lowq4 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
454 ref4 = alt4 = ref4f = alt4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
455
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
456 read_pos1 = read_pos2 = read_pos3 = read_pos4 = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
457 read_len_median1 = read_len_median2 = read_len_median3 = read_len_median4 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
458
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
459 if key2[:-5] + '.ab.1' in mut_read_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
460 read_pos1 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ab.1'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
461 read_len_median1 = np.median(reads_dict[key1][key2[:-5] + '.ab.1'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
462 if key2[:-5] + '.ab.2' in mut_read_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
463 read_pos2 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ab.2'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
464 read_len_median2 = np.median(reads_dict[key1][key2[:-5] + '.ab.2'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
465 if key2[:-5] + '.ba.1' in mut_read_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
466 read_pos3 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ba.1'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
467 read_len_median3 = np.median(reads_dict[key1][key2[:-5] + '.ba.1'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
468 if key2[:-5] + '.ba.2' in mut_read_pos_dict[key1].keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
469 read_pos4 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ba.2'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
470 read_len_median4 = np.median(reads_dict[key1][key2[:-5] + '.ba.2'])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
471
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
472 used_keys.append(key2[:-5])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
473 counts_mut += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
474 if (alt1f + alt2f + alt3f + alt4f) > 0.5:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
475 if total1new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
476 ref1f = alt1f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
477 alt1ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
478 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
479 alt1ff = alt1f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
480 if total2new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
481 ref2f = alt2f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
482 alt2ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
483 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
484 alt2ff = alt2f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
485 if total3new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
486 ref3f = alt3f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
487 alt3ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
488 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
489 alt3ff = alt3f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
490 if total4new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
491 ref4f = alt4f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
492 alt4ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
493 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
494 alt4ff = alt4f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
495
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
496 beg1 = beg4 = beg2 = beg3 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
497
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
498 details1 = (total1, total4, total1new, total4new, ref1, ref4, alt1, alt4, ref1f, ref4f, alt1f, alt4f, na1, na4, lowq1, lowq4, beg1, beg4)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
499 details2 = (total2, total3, total2new, total3new, ref2, ref3, alt2, alt3, ref2f, ref3f, alt2f, alt3f, na2, na3, lowq2, lowq3, beg2, beg3)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
500
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
501
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
502 trimmed = False
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
503 contradictory = False
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
504
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
505 if ((all(float(ij) >= 0.5 for ij in [alt1ff, alt4ff]) & # contradictory variant
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
506 all(float(ij) == 0. for ij in [alt2ff, alt3ff])) |
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
507 (all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
508 all(float(ij) == 0. for ij in [alt1ff, alt4ff]))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
509 alt1ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
510 alt4ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
511 alt2ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
512 alt3ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
513 trimmed = False
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
514 contradictory = True
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
515 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
516 if ((read_pos1 >= 0) and ((read_pos1 <= trim) | (abs(read_len_median1 - read_pos1) <= trim))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
517 beg1 = total1new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
518 total1new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
519 alt1ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
520 alt1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
521 trimmed = True
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
522
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
523 if ((read_pos4 >= 0) and ((read_pos4 <= trim) | (abs(read_len_median4 - read_pos4) <= trim))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
524 beg4 = total4new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
525 total4new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
526 alt4ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
527 alt4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
528 trimmed = True
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
529
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
530 if ((read_pos2 >= 0) and ((read_pos2 <= trim) | (abs(read_len_median2 - read_pos2) <= trim))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
531 beg2 = total2new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
532 total2new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
533 alt2ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
534 alt2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
535 trimmed = True
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
536
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
537 if ((read_pos3 >= 0) and ((read_pos3 <= trim) | (abs(read_len_median3 - read_pos3) <= trim))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
538 beg3 = total3new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
539 total3new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
540 alt3ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
541 alt3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
542 trimmed = True
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
543 details1 = (total1, total4, total1new, total4new, ref1, ref4, alt1, alt4, ref1f, ref4f, alt1f, alt4f, na1, na4, lowq1, lowq4, beg1, beg4)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
544 details2 = (total2, total3, total2new, total3new, ref2, ref3, alt2, alt3, ref2f, ref3f, alt2f, alt3f, na2, na3, lowq2, lowq3, beg2, beg3)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
545
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
546 # assign tiers
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
547 if ((all(int(ij) >= 3 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
548 all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff])) |
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
549 (all(int(ij) >= 3 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
550 all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
551 tier = "1.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
552 counter_tier11 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
553 tier_dict[key1]["tier 1.1"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
554
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
555 elif (all(int(ij) >= 1 for ij in [total1new, total2new, total3new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
556 any(int(ij) >= 3 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
557 any(int(ij) >= 3 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
558 all(float(ij) >= 0.75 for ij in [alt1ff, alt2ff, alt3ff, alt4ff])):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
559 tier = "1.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
560 counter_tier12 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
561 tier_dict[key1]["tier 1.2"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
562
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
563 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
564 any(int(ij) >= 3 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
565 all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff])) |
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
566 (all(int(ij) >= 1 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
567 any(int(ij) >= 3 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
568 all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
569 tier = "2.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
570 counter_tier21 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
571 tier_dict[key1]["tier 2.1"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
572
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
573 elif (all(int(ij) >= 1 for ij in [total1new, total2new, total3new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
574 all(float(ij) >= 0.75 for ij in [alt1ff, alt2ff, alt3ff, alt4ff])):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
575 tier = "2.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
576 counter_tier22 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
577 tier_dict[key1]["tier 2.2"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
578
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
579 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
580 any(int(ij) >= 3 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
581 all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
582 any(float(ij) >= 0.75 for ij in [alt2ff, alt3ff])) |
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
583 (all(int(ij) >= 1 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
584 any(int(ij) >= 3 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
585 all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
586 any(float(ij) >= 0.75 for ij in [alt1ff, alt4ff]))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
587 tier = "2.3"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
588 counter_tier23 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
589 tier_dict[key1]["tier 2.3"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
590
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
591 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
592 all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff])) |
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
593 (all(int(ij) >= 1 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
594 all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
595 tier = "2.4"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
596 counter_tier24 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
597 tier_dict[key1]["tier 2.4"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
598
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
599 elif ((len(pure_tags_dict_short[key1]) > 1) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
600 (all(float(ij) >= 0.5 for ij in [alt1ff, alt4ff]) |
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
601 all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
602 tier = "3.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
603 counter_tier31 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
604 tier_dict[key1]["tier 3.1"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
605
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
606 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
607 all(float(ij) >= 0.5 for ij in [alt1ff, alt4ff])) |
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
608 (all(int(ij) >= 1 for ij in [total2new, total3new]) &
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
609 all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]))):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
610 tier = "3.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
611 counter_tier32 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
612 tier_dict[key1]["tier 3.2"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
613
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
614 elif (trimmed):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
615 tier = "4.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
616 counter_tier41 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
617 tier_dict[key1]["tier 4.1"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
618
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
619 elif (contradictory):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
620 tier = "4.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
621 counter_tier42 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
622 tier_dict[key1]["tier 4.2"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
623
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
624 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
625 tier = "5"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
626 counter_tier5 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
627 tier_dict[key1]["tier 5"] += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
628
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
629 chrom, pos = re.split(r'\#', key1)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
630 var_id = '-'.join([chrom, str(int(pos)+1), ref, alt])
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
631 sample_tag = key2[:-5]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
632 array2 = np.unique(whole_array) # remove duplicate sequences to decrease running time
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
633 # exclude identical tag from array2, to prevent comparison to itself
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
634 same_tag = np.where(array2 == sample_tag)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
635 index_array2 = np.arange(0, len(array2), 1)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
636 index_withoutSame = np.delete(index_array2, same_tag) # delete identical tag from the data
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
637 array2 = array2[index_withoutSame]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
638 if len(array2) != 0: # only perform chimera analysis if there is more than 1 variant
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
639 array1_half = sample_tag[0:int(len(sample_tag) / 2)] # mate1 part1
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
640 array1_half2 = sample_tag[int(len(sample_tag) / 2):int(len(sample_tag))] # mate1 part 2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
641 array2_half = np.array([ii[0:int(len(ii) / 2)] for ii in array2]) # mate2 part1
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
642 array2_half2 = np.array([ii[int(len(ii) / 2):int(len(ii))] for ii in array2]) # mate2 part2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
643
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
644 min_tags_list_zeros = []
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
645 chimera_tags = []
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
646 for mate_b in [False, True]:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
647 i = 0 # counter, only used to see how many HDs of tags were already calculated
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
648 if mate_b is False: # HD calculation for all a's
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
649 half1_mate1 = array1_half
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
650 half2_mate1 = array1_half2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
651 half1_mate2 = array2_half
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
652 half2_mate2 = array2_half2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
653 elif mate_b is True: # HD calculation for all b's
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
654 half1_mate1 = array1_half2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
655 half2_mate1 = array1_half
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
656 half1_mate2 = array2_half2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
657 half2_mate2 = array2_half
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
658 # calculate HD of "a" in the tag to all "a's" or "b" in the tag to all "b's"
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
659 dist = np.array([sum(itertools.imap(operator.ne, half1_mate1, c)) for c in half1_mate2])
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
660 min_index = np.where(dist == dist.min()) # get index of min HD
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
661 # get all "b's" of the tag or all "a's" of the tag with minimum HD
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
662 min_tag_half2 = half2_mate2[min_index]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
663 min_tag_array2 = array2[min_index] # get whole tag with min HD
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
664 min_value = dist.min()
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
665 # calculate HD of "b" to all "b's" or "a" to all "a's"
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
666 dist_second_half = np.array([sum(itertools.imap(operator.ne, half2_mate1, e))
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
667 for e in min_tag_half2])
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
668
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
669 dist2 = dist_second_half.max()
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
670 max_index = np.where(dist_second_half == dist_second_half.max())[0] # get index of max HD
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
671 max_tag = min_tag_array2[max_index]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
672
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
673 # tags which have identical parts:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
674 if min_value == 0 or dist2 == 0:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
675 min_tags_list_zeros.append(tag)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
676 chimera_tags.append(max_tag)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
677 # chimeric = True
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
678 # else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
679 # chimeric = False
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
680
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
681 # if mate_b is False:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
682 # text = "pos {}: sample tag: {}; HD a = {}; HD b' = {}; similar tag(s): {}; chimeric = {}".format(pos, sample_tag, min_value, dist2, list(max_tag), chimeric)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
683 # else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
684 # text = "pos {}: sample tag: {}; HD a' = {}; HD b = {}; similar tag(s): {}; chimeric = {}".format(pos, sample_tag, dist2, min_value, list(max_tag), chimeric)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
685 i += 1
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
686 chimera_tags = [x for x in chimera_tags if x != []]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
687 chimera_tags_new = []
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
688 for i in chimera_tags:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
689 if len(i) > 1:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
690 for t in i:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
691 chimera_tags_new.append(t)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
692 else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
693 chimera_tags_new.extend(i)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
694 chimera = ", ".join(chimera_tags_new)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
695 else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
696 chimera_tags_new = []
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
697 chimera = ""
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
698
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
699 if len(chimera_tags_new) > 0:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
700 chimera_tags_new.append(sample_tag)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
701 key_chimera = ",".join(sorted(chimera_tags_new))
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
702 if key_chimera in chimeric_tag.keys():
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
703 chimeric_tag[key_chimera].append(float(tier))
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
704 else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
705 chimeric_tag[key_chimera] = [float(tier)]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
706
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
707 if (read_pos1 == -1):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
708 read_pos1 = read_len_median1 = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
709 if (read_pos4 == -1):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
710 read_pos4 = read_len_median4 = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
711 if (read_pos2 == -1):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
712 read_pos2 = read_len_median2 = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
713 if (read_pos3 == -1):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
714 read_pos3 = read_len_median3 = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
715 line = (var_id, tier, key2[:-5], 'ab1.ba2', read_pos1, read_pos4, read_len_median1, read_len_median4, dcs_median) + details1 + (sscs_mut_ab, sscs_mut_ba, sscs_ref_ab, sscs_ref_ba, add_mut14, chimera)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
716 ws1.write_row(row, 0, line)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
717 line = ("", "", key2[:-5], 'ab2.ba1', read_pos2, read_pos3, read_len_median2, read_len_median3, dcs_median) + details2 + (sscs_mut_ab, sscs_mut_ba, sscs_ref_ab, sscs_ref_ba, add_mut23, chimera)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
718 ws1.write_row(row + 1, 0, line)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
719
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
720 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
721 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
722 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(row + 1, row + 1),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
723 'format': format1,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
724 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
725 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
726 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
727 'criteria': '=OR($B${}="2.1", $B${}="2.2", $B${}="2.3", $B${}="2.4")'.format(row + 1, row + 1, row + 1, row + 1),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
728 'format': format3,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
729 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
730 ws1.conditional_format('L{}:M{}'.format(row + 1, row + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
731 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
732 'criteria': '=$B${}>="3"'.format(row + 1),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
733 'format': format2,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
734 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1, row + 2)})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
735
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
736 row += 3
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
737 if chimera_correction:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
738 chimeric_dcs_high_tiers = 0
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
739 chimeric_dcs = 0
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
740 for keys_chimera in chimeric_tag.keys():
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
741 tiers = chimeric_tag[keys_chimera]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
742 chimeric_dcs += len(tiers) - 1
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
743 high_tiers = sum(1 for t in tiers if t < 3.)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
744 if high_tiers == len(tiers):
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
745 chimeric_dcs_high_tiers += high_tiers - 1
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
746 else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
747 chimeric_dcs_high_tiers += high_tiers
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
748 chimera_dict[key1] = (chimeric_dcs, chimeric_dcs_high_tiers)
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
749 # sheet 2
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
750 if chimera_correction:
3
4fc62ab6e9e8 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 2
diff changeset
751 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'chimeras in AC alt (all tiers)', 'chimera-corrected cvrg', 'chimera-corrected AF (all tiers)', 'cvrg (tiers 1.1-2.4)', 'AC alt (tiers 1.1-2.4)', 'AF (tiers 1.1-2.4)', 'chimeras in AC alt (tiers 1.1-2.4)', 'chimera-corrected cvrg (tiers 1.1-2.4)', 'chimera-corrected AF (tiers 1.1-2.4)', 'AC alt (orginal DCS)', 'AF (original DCS)',
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
752 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4',
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
753 'tier 3.1', 'tier 3.2', 'tier 4.1', 'tier 4.2', 'tier 5', 'AF 1.1-1.2', 'AF 1.1-2.1', 'AF 1.1-2.2',
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
754 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4.1', 'AF 1.1-4.2', 'AF 1.1-5')
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
755 else:
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
756 header_line2 = ('variant ID', 'cvrg', 'AC alt (all tiers)', 'AF (all tiers)', 'cvrg (tiers 1.1-2.4)', 'AC alt (tiers 1.1-2.4)', 'AF (tiers 1.1-2.4)', 'AC alt (orginal DCS)', 'AF (original DCS)',
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
757 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
758 'tier 3.1', 'tier 3.2', 'tier 4.1', 'tier 4.2', 'tier 5', 'AF 1.1-1.2', 'AF 1.1-2.1', 'AF 1.1-2.2',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
759 'AF 1.1-2.3', 'AF 1.1-2.4', 'AF 1.1-3.1', 'AF 1.1-3.2', 'AF 1.1-4.1', 'AF 1.1-4.2', 'AF 1.1-5')
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
760
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
761 ws2.write_row(0, 0, header_line2)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
762 row = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
763
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
764 for key1, value1 in sorted(tier_dict.items()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
765 if key1 in pure_tags_dict_short.keys():
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
766 i = np.where(np.array(['#'.join(str(i) for i in z)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
767 for z in zip(mut_array[:, 1], mut_array[:, 2])]) == key1)[0][0]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
768 ref = mut_array[i, 9]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
769 alt = mut_array[i, 10]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
770 chrom, pos = re.split(r'\#', key1)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
771 ref_count = cvrg_dict[key1][0]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
772 alt_count = cvrg_dict[key1][1]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
773 cvrg = ref_count + alt_count
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
774
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
775 var_id = '-'.join([chrom, str(int(pos)+1), ref, alt])
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
776 lst = [var_id, cvrg]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
777 used_tiers = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
778 cum_af = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
779 for key2, value2 in sorted(value1.items()):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
780 # calculate cummulative AF
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
781 used_tiers.append(value2)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
782 if len(used_tiers) > 1:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
783 cum = safe_div(sum(used_tiers), cvrg)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
784 cum_af.append(cum)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
785 lst.extend([sum(used_tiers), safe_div(sum(used_tiers), cvrg)])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
786 if chimera_correction:
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
787 chimeras_all = chimera_dict[key1][0]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
788 new_alt = sum(used_tiers) - chimeras_all
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
789 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers)))
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
790 if fraction_chimeras is None:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
791 fraction_chimeras = 0.
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
792 new_cvrg = cvrg * (1. - fraction_chimeras)
3
4fc62ab6e9e8 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 2
diff changeset
793 lst.extend([chimeras_all, new_cvrg, safe_div(new_alt, new_cvrg)])
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
794 lst.extend([(cvrg - sum(used_tiers[-5:])), sum(used_tiers[0:6]), safe_div(sum(used_tiers[0:6]), (cvrg - sum(used_tiers[-5:])))])
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
795 if chimera_correction:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
796 chimeras_all = chimera_dict[key1][1]
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
797 new_alt = sum(used_tiers[0:6]) - chimeras_all
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
798 fraction_chimeras = safe_div(chimeras_all, float(sum(used_tiers[0:6])))
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
799 if fraction_chimeras is None:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
800 fraction_chimeras = 0.
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
801 new_cvrg = (cvrg - sum(used_tiers[-5:])) * (1. - fraction_chimeras)
3
4fc62ab6e9e8 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 2
diff changeset
802 lst.extend([chimeras_all, new_cvrg, safe_div(new_alt, new_cvrg)])
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
803 lst.extend([alt_count, safe_div(alt_count, cvrg)])
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
804 lst.extend(used_tiers)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
805 lst.extend(cum_af)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
806 lst = tuple(lst)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
807 ws2.write_row(row + 1, 0, lst)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
808 if chimera_correction:
3
4fc62ab6e9e8 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 2
diff changeset
809 ws2.conditional_format('P{}:Q{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$P$1="tier 1.1"', 'format': format1, 'multi_range': 'P{}:Q{} P1:Q1'.format(row + 2, row + 2)})
4fc62ab6e9e8 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 2
diff changeset
810 ws2.conditional_format('R{}:U{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$R$1="tier 2.1"', 'format': format3, 'multi_range': 'R{}:U{} R1:U1'.format(row + 2, row + 2)})
4fc62ab6e9e8 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 2
diff changeset
811 ws2.conditional_format('V{}:Z{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$V$1="tier 3.1"', 'format': format2, 'multi_range': 'V{}:Z{} V1:Z1'.format(row + 2, row + 2)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
812 else:
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
813 ws2.conditional_format('J{}:K{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$J$1="tier 1.1"', 'format': format1, 'multi_range': 'J{}:K{} J1:K1'.format(row + 2, row + 2)})
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
814 ws2.conditional_format('L{}:O{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$L$1="tier 2.1"', 'format': format3, 'multi_range': 'L{}:O{} L1:O1'.format(row + 2, row + 2)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
815 ws2.conditional_format('P{}:T{}'.format(row + 2, row + 2), {'type': 'formula', 'criteria': '=$P$1="tier 3.1"', 'format': format2, 'multi_range': 'P{}:T{} P1:T1'.format(row + 2, row + 2)})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
816 row += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
817
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
818 # sheet 3
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
819 sheet3 = [("tier 1.1", counter_tier11), ("tier 1.2", counter_tier12), ("tier 2.1", counter_tier21),
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
820 ("tier 2.2", counter_tier22), ("tier 2.3", counter_tier23), ("tier 2.4", counter_tier24),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
821 ("tier 3.1", counter_tier31), ("tier 3.2", counter_tier32), ("tier 4.1", counter_tier41),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
822 ("tier 4.2", counter_tier42), ("tier 5", counter_tier5)]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
823
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
824 header = ("tier", "count")
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
825 ws3.write_row(0, 0, header)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
826
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
827 for i in range(len(sheet3)):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
828 ws3.write_row(i + 1, 0, sheet3[i])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
829 ws3.conditional_format('A{}:B{}'.format(i + 2, i + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
830 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
831 'criteria': '=OR($A${}="tier 1.1", $A${}="tier 1.2")'.format(i + 2, i + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
832 'format': format1})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
833 ws3.conditional_format('A{}:B{}'.format(i + 2, i + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
834 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
835 'criteria': '=OR($A${}="tier 2.1", $A${}="tier 2.2", $A${}="tier 2.3", $A${}="tier 2.4")'.format(i + 2, i + 2, i + 2, i + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
836 'format': format3})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
837 ws3.conditional_format('A{}:B{}'.format(i + 2, i + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
838 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
839 'criteria': '=$A${}>="3"'.format(i + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
840 'format': format2})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
841
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
842 description_tiers = [("Tier 1.1", "both ab and ba SSCS present (>75% of the sites with alternative base) and minimal FS>=3 for both SSCS in at least one mate"), ("", ""), ("Tier 1.2", "both ab and ba SSCS present (>75% of the sites with alt. base) and mate pair validation (min. FS=1) and minimal FS>=3 for at least one of the SSCS"), ("Tier 2.1", "both ab and ba SSCS present (>75% of the sites with alt. base) and minimal FS>=3 for at least one of the SSCS in at least one mate"), ("Tier 2.2", "both ab and ba SSCS present (>75% of the sites with alt. base) and mate pair validation (min. FS=1)"), ("Tier 2.3", "both ab and ba SSCS present (>75% of the sites with alt. base) and minimal FS=1 for both SSCS in one mate and minimal FS>=3 for at least one of the SSCS in the other mate"), ("Tier 2.4", "both ab and ba SSCS present (>75% of the sites with alt. base) and minimal FS=1 for both SSCS in at least one mate"), ("Tier 3.1", "both ab and ba SSCS present (>50% of the sites with alt. base) and recurring mutation on this position"), ("Tier 3.2", "both ab and ba SSCS present (>50% of the sites with alt. base) and minimal FS>=1 for both SSCS in at least one mate"), ("Tier 4.1", "variants at the start or end of the reads"), ("Tier 4.2", "mates with contradictory information"), ("Tier 5", "remaining variants")]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
843 examples_tiers = [[("Chr5:5-20000-11068-C-G", "1.1", "AAAAAGATGCCGACTACCTT", "ab1.ba2", "254", "228", "287", "288", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
844 "3", "6", "3", "6", "0", "0", "3", "6", "0", "0", "1", "1", "0", "0", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
845 "4081", "4098", "5", "10", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
846 ("", "", "AAAAAGATGCCGACTACCTT", "ab2.ba1", None, None, None, None,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
847 "289", "0", "0", "0", "0", "0", "0", "0", "0", None, None, None, None,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
848 "0", "0", "0", "0", "0", "0", "4081", "4098", "5", "10", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
849 [("Chr5:5-20000-11068-C-G", "1.1", "AAAAATGCGTAGAAATATGC", "ab1.ba2", "254", "228", "287", "288", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
850 "33", "43", "33", "43", "0", "0", "33", "43", "0", "0", "1", "1", "0", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
851 "0", "4081", "4098", "5", "10", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
852 ("", "", "AAAAATGCGTAGAAATATGC", "ab2.ba1", "268", "268", "270", "288", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
853 "11", "34", "10", "27", "0", "0", "10", "27", "0", "0", "1", "1", "0", "0", "1",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
854 "7", "0", "0", "4081", "4098", "5", "10", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
855 [("Chr5:5-20000-10776-G-T", "1.2", "CTATGACCCGTGAGCCCATG", "ab1.ba2", "132", "132", "287", "288", "290",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
856 "4", "1", "4", "1", "0", "0", "4", "1", "0", "0", "1", "1", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
857 "0", "0", "1", "6", "47170", "41149", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
858 ("", "", "CTATGACCCGTGAGCCCATG", "ab2.ba1", "77", "132", "233", "200", "290",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
859 "4", "1", "4", "1", "0", "0", "4", "1", "0", "0", "1", "1", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
860 "0", "0", "1", "6", "47170", "41149", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
861 [("Chr5:5-20000-11068-C-G", "2.1", "AAAAAAACATCATACACCCA", "ab1.ba2", "246", "244", "287", "288", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
862 "2", "8", "2", "8", "0", "0", "2", "8", "0", "0", "1", "1", "0", "0", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
863 "4081", "4098", "5", "10", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
864 ("", "", "AAAAAAACATCATACACCCA", "ab2.ba1", None, None, None, None,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
865 "289", "0", "0", "0", "0", "0", "0", "0", "0", None, None, None, None, "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
866 "0", "0", "0", "0", "4081", "4098", "5", "10", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
867 [("Chr5:5-20000-11068-C-G", "2.2", "ATCAGCCATGGCTATTATTG", "ab1.ba2", "72", "72", "217", "288", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
868 "1", "1", "1", "1", "0", "0", "1", "1", "0", "0", "1", "1", "0", "0", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
869 "4081", "4098", "5", "10", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
870 ("", "", "ATCAGCCATGGCTATTATTG", "ab2.ba1", "153", "164", "217", "260", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
871 "1", "1", "1", "1", "0", "0", "1", "1", "0", "0", "1", "1", "0", "0", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
872 "4081", "4098", "5", "10", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
873 [("Chr5:5-20000-11068-C-G", "2.3", "ATCAATATGGCCTCGCCACG", "ab1.ba2", None, None, None, None,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
874 "289", "0", "5", "0", "5", "0", "0", "0", "5", None, None, None, "1", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
875 "0", "0", "0", "0", "0", "4081", "4098", "5", "10", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
876 ("", "", "ATCAATATGGCCTCGCCACG", "ab2.ba1", "202", "255", "277", "290", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
877 "1", "3", "1", "3", "0", "0", "1", "3", "0", "0", "1", "1", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
878 "0", "0", "4081", "4098", "5", "10", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
879 [("Chr5:5-20000-11068-C-G", "2.4", "ATCAGCCATGGCTATTTTTT", "ab1.ba2", "72", "72", "217", "288", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
880 "1", "1", "1", "1", "0", "0", "1", "1", "0", "0", "1", "1", "0", "0", "0", "0", "0", "0", "4081",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
881 "4098", "5", "10", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
882 ("", "", "ATCAGCCATGGCTATTTTTT", "ab2.ba1", "153", "164", "217", "260", "289",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
883 "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "0", "0", "0", "0", "4081",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
884 "4098", "5", "10", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
885 [("Chr5:5-20000-10776-G-T", "3.1", "ATGCCTACCTCATTTGTCGT", "ab1.ba2", "46", "15", "287", "288", "290",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
886 "3", "3", "3", "2", "3", "1", "0", "1", "1", "0.5", "0", "0.5", "0", "0", "0", "1",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
887 "0", "0", "3", "3", "47170", "41149", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
888 ("", "", "ATGCCTACCTCATTTGTCGT", "ab2.ba1", None, "274", None,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
889 "288", "290", "0", "3", "0", "2", "0", "1", "0", "1", None, "0.5", None, "0.5",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
890 "0", "0", "0", "1", "0", "0", "3", "3", "47170", "41149", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
891 [("Chr5:5-20000-11315-C-T", "3.2", "ACAACATCACGTATTCAGGT", "ab1.ba2", "197", "197", "240", "255", "271",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
892 "2", "3", "2", "3", "0", "1", "2", "2", "0", "0.333333333333333", "1",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
893 "0.666666666666667", "0", "0", "0", "0", "0", "0", "1", "1", "6584", "6482", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
894 ("", "", "ACAACATCACGTATTCAGGT", "ab2.ba1", "35", "35", "240", "258", "271",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
895 "2", "3", "2", "3", "0", "1", "2", "2", "0", "0.333333333333333", "1",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
896 "0.666666666666667", "0", "0", "0", "0", "0", "0", "1", "1", "6584", "6482", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
897 [("Chr5:5-20000-13983-G-C", "4.1", "AAAAAAAGAATAACCCACAC", "ab1.ba2", "0", "100", "255", "276", "269",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
898 "5", "6", "0", "6", "0", "0", "5", "6", "0", "0", "0", "1", "0", "0", "0", "0", "5", "0", "1", "1", "5348", "5350", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
899 ("", "", "AAAAAAAGAATAACCCACAC", "ab2.ba1", None, None, None, None,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
900 "269", "0", "0", "0", "0", "0", "0", "0", "0", None, None, None, None, "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
901 "0", "0", "0", "0", "0", "1", "1", "5348", "5350", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
902 [("Chr5:5-20000-13963-T-C", "4.2", "TTTTTAAGAATAACCCACAC", "ab1.ba2", "38", "38", "240", "283", "263",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
903 "110", "54", "110", "54", "0", "0", "110", "54", "0", "0", "1", "1", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
904 "0", "0", "0", "1", "1", "5348", "5350", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
905 ("", "", "TTTTTAAGAATAACCCACAC", "ab2.ba1", "100", "112", "140", "145", "263",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
906 "7", "12", "7", "12", "7", "12", "0", "0", "1", "1", "0",
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
907 "0", "0", "0", "0", "0", "0", "0", "1", "1", "5348", "5350", "", "")],
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
908 [("Chr5:5-20000-13983-G-C", "5", "ATGTTGTGAATAACCCACAC", "ab1.ba2", None, "186", None, "276", "269",
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
909 "0", "6", "0", "6", "0", "0", "0", "6", "0", "0", "0", "1", "0", "0", "0", "0", "0",
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
910 "0", "1", "1", "5348", "5350", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
911 ("", "", "ATGTTGTGAATAACCCACAC", "ab2.ba1", None, None, None, None,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
912 "269", "0", "0", "0", "0", "0", "0", "0", "0", None, None, None, None, "0",
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
913 "0", "0", "0", "0", "0", "1", "1", "5348", "5350", "", "")]]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
914
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
915 start_row = 15
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
916 ws3.write(start_row, 0, "Description of tiers with examples")
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
917 ws3.write_row(start_row + 1, 0, header_line)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
918 row = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
919 for i in range(len(description_tiers)):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
920 ws3.write_row(start_row + 2 + row + i + 1, 0, description_tiers[i])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
921 ex = examples_tiers[i]
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
922 for k in range(len(ex)):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
923 ws3.write_row(start_row + 2 + row + i + k + 2, 0, ex[k])
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
924 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3), {'type': 'formula', 'criteria': '=OR($B${}="1.1", $B${}="1.2")'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2), 'format': format1, 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3)})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
925 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
926 {'type': 'formula', 'criteria': '=OR($B${}="2.1",$B${}="2.2", $B${}="2.3", $B${}="2.4")'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
927 'format': format3,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
928 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3)})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
929 ws3.conditional_format('L{}:M{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
930 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
931 'criteria': '=$B${}>="3"'.format(start_row + 2 + row + i + k + 2),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
932 'format': format2,
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
933 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3, start_row + 2 + row + i + k + 2, start_row + 2 + row + i + k + 3)})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
934 row += 3
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
935 workbook.close()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
936
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
937
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
938 if __name__ == '__main__':
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
939 sys.exit(read2mut(sys.argv))