parser.add_argument('--markersizes') parser.add_argument('--dont-calculate-mean-info', action='store_true') parser.add_argument('--normalize', action='store_true') parser.add_argument('--graphify', action='store_true') parser.add_argument('--strings-to-ignore') # remove this string from the plot names in each dir (e.g. '-mean-bins') NOTE replaces '_' with '-' args = parser.parse_args() if args.strings_to_ignore is not None: args.strings_to_ignore = args.strings_to_ignore.replace('_', '-') args.plotdirs = utils.get_arg_list(args.plotdirs) args.scale_errors = utils.get_arg_list(args.scale_errors) args.colors = utils.get_arg_list(args.colors, intify=True) args.linestyles = utils.get_arg_list(args.linestyles, intify=True) args.names = utils.get_arg_list(args.names) args.leaves_per_tree = utils.get_arg_list(args.leaves_per_tree, intify=True) args.strings_to_ignore = utils.get_arg_list(args.strings_to_ignore) args.markersizes = utils.get_arg_list(args.markersizes, intify=True) args.linewidths = utils.get_arg_list(args.linewidths, intify=True) for iname in range(len(args.names)): args.names[iname] = args.names[iname].replace('@', ' ') assert len(args.plotdirs) == len(args.names) with opener('r')(args.datadir + '/v-meta.json') as json_file: # get location of <begin> cysteine in each v region args.cyst_positions = json.load(json_file) with opener('r')(args.datadir + '/j_tryp.csv') as csv_file: # get location of <end> tryptophan in each j region (TGG) tryp_reader = csv.reader(csv_file) args.tryp_positions = {row[0]:row[1] for row in tryp_reader} # WARNING: this doesn't filter out the header line plotting.compare_directories(args)
del_3p = len(self.germline_seqs[region][match_name]) - del_5p - len(gl_match_seq) if region == 'j' and del_5p < 0: print ' WARNING adding to right side of germline j' # assert len(gl_match_seq) > len(self.germline_seqs[region][match_name]) self.germline_seqs[region][match_name] = gl_match_seq del_5p = self.germline_seqs[region][match_name].find(gl_match_seq) del_3p = len(self.germline_seqs[region][match_name]) - del_5p - len(gl_match_seq) if del_5p < 0 or del_3p < 0: print 'ERROR couldn\'t figure out deletions in', region print ' germline', self.germline_seqs[region][match_name], match_name print ' germline match', gl_match_seq print ' ', del_5p, del_3p return line[region + '_5p_del'] = del_5p line[region + '_3p_del'] = del_3p line[region + '_gene'] = match_name line[region + '_gl_seq'] = gl_match_seq line[region + '_qr_seq'] = region_query_seq if __name__ == "__main__": filelist = [ '/home/dralph/Dropbox/join-output-' + str(ifile) + '.xml' for ifile in range(1,6)] # jparser = JoinParser('caches/recombinator/simu.csv', filelist, datadir='./data') # plotting.compare_directories('/var/www/sharing/dralph/partis/performance/plots/', 'hmm', '/var/www/sharing/dralph/partis/joinsolver_performance/plots/', 'jsolver', xtitle='inferred - true', stats='') base_plotdir = '/var/www/sharing/dralph/partis' plotting.compare_directories(base_plotdir + '/performance/plots', 'partis', base_plotdir + '/imgt_performance/plots', 'imgt', dir3=base_plotdir + '/joinsolver_performance/plots', name3='joinsolver')
if del_5p < 0 or del_3p < 0: print 'ERROR couldn\'t figure out deletions in', region print ' germline', self.germline_seqs[region][ match_name], match_name print ' germline match', gl_match_seq print ' ', del_5p, del_3p return line[region + '_5p_del'] = del_5p line[region + '_3p_del'] = del_3p line[region + '_gene'] = match_name line[region + '_gl_seq'] = gl_match_seq line[region + '_qr_seq'] = region_query_seq if __name__ == "__main__": filelist = [ '/home/dralph/Dropbox/join-output-' + str(ifile) + '.xml' for ifile in range(1, 6) ] # jparser = JoinParser('caches/recombinator/simu.csv', filelist, datadir='./data') # plotting.compare_directories('/var/www/sharing/dralph/partis/performance/plots/', 'hmm', '/var/www/sharing/dralph/partis/joinsolver_performance/plots/', 'jsolver', xtitle='inferred - true', stats='') base_plotdir = '/var/www/sharing/dralph/partis' plotting.compare_directories(base_plotdir + '/performance/plots', 'partis', base_plotdir + '/imgt_performance/plots', 'imgt', dir3=base_plotdir + '/joinsolver_performance/plots', name3='joinsolver')
del_5p = self.germline_seqs[region][match_name].find(gl_match_seq) del_3p = len(self.germline_seqs[region][match_name]) - del_5p - len(gl_match_seq) if del_5p < 0 or del_3p < 0: print "ERROR couldn't figure out deletions in", region print " germline", self.germline_seqs[region][match_name], match_name print " germline match", gl_match_seq print " ", del_5p, del_3p return line[region + "_5p_del"] = del_5p line[region + "_3p_del"] = del_3p line[region + "_gene"] = match_name line[region + "_gl_seq"] = gl_match_seq line[region + "_qr_seq"] = region_query_seq if __name__ == "__main__": filelist = ["/home/dralph/Dropbox/join-output-" + str(ifile) + ".xml" for ifile in range(1, 6)] # jparser = JoinParser('caches/recombinator/simu.csv', filelist, datadir='./data') # plotting.compare_directories('/var/www/sharing/dralph/partis/performance/plots/', 'hmm', '/var/www/sharing/dralph/partis/joinsolver_performance/plots/', 'jsolver', xtitle='inferred - true', stats='') base_plotdir = "/var/www/sharing/dralph/partis" plotting.compare_directories( base_plotdir + "/performance/plots", "partis", base_plotdir + "/imgt_performance/plots", "imgt", dir3=base_plotdir + "/joinsolver_performance/plots", name3="joinsolver", )