annotate read2mut.py @ 17:f06067bedfc5 draft

planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
author mheinzl
date Mon, 22 Feb 2021 14:40:07 +0000
parents 30aec05d04d3
children d910b6dfd826
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
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
13 2.0.0 2020-10-30 Gundula Povysil -
0
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
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
26 import csv
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
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
33
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
34 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
35 import pysam
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
36 import xlsxwriter
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
37 from cyvcf2 import VCF
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
38
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
39
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
40 def make_argparser():
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
41 parser = argparse.ArgumentParser(description='Takes a VCF file with mutations, a BAM file and JSON files as input and prints stats about variants to a user specified output file.')
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
42 parser.add_argument('--mutFile',
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
43 help='VCF file with DCS mutations.')
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
44 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
45 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
46 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
47 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
48 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
49 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
50 parser.add_argument('--outputFile',
12
7a418148319d planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 11
diff changeset
51 help='Output xlsx file with summary of mutations.')
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
52 parser.add_argument('--outputFile_csv',
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
53 help='Output csv file with summary of mutations.')
12
7a418148319d planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 11
diff changeset
54 parser.add_argument('--outputFile2',
7a418148319d planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 11
diff changeset
55 help='Output xlsx file with allele frequencies of mutations.')
7a418148319d planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 11
diff changeset
56 parser.add_argument('--outputFile3',
7a418148319d planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 11
diff changeset
57 help='Output xlsx file with examples of the tier classification.')
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
58 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
59 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
60 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
61 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
62 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
63 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
64 parser.add_argument('--chimera_correction', action="store_true",
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
65 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
66 return parser
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
67
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
68
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
69 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
70 if y == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
71 return None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
72 return x / y
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
73
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
74
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
75 def read2mut(argv):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
76 parser = make_argparser()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
77 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
78 file1 = args.mutFile
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
79 file2 = args.bamFile
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
80 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
81 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
82 outfile = args.outputFile
12
7a418148319d planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 11
diff changeset
83 outfile2 = args.outputFile2
7a418148319d planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 11
diff changeset
84 outfile3 = args.outputFile3
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
85 outputFile_csv = args.outputFile_csv
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
86 thresh = args.thresh
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
87 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
88 trim = args.trim
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
89 chimera_correction = args.chimera_correction
14
bcdb63df70ce planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 13
diff changeset
90 delim_csv = args.delim_csv
0
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 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
93 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
94 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
95 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
96 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
97 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
98 if thresh < 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
99 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
100 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
101 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
102 if trim < 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
103 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
104
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
105 # load dicts
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
106 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
107 (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
108
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
109 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
110 (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
111
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
112 # 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
113 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
114
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
115 # create mut_dict
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
116 mut_dict = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
117 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
118 mut_read_dict = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
119 reads_dict = {}
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
120 i = 0
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
121 mut_array = []
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
122
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
123 for variant in VCF(file1):
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
124 chrom = variant.CHROM
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
125 stop_pos = variant.start
7
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
126 #chrom_stop_pos = str(chrom) + "#" + str(stop_pos)
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
127 ref = variant.REF
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
128 alt = variant.ALT[0]
7
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
129 chrom_stop_pos = str(chrom) + "#" + str(stop_pos) + "#" + ref + "#" + alt
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
130
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
131 if len(ref) == len(alt):
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
132 mut_array.append([chrom, stop_pos, ref, alt])
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
133 i += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
134 mut_dict[chrom_stop_pos] = {}
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
135 mut_read_pos_dict[chrom_stop_pos] = {}
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
136 reads_dict[chrom_stop_pos] = {}
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
137
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
138 for pileupcolumn in bam.pileup(chrom, stop_pos - 1, stop_pos + 1, max_depth=100000000):
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
139 if pileupcolumn.reference_pos == stop_pos:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
140 count_alt = 0
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
141 count_ref = 0
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
142 count_indel = 0
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
143 count_n = 0
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
144 count_other = 0
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
145 count_lowq = 0
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
146 n = 0
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
147 print("unfiltered reads=", pileupcolumn.n, "filtered reads=", len(pileupcolumn.pileups),
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
148 "difference= ", len(pileupcolumn.pileups) - pileupcolumn.n)
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
149 for pileupread in pileupcolumn.pileups:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
150 n += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
151 if not pileupread.is_del and not pileupread.is_refskip:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
152 tag = pileupread.alignment.query_name
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
153 nuc = pileupread.alignment.query_sequence[pileupread.query_position]
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
154 phred = ord(pileupread.alignment.qual[pileupread.query_position]) - 33
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
155 if phred < phred_score:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
156 nuc = "lowQ"
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
157 if tag not in mut_dict[chrom_stop_pos]:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
158 mut_dict[chrom_stop_pos][tag] = {}
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
159 if nuc in mut_dict[chrom_stop_pos][tag]:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
160 mut_dict[chrom_stop_pos][tag][nuc] += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
161 else:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
162 mut_dict[chrom_stop_pos][tag][nuc] = 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
163 if tag not in mut_read_pos_dict[chrom_stop_pos]:
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
164 mut_read_pos_dict[chrom_stop_pos][tag] = np.array(pileupread.query_position) + 1
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
165 reads_dict[chrom_stop_pos][tag] = len(pileupread.alignment.query_sequence)
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
166 else:
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
167 mut_read_pos_dict[chrom_stop_pos][tag] = np.append(
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
168 mut_read_pos_dict[chrom_stop_pos][tag], pileupread.query_position + 1)
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
169 reads_dict[chrom_stop_pos][tag] = np.append(
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
170 reads_dict[chrom_stop_pos][tag], len(pileupread.alignment.query_sequence))
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
171
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
172 if nuc == alt:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
173 count_alt += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
174 if tag not in mut_read_dict:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
175 mut_read_dict[tag] = {}
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
176 mut_read_dict[tag][chrom_stop_pos] = (alt, ref)
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
177 else:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
178 mut_read_dict[tag][chrom_stop_pos] = (alt, ref)
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
179 elif nuc == ref:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
180 count_ref += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
181 elif nuc == "N":
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
182 count_n += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
183 elif nuc == "lowQ":
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
184 count_lowq += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
185 else:
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
186 count_other += 1
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
187 else:
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
188 count_indel += 1
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
189
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
190 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))
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
191 else:
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
192 print("indels are currently not evaluated")
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
193
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
194 mut_array = np.array(mut_array)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
195 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
196 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
197 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
198 nuc = "na"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
199 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
200 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
201 mut_dict[key] = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
202 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
203 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
204 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
205 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
206 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
207 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
208 bam.close()
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
209
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
210 # create pure_tags_dict
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 = {}
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
212 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
213 i = np.where(np.array(['#'.join(str(i) for i in z)
7
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
214 for z in zip(mut_array[:, 0], mut_array[:, 1], mut_array[:, 2], mut_array[:, 3])]) == key1)[0][0]
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
215 ref = mut_array[i, 2]
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
216 alt = mut_array[i, 3]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
217 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
218 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
219 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
220 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
221 if key3 == alt:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
222 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
223 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
224 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
225 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
226
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
227 # create pure_tags_dict_short with thresh
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
228 if thresh > 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
229 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
230 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
231 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
232 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
233 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
234 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
235
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
236 csv_data = open(outputFile_csv, "w")
17
f06067bedfc5 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 16
diff changeset
237 csv_writer = csv.writer(csv_data, delimiter=",")
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
238
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
239 # output summary with threshold
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
240 workbook = xlsxwriter.Workbook(outfile)
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
241 workbook2 = xlsxwriter.Workbook(outfile2)
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
242 workbook3 = xlsxwriter.Workbook(outfile3)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
243 ws1 = workbook.add_worksheet("Results")
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
244 ws2 = workbook2.add_worksheet("Allele frequencies")
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
245 ws3 = workbook3.add_worksheet("Tiers")
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
246
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
247 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
248 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
249 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
250
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
251 format12 = workbook2.add_format({'bg_color': '#BCF5A9'}) # green
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
252 format22 = workbook2.add_format({'bg_color': '#FFC7CE'}) # red
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
253 format32 = workbook2.add_format({'bg_color': '#FACC2E'}) # yellow
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
254
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
255 format13 = workbook3.add_format({'bg_color': '#BCF5A9'}) # green
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
256 format23 = workbook3.add_format({'bg_color': '#FFC7CE'}) # red
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
257 format33 = workbook3.add_format({'bg_color': '#FACC2E'}) # yellow
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
258
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
259 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
260 '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
261 '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
262 '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
263 '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
264 '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
265 '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
266 ws1.write_row(0, 0, header_line)
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
267 csv_writer.writerow(header_line)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
268 counter_tier11 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
269 counter_tier12 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
270 counter_tier21 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
271 counter_tier22 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
272 counter_tier23 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
273 counter_tier24 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
274 counter_tier31 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
275 counter_tier32 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
276 counter_tier41 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
277 counter_tier42 = 0
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
278 counter_tier5 = 0
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
279 row = 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
280 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
281 chimera_dict = {}
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
282 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
283 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
284 chimeric_tag = {}
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
285 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
286 i = np.where(np.array(['#'.join(str(i) for i in z)
7
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
287 for z in zip(mut_array[:, 0], mut_array[:, 1], mut_array[:, 2], mut_array[:, 3])]) == key1)[0][0]
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
288 ref = mut_array[i, 2]
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
289 alt = mut_array[i, 3]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
290 dcs_median = cvrg_dict[key1][2]
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
291 whole_array = list(pure_tags_dict_short[key1].keys())
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
292
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
293 tier_dict[key1] = {}
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
294 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
295 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
296 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
297
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
298 used_keys = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
299 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
300 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
301 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
302 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
303 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
304 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
305 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
306 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
307 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
308 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
309 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
310 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
311 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
312 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
313 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
314 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
315 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
316 add_mut14 = ""
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
317 add_mut23 = ""
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
318 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
319 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
320 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
321 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
322 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
323 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
324 na1 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
325 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
326 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
327 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
328 lowq1 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
329 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
330 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
331 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
332 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
333 ref1 = ref1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
334 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
335 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
336 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
337 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
338 alt1 = alt1f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
339 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
340 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
341 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
342 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
343 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
344 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
345 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
346 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
347 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
348 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
349 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
350 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
351 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
352 k1 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
353 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
354 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
355 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
356 k1 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
357
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
358 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
359 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
360 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
361 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
362 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
363 na2 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
364 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
365 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
366 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
367 lowq2 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
368 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
369 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
370 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
371 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
372 ref2 = ref2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
373 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
374 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
375 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
376 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
377 alt2 = alt2f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
378 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
379 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
380 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
381 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
382 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
383 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
384 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
385 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
386 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
387 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
388 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
389 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
390 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
391 k2 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
392 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
393 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
394 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
395 k2 = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
396
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
397 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
398 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
399 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
400 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
401 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
402 na3 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
403 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
404 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
405 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
406 lowq3 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
407 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
408 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
409 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
410 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
411 ref3 = ref3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
412 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
413 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
414 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
415 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
416 alt3 = alt3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
417 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
418 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
419 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
420 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
421 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
422 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
423 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
424 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
425 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
426 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
427 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
428 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
429 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
430 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
431
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
432 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
433 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
434 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
435 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
436 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
437 na4 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
438 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
439 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
440 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
441 lowq4 = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
442 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
443 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
444 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
445 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
446 ref4 = ref4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
447 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
448 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
449 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
450 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
451 alt4 = alt4f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
452 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
453 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
454 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
455 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
456 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
457 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
458 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
459 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
460 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
461 else:
4
386438cd4c3b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 3
diff changeset
462 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
463 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
464 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
465 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
466
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
467 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
468 read_len_median1 = read_len_median2 = read_len_median3 = read_len_median4 = 0
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
469
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
470 if key2[:-5] + '.ab.1' in mut_read_pos_dict[key1].keys():
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
471 read_pos1 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ab.1'])
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
472 read_len_median1 = np.median(reads_dict[key1][key2[:-5] + '.ab.1'])
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
473 if key2[:-5] + '.ab.2' in mut_read_pos_dict[key1].keys():
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
474 read_pos2 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ab.2'])
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
475 read_len_median2 = np.median(reads_dict[key1][key2[:-5] + '.ab.2'])
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
476 if key2[:-5] + '.ba.1' in mut_read_pos_dict[key1].keys():
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
477 read_pos3 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ba.1'])
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
478 read_len_median3 = np.median(reads_dict[key1][key2[:-5] + '.ba.1'])
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
479 if key2[:-5] + '.ba.2' in mut_read_pos_dict[key1].keys():
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
480 read_pos4 = np.median(mut_read_pos_dict[key1][key2[:-5] + '.ba.2'])
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
481 read_len_median4 = np.median(reads_dict[key1][key2[:-5] + '.ba.2'])
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
482
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
483 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
484 counts_mut += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
485 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
486 if total1new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
487 ref1f = alt1f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
488 alt1ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
489 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
490 alt1ff = alt1f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
491 if total2new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
492 ref2f = alt2f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
493 alt2ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
494 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
495 alt2ff = alt2f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
496 if total3new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
497 ref3f = alt3f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
498 alt3ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
499 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
500 alt3ff = alt3f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
501 if total4new == 0:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
502 ref4f = alt4f = None
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
503 alt4ff = -1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
504 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
505 alt4ff = alt4f
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
506
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
507 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
508
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
509 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
510 details2 = (total2, total3, total2new, total3new, ref2, ref3, alt2, alt3, ref2f, ref3f, alt2f, alt3f, na2, na3, lowq2, lowq3, beg2, beg3)
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
511
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
512 trimmed = False
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
513 contradictory = False
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
514
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
515 if ((all(float(ij) >= 0.5 for ij in [alt1ff, alt4ff]) & all(float(ij) == 0. for ij in [alt2ff, alt3ff])) | (all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]) & all(float(ij) == 0. for ij in [alt1ff, alt4ff]))):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
516 alt1ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
517 alt4ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
518 alt2ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
519 alt3ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
520 trimmed = False
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
521 contradictory = True
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
522 else:
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
523 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
524 beg1 = total1new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
525 total1new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
526 alt1ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
527 alt1f = 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_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
531 beg4 = total4new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
532 total4new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
533 alt4ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
534 alt4f = 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
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
536
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
537 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
538 beg2 = total2new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
539 total2new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
540 alt2ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
541 alt2f = 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
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
543
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
544 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
545 beg3 = total3new
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
546 total3new = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
547 alt3ff = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
548 alt3f = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
549 trimmed = True
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
550 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
551 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
552
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
553 # assign tiers
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
554 if ((all(int(ij) >= 3 for ij in [total1new, total4new]) & all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff])) | (all(int(ij) >= 3 for ij in [total2new, total3new]) & all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
555 tier = "1.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
556 counter_tier11 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
557 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
558
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
559 elif (all(int(ij) >= 1 for ij in [total1new, total2new, total3new, total4new]) & any(int(ij) >= 3 for ij in [total1new, total4new])
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
560 & any(int(ij) >= 3 for ij in [total2new, total3new]) & all(float(ij) >= 0.75 for ij in [alt1ff, alt2ff, alt3ff, alt4ff])):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
561 tier = "1.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
562 counter_tier12 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
563 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
564
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
565 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) & any(int(ij) >= 3 for ij in [total1new, total4new]) & all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff]))
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
566 | (all(int(ij) >= 1 for ij in [total2new, total3new]) & any(int(ij) >= 3 for ij in [total2new, total3new]) & all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
567 tier = "2.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
568 counter_tier21 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
569 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
570
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
571 elif (all(int(ij) >= 1 for ij in [total1new, total2new, total3new, total4new]) & all(float(ij) >= 0.75 for ij in [alt1ff, alt2ff, alt3ff, alt4ff])):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
572 tier = "2.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
573 counter_tier22 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
574 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
575
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
576 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) & any(int(ij) >= 3 for ij in [total2new, total3new]) & all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff]) & any(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
577 | (all(int(ij) >= 1 for ij in [total2new, total3new]) & any(int(ij) >= 3 for ij in [total1new, total4new]) & all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]) & any(float(ij) >= 0.75 for ij in [alt1ff, alt4ff]))):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
578 tier = "2.3"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
579 counter_tier23 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
580 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
581
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
582 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) & all(float(ij) >= 0.75 for ij in [alt1ff, alt4ff]))
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
583 | (all(int(ij) >= 1 for ij in [total2new, total3new]) & all(float(ij) >= 0.75 for ij in [alt2ff, alt3ff]))):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
584 tier = "2.4"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
585 counter_tier24 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
586 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
587
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
588 elif ((len(pure_tags_dict_short[key1]) > 1) & (all(float(ij) >= 0.5 for ij in [alt1ff, alt4ff]) | all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]))):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
589 tier = "3.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
590 counter_tier31 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
591 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
592
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
593 elif ((all(int(ij) >= 1 for ij in [total1new, total4new]) & all(float(ij) >= 0.5 for ij in [alt1ff, alt4ff]))
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
594 | (all(int(ij) >= 1 for ij in [total2new, total3new]) & all(float(ij) >= 0.5 for ij in [alt2ff, alt3ff]))):
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
595 tier = "3.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
596 counter_tier32 += 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 3.2"] += 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 (trimmed):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
600 tier = "4.1"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
601 counter_tier41 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
602 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
603
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
604 elif (contradictory):
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
605 tier = "4.2"
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
606 counter_tier42 += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
607 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
608
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
609 else:
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
610 tier = "5"
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
611 counter_tier5 += 1
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
612 tier_dict[key1]["tier 5"] += 1
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
613
7
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
614 chrom, pos, ref_a, alt_a = re.split(r'\#', key1)
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
615 var_id = '-'.join([chrom, str(int(pos) + 1), ref, alt])
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
616 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
617 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
618 # 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
619 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
620 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
621 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
622 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
623 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
624 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
625 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
626 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
627 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
628
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
629 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
630 chimera_tags = []
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
631 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
632 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
633 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
634 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
635 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
636 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
637 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
638 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
639 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
640 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
641 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
642 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
643 # calculate HD of "a" in the tag to all "a's" or "b" in the tag to all "b's"
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
644 dist = np.array([sum(map(operator.ne, half1_mate1, c)) for c in half1_mate2])
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
645 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
646 # 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
647 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
648 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
649 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
650 # calculate HD of "b" to all "b's" or "a" to all "a's"
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
651 dist_second_half = np.array([sum(map(operator.ne, half2_mate1, e))
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
652 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
653
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
654 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
655 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
656 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
657
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
658 # 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
659 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
660 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
661 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
662
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
663 i += 1
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
664 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
665 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
666 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
667 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
668 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
669 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
670 else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
671 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
672 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
673 else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
674 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
675 chimera = ""
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
676
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
677 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
678 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
679 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
680 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
681 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
682 else:
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
683 chimeric_tag[key_chimera] = [float(tier)]
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
684
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
685 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
686 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
687 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
688 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
689 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
690 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
691 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
692 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
693 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
694 ws1.write_row(row, 0, line)
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
695 csv_writer.writerow(line)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
696 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
697 ws1.write_row(row + 1, 0, line)
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
698 csv_writer.writerow(line)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
699
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
700 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
701 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
702 '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
703 'format': format1,
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
704 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
705 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
706 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
707 '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
708 'format': format3,
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
709 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
710 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
711 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
712 '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
713 'format': format2,
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
714 'multi_range': 'L{}:M{} T{}:U{} B{}'.format(row + 1, row + 2, row + 1, row + 2, row + 1)})
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
715 row += 3
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
716
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
717 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
718 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
719 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
720 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
721 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
722 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
723 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
724 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
725 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
726 else:
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
727 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
728 chimera_dict[key1] = (chimeric_dcs, chimeric_dcs_high_tiers)
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
729
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
730 # sheet 2
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
731 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
732 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)',
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
733 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4',
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
734 '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',
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
735 '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
736 else:
2
9d74f30275c6 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 0
diff changeset
737 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)',
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
738 'tier 1.1', 'tier 1.2', 'tier 2.1', 'tier 2.2', 'tier 2.3', 'tier 2.4',
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
739 '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',
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
740 '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
741
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
742 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
743 row = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
744
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
745 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
746 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
747 i = np.where(np.array(['#'.join(str(i) for i in z)
7
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
748 for z in zip(mut_array[:, 0], mut_array[:, 1], mut_array[:, 2], mut_array[:, 3])]) == key1)[0][0]
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
749 ref = mut_array[i, 2]
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
750 alt = mut_array[i, 3]
7
ded0dc6a20d3 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 6
diff changeset
751 chrom, pos, ref_a, alt_a = re.split(r'\#', key1)
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
752 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
753 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
754 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
755
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
756 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
757 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
758 used_tiers = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
759 cum_af = []
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
760 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
761 # calculate cummulative AF
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
762 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
763 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
764 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
765 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
766 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
767 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
768 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
769 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
770 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
771 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
772 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
773 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
774 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
775 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
776 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
777 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
778 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
779 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
780 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
781 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
782 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
783 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
784 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
785 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
786 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
787 lst = tuple(lst)
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
788 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
789 if chimera_correction:
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
790 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)})
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
791 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)})
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
792 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
793 else:
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
794 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)})
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
795 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)})
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
796 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)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
797 row += 1
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
798
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
799 # 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
800 sheet3 = [("tier 1.1", counter_tier11), ("tier 1.2", counter_tier12), ("tier 2.1", counter_tier21),
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
801 ("tier 2.2", counter_tier22), ("tier 2.3", counter_tier23), ("tier 2.4", counter_tier24),
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
802 ("tier 3.1", counter_tier31), ("tier 3.2", counter_tier32), ("tier 4.1", counter_tier41),
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
803 ("tier 4.2", counter_tier42), ("tier 5", counter_tier5)]
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
804
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
805 header = ("tier", "count")
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
806 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
807
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
808 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
809 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
810 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
811 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
812 '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
813 'format': format1})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
814 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
815 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
816 '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
817 'format': format3})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
818 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
819 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
820 '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
821 'format': format2})
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
822
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
823 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
824 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
825 "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
826 "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
827 ("", "", "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
828 "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
829 "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
830 [("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
831 "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
832 "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
833 ("", "", "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
834 "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
835 "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
836 [("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
837 "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
838 "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
839 ("", "", "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
840 "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
841 "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
842 [("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
843 "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
844 "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
845 ("", "", "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
846 "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
847 "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
848 [("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
849 "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
850 "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
851 ("", "", "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
852 "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
853 "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
854 [("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
855 "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
856 "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
857 ("", "", "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
858 "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
859 "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
860 [("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
861 "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
862 "4098", "5", "10", "", ""),
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
863 ("", "", "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
864 "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
865 "4098", "5", "10", "", "")],
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
866 [("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
867 "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
868 "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
869 ("", "", "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
870 "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
871 "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
872 [("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
873 "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
874 "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
875 ("", "", "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
876 "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
877 "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
878 [("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
879 "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
880 ("", "", "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
881 "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
882 "0", "0", "0", "0", "0", "1", "1", "5348", "5350", "", "")],
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
883 [("Chr5:5-20000-13963-T-C", "4.2", "TTTTTAAGAATAACCCACAC", "ab1.ba2", "38", "38", "240", "283", "263",
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
884 "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
885 "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
886 ("", "", "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
887 "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
888 "0", "0", "0", "0", "0", "0", "0", "1", "1", "5348", "5350", "", "")],
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
889 [("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
890 "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
891 "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
892 ("", "", "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
893 "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
894 "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
895
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
896 start_row = 15
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
897 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
898 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
899 row = 0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
900 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
901 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
902 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
903 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
904 ws3.write_row(start_row + 2 + row + i + k + 2, 0, ex[k])
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
905 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)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
906 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
907 {'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),
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
908 'format': format3,
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
909 '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)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
910 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
911 {'type': 'formula',
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
912 'criteria': '=$B${}>="3"'.format(start_row + 2 + row + i + k + 2),
11
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
913 'format': format2,
84a1a3f70407 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 10
diff changeset
914 '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)})
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
915 row += 3
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
916 workbook.close()
6
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
917 workbook2.close()
11a2a34f8a2b planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 5
diff changeset
918 workbook3.close()
13
02bf6425fc25 planemo upload for repository https://github.com/Single-Molecule-Genetics/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents: 12
diff changeset
919 csv_data.close()
0
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
920
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
921
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
922 if __name__ == '__main__':
e5953c54cfb5 planemo upload for repository https://github.com/gpovysil/VariantAnalyzerGalaxy/tree/master/tools/variant_analyzer commit ee4a8e6cf290e6c8a4d55f9cd2839d60ab3b11c8
mheinzl
parents:
diff changeset
923 sys.exit(read2mut(sys.argv))