annotate fsd.py @ 44:a76af7fd9fca draft

planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
author mheinzl
date Wed, 14 Aug 2019 13:03:14 -0400
parents f72593bcc8ee
children 6651e76baca1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
1 #!/usr/bin/env python
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
2
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
3 # Family size distribution of SSCSs
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
4 #
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
5 # Author: Monika Heinzl, Johannes-Kepler University Linz (Austria)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
6 # Contact: monika.heinzl@edumail.at
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
7 #
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
8 # Takes at least one TABULAR file with tags before the alignment to the SSCS, but up to 4 files can be provided, as input.
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
9 # The program produces a plot which shows the distribution of family sizes of the all SSCSs from the input files and
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
10 # a tabular file with the data of the plot, as well as a TXT file with all tags of the DCS and their family sizes.
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
11 # If only one file is provided, then a family size distribution, which is separated after SSCSs without a partner and DCSs, is produced.
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
12 # Whereas a family size distribution with multiple data in one plot is produced, when more than one file (up to 4) is given.
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
13
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
14 # USAGE: python FSD_Galaxy_1.4_commandLine_FINAL.py --inputFile1 filename --inputName1 filename --inputFile2 filename2 --inputName2 filename2 --inputFile3 filename3 --inputName3 filename3 --inputFile4 filename4 --inputName4 filename4 --log_axis --output_tabular outptufile_name_tabular --output_pdf outptufile_name_pdf
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
15
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
16 import argparse
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
17 import sys
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
18 import os
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
19
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
20 import matplotlib.pyplot as plt
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
21 import numpy
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
22 from matplotlib.backends.backend_pdf import PdfPages
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
23
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
24 plt.switch_backend('agg')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
25
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
26
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
27 def readFileReferenceFree(file):
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
28 with open(file, 'r') as dest_f:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
29 data_array = numpy.genfromtxt(dest_f, skip_header=0, delimiter='\t', comments='#', dtype='string')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
30 return(data_array)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
31
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
32
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
33 def make_argparser():
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
34 parser = argparse.ArgumentParser(description='Family Size Distribution of duplex sequencing data')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
35 parser.add_argument('--inputFile1', help='Tabular File with three columns: ab or ba, tag and family size.')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
36 parser.add_argument('--inputName1')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
37 parser.add_argument('--inputFile2', default=None, help='Tabular File with three columns: ab or ba, tag and family size.')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
38 parser.add_argument('--inputName2')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
39 parser.add_argument('--inputFile3', default=None, help='Tabular File with three columns: ab or ba, tag and family size.')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
40 parser.add_argument('--inputName3')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
41 parser.add_argument('--inputFile4', default=None, help='Tabular File with three columns: ab or ba, tag and family size.')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
42 parser.add_argument('--inputName4')
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
43 parser.add_argument('--log_axis', action="store_false", help='Transform y axis in log scale.')
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
44 parser.add_argument('--output_pdf', default="data.pdf", type=str, help='Name of the pdf file.')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
45 parser.add_argument('--output_tabular', default="data.tabular", type=str, help='Name of the tabular file.')
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
46 return parser
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
47
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
48
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
49 def compare_read_families(argv):
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
50
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
51 parser = make_argparser()
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
52 args = parser.parse_args(argv[1:])
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
53
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
54 firstFile = args.inputFile1
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
55 name1 = args.inputName1
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
56
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
57 secondFile = args.inputFile2
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
58 name2 = args.inputName2
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
59 thirdFile = args.inputFile3
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
60 name3 = args.inputName3
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
61 fourthFile = args.inputFile4
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
62 name4 = args.inputName4
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
63 log_axis = args.log_axis
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
64
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
65 title_file = args.output_tabular
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
66 title_file2 = args.output_pdf
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
67
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
68 sep = "\t"
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
69
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
70 plt.rc('figure', figsize=(11.69, 8.27)) # A4 format
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
71 plt.rcParams['patch.edgecolor'] = "black"
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
72 plt.rcParams['axes.facecolor'] = "E0E0E0" # grey background color
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
73 plt.rcParams['xtick.labelsize'] = 14
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
74 plt.rcParams['ytick.labelsize'] = 14
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
75
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
76 list_to_plot = []
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
77 label = []
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
78 data_array_list = []
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
79 list_to_plot_original = []
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
80 colors = []
21
89ddbe5ae2aa planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 20
diff changeset
81 bins = numpy.arange(1, 22)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
82 with open(title_file, "w") as output_file, PdfPages(title_file2) as pdf:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
83 fig = plt.figure()
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
84 fig.subplots_adjust(left=0.12, right=0.97, bottom=0.23, top=0.94, hspace=0)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
85 fig2 = plt.figure()
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
86 fig2.subplots_adjust(left=0.12, right=0.97, bottom=0.23, top=0.94, hspace=0)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
87
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
88 # plt.subplots_adjust(bottom=0.25)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
89 if firstFile != str(None):
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
90 file1 = readFileReferenceFree(firstFile)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
91 integers = numpy.array(file1[:, 0]).astype(int) # keep original family sizes
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
92 list_to_plot_original.append(integers)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
93 colors.append("#0000FF")
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
94
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
95 # for plot: replace all big family sizes by 22
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
96 # data1 = numpy.array(file1[:, 0]).astype(int)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
97 # bigFamilies = numpy.where(data1 > 20)[0]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
98 # data1[bigFamilies] = 22
20
64f0362c974e planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 19
diff changeset
99 data1 = numpy.clip(integers, bins[0], bins[-1])
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
100 name1 = name1.split(".tabular")[0]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
101 list_to_plot.append(data1)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
102 label.append(name1)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
103 data_array_list.append(file1)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
104
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
105 legend = "\n\n\n{}".format(name1)
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
106 fig.text(0.05, 0.11, legend, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
107 fig2.text(0.05, 0.11, legend, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
108
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
109 legend1 = "singletons:\nnr. of tags\n{:,} ({:.3f})".format(numpy.bincount(data1)[1], float(numpy.bincount(data1)[1]) / len(data1))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
110 fig.text(0.32, 0.11, legend1, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
111 fig2.text(0.32, 0.11, legend1, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
112
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
113 legend3b = "PE reads\n{:,} ({:.3f})".format(numpy.bincount(data1)[1], float(numpy.bincount(data1)[1]) / sum(integers))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
114 fig.text(0.45, 0.11, legend3b, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
115 fig2.text(0.45, 0.11, legend3b, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
116
41
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
117 legend4 = "family size > 20:\nnr. of tags\n{:,} ({:.3f})".format(len(integers[integers > 20]),
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
118 float(sum(integers[integers > 20]))
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
119 / sum(integers))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
120 fig.text(0.58, 0.11, legend4, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
121 fig2.text(0.58, 0.11, legend4, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
122
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
123 legend5 = "PE reads\n{:,} ({:.3f})".format(sum(integers[integers > 20]), float(sum(integers[integers > 20])) / sum(integers))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
124 fig.text(0.70, 0.11, legend5, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
125 fig2.text(0.70, 0.11, legend5, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
126
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
127 legend6 = "total nr. of\ntags\n{:,}".format(len(data1))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
128 fig.text(0.82, 0.11, legend6, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
129 fig2.text(0.82, 0.11, legend6, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
130
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
131 legend6b = "PE reads\n{:,}".format(sum(integers))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
132 fig.text(0.89, 0.11, legend6b, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
133 fig2.text(0.89, 0.11, legend6b, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
134
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
135 if secondFile != str(None):
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
136 file2 = readFileReferenceFree(secondFile)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
137 integers2 = numpy.array(file2[:, 0]).astype(int) # keep original family sizes
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
138 list_to_plot_original.append(integers2)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
139 colors.append("#298A08")
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
140
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
141 # data2 = numpy.asarray(file2[:, 0]).astype(int)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
142 # bigFamilies2 = numpy.where(data2 > 20)[0]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
143 # data2[bigFamilies2] = 22
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
144
20
64f0362c974e planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 19
diff changeset
145 data2 = numpy.clip(integers2, bins[0], bins[-1])
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
146 list_to_plot.append(data2)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
147 name2 = name2.split(".tabular")[0]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
148 label.append(name2)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
149 data_array_list.append(file2)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
150
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
151 fig.text(0.05, 0.09, name2, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
152 fig2.text(0.05, 0.09, name2, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
153
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
154 legend1 = "{:,} ({:.3f})".format(numpy.bincount(data2)[1], float(numpy.bincount(data2)[1]) / len(data2))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
155 fig.text(0.32, 0.09, legend1, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
156 fig2.text(0.32, 0.09, legend1, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
157
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
158 legend3 = "{:,} ({:.3f})".format(numpy.bincount(data2)[1], float(numpy.bincount(data2)[1]) / sum(integers2))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
159 fig.text(0.45, 0.09, legend3, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
160 fig2.text(0.45, 0.09, legend3, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
161
41
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
162 legend4 = "{:,} ({:.3f})".format(len(integers2[integers2 > 20]), float(sum(integers2[integers2 > 20])) / sum(integers2))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
163 fig.text(0.58, 0.09, legend4, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
164 fig2.text(0.58, 0.09, legend4, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
165
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
166 legend5 = "{:,} ({:.3f})".format(sum(integers2[integers2 > 20]), float(sum(integers2[integers2 > 20])) / sum(integers2))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
167 fig.text(0.70, 0.09, legend5, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
168 fig2.text(0.70, 0.09, legend5, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
169
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
170 legend6 = "{:,}".format(len(data2))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
171 fig.text(0.82, 0.09, legend6, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
172 fig2.text(0.82, 0.09, legend6, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
173
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
174 legend6b = "{:,}".format(sum(integers2))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
175 fig.text(0.89, 0.09, legend6b, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
176 fig2.text(0.89, 0.09, legend6b, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
177
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
178 if thirdFile != str(None):
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
179 file3 = readFileReferenceFree(thirdFile)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
180 integers3 = numpy.array(file3[:, 0]).astype(int) # keep original family sizes
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
181 list_to_plot_original.append(integers3)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
182 colors.append("#DF0101")
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
183
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
184 # data3 = numpy.asarray(file3[:, 0]).astype(int)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
185 # bigFamilies3 = numpy.where(data3 > 20)[0]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
186 # data3[bigFamilies3] = 22
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
187
20
64f0362c974e planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 19
diff changeset
188 data3 = numpy.clip(integers3, bins[0], bins[-1])
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
189 list_to_plot.append(data3)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
190 name3 = name3.split(".tabular")[0]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
191 label.append(name3)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
192 data_array_list.append(file3)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
193
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
194 fig.text(0.05, 0.07, name3, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
195 fig2.text(0.05, 0.07, name3, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
196
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
197 legend1 = "{:,} ({:.3f})".format(numpy.bincount(data3)[1], float(numpy.bincount(data3)[1]) / len(data3))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
198 fig.text(0.32, 0.07, legend1, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
199 fig2.text(0.32, 0.07, legend1, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
200
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
201 legend3b = "{:,} ({:.3f})".format(numpy.bincount(data3)[1], float(numpy.bincount(data3)[1]) / sum(integers3))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
202 fig.text(0.45, 0.07, legend3b, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
203 fig2.text(0.45, 0.07, legend3b, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
204
41
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
205 legend4 = "{:,} ({:.3f})".format(len(integers3[integers3 > 20]), float(sum(integers3[integers3 > 20])) / sum(integers3))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
206 fig.text(0.58, 0.07, legend4, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
207 fig2.text(0.58, 0.07, legend4, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
208
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
209 legend5 = "{:,} ({:.3f})".format(sum(integers3[integers3 > 20]),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
210 float(sum(integers3[integers3 > 20])) / sum(integers3))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
211 fig.text(0.70, 0.07, legend5, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
212 fig2.text(0.70, 0.07, legend5, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
213
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
214 legend6 = "{:,}".format(len(data3))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
215 fig.text(0.82, 0.07, legend6, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
216 fig2.text(0.82, 0.07, legend6, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
217
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
218 legend6b = "{:,}".format(sum(integers3))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
219 fig.text(0.89, 0.07, legend6b, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
220 fig2.text(0.89, 0.07, legend6b, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
221
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
222 if fourthFile != str(None):
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
223 file4 = readFileReferenceFree(fourthFile)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
224 integers4 = numpy.array(file4[:, 0]).astype(int) # keep original family sizes
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
225 list_to_plot_original.append(integers4)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
226 colors.append("#04cec7")
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
227
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
228 # data4 = numpy.asarray(file4[:, 0]).astype(int)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
229 # bigFamilies4 = numpy.where(data4 > 20)[0]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
230 # data4[bigFamilies4] = 22
20
64f0362c974e planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 19
diff changeset
231 data4 = numpy.clip(integers4, bins[0], bins[-1])
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
232 list_to_plot.append(data4)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
233 name4 = name4.split(".tabular")[0]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
234 label.append(name4)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
235 data_array_list.append(file4)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
236
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
237 fig.text(0.05, 0.05, name4, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
238 fig2.text(0.05, 0.05, name4, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
239
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
240 legend1 = "{:,} ({:.3f})".format(numpy.bincount(data4)[1], float(numpy.bincount(data4)[1]) / len(data4))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
241 fig.text(0.32, 0.05, legend1, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
242 fig2.text(0.32, 0.05, legend1, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
243
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
244 legend3b = "{:,} ({:.3f})".format(numpy.bincount(data4)[1], float(numpy.bincount(data4)[1]) / sum(integers4))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
245 fig.text(0.45, 0.05, legend3b, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
246 fig2.text(0.45, 0.05, legend3b, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
247
41
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
248 legend4 = "{:,} ({:.3f})".format(len(integers4[integers4 > 20]), float(sum(integers4[integers4 > 20])) / sum(integers4))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
249 fig.text(0.58, 0.05, legend4, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
250 fig2.text(0.58, 0.05, legend4, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
251
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
252 legend5 = "{:,} ({:.3f})".format(sum(integers4[integers4 > 20]),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
253 float(sum(integers4[integers4 > 20])) / sum(integers4))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
254 fig.text(0.70, 0.05, legend5, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
255 fig2.text(0.70, 0.05, legend5, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
256
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
257 legend6 = "{:,}".format(len(data4))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
258 fig.text(0.82, 0.05, legend6, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
259 fig2.text(0.82, 0.05, legend6, size=10, transform=plt.gcf().transFigure)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
260
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
261 legend6b = "{:,}".format(sum(integers4))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
262 fig.text(0.89, 0.05, legend6b, size=10, transform=plt.gcf().transFigure)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
263 fig2.text(0.89, 0.05, legend6b, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
264
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
265 maximumX = numpy.amax(numpy.concatenate(list_to_plot))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
266 minimumX = numpy.amin(numpy.concatenate(list_to_plot))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
267 list_to_plot2 = list_to_plot
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
268 to_plot = ["Absolute frequencies", "Relative frequencies"]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
269 plt.xticks([], [])
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
270 plt.yticks([], [])
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
271 fig.suptitle('Family Size Distribution (tags)', fontsize=14)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
272
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
273 for l in range(len(to_plot)):
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
274 ax = fig.add_subplot(2, 1, l+1)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
275 ticks = numpy.arange(1, 22, 1)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
276 ticks1 = map(str, ticks)
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
277 ticks1[len(ticks1) - 1] = ">20"
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
278
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
279 if to_plot[l] == "Relative frequencies":
39
00f5ca6bb610 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty
mheinzl
parents: 38
diff changeset
280 w = [numpy.zeros_like(data) + 1. / len(data) for data in list_to_plot2]
00f5ca6bb610 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty
mheinzl
parents: 38
diff changeset
281 counts_rel = ax.hist(list_to_plot2, weights=w,
00f5ca6bb610 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty
mheinzl
parents: 38
diff changeset
282 bins=numpy.arange(1, 23), stacked=False, edgecolor="black",
00f5ca6bb610 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty
mheinzl
parents: 38
diff changeset
283 linewidth=1, label=label, align="left", alpha=0.7, rwidth=0.8)
41
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
284 ax.set_ylim(0, 1.07)
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
285 else:
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
286 counts = ax.hist(list_to_plot2, bins=numpy.arange(1, 23), stacked=False, edgecolor="black", linewidth=1, label=label, align="left", alpha=0.7, rwidth=0.8, color=colors)
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
287 ax.legend(loc='upper right', fontsize=14, frameon=True, bbox_to_anchor=(0.9, 1))
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
288
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
289 ax.set_xticks(numpy.array(ticks))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
290 ax.set_xticklabels(ticks1)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
291
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
292 ax.set_ylabel(to_plot[l], fontsize=14)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
293 ax.set_xlabel("Family size", fontsize=14)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
294 if log_axis:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
295 ax.set_yscale('log')
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
296 ax.grid(b=True, which="major", color="#424242", linestyle=":")
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
297 ax.margins(0.01, None)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
298 pdf.savefig(fig)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
299 plt.close()
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
300
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
301 fig2.suptitle('Family Size Distribution (PE reads)', fontsize=14)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
302 for l in range(len(to_plot)):
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
303 ax = fig2.add_subplot(2, 1, l + 1)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
304 ticks = numpy.arange(minimumX, maximumX + 1)
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
305 ticks = numpy.arange(1, 22)
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
306 ticks1 = map(str, ticks)
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
307 ticks1[len(ticks1) - 1] = ">20"
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
308 reads = []
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
309 reads_rel = []
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
310
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
311 barWidth = 0 - (len(list_to_plot)+1)/2 * 1./(len(list_to_plot)+1)
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
312
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
313 for i in range(len(list_to_plot2)):
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
314 x = list(numpy.arange(1, 22).astype(float))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
315 unique, c = numpy.unique(list_to_plot2[i], return_counts=True)
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
316 y = unique * c
41
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
317 if sum(list_to_plot_original[i] > 20) > 0:
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
318 y[len(y) - 1] = sum(list_to_plot_original[i][list_to_plot_original[i] > 20])
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
319 y = [y[x[idx] == unique][0] if x[idx] in unique else 0 for idx in range(len(x))]
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
320 reads.append(y)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
321 reads_rel.append(list(numpy.float_(y)) / sum(y))
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
322 #x = [xi + barWidth for xi in x]
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
323
22
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
324 if len(list_to_plot2) == 1:
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
325 x = [xi * 0.5 for xi in x]
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
326 w = 0.4
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
327 else:
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
328 x = [xi + barWidth for xi in x]
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
329 w = 1./(len(list_to_plot) + 1)
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
330 if to_plot[l] == "Relative frequencies":
39
00f5ca6bb610 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty
mheinzl
parents: 38
diff changeset
331 counts2_rel = ax.bar(x, list(numpy.float_(y)) / numpy.sum(y), align="edge", width=w,
00f5ca6bb610 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty
mheinzl
parents: 38
diff changeset
332 edgecolor="black", label=label[i],linewidth=1, alpha=0.7, color=colors[i])
41
54f0dac1c834 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 39
diff changeset
333 ax.set_ylim(0, 1.07)
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
334 else:
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
335 #y = list(y.reshape((len(y))))
36
54ba0ad1263f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 35
diff changeset
336 counts2 = ax.bar(x, y, align="edge", width=w, edgecolor="black", label=label[i], linewidth=1,
39
00f5ca6bb610 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 5b3ab8c6467fe3a52e89f5a7d175bd8a0189018a-dirty
mheinzl
parents: 38
diff changeset
337 alpha=0.7, color=colors[i])
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
338 if i == len(list_to_plot2)-1:
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
339 barWidth += 1. / (len(list_to_plot) + 1) + 1. / (len(list_to_plot) + 1)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
340 else:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
341 barWidth += 1. / (len(list_to_plot) + 1)
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
342
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
343 if to_plot[l] == "Absolute frequencies":
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
344 ax.legend(loc='upper right', fontsize=14, frameon=True, bbox_to_anchor=(0.9, 1))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
345 else:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
346 ax.set_xlabel("Family size", fontsize=14)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
347
22
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
348 if len(list_to_plot2) == 1:
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
349 ax.set_xticks(numpy.array([xi + 0.2 for xi in x]))
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
350 else:
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
351 ax.set_xticks(numpy.array(ticks))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
352 ax.set_xticklabels(ticks1)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
353 ax.set_ylabel(to_plot[l], fontsize=14)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
354 if log_axis:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
355 ax.set_yscale('log')
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
356 ax.grid(b=True, which="major", color="#424242", linestyle=":")
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
357 ax.margins(0.01, None)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
358
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
359 pdf.savefig(fig2)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
360 plt.close()
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
361
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
362 # write data to CSV file tags
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
363 output_file.write("Values from family size distribution with all datasets (tags)\n")
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
364 output_file.write("\nFamily size")
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
365 for i in label:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
366 output_file.write("{}{}".format(sep, i))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
367 # output_file.write("{}sum".format(sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
368 output_file.write("\n")
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
369 j = 0
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
370 for fs in counts[1][0:len(counts[1]) - 1]:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
371 if fs == 21:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
372 fs = ">20"
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
373 else:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
374 fs = "={}".format(fs)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
375 output_file.write("FS{}{}".format(fs, sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
376 if len(label) == 1:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
377 output_file.write("{}{}".format(int(counts[0][j]), sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
378 else:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
379 for n in range(len(label)):
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
380 output_file.write("{}{}".format(int(counts[0][n][j]), sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
381 output_file.write("\n")
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
382 j += 1
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
383 output_file.write("sum{}".format(sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
384 if len(label) == 1:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
385 output_file.write("{}{}".format(int(sum(counts[0])), sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
386 else:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
387 for i in counts[0]:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
388 output_file.write("{}{}".format(int(sum(i)), sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
389
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
390 # write data to CSV file PE reads
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
391 output_file.write("\n\nValues from family size distribution with all datasets (PE reads)\n")
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
392 output_file.write("\nFamily size")
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
393 for i in label:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
394 output_file.write("{}{}".format(sep, i))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
395 # output_file.write("{}sum".format(sep))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
396 output_file.write("\n")
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
397 j = 0
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
398
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
399 for fs in bins:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
400 if fs == 21:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
401 fs = ">20"
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
402 else:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
403 fs = "={}".format(fs)
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
404 output_file.write("FS{}{}".format(fs, sep))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
405 if len(label) == 1:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
406 output_file.write("{}{}".format(int(reads[0][j]), sep))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
407 else:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
408 for n in range(len(label)):
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
409 output_file.write("{}{}".format(int(reads[n][j]), sep))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
410 output_file.write("\n")
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
411 j += 1
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
412 output_file.write("sum{}".format(sep))
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
413 if len(label) == 1:
22
5e650e66e058 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 21
diff changeset
414 output_file.write("{}{}".format(int(sum(numpy.concatenate(reads))), sep))
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
415 else:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
416 for i in reads:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
417 output_file.write("{}{}".format(int(sum(i)), sep))
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
418 output_file.write("\n")
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
419
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
420 # Family size distribution after DCS and SSCS
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
421 for dataset, data_o, name_file in zip(list_to_plot, data_array_list, label):
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
422 maximumX = numpy.amax(dataset)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
423 minimumX = numpy.amin(dataset)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
424
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
425 tags = numpy.array(data_o[:, 2])
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
426 seq = numpy.array(data_o[:, 1])
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
427 data = numpy.array(dataset)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
428 data_o = numpy.array(data_o[:, 0]).astype(int)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
429 # find all unique tags and get the indices for ALL tags, but only once
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
430 u, index_unique, c = numpy.unique(numpy.array(seq), return_counts=True, return_index=True)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
431 d = u[c > 1]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
432
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
433 # get family sizes, tag for duplicates
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
434 duplTags_double = data[numpy.in1d(seq, d)]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
435 duplTags_double_o = data_o[numpy.in1d(seq, d)]
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
436
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
437 duplTags = duplTags_double[0::2] # ab of DCS
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
438 duplTags_o = duplTags_double_o[0::2] # ab of DCS
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
439
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
440 duplTagsBA = duplTags_double[1::2] # ba of DCS
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
441 duplTagsBA_o = duplTags_double_o[1::2] # ba of DCS
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
442
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
443 # duplTags_double_tag = tags[numpy.in1d(seq, d)]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
444 # duplTags_double_seq = seq[numpy.in1d(seq, d)]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
445
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
446 # get family sizes for SSCS with no partner
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
447 ab = numpy.where(tags == "ab")[0]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
448 abSeq = seq[ab]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
449 ab_o = data_o[ab]
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
450 ab = data[ab]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
451
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
452 ba = numpy.where(tags == "ba")[0]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
453 baSeq = seq[ba]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
454 ba_o = data_o[ba]
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
455 ba = data[ba]
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
456
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
457 dataAB = ab[numpy.in1d(abSeq, d, invert=True)]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
458 dataAB_o = ab_o[numpy.in1d(abSeq, d, invert=True)]
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
459
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
460 dataBA = ba[numpy.in1d(baSeq, d, invert=True)]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
461 dataBA_o = ba_o[numpy.in1d(baSeq, d, invert=True)]
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
462
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
463 list1 = [duplTags_double, dataAB, dataBA] # list for plotting
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
464
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
465 # information for family size >= 3
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
466 dataAB_FS3 = dataAB[dataAB >= 3]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
467 dataAB_FS3_o = dataAB_o[dataAB_o >= 3]
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
468 dataBA_FS3 = dataBA[dataBA >= 3]
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
469 dataBA_FS3_o = dataBA_o[dataBA_o >= 3]
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
470 # ab_FS3 = ab[ab >= 3]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
471 # ba_FS3 = ba[ba >= 3]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
472 # ab_FS3_o = ab_o[ab_o >= 3]
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
473 # ba_FS3_o = ba_o[ba_o >= 3]
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
474
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
475 duplTags_FS3 = duplTags[(duplTags >= 3) & (duplTagsBA >= 3)] # ab+ba with FS>=3
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
476 duplTags_FS3_BA = duplTagsBA[(duplTags >= 3) & (duplTagsBA >= 3)] # ba+ab with FS>=3
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
477 duplTags_double_FS3 = len(duplTags_FS3) + len(duplTags_FS3_BA) # both ab and ba strands with FS>=3
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
478
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
479 # original FS
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
480 duplTags_FS3_o = duplTags_o[(duplTags_o >= 3) & (duplTagsBA_o >= 3)] # ab+ba with FS>=3
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
481 duplTags_FS3_BA_o = duplTagsBA_o[(duplTags_o >= 3) & (duplTagsBA_o >= 3)] # ba+ab with FS>=3
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
482 duplTags_double_FS3_o = sum(duplTags_FS3_o) + sum(duplTags_FS3_BA_o) # both ab and ba strands with FS>=3
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
483
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
484 fig = plt.figure()
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
485 plt.subplots_adjust(left=0.12, right=0.97, bottom=0.3, top=0.94, hspace=0)
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
486 counts = plt.hist(list1, bins=numpy.arange(1, 23), stacked=True, label=["duplex", "ab", "ba"],
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
487 edgecolor="black", linewidth=1, align="left", color=["#FF0000", "#5FB404", "#FFBF00"],
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
488 rwidth=0.8)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
489 # tick labels of x axis
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
490 ticks = numpy.arange(1, 22, 1)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
491 ticks1 = map(str, ticks)
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
492 ticks1[len(ticks1) - 1] = ">20"
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
493 plt.xticks(numpy.array(ticks), ticks1)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
494 singl = counts[0][2][0] # singletons
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
495 last = counts[0][2][len(counts[0][0]) - 1] # large families
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
496 if log_axis:
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
497 plt.yscale('log')
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
498 plt.legend(loc='upper right', fontsize=14, bbox_to_anchor=(0.9, 1), frameon=True)
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
499 plt.title(name_file, fontsize=14)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
500 plt.xlabel("Family size", fontsize=14)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
501 plt.ylabel("Absolute Frequency", fontsize=14)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
502 plt.margins(0.01, None)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
503 plt.grid(b=True, which="major", color="#424242", linestyle=":")
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
504
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
505 # extra information beneath the plot
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
506 legend = "SSCS ab= \nSSCS ba= \nDCS (total)= \ntotal nr. of tags="
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
507 plt.text(0.1, 0.09, legend, size=10, transform=plt.gcf().transFigure)
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
508
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
509 legend = "nr. of tags\n\n{:,}\n{:,}\n{:,} ({:,})\n{:,} ({:,})".format(len(dataAB), len(dataBA), len(duplTags), len(duplTags_double), (len(dataAB) + len(dataBA) + len(duplTags)), (len(ab) + len(ba)))
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
510 plt.text(0.23, 0.09, legend, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
511
42
321a4871564b planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 41
diff changeset
512 legend5 = "PE reads\n\n{:,}\n{:,}\n{:,} ({:,})\n{:,} ({:,})".format(sum(dataAB_o), sum(dataBA_o), sum(duplTags_o), sum(duplTags_double_o), (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)), (sum(ab_o) + sum(ba_o)))
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
513 plt.text(0.38, 0.09, legend5, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
514
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
515 legend = "rel. freq. of tags\nunique\n{:.3f}\n{:.3f}\n{:.3f}\n{:,}".format(float(len(dataAB)) / (len(dataAB) + len(dataBA) + len(duplTags)), float(len(dataBA)) / (len(dataAB) + len(dataBA) + len(duplTags)), float(len(duplTags)) / (len(dataAB) + len(dataBA) + len(duplTags)), (len(dataAB) + len(dataBA) + len(duplTags)))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
516 plt.text(0.54, 0.09, legend, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
517
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
518 legend = "total\n{:.3f}\n{:.3f}\n{:.3f} ({:.3f})\n{:,}".format(float(len(dataAB)) / (len(ab) + len(ba)), float(len(dataBA)) / (len(ab) + len(ba)), float(len(duplTags)) / (len(ab) + len(ba)), float(len(duplTags_double)) / (len(ab) + len(ba)), (len(ab) + len(ba)))
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
519 plt.text(0.64, 0.09, legend, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
520
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
521 legend1 = "\nsingletons:\nfamily size > 20:"
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
522 plt.text(0.1, 0.03, legend1, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
523
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
524 legend4 = "{:,}\n{:,}".format(singl.astype(int), last.astype(int))
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
525 plt.text(0.23, 0.03, legend4, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
526
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
527 legend3 = "{:.3f}\n{:.3f}".format(singl / len(data), last / len(data))
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
528 plt.text(0.64, 0.03, legend3, size=10, transform=plt.gcf().transFigure)
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
529
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
530 legend3 = "\n\n{:,}".format(sum(data_o[data_o > 20]))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
531 plt.text(0.38, 0.03, legend3, size=10, transform=plt.gcf().transFigure)
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
532
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
533 legend3 = "{:.3f}\n{:.3f}".format(float(singl)/sum(data_o), float(sum(data_o[data_o > 20])) / sum(data_o))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
534 plt.text(0.84, 0.03, legend3, size=10, transform=plt.gcf().transFigure)
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
535
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
536 legend = "PE reads\nunique\n{:.3f}\n{:.3f}\n{:.3f}\n{:,}".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
537 float(sum(dataAB_o)) / (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
538 float(sum(dataBA_o)) / (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
539 float(sum(duplTags_o)) / (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
540 (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
541 plt.text(0.74, 0.09, legend, size=10, transform=plt.gcf().transFigure)
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
542
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
543 legend = "total\n{:.3f}\n{:.3f}\n{:.3f} ({:.3f})\n{:,}".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
544 float(sum(dataAB_o)) / (sum(ab_o) + sum(ba_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
545 float(sum(dataBA_o)) / (sum(ab_o) + sum(ba_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
546 float(sum(duplTags_o)) / (sum(ab_o) + sum(ba_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
547 float(sum(duplTags_double_o)) / (sum(ab_o) + sum(ba_o)), (sum(ab_o) + sum(ba_o)))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
548 plt.text(0.84, 0.09, legend, size=10, transform=plt.gcf().transFigure)
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
549
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
550 pdf.savefig(fig)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
551 plt.close()
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
552
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
553 # write same information to a csv file
44
a76af7fd9fca planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 43
diff changeset
554 count = numpy.bincount(data_o) # original counts of family sizes
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
555 output_file.write("\nDataset:{}{}\n".format(sep, name_file))
44
a76af7fd9fca planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 43
diff changeset
556 output_file.write("max. family size:{}{}\n".format(sep, max(data_o)))
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
557 output_file.write("absolute frequency:{}{}\n".format(sep, count[len(count) - 1]))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
558 output_file.write("relative frequency:{}{:.3f}\n\n".format(sep, float(count[len(count) - 1]) / sum(count)))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
559
44
a76af7fd9fca planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 43
diff changeset
560 output_file.write("median family size:{}{}\n".format(sep, numpy.median(numpy.array(data_o))))
a76af7fd9fca planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 43
diff changeset
561 output_file.write("mean family size:{}{}\n\n".format(sep, numpy.mean(numpy.array(data_o))))
43
f72593bcc8ee planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit 033dd7b750f68e8aa68f327d7d72bd311ddbee4e-dirty
mheinzl
parents: 42
diff changeset
562
18
c825a29a7d9f planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 17
diff changeset
563 output_file.write("{}singletons:{}{}{}family size > 20:{}{}{}{}length of dataset:\n".format(sep, sep, sep, sep, sep, sep, sep, sep))
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
564 output_file.write("{}nr. of tags{}rel. freq of tags{}rel.freq of PE reads{}nr. of tags{}rel. freq of tags{}nr. of PE reads{}rel. freq of PE reads{}total nr. of tags{}total nr. of PE reads\n".format(sep, sep, sep, sep, sep, sep, sep, sep, sep))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
565 output_file.write("{}{}{}{}{:.3f}{}{:.3f}{}{}{}{:.3f}{}{}{}{:.3f}{}{}{}{}\n\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
566 name_file, sep, singl.astype(int), sep, singl / len(data), sep, float(singl)/sum(data_o), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
567 last.astype(int), sep, last / len(data), sep, sum(data_o[data_o > 20]), sep, float(sum(data_o[data_o > 20])) / sum(data_o), sep, len(data), sep, sum(data_o)))
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
568
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
569 # information for FS >= 1
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
570 output_file.write("The unique frequencies were calculated from the dataset where the tags occured only once (=ab without DCS, ba without DCS)\n"
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
571 "Whereas the total frequencies were calculated from the whole dataset (=including the DCS).\n\n")
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
572 output_file.write("FS >= 1{}nr. of tags{}nr. of PE reads{}rel. freq of tags{}{}rel. freq of PE reads:\n".format(sep, sep, sep, sep, sep))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
573 output_file.write("{}{}{}unique:{}total{}unique{}total:\n".format(sep, sep, sep, sep, sep, sep))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
574 output_file.write("SSCS ab{}{}{}{}{}{:.3f}{}{:.3f}{}{:.3f}{}{:.3f}\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
575 sep, len(dataAB), sep, sum(dataAB_o), sep, float(len(dataAB)) / (len(dataAB) + len(dataBA) + len(duplTags)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
576 sep, float(sum(dataAB_o)) / (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
577 float(len(dataAB)) / (len(ab) + len(ba)), sep, float(sum(dataAB_o)) / (sum(ab_o) + sum(ba_o))))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
578 output_file.write("SSCS ba{}{}{}{}{}{:.3f}{}{:.3f}{}{:.3f}{}{:.3f}\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
579 sep, len(dataBA), sep, sum(dataBA_o), sep, float(len(dataBA)) / (len(dataBA) + len(dataBA) + len(duplTags)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
580 sep, float(sum(dataBA_o)) / (sum(dataBA_o) + sum(dataBA_o) + sum(duplTags_o)), sep, float(len(dataBA)) / (len(ba) + len(ba)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
581 sep, float(sum(dataBA_o)) / (sum(ba_o) + sum(ba_o))))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
582 output_file.write("DCS (total){}{} ({}){}{} ({}){}{:.3f}{}{:.3f} ({:.3f}){}{:.3f}{}{:.3f} ({:.3f})\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
583 sep, len(duplTags), len(duplTags_double), sep, sum(duplTags_o), sum(duplTags_double_o), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
584 float(len(duplTags)) / (len(dataAB) + len(dataBA) + len(duplTags)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
585 float(len(duplTags)) / (len(ab) + len(ba)), float(len(duplTags_double)) / (len(ab) + len(ba)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
586 float(sum(duplTags_o)) / (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
587 float(sum(duplTags_o)) / (sum(ab_o) + sum(ba_o)), float(sum(duplTags_double_o)) / (sum(ab_o) + sum(ba_o))))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
588 output_file.write("total nr. of tags{}{}{}{}{}{}{}{}{}{}{}{}\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
589 sep, (len(dataAB) + len(dataBA) + len(duplTags)), sep, (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
590 (len(dataAB) + len(dataBA) + len(duplTags)), sep, (len(ab) + len(ba)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
591 (sum(dataAB_o) + sum(dataBA_o) + sum(duplTags_o)), sep, (sum(ab_o) + sum(ba_o))))
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
592 # information for FS >= 3
17
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
593 output_file.write("\nFS >= 3{}nr. of tags{}nr. of PE reads{}rel. freq of tags{}{}rel. freq of PE reads:\n".format(sep, sep, sep, sep, sep))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
594 output_file.write("{}{}{}unique:{}total{}unique{}total:\n".format(sep, sep, sep, sep, sep, sep))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
595 output_file.write("SSCS ab{}{}{}{}{}{:.3f}{}{:.3f}{}{:.3f}{}{:.3f}\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
596 sep, len(dataAB_FS3), sep, sum(dataAB_FS3_o), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
597 float(len(dataAB_FS3)) / (len(dataAB_FS3) + len(dataBA_FS3) + len(duplTags_FS3)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
598 float(len(dataAB_FS3)) / (len(dataBA_FS3) + len(dataBA_FS3) + duplTags_double_FS3),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
599 sep, float(sum(dataAB_FS3_o)) / (sum(dataAB_FS3_o) + sum(dataBA_FS3_o) + sum(duplTags_FS3_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
600 sep, float(sum(dataAB_FS3_o)) / (sum(dataBA_FS3_o) + sum(dataBA_FS3_o) + duplTags_double_FS3_o)))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
601 output_file.write("SSCS ba{}{}{}{}{}{:.3f}{}{:.3f}{}{:.3f}{}{:.3f}\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
602 sep, len(dataBA_FS3), sep, sum(dataBA_FS3_o), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
603 float(len(dataBA_FS3)) / (len(dataBA_FS3) + len(dataBA_FS3) + len(duplTags_FS3)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
604 sep, float(len(dataBA_FS3)) / (len(dataBA_FS3) + len(dataBA_FS3) + duplTags_double_FS3),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
605 sep, float(sum(dataBA_FS3_o)) / (sum(dataBA_FS3_o) + sum(dataBA_FS3_o) + sum(duplTags_FS3_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
606 sep, float(sum(dataBA_FS3_o)) / (sum(dataBA_FS3_o) + sum(dataBA_FS3_o) + duplTags_double_FS3_o)))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
607 output_file.write("DCS (total){}{} ({}){}{} ({}){}{:.3f}{}{:.3f} ({:.3f}){}{:.3f}{}{:.3f} ({:.3f})\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
608 sep, len(duplTags_FS3), duplTags_double_FS3, sep, sum(duplTags_FS3_o), duplTags_double_FS3_o, sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
609 float(len(duplTags_FS3)) / (len(dataAB_FS3) + len(dataBA_FS3) + len(duplTags_FS3)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
610 float(len(duplTags_FS3)) / (len(dataAB_FS3) + len(dataBA_FS3) + duplTags_double_FS3),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
611 float(duplTags_double_FS3) / (len(dataAB_FS3) + len(dataBA_FS3) + duplTags_double_FS3),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
612 sep, float(sum(duplTags_FS3_o)) / (sum(dataAB_FS3_o) + sum(dataBA_FS3_o) + sum(duplTags_FS3_o)), sep,
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
613 float(sum(duplTags_FS3_o)) / (sum(dataAB_FS3_o) + sum(dataBA_FS3_o) + duplTags_double_FS3_o),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
614 float(duplTags_double_FS3_o) / (sum(dataAB_FS3_o) + sum(dataBA_FS3_o) + duplTags_double_FS3_o)))
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
615 output_file.write("total nr. of tags{}{}{}{}{}{}{}{}{}{}{}{}\n".format(
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
616 sep, (len(dataAB_FS3) + len(dataBA_FS3) + len(duplTags_FS3)), sep, (sum(dataAB_FS3_o) + sum(dataBA_FS3_o) + sum(duplTags_FS3_o)),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
617 sep, (len(dataAB_FS3) + len(dataBA_FS3) + len(duplTags_FS3)), sep, (len(dataAB_FS3) + len(dataBA_FS3) + duplTags_double_FS3),
2e517a54eedc planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit b8a2f7b7615b2bcd3b602027af31f4e677da94f6-dirty
mheinzl
parents: 16
diff changeset
618 sep, (sum(dataAB_FS3_o) + sum(dataBA_FS3_o) + sum(duplTags_FS3_o)), sep, (sum(dataAB_FS3_o) + sum(dataBA_FS3_o) + duplTags_double_FS3_o)))
16
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
619
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
620 output_file.write("\nValues from family size distribution\n")
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
621 output_file.write("{}duplex{}ab{}ba{}sum\n".format(sep, sep, sep, sep))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
622 for dx, ab, ba, fs in zip(counts[0][0], counts[0][1], counts[0][2], counts[1]):
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
623 if fs == 21:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
624 fs = ">20"
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
625 else:
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
626 fs = "={}".format(fs)
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
627 ab1 = ab - dx
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
628 ba1 = ba - ab
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
629 output_file.write("FS{}{}{}{}{}{}{}{}{}\n".format(fs, sep, int(dx), sep, int(ab1), sep, int(ba1), sep, int(ba)))
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
630
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
631 print("Files successfully created!")
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
632
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
633
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
634 if __name__ == '__main__':
6bd9ef49d013 planemo upload for repository https://github.com/monikaheinzl/duplexanalysis_galaxy/tree/master/tools/fsd commit dfaab79252a858e8df16bbea3607ebf1b6962e5a
mheinzl
parents:
diff changeset
635 sys.exit(compare_read_families(sys.argv))