annotate scripts/S01b_extract_variable_prot.py @ 10:f62c76aab669 draft default tip

planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
author lecorguille
date Mon, 24 Sep 2018 04:34:39 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
1 #!/usr/bin/env python
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
2 #coding: utf-8
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
3 #Author : Eric Fontanillas (2010) - Victor Mataigne (2018)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
4
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
5 # TODO :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
6 # - Deal with missing data : do not do the sign test if missing species in a group
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
7 # - Find a way to avoid the list_species argument
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
8
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
9 import argparse, os
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
10 from functions import dico, write_output, fill_with_NaN
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
11
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
12 def aa_properties(amino_acids_properties_file):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
13 """ Read the file 'amino_acids_properties' and stores its content
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
14
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
15 Args :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
16 amino_acids_properties_file (String) : the file
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
17
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
18 Return :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
19 aa_properties (dict) : key/amino-acid - value/list of properties
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
20 """
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
21
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
22 dict_aa_properties={}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
23 with open(amino_acids_properties_file, 'r') as f:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
24 f.readline() #jump headers
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
25 for line in f.readlines():
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
26 S1 = line.split(",")
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
27 aa_name = S1[1]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
28 S2 = aa_name.split("/")
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
29 aa_code = S2[1][:-1]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
30
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
31 frequencies = S1[2][:-1]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
32 residue_weight = S1[5]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
33 residue_volume = S1[6]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
34 partial_specific_volume = S1[7]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
35 hydration = S1[8]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
36
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
37 dict_aa_properties[aa_code] = [frequencies, residue_weight, residue_volume, partial_specific_volume, hydration]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
38
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
39 return(dict_aa_properties)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
40
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
41 """ Functions for proteic format """
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
42
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
43 def all_aa_counts(seq):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
44 """ Count the occurrences of all amino-acids in a sequence
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
45
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
46 Args:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
47 seq (String) : a proteic sequence
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
48
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
49 Returns: a dictionary with amino-acids counts
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
50 """
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
51
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
52 aa_counts = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
53 seqU = seq.upper()
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
54 LAA =['K','R','A','F','I','L','M','V','W','N','Q','S','T','H','Y','C','D','E','P','G']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
55
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
56 for aa in LAA:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
57 aa_counts[aa] = seqU.count(aa)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
58
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
59 return aa_counts
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
60
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
61 def all_aa_props(seq_counts):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
62 """ Converts a dictionnary of counts into a dictionnary of proportions
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
63
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
64 Args:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
65 seq_counts (dict) : dictionnary computed by the function all_aa_counts()
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
66
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
67 Returns: a dictionary with counts replaced by proportions
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
68 """
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
69
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
70 aa_props = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
71 for key in seq_counts.keys():
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
72 aa_props[key] = float(seq_counts[key]) / sum(seq_counts.values())
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
73 return aa_props
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
74
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
75 def aa_variables_counts_and_props(aa_counts):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
76 """ Computes several thermostability indices (summed occurrences of some AAs, and then various ratios)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
77
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
78 Args:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
79 aa_counts (dict) : dictionnary computed by the function all_aa_counts()
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
80
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
81 Returns:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
82 aa_variables_counts : a dictionary with indices values
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
83 aa_variables_props : a dictionary with indices proportions (ratios excluded)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
84 """
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
85
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
86 # Hyperthermophile Prokaryotes criterias
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
87 # IVYWREL : positivelly correlated with otpimal growth
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
88 # ERK : (i.e. ) => positivelly correlated with optimal growth temperature
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
89 # ERK/DNQTSHA (or DNQTSH ??)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
90 # EK/QH
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
91
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
92 # Mutationnal bias hypothesis => AT rich: favor FYMINK // GC rich: favor GARP
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
93 # The mutational bias model predict a linear relationship between GARP vs FYMINK
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
94 # ==> so if outliers to that, it means that the excess of GARP or FYMINK are not explained by the mutationnal bias model but by something else (selection ?)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
95
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
96
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
97 # Hydophobicity hypothesis [should INCREASE with thermal adaptation]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
98 # AL
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
99 # Only non-aromatic : AVLIM
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
100 # Only aromatic : FYW
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
101
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
102 # Charged hypothesis => positivelly correlated with optimal growth temperature
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
103 # All charged : RHKDE
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
104 # Only positive : RHK
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
105 # Only negative : DE
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
106
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
107 # Neutral polar hypothesis [should DECREASE with thermal adaptation]
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
108 # STNQ
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
109
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
110 # Fontanillas' criteria
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
111 # PAYRE
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
112 # MVGDS
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
113 # PAYRE/MVGDS
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
114
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
115 # Jollivet's criteria
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
116 # AC
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
117 # MVGDS
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
118 # AC/MVGDS
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
119
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
120 aa_variables_counts = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
121 aa_variables_props = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
122 len_seq = sum(aa_counts.values()) # length of the sequence
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
123
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
124 # counts of variables
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
125 aa_variables_counts['AC'] = aa_counts['A'] + aa_counts['C']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
126 aa_variables_counts['APGC'] = aa_counts['A'] + aa_counts['P'] + aa_counts['G'] + aa_counts['C']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
127 aa_variables_counts['AVLIM'] = aa_counts['A'] + aa_counts['V'] + aa_counts['L'] + aa_counts['I'] + aa_counts['M']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
128 aa_variables_counts['AVLIMFYW'] = aa_variables_counts['AVLIM'] + aa_counts['F'] + aa_counts['Y'] + aa_counts['W']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
129 aa_variables_counts['DE'] = aa_counts['D'] + aa_counts['E']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
130 aa_variables_counts['DNQTSHA'] = aa_counts['D'] + aa_counts['N'] + aa_counts['Q'] + aa_counts['T'] + aa_counts['S'] + aa_counts['H'] + aa_counts['A']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
131 aa_variables_counts['EK'] = aa_counts['E'] + aa_counts['K']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
132 aa_variables_counts['ERK'] = aa_counts['E'] + aa_counts['K'] + aa_counts['K']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
133 aa_variables_counts['FYMINK'] = aa_counts['F'] + aa_counts['Y'] + aa_counts['M'] + aa_counts['I'] + aa_counts['N'] + aa_counts['K']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
134 aa_variables_counts['FYW'] = aa_counts['F'] + aa_counts['Y'] + aa_counts['W']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
135 aa_variables_counts['GARP'] = aa_counts['G'] + aa_counts['A'] + aa_counts['R'] + aa_counts['P']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
136 aa_variables_counts['IVYWREL'] = aa_counts['I'] + aa_counts['V'] + aa_counts['Y'] + aa_counts['W'] + aa_counts['R'] + aa_counts['E'] + aa_counts['L']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
137 aa_variables_counts['QH'] = aa_counts['Q'] + aa_counts['H']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
138 aa_variables_counts['RHK'] = aa_counts['R'] + aa_counts['H'] + aa_counts['K']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
139 aa_variables_counts['RHKDE'] = aa_counts['R'] + aa_counts['H'] + aa_counts['K'] + aa_counts['D'] + aa_counts['E']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
140 aa_variables_counts['STNQ'] = aa_counts['S'] + aa_counts['T'] + aa_counts['N'] + aa_counts['Q']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
141 aa_variables_counts['VLIM'] = aa_counts['V'] + aa_counts['L'] + aa_counts['I'] + aa_counts['M']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
142 aa_variables_counts['PAYRE'] = aa_counts['P'] + aa_counts['A'] + aa_counts['Y'] + aa_counts['R'] + aa_counts['E']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
143 aa_variables_counts['MVGDS'] = aa_counts['M'] + aa_counts['V'] + aa_counts['G'] + aa_counts['D'] + aa_counts['S']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
144
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
145 # compute proportions
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
146 for key in aa_variables_counts.keys():
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
147 aa_variables_props[key] = float(aa_variables_counts[key]) / float(len_seq)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
148
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
149 if aa_variables_counts['DNQTSHA'] != 0:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
150 ratio_ERK_DNQTSHA = float(aa_variables_counts['ERK'])/float(aa_variables_counts['DNQTSHA'])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
151 else :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
152 ratio_ERK_DNQTSHA = -1
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
153
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
154 if aa_variables_counts['QH'] != 0:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
155 ratio_EK_QH = float(aa_variables_counts['EK'])/float(aa_variables_counts['QH'])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
156 else :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
157 ratio_EK_QH = -1
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
158
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
159 if aa_variables_counts['FYMINK'] != 0:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
160 ratio_GARP_FYMINK = float(aa_variables_counts['EK'])/float(aa_variables_counts['FYMINK'])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
161 else :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
162 ratio_GARP_FYMINK = -1
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
163
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
164 if aa_variables_counts['VLIM'] != 0:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
165 ratio_AC_VLIM = float(aa_variables_counts['AC'])/float(aa_variables_counts['VLIM'])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
166 ratio_APGC_VLIM = float(aa_variables_counts['APGC'])/float(aa_variables_counts['VLIM'])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
167 else :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
168 ratio_AC_VLIM = -1
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
169 ratio_APGC_VLIM = -1
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
170
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
171 if aa_variables_counts['MVGDS'] != 0:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
172 ratio_PAYRE_MVGDS = float(aa_variables_counts['PAYRE'])/float(aa_variables_counts['MVGDS'])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
173 else :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
174 ratio_PAYRE_MVGDS = -1
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
175
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
176 if aa_variables_counts['MVGDS'] != 0:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
177 ratio_AC_MVGDS = float(aa_variables_counts['AC'])/float(aa_variables_counts['MVGDS'])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
178 else :
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
179 ratio_AC_MVGDS = -1
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
180
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
181 aa_variables_counts['ratio_ERK_DNQTSHA'] = ratio_ERK_DNQTSHA
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
182 aa_variables_counts['ratio_EK_QH'] = ratio_EK_QH
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
183 aa_variables_counts['ratio_GARP_FYMINK'] = ratio_GARP_FYMINK
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
184 aa_variables_counts['ratio_AC_VLIM'] = ratio_AC_VLIM
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
185 aa_variables_counts['ratio_APGC_VLIM'] = ratio_APGC_VLIM
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
186 aa_variables_counts['ratio_PAYRE_MVGDS'] = ratio_PAYRE_MVGDS
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
187 aa_variables_counts['ratio_AC_MVGDS'] = ratio_AC_MVGDS
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
188
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
189 return aa_variables_counts, aa_variables_props
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
190
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
191 def sequence_properties_from_aa_properties(aa_counts, aa_properties):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
192 """ Computes a sequence properties (based on an external data file)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
193
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
194 Args:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
195 - aa_counts (dict) : counts of amino-acids in the sequence
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
196 - aa_properties (dict) : key/amino-acid - value/list of properties extract from the external data file
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
197
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
198 Returns:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
199 - seq_props (dict) : values of the sequence properties
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
200 """
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
201
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
202 LS = ['total_residue_weight', 'total_residue_volume', 'total_partial_specific_volume', 'total_hydratation']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
203 seq_props = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
204
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
205 for i in range(1,5):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
206 seq_props[LS[i-1]] = 0
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
207 for key in aa_counts.keys():
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
208 seq_props[LS[i-1]] += aa_counts[key] * float(aa_properties[key][i])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
209
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
210 return seq_props
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
211
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
212 """ Main """
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
213
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
214 def main():
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
215 parser = argparse.ArgumentParser()
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
216 parser.add_argument("species_list", help="List of species separated by commas")
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
217 parser.add_argument("aa_properties", help="File with all amino-acids properties")
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
218 args = parser.parse_args()
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
219
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
220 LAA = ['K','R','A','F','I','L','M','V','W','N','Q','S','T','H','Y','C','D','E','P','G']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
221 LV = ['IVYWREL','EK','ERK','DNQTSHA','QH','ratio_ERK_DNQTSHA','ratio_EK_QH','FYMINK','GARP',
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
222 'ratio_GARP_FYMINK','AVLIM','FYW','AVLIMFYW','STNQ','RHK','DE','RHKDE','APGC','AC',
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
223 'VLIM','ratio_AC_VLIM','ratio_APGC_VLIM']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
224 LS = ['total_residue_weight', 'total_residue_volume', 'total_partial_specific_volume', 'total_hydratation']
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
225
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
226 list_inputs = []
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
227
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
228 path_inputs = '01_input_files'
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
229 list_inputs = os.listdir(path_inputs)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
230
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
231 lsp = args.species_list.split(',')
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
232 lsp = sorted(lsp)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
233 flsp = ''
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
234 for el in lsp:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
235 flsp += el+','
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
236
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
237 path_outputs_1 = '02_tables_per_aa'
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
238 path_outputs_2 = '02_tables_per_aa_variable'
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
239 os.mkdir(path_outputs_1)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
240 os.mkdir(path_outputs_2)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
241
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
242 # Init empty dicts for results
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
243 dict_for_files_aa_counts = {} # counts
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
244 dict_for_files_aa_props = {} # proportions
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
245 dict_for_files_variables_counts = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
246 dict_for_files_variables_props = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
247 dict_for_files_seq_properties = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
248
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
249 aa_properties_file = aa_properties(args.aa_properties) # read the aa_properties file
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
250
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
251 # All counts and props
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
252 for file in list_inputs:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
253 # iterate over input files
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
254 sequences = dico(file, path_inputs)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
255
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
256 # TEMPORARY CORRECTION FOR SEQUENCES CONTAINING ONLY INDELS
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
257 # It appears than CDS_Search can bug sometimes and return an alignement where a species' sequence is made of indels only
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
258 # This causes a crash here (in the ratios function). The correction skip the whole file.
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
259 # When CDS_Search is corrected, lines with 'skip' can be removed
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
260 skip = False
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
261 for key in sequences.keys():
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
262 if all(x == '-' for x in sequences[key]):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
263 skip = True
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
264
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
265 if not skip:
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
266
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
267 aa_counts_per_seq = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
268 aa_props_per_seq = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
269 aa_variables_counts_per_seq = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
270 aa_variables_props_per_seq = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
271 seq_properties = {}
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
272
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
273 for key in sequences.keys():
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
274 # iterate over sequences in the file
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
275 aa_counts_per_seq[key] = all_aa_counts(sequences[key])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
276 aa_props_per_seq[key] = all_aa_props(aa_counts_per_seq[key])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
277 aa_variables_counts_per_seq[key], aa_variables_props_per_seq[key] = aa_variables_counts_and_props(aa_counts_per_seq[key])
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
278 seq_properties[key] = sequence_properties_from_aa_properties(aa_counts_per_seq[key], aa_properties_file)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
279
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
280 # Add NaN for missing species
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
281 for key in set(lsp).difference(set(sequences.keys())):
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
282 aa_counts_per_seq[key] = fill_with_NaN(LAA)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
283 aa_props_per_seq[key] = fill_with_NaN(LAA)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
284 aa_variables_counts_per_seq[key] = fill_with_NaN(LV)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
285 seq_properties[key] = fill_with_NaN(LS)
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
286
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
287 # Add computations to final dicts
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
288 dict_for_files_aa_counts[file] = aa_counts_per_seq
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
289 dict_for_files_aa_props[file] = aa_props_per_seq
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
290 dict_for_files_variables_counts[file] = aa_variables_counts_per_seq
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
291 dict_for_files_variables_props[file] = aa_variables_props_per_seq
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
292 dict_for_files_seq_properties[file] = seq_properties
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
293
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
294 # Try with pandas ?
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
295 write_output(LAA, flsp, path_outputs_1, dict_for_files_aa_counts) # one file per AA
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
296 write_output(LV, flsp, path_outputs_2, dict_for_files_variables_counts) # one file per aa_variable
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
297 write_output(LS, flsp, path_outputs_2, dict_for_files_seq_properties) #one file per seq properties
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
298
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
299 # { file_name1 : { seq1: {'A' : 0, 'C':0, 'E':0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
300 # seq2: {'A' : 0, 'C':0, 'E':0, ...}, ...
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
301 # },
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
302 # { file_name2 : { seq1: {'A' : 0, 'C':0, 'E':0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
303 # seq2: {'A' : 0, 'C':0, 'E':0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
304 # },
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
305 # ... }
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
306
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
307 # { file_name1 : {seq1 : {'IVYWREL' : 0, 'EK': 0, 'ERK': 0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
308 # seq2 : {'IVYWREL' : 0, 'EK': 0, 'ERK': 0, ...}, ...
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
309 # },
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
310 # file_name2 : {seq1 : {'IVYWREL' : 0, 'EK': 0, 'ERK': 0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
311 # seq2 : {'IVYWREL' : 0, 'EK': 0, 'ERK': 0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
312 # },
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
313 # ... }
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
314
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
315 # { file_name1 : {'IVYWREL' : 0, 'EK': 0, 'ERK': 0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
316 # file_name2 : {'IVYWREL' : 0, 'EK': 0, 'ERK': 0, ...},
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
317 # ...
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
318 # }
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
319
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
320 if __name__ == '__main__':
f62c76aab669 planemo upload for repository htpps://github.com/abims-sbr/adaptearch commit 3c7982d775b6f3b472f6514d791edcb43cd258a1
lecorguille
parents:
diff changeset
321 main()