annotate clsi_profile.py @ 2:306236ec0511 draft

Deleted selected files
author rakesh4osdd
date Fri, 11 Jun 2021 13:20:08 +0000
parents 62226cd1acb5
children 683299422575
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
1 #!/usr/bin/env python
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
2 # coding: utf-8
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
3
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
4 # In[206]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
5
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
6
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
7 # ASIST module2 | map AST result to the CLSI breakporints with combination antibiotics
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
8 # By rakesh4osdd@gmail.com, 06-Jun-2021
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
9 import pandas as pd
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
10 import re
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
11 import sys
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
12
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
13
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
14 # In[207]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
15
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
16
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
17 #print(pd.__version__, re.__version__)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
18
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
19
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
20 # In[208]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
21
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
22
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
23 # compare two MIC value strings
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
24 def check_mic(mic1,mic2,mic_type):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
25 #print(mic1,mic2,mic_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
26 try:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
27 if '/' in mic1:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
28 m1a = mic1.split('/')[0]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
29 m1b = mic1.split('/')[1]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
30 if float(m1a)==0 or float(m1b)==0:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
31 strain_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
32 return(strain_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
33 elif '/' in mic2:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
34 m1a = mic1
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
35 if float(m1a)==0:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
36 strain_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
37 return(strain_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
38 m1b = '1'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
39 elif float(mic1)==0:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
40 strain_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
41 return(strain_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
42 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
43 m1a = mic1
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
44
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
45 if '-' in mic2:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
46 m2a = mic2.split('-')[0]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
47 m2b = mic2.split('-')[1]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
48
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
49 except ValueError:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
50 strain_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
51 return(strain_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
52 try:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
53 if '-' in mic2 and mic_type == 'i': # for intermediate only
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
54 if '/' in mic2:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
55 m2a = mic2.split('-')[0].split('/')[0]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
56 m2b = mic2.split('-')[0].split('/')[1]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
57 m2aa = mic2.split('-')[1].split('/')[0]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
58 m2bb = mic2.split('-')[1].split('/')[1]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
59 if (float(m2aa)>=float(m1a)>=float(m2a) and float(m2bb)>=float(m1b)>=float(m2b)):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
60 #print('intermediate')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
61 m_type='Intermediate'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
62 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
63 #print('not define')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
64 m_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
65 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
66 m2a = mic2.split('-')[0]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
67 m2b = mic2.split('-')[1]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
68 if (float(m2b)>=float(m1a)>=float(m2a)):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
69 #print('intermediate')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
70 m_type='Intermediate'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
71 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
72 #print('not define')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
73 m_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
74 #print (m1a,m1b,m2a,m2b,m2aa,m2bb)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
75 elif '/' in mic2:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
76 m2a = mic2.split('/')[0]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
77 m2b = mic2.split('/')[1]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
78 #print(m1a,m1b,m2a,m2b,mic_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
79 if (mic_type=='s' and (float(m1a)<=float(m2a) and float(m1b)<=float(m2b))):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
80 m_type='Susceptible'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
81 elif (mic_type=='r' and (float(m1a)>=float(m2a) and float(m1b)>=float(m2b))):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
82 m_type='Resistant'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
83 elif (mic_type=='i' and (float(m1a)==float(m2a) and float(m1b)==float(m2b))):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
84 m_type='Intermediate'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
85 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
86 m_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
87 elif '-' in mic2:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
88 m_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
89 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
90 m2a=mic2
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
91 if (mic_type=='s' and (float(m1a)<=float(m2a))):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
92 m_type='Susceptible'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
93 elif (mic_type=='r' and (float(m1a)>=float(m2a))):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
94 m_type='Resistant'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
95 elif (mic_type=='i' and (float(m1a)==float(m2a))):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
96 m_type='Intermediate'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
97 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
98 m_type='Strain could not be classified-1'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
99 except IndexError:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
100 strain_type='Strain could not be classified-2'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
101 return(strain_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
102
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
103 return(m_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
104
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
105 #check_mic('65','32-64','i')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
106
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
107
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
108 # In[209]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
109
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
110
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
111 # compare MIC value in pandas list
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
112 def sus_res_int(mic):
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
113 #print(mic)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
114 o_mic = mic[0].replace(' ', '')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
115 s_mic = mic[1].replace(' ', '')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
116 r_mic = mic[2].replace(' ', '')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
117 i_mic = mic[3].replace(' ', '')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
118 try:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
119 if check_mic(o_mic,s_mic,'s')=='Susceptible':
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
120 strain_type='Susceptible'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
121 elif check_mic(o_mic,r_mic,'r')=='Resistant':
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
122 strain_type='Resistant'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
123 elif check_mic(o_mic,i_mic,'i')=='Intermediate':
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
124 strain_type='Intermediate'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
125 else:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
126 strain_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
127 except ValueError:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
128 strain_type='Strain could not be classified'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
129 return(strain_type)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
130
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
131 #mic=['128','16/4','128/4','32/4-64/4']
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
132 #sus_res_int(mic)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
133
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
134
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
135 # In[210]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
136
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
137
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
138 # for input argument
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
139 input_user = sys.argv[1]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
140 input_clsi = sys.argv[2]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
141 output_table = sys.argv[3]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
142
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
143
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
144 # In[211]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
145
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
146 """
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
147 input_user='input.csv'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
148 input_clsi='clsi.csv'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
149 output_profile=input_user+'_profile.csv'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
150 output_table=input_user+'_table.csv'
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
151 """
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
152
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
153 # In[212]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
154
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
155
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
156 # read user AST data with selected 3 columns
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
157 strain_mic=pd.read_csv(input_user, sep=',', usecols =['Strain name', 'Antibiotics', 'MIC'],na_filter=False)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
158
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
159
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
160 # In[213]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
161
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
162
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
163 clsi_bp=pd.read_csv(input_clsi,sep=',')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
164
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
165
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
166 # In[214]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
167
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
168
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
169 #clsi_bp
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
170 #strain_mic
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
171
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
172
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
173 # In[215]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
174
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
175
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
176 # convert MIC to numbers sMIC, rMIC
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
177 clsi_bp['s_mic'] =clsi_bp[['Susceptible']].applymap(lambda x: (re.sub(r'[^0-9.\/-]', '', x)))
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
178 clsi_bp['r_mic'] =clsi_bp[['Resistant']].applymap(lambda x: (re.sub(r'[^0-9.\/-]', '', x)))
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
179 clsi_bp['i_mic'] = clsi_bp[['Intermediate']].applymap(lambda x: (re.sub(r'[^0-9.\/-]', '', x)))
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
180
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
181
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
182 # In[216]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
183
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
184
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
185 #clsi_bp['i_mic'] = clsi_bp[['Intermediate']].applymap(lambda x: (re.sub(r'[^0-9.\/-]', '', x)))
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
186
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
187
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
188 # In[217]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
189
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
190
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
191 # Read only numbers in MIC values
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
192 #try:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
193 strain_mic['o_mic']=strain_mic[['MIC']].applymap(lambda x: (re.sub(r'[^0-9.\/]','', x)))
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
194 #except TypeError:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
195 # print('Waring: Error in MIC value')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
196
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
197
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
198 # In[218]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
199
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
200
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
201 #strain_mic
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
202
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
203
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
204 # In[219]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
205
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
206
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
207 # capitalize each Antibiotic Name for comparision with removing whitespace
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
208 strain_mic['Antibiotics']=strain_mic['Antibiotics'].str.capitalize().str.replace(" ","")
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
209 clsi_bp['Antibiotics']=clsi_bp['Antibiotics'].str.capitalize().str.replace(" ","")
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
210
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
211
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
212 # In[220]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
213
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
214
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
215 #compare CLSI Antibiotics only
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
216 #result=pd.merge(strain_mic, clsi_bp, on='Antibiotics',how='inner', indicator=True)[['Strain name','Antibiotics', 'MIC', 'o_mic', 's_mic', 'r_mic','_merge']]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
217 try:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
218 result=pd.merge(strain_mic, clsi_bp, on='Antibiotics',how='inner')[['Strain name','Antibiotics', 'MIC', 'o_mic', 's_mic', 'r_mic','i_mic']]
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
219 except KeyError:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
220 print('Waring: Error in input Values')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
221
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
222
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
223 # In[221]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
224
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
225
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
226 #compare MIC values and assign Susceptible and Resistant to Strain
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
227 #try:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
228 result[['CLSI_profile']] = result[['o_mic','s_mic','r_mic','i_mic']].apply(sus_res_int,axis = 1)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
229 #except ValueError:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
230 # print('Waring: Error in input MIC value')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
231
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
232
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
233 # In[222]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
234
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
235
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
236 #result
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
237
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
238
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
239 # In[223]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
240
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
241
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
242 #result[['Strain name', 'Antibiotics', 'MIC','s_mic','r_mic','CLSI_profile']].to_csv(output_profile,sep=',', index=False, encoding='utf-8-sig')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
243
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
244
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
245 # In[224]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
246
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
247
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
248 #create a pivot table for ASIST
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
249 table=result[['Strain name', 'Antibiotics','CLSI_profile']].drop_duplicates()
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
250 result_table=pd.pivot_table(table, values ='CLSI_profile', index =['Strain name'],columns =['Antibiotics'], aggfunc = lambda x: ' '.join(x))
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
251
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
252
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
253 # In[225]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
254
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
255
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
256 #result_table
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
257
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
258
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
259 # In[226]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
260
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
261
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
262 #result_table.to_csv(output_table,na_rep='NA')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
263
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
264
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
265 # In[227]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
266
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
267
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
268 # reorder the Antibiotics for ASIST
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
269 clsi_ab=['Amikacin','Tobramycin','Gentamycin','Imipenem','Meropenem','Doripenem','Ciprofloxacin','Levofloxacin',
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
270 'Piperacillin/tazobactam','Ticarcillin/clavulanicacid','Cefotaxime','Ceftriaxone','Ceftazidime','Cefepime',
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
271 'Trimethoprim/sulfamethoxazole','Ampicillin/sulbactam','Colistin','Polymyxinb','Tetracycline','Doxicycline ',
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
272 'Minocycline']
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
273 result_selected=result_table.filter(clsi_ab)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
274
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
275
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
276 # In[228]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
277
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
278
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
279 #print(result_selected.shape, result_table.shape)
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
280
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
281
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
282 # In[229]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
283
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
284
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
285 result_selected.insert(0,'Resistance_phenotype','')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
286
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
287
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
288 # In[230]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
289
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
290
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
291 #rename headers
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
292 result_selected=result_selected.rename(columns = {'Ticarcillin/clavulanicacid':'Ticarcillin/clavulanic acid','Piperacillin/tazobactam':'Piperacillin/ tazobactam','Trimethoprim/sulfamethoxazole': 'Trimethoprim/ sulfamethoxazole','Ampicillin/sulbactam':'Ampicillin/ sulbactam', 'Polymyxinb': 'Polymyxin B'} )
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
293
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
294
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
295 # In[231]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
296
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
297
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
298 #result_selected
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
299
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
300
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
301 # In[232]:
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
302
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
303
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
304 result_selected.to_csv(output_table,na_rep='NA')
62226cd1acb5 "planemo upload for repository https://github.com/rakesh4osdd/clsi_profile/tree/master commit ae6f2bc197b28000c56f6368ad044b350bc34f6a"
rakesh4osdd
parents:
diff changeset
305