rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
ecotype_id2cnv_qc_call_data[row.ecotype_id] = [] cnv_qc_call_data = ecotype_id2cnv_qc_call_data[row.ecotype_id] cnv_qc_call_data.append((row.chromosome, row.start, row.stop, row.size_affected, row.id)) | ecotype_id2cnv_qc_call_data[row.ecotype_id] = RBDict() segmentKey = CNVSegmentBinarySearchTreeKey(chromosome=row.chromosome, span_ls=[row.start, row.stop], \ min_reciprocal_overlap=min_reciprocal_overlap) ecotype_id2cnv_qc_call_data[row.ecotype_id][segmentKey] = (row.chromosome, row.start, row.stop, row.size_affected... | def getCNVQCDataFromDB(cls, data_source_id=1, ecotype_id=None, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=None): """ 2009-11-4 get CNV QC data from database """ sys.stderr.write("Getting CNV QC data ... \n") import Stock_250kDB sql_string = "select a.ecotype_id, c.chromosome, c.start, c.stop, c.size_aff... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
for ecotype_id, cnv_qc_call_data in ecotype_id2cnv_qc_call_data.iteritems(): cnv_qc_call_data.sort() ecotype_id2cnv_qc_call_data[ecotype_id] = cnv_qc_call_data sys.stderr.write("%s cnv qc calls for %s ecotypes. Done.\n"%(count, len(ecotype_id2cnv_qc_call_data))) | import math for ecotype_id, tree in ecotype_id2cnv_qc_call_data.iteritems(): print "\tDepth of Ecotype %s's tree: %d" % (ecotype_id, tree.depth()) print "\tOptimum Depth: %f (%d) (%f%% depth efficiency)" % (tree.optimumdepth(), math.ceil(tree.optimumdepth()), math.ceil(tree.optimumdepth()) / tree.depth()) sys.stder... | def getCNVQCDataFromDB(cls, data_source_id=1, ecotype_id=None, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=None): """ 2009-11-4 get CNV QC data from database """ sys.stderr.write("Getting CNV QC data ... \n") import Stock_250kDB sql_string = "select a.ecotype_id, c.chromosome, c.start, c.stop, c.size_aff... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
def countMatchedDeletionsFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ | def countMatchedDeletionsFunctor(cls, param_obj, cnv_segment_obj=None, cnv_qc_call=None): """ 2009-12-9 store qc data in param_obj.array_id2qc_data | def countMatchedDeletionsFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 a functor to be called in """ if not hasattr(param_obj, 'no_of_valid_deletions'): setattr(param_obj, 'no_of_valid_deletions', 0) qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv_qc_call_id_set.add(cnv_qc_call_id) param_obj.no_of_valid_deletions += 1 | if not hasattr(param_obj, "array_id2qc_data"): param_obj.array_id2qc_data = {} if not hasattr(param_obj, "array_id2no_of_probes2qc_data"): param_obj.array_id2no_of_probes2qc_data = {} if not hasattr(param_obj, "array_id2qc_no_of_probes2qc_data"): param_obj.array_id2qc_no_of_probes2qc_data = {} array_id = cnv_segment_o... | def countMatchedDeletionsFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 a functor to be called in """ if not hasattr(param_obj, 'no_of_valid_deletions'): setattr(param_obj, 'no_of_valid_deletions', 0) qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
no_of_QCCalls_matched = len(param_obj.cnv_qc_call_id_set) no_of_total_QCCalls = sum(map(len, param_obj.ecotype_id2cnv_qc_call_data.values())) false_negative_rate = (no_of_total_QCCalls-no_of_QCCalls_matched)/float(no_of_total_QCCalls) sys.stderr.write("False negative rate: %s/%s(%s).\n"%(no_of_total_QCCalls-no_of_QCCal... | for array_id, qc_data in param_obj.array_id2qc_data.iteritems(): no_of_QCCalls_matched = len(qc_data.cnv_qc_call_id_set) no_of_total_QCCalls = len(param_obj.ecotype_id2cnv_qc_call_data[qc_data.ecotype_id]) false_negative_rate = (no_of_total_QCCalls-no_of_QCCalls_matched)/float(no_of_total_QCCalls) sys.stderr.write("Arr... | def outputFalseNegativeRate(cls, param_obj): """ 2009-11-4 """ no_of_QCCalls_matched = len(param_obj.cnv_qc_call_id_set) no_of_total_QCCalls = sum(map(len, param_obj.ecotype_id2cnv_qc_call_data.values())) false_negative_rate = (no_of_total_QCCalls-no_of_QCCalls_matched)/float(no_of_total_QCCalls) sys.stderr.write("Fals... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
no_of_valid_deletions = param_obj.no_of_valid_deletions no_of_deletions = param_obj.no_of_deletions no_of_non_valid_deletions = no_of_deletions-no_of_valid_deletions false_positive_rate = no_of_non_valid_deletions/float(no_of_deletions) sys.stderr.write("False positive rate: %s/%s(%s).\n"%\ (no_of_non_valid_deletions, ... | for array_id, qc_data in param_obj.array_id2qc_data.iteritems(): no_of_valid_deletions = qc_data.no_of_valid_deletions no_of_deletions = qc_data.no_of_deletions no_of_non_valid_deletions = no_of_deletions-no_of_valid_deletions false_positive_rate = no_of_non_valid_deletions/float(no_of_deletions) sys.stderr.write("Arra... | def outputFalsePositiveRate(cls, param_obj): """ 2009-11-4 """ no_of_valid_deletions = param_obj.no_of_valid_deletions no_of_deletions = param_obj.no_of_deletions no_of_non_valid_deletions = no_of_deletions-no_of_valid_deletions false_positive_rate = no_of_non_valid_deletions/float(no_of_deletions) sys.stderr.write("Fa... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
count_embedded_segment_as_match=True): """ | count_embedded_segment_as_match=True, min_reciprocal_overlap=0.6): """ 2010-1-26 pass min_reciprocal_overlap to cls.getCNVQCDataFromDB() 2009-12-9 calculate FNR for each class with same number of probes | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
ecotype_id2cnv_qc_call_data = cls.getCNVQCDataFromDB(data_source_id, ecotype_id, cnv_type_id, min_QC_segment_size, min_no_of_probes) | ecotype_id2cnv_qc_call_data = cls.getCNVQCDataFromDB(data_source_id, ecotype_id, cnv_type_id, min_QC_segment_size, min_no_of_probes,\ min_reciprocal_overlap=min_reciprocal_overlap) | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
param_obj = PassingData(no_of_valid_deletions=0, cnv_qc_call_id_set=set()) | param_obj = PassingData(no_of_valid_deletions=0, cnv_qc_call_id_set=set(), array_id2qc_data={}) | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
count_embedded_segment_as_match=count_embedded_segment_as_match) sys.stderr.write("For ecotype_id %s, data_source_id %s, min_QC_segment_size %s, deletion_cutoff: %s, min_no_of_probes: %s, max_boundary_diff: %s, max_diff_perc %s.\n"%\ | count_embedded_segment_as_match=count_embedded_segment_as_match, \ min_reciprocal_overlap=min_reciprocal_overlap, report=False) sys.stderr.write("For ecotype_id %s, data_source_id %s, min_QC_segment_size %s, deletion_cutoff: %s, min_no_of_probes: %s, min_reciprocal_overlap: %s.\n"%\ | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
data_source_id, min_QC_segment_size, deletion_cutoff, min_no_of_probes, max_boundary_diff, max_diff_perc)) | data_source_id, min_QC_segment_size, deletion_cutoff, min_no_of_probes, min_reciprocal_overlap)) | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
for max_boundary_diff in [10000]: for max_diff_perc in [0.20, 0.3]: CNV.countNoOfCNVDeletionsMatchQC(db_250k, input_fname_ls, ecotype_id=ecotype_id, data_source_id=data_source_id, \ cnv_type_id=1,\ | for min_reciprocal_overlap in [0.4, 0.6, 0.8]: CNV.countNoOfCNVDeletionsMatchQC(db_250k, input_fname_ls, ecotype_id=ecotype_id, data_source_id=data_source_id, \ cnv_type_id=1,\ | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
max_boundary_diff=max_boundary_diff, max_diff_perc=max_diff_perc, \ | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py | |
count_embedded_segment_as_match=count_embedded_segment_as_match) """ @classmethod def addAmplitudeFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ | count_embedded_segment_as_match=count_embedded_segment_as_match,\ min_reciprocal_overlap=min_reciprocal_overlap) input_fname_ls = [] for i in range(1,6): input_fname_ls.append(os.path.expanduser('~/mnt2/panfs/250k/CNV/call_method_48_CNV_intensity_QNorm_sub_ref_chr%s.GADA_A0.5T4M5.tsv'%i)) ecotype_id_data_source... | def countNoOfCNVDeletionsMatchQC(cls, db_250k, input_fname_ls, ecotype_id=6909, data_source_id=3, cnv_type_id=1, \ min_QC_segment_size=200, deletion_cutoff=-0.33, max_boundary_diff=10000, \ max_diff_perc=0.10, min_no_of_probes=5,\ count_embedded_segment_as_match=True): """ 2009-10-29 for all CNV deletions, check how ma... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv_qc_call_id_set.add(cnv_qc_call_id) param_obj.amp_ls.append(cnv_segment_obj.amplitude) | if cnv_qc_call is not None: qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv_qc_call_id_set.add(cnv_qc_call_id) param_obj.amp_ls.append(cnv_segment_obj.amplitude) | def addAmplitudeFunctor(cls, cnv_segment_obj, cnv_qc_call, param_obj): """ 2009-11-4 """ if not hasattr(param_obj, 'amp_ls'): setattr(param_obj, 'amp_ls', []) qc_chromosome, qc_start, qc_stop = cnv_qc_call[:3] cnv_qc_call_id = cnv_qc_call[-1] param_obj.cnv_qc_call_id_set.add(cnv_qc_call_id) param_obj.amp_ls.append(cnv_... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
max_diff_perc=0.10, count_embedded_segment_as_match=True): | max_diff_perc=0.10, count_embedded_segment_as_match=True, min_reciprocal_overlap=0.6): | def drawHistOfAmpOfValidatedDeletions(cls, db_250k, input_fname_ls, output_fname_prefix, data_source_id=1, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=5, max_boundary_diff=10000, \ max_diff_perc=0.10, count_embedded_segment_as_match=True): """ 2009-11-4 draw histogram of amplitude of segments who are val... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
min_no_of_probes=min_no_of_probes) | min_no_of_probes=min_no_of_probes, \ min_reciprocal_overlap=min_reciprocal_overlap) | def drawHistOfAmpOfValidatedDeletions(cls, db_250k, input_fname_ls, output_fname_prefix, data_source_id=1, cnv_type_id=1, \ min_QC_segment_size=200, min_no_of_probes=5, max_boundary_diff=10000, \ max_diff_perc=0.10, count_embedded_segment_as_match=True): """ 2009-11-4 draw histogram of amplitude of segments who are val... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
overlap_length = max(0, stop-self.start) - max(0, stop-self.stop) - max(0, start-self.start) overlap_length = float(overlap_length) overlap1 = overlap_length/(stop-start) overlap2 = overlap_length/self.segment_length if overlap1>=self.min_reciprocal_overlap and overlap2>=self.min_reciprocal_overlap: | is_overlap = is_reciprocal_overlap([start, stop], [self.start, self.stop], \ min_reciprocal_overlap=self.min_reciprocal_overlap) if is_overlap: | def addNewCNV(self, chromosome, start, stop, array_id=None): """ """ if self.chromosome is None: self.addOneCNV(chromosome, start, stop, array_id) elif self.chromosome is not None and chromosome!=self.chromosome: return False else: """ boundary_diff1 = abs(start-self.start) boundary_diff2 = abs(stop-self.stop) diff1_pe... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
2 functions: 1. detect deletions. make sure the deletion is covered by the sequencing. | Two functions: 1. deletion_only=True. make sure the deletion is covered by the sequencing. | def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
2. detect copy number changes. If two adjacent probes have different number of contigs, then it's a copy number change point. | 2. deletion_only=False, detect copy number changes. If two adjacent probes have different number of contigs, then it's a copy number change point. | def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
session = db_250k.session | def discoverLerDeletionDuplication(cls, db_250k, ler_blast_result_fname, output_fname, deletion_only=True, min_no_of_matches=25): """ 2009-12-7 ler_blast_result_fname is the output of blasting all CNV probes against Ler contigs http://www.arabidopsis.org/browse/Cereon/index.jsp. 2 functions: 1. detect deletions. make s... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py | |
inputFname1 = '/Network/Data/250k/db/dataset/call_method_35.tsv' inputFname2 = '/Network/Data/250k/db/dataset/call_method_33.tsv' return_data = AnalyzeSNPData.cmpTwoSNPDatasets(inputFname1, inputFname2) | inputFname1 = '/Network/Data/250k/db/dataset/call_method_35.tsv' inputFname2 = '/Network/Data/250k/db/dataset/call_method_33.tsv' return_data = AnalyzeSNPData.cmpTwoSNPDatasets(inputFname1, inputFname2) | def cmpTwoSNPDatasets(cls, inputFname1, inputFname2): """ 2009-6-12 compare two SNP datasets, report: #rows deleted/added #columns deleted/added #SNPs changed (from which to which) """ sys.stderr.write("Comparing two SNP datasets ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData1 = SNPData(input_fn... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
snpData = SNPData(input_fname=inputFname, turn_into_array=1) | row_id_key_set = set([row_id1, row_id2]) snpData = SNPData(input_fname=inputFname, turn_into_array=1, row_id_key_set=row_id_key_set) | def cmpOneRowToTheOther(cls, inputFname, row_id1, row_id2): """ 2009-6-17 compare SNP data of one accession to the other in the same dataset """ sys.stderr.write("Comparing one row to the other ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData = SNPData(input_fname=inputFname, turn_into_array=1) tw... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
inputFname = '/Network/Data/250k/db/dataset/call_method_29.tsv' row_id1 = ('6910', '62') row_id2 = ('8290', '181') AnalyzeSNPData.cmpOneRowToTheOther(inputFname, row_id1, row_id2) | inputFname = '/Network/Data/250k/db/dataset/call_method_29.tsv' row_id1 = ('6910', '62') row_id2 = ('8290', '181') AnalyzeSNPData.cmpOneRowToTheOther(inputFname, row_id1, row_id2) inputFname = os.path.expanduser('~/mnt2/panfs/NPUTE_data/input/250k_l3_y.85_20091208.tsv') row_id1 = ('7034', '1338') row_id2 = ('7035', '... | def cmpOneRowToTheOther(cls, inputFname, row_id1, row_id2): """ 2009-6-17 compare SNP data of one accession to the other in the same dataset """ sys.stderr.write("Comparing one row to the other ... \n") from pymodule import SNPData, TwoSNPData, PassingData snpData = SNPData(input_fname=inputFname, turn_into_array=1) tw... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
ler_blast_result_fname = '/Network/Data/250k/tmp-dazhe/tair9_raw.csv' output_fname = '/tmp/Col-copy-number.tsv' CNV.discoverLerDeletionDuplication(db_250k, ler_blast_result_fname, output_fname, deletion_only=False) """ cnv_intensity_fname = os.path.expanduser('~/mnt2/panfs/250k/CNV/call_method_48_CNV_intensity.tsv') a... | ler_blast_result_fname = '/Network/Data/250k/tmp-dazhe/ler_raw_CNV_QC.csv' max_delta_ratio = 0.4 max_length_delta = 10000 for max_length_delta in range(1,7): max_length_delta = max_length_delta*10000 output_fname = '/tmp/Ler-span-over-Col-mdr%s-mld%s.tsv'%(max_delta_ratio, max_length_delta) CNV.discoverLerContigSpanOve... | def linkEcotypeIDFromSuziPhenotype(cls, fname_with_ID, fname_with_phenotype, output_fname): """ 2009-7-31 she gave me two files one has phenotype data and accession names but with no ecotype ID 2nd is a map from accession name to ecotype ID """ sys.stderr.write("Linking accession names to ecotype ID ... ") import csv i... | 1440ce5092ec2e1bfdd9b1e187e40f109bf0000b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/1440ce5092ec2e1bfdd9b1e187e40f109bf0000b/misc.py |
overlap1 = overlap_length/(qc_stop-qc_start) overlap2 = overlap_length/(segment_stop_pos-segment_start_pos) | overlap1 = overlap_length/(segment_stop_pos-segment_start_pos) overlap2 = overlap_length/(qc_stop-qc_start) | def get_overlap_ratio(span1_ls, span2_ls): """ 2009-12-13 calculate the two overlap ratios for two segments """ segment_start_pos, segment_stop_pos = span1_ls qc_start, qc_stop = span2_ls overlap_length = max(0, segment_stop_pos - qc_start) - max(0, segment_stop_pos - qc_stop) - max(0, segment_start_pos - qc_start) # a... | 36dbdbb0f24610384d1c8a154afacd3e1e038e88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/36dbdbb0f24610384d1c8a154afacd3e1e038e88/CNV.py |
a key designed to represent a CNV segment in a binary search tree (BinarySearchTree.py), which could be used to do == or >, or < operators | a key designed to represent a CNV segment in the node of a binary search tree (BinarySearchTree.py) or RBTree (RBTree.py), It has custom comparison function based on the is_reciprocal_overlap() function. | def is_reciprocal_overlap(span1_ls, span2_ls, min_reciprocal_overlap=0.6): """ 2009-12-12 return True if both overlap ratios are above the min_reciprocal_overlap """ overlap1, overlap2 = get_overlap_ratio(span1_ls, span2_ls) if overlap1>=min_reciprocal_overlap and overlap2>=min_reciprocal_overlap: return True else: ret... | 36dbdbb0f24610384d1c8a154afacd3e1e038e88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/36dbdbb0f24610384d1c8a154afacd3e1e038e88/CNV.py |
return self.span_ls[0]>=other.span_ls[0] and self.span_ls[1]<=other.span_ls[0] | return self.span_ls[0]<=other.span_ls[0] and self.span_ls[1]>=other.span_ls[0] | def __eq__(self, other): """ 2009-12-12 """ if self.chromosome==other.chromosome: if len(self.span_ls)==1: if len(other.span_ls)==1: return self.span_ls[0]==other.span_ls[0] elif len(other.span_ls)>1: return self.span_ls[0]>=other.span_ls[0] and self.span_ls[0]<=other.span_ls[1] # equal if self is within the "other" se... | 36dbdbb0f24610384d1c8a154afacd3e1e038e88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/36dbdbb0f24610384d1c8a154afacd3e1e038e88/CNV.py |
import os, sys | import os, sys, math | def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | 36dbdbb0f24610384d1c8a154afacd3e1e038e88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/36dbdbb0f24610384d1c8a154afacd3e1e038e88/CNV.py |
cnv_ls = [[1, (2323,2600)], [2,(50000,)], [3,(43214,78788)], [5, (43242,)], [5,(144,566)], [5,(150,500)], [5,(500,950)], [5, (43241, 43242)]] | cnv_ls = [[1, (2323,2600)], [2,(50000,)], [3,(43214,78788)], [5,(150,500)], [5,(500,950)], [5, (43241, 43242)]] | def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | 36dbdbb0f24610384d1c8a154afacd3e1e038e88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/36dbdbb0f24610384d1c8a154afacd3e1e038e88/CNV.py |
print "==", segmentKey1==segmentKey2 | print "==", segmentKey1==segmentKey2 """ | def getCNVDataFromFileInGWA(input_fname_ls, array_id, max_amp=-0.33, min_amp=-0.33, min_size=50, min_no_of_probes=None, report=False): """ 2009-10-31 get deletion (below max_amp) or duplication (above min_amp) from files (output by RunGADA.py) """ sys.stderr.write("Getting CNV calls for array %s, min_size %s, min_no_of... | 36dbdbb0f24610384d1c8a154afacd3e1e038e88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/36dbdbb0f24610384d1c8a154afacd3e1e038e88/CNV.py |
@classmethod | def __init__(self, **keywords): """ 2008-11-10 upgrade option handling to ProcessOptions 2008-4-2 2008-02-28 argument_default_dict is a dictionary of default arguments, the key is a tuple, ('argument_name', is_argument_required, argument_type) argument_type is optional """ #argument dictionary #self.ad = process_funct... | 339ac869d54e6144748e13b6884314d8f95506dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/339ac869d54e6144748e13b6884314d8f95506dd/OutputPhenotype.py | |
get_phenotype_method_id_info = classmethod(get_phenotype_method_id_info) | @classmethod | def get_phenotype_method_id_info(cls, curs, phenotype_avg_table, phenotype_method_table ): """ 2009-2-2 curs could be either MySQLdb cursor or elixirdb.metadata.bind. do two selects in one 2008-4-2 """ sys.stderr.write("Getting phenotype_method_id info ... " ) phenotype_method_id2index = {} #index of the matrix method... | 339ac869d54e6144748e13b6884314d8f95506dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/339ac869d54e6144748e13b6884314d8f95506dd/OutputPhenotype.py |
get_ecotype_id2info = classmethod(get_ecotype_id2info) | @classmethod | def get_ecotype_id2info(cls, curs, phenotype_avg_table, ecotype_table): """ 2009-2-2 curs could be either MySQLdb cursor or elixirdb.metadata.bind. do two selects in one 2008-4-2 """ sys.stderr.write("Getting ecotype id info ... " ) ecotype_id2index = {} #index of the matrix ecotype_id_ls = [] ecotype_name_ls = [] row... | 339ac869d54e6144748e13b6884314d8f95506dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/339ac869d54e6144748e13b6884314d8f95506dd/OutputPhenotype.py |
get_matrix = classmethod(get_matrix) | @classmethod | def get_matrix(cls, curs, phenotype_avg_table, ecotype_id2index, phenotype_info, get_raw_data=0, \ phenotype_method_table='phenotype_method'): """ 2009-9-2 if value>-5e-7 and value<+5e-7: #beyond float resolution by a python float value = 0 without condition above, values like -5.32907e-15 would be taken as -5.32907e,... | 339ac869d54e6144748e13b6884314d8f95506dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/339ac869d54e6144748e13b6884314d8f95506dd/OutputPhenotype.py |
getPhenotypeData = classmethod(getPhenotypeData) | def getPhenotypeData(cls, curs, phenotype_avg_table=None, phenotype_method_table=None, ecotype_table='stock.ecotype', get_raw_data=1): """ 2009-2-2 wrap up all other 3 methods """ phenotype_info = cls.get_phenotype_method_id_info(curs, phenotype_avg_table, phenotype_method_table) ecotype_id2index, ecotype_id_ls, ecotyp... | 339ac869d54e6144748e13b6884314d8f95506dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/339ac869d54e6144748e13b6884314d8f95506dd/OutputPhenotype.py | |
write_data_matrix(pheno_data.data_matrix, self.output_fname, header, pheno_data.row_id_ls, pheno_data.row_label_ls) | write_data_matrix(pheno_data.data_matrix, self.output_fname, header, pheno_data.row_id_ls, pheno_data.row_label_ls, \ transform_to_numpy=False) | def run(self): import MySQLdb conn = MySQLdb.connect(db=self.dbname, host=self.hostname, user = self.db_user, passwd = self.db_passwd) curs = conn.cursor() pheno_data = self.getPhenotypeData(curs, self.phenotype_avg_table, self.phenotype_method_table, \ self.ecotype_table, get_raw_data=self.get_raw_data) header = ['e... | 339ac869d54e6144748e13b6884314d8f95506dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/339ac869d54e6144748e13b6884314d8f95506dd/OutputPhenotype.py |
def output(self, data_matrix, probe_id_ls, chr_pos_ls, header, output_fname_prefix, split_genome_into_chromosomes=False): """ | @classmethod def output(cls, data_matrix, probe_id_ls, chr_pos_ls, header, output_fname_prefix, split_genome_into_chromosomes=False): """ 2010-2-10 becomes classmethod | def output(self, data_matrix, probe_id_ls, chr_pos_ls, header, output_fname_prefix, split_genome_into_chromosomes=False): """ 2009-10-11 add argument split_genome_into_chromosomes 2009-5-18 split output into different chromosomes """ sys.stderr.write("Outputting ...") no_of_rows, no_of_cols = data_matrix.shape old_chr ... | 2759a1490370872028c717552507aa70488eb7b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9645/2759a1490370872028c717552507aa70488eb7b0/CNVNormalize.py |
return redirect_to("/css/main.css") | response.headers['content-type'] = 'text/css; charset=utf-8' return render("/css/main.css") | def index(self): return redirect_to("/css/main.css") | 809296bee0e644a26a70efb8cc25029cfecdc922 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8621/809296bee0e644a26a70efb8cc25029cfecdc922/style.py |
return redirect_to("/css/main.css") | response.headers['content-type'] = 'text/css; charset=utf-8' return render("/css/main.css") | def index(self): return redirect_to("/css/main.css") | 8319affe152b653b30ff97360f8e303955b8480e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8621/8319affe152b653b30ff97360f8e303955b8480e/style.py |
self.url = ozutil.check_url(self.url) | self.url = ozutil.check_url(idl.url()) | def __init__(self, idl, config): update = idl.update() if idl.arch() != "i386": raise Exception, "Invalid arch " + arch + "for RHEL-2.1 guest" self.ks_file = ozutil.generate_full_auto_path("rhel-2.1-jeos.ks") | 139efedce599d493e1e1bb4e964f632be6eca3db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/139efedce599d493e1e1bb4e964f632be6eca3db/RHEL_2_1.py |
self.log.info("%dkB of %dkB" % (down_current/1024, down_total/1024)) | if down_total == 0: return current_mb = int(down_current) / 10485760 if current_mb > self.last_mb or down_current == down_total: self.last_mb = current_mb self.log.debug("%dkB of %dkB" % (down_current/1024, down_total/1024)) | def progress(down_total, down_current, up_total, up_current): # FIXME: we should probably not print every single time this is # called; maybe every 1MB or so? self.log.info("%dkB of %dkB" % (down_current/1024, down_total/1024)) | b975700216038ba5992f0b793718e46a0c0e6ab5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/b975700216038ba5992f0b793718e46a0c0e6ab5/Guest.py |
initrdline += self.url + "\n" | initrdline += " repo=" + self.url + "\n" | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 5225240a64ce33ed859027b79ec241e86a58e98f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/5225240a64ce33ed859027b79ec241e86a58e98f/RHEL_6.py |
interfaceModel.setProp("type", "virtio") | interfaceModel.setProp("type", self.nicmodel) | def generate_define_xml(self, bootdev, want_install_disk=True): self.log.info("Generate/define XML for guest %s with bootdev %s" % (self.name, bootdev)) | 63a1ad23895a8e95208ccb794d96f7480144936c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/63a1ad23895a8e95208ccb794d96f7480144936c/Guest.py |
self.url = ozutil.check_url(self.url) | self.url = ozutil.check_url(idl.url()) | def __init__(self, idl, config): update = idl.update() arch = idl.arch() self.ks_file = ozutil.generate_full_auto_path("rhel-3-jeos.ks") | d0112eb3a209e298ae1c0f2ca5c33ab405e5d858 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/d0112eb3a209e298ae1c0f2ca5c33ab405e5d858/RHEL_3.py |
disks = input_doc.xpathEval('/domain/devices/disk/source') | disks = input_doc.xpathEval('/domain/devices/disk') | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py |
input_disk = disks[0].prop('file') | source = disks[0].xpathEval('source') if len(source) != 1: raise Exception, "invalid <disk> entry without a source" input_disk = source[0].prop('file') driver = disks[0].xpathEval('driver') if len(driver) == 0: input_disk_type = 'raw' elif len(driver) != 1: input_disk_type = driver[0].prop('type') else: raise Exception... | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py |
g.add_drive(input_disk) | g.add_drive_opts(input_disk, format=input_disk_type) | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py |
os = g.inspect_os() | roots = g.inspect_os() if len(roots) == 0: raise Exception, "No operating systems found on the disk" | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py |
mountpoints = g.inspect_get_mountpoints(os[0]) self.log.debug("Mounting /") for point in mountpoints: if point[0] == '/': g.mount(point[1], '/') break self.log.debug("Mount other filesystems") for point in mountpoints: if point[0] != '/': g.mount(point[1], point[0]) | for root in roots: self.log.debug("Root device: %s" % root) mps = g.inspect_get_mountpoints(root) def compare(a, b): if len(a[0]) > len(b[0]): return 1 elif len(a[0]) == len(b[0]): return 0 else: return -1 mps.sort(compare) for mp_dev in mps: g.mount_options('', mp_dev[1], mp_dev[0]) | def guestfs_handle_setup(self, libvirt_xml): input_doc = libxml2.parseMemory(libvirt_xml, len(libvirt_xml)) namenode = input_doc.xpathEval('/domain/name') if len(namenode) != 1: raise Exception, "invalid libvirt XML with no name" input_name = namenode[0].getContent() disks = input_doc.xpathEval('/domain/devices/disk/so... | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py |
tarout = self.iso_contents + "/data.tar" | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py | |
gfs.add_drive(self.orig_iso) | gfs.add_drive_opts(self.orig_iso, readonly=1, format='raw') | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py |
gfs.mount("/dev/sda", "/") self.log.debug("Getting data from ISO onto %s" % (tarout)) gfs.tar_out("/", tarout) self.log.debug("Cleaning up guestfs process") | gfs.mount_options('ro', "/dev/sda", "/") rd,wr = os.pipe() current = os.getcwd() os.chdir(self.iso_contents) tar = subprocess.Popen(["tar", "-x", "-v"], stdin=rd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.log.debug("Extracting ISO contents:") gfs.tar_out("/", "/dev/fd/%d" % wr) self.log.debug("%s" % t... | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py |
self.log.debug("Extracting tarball") tar = tarfile.open(tarout) tar.extractall(path=self.iso_contents) self.log.debug("Removing tarball") os.unlink(tarout) | def copy_iso(self): self.log.info("Copying ISO contents for modification") if os.access(self.iso_contents, os.F_OK): shutil.rmtree(self.iso_contents) os.makedirs(self.iso_contents) | ec4f0d5c04b33726f2329f43429c40b92c42e6c7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/ec4f0d5c04b33726f2329f43429c40b92c42e6c7/Guest.py | |
def __init__(self, idl, config, nicmodel, haverepo, diskbus): | def __init__(self, idl, config, nicmodel, haverepo, diskbus, brokenisomethod): | def __init__(self, idl, config, nicmodel, haverepo, diskbus): update = idl.update() arch = idl.arch() self.ks_file = ozutil.generate_full_auto_path("fedora-" + update + "-jeos.ks") self.haverepo = haverepo self.installtype = idl.installtype() | 78204acfbf9d687c0b46895791efc62952946213 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/78204acfbf9d687c0b46895791efc62952946213/Fedora.py |
eltoritodata = cdfile.read(count*2048) | eltoritodata = cdfile.read(count*512) | def checksum(data): s = 0 for i in range(0, len(data), 2): w = ord(data[i]) + (ord(data[i+1]) << 8) s = numpy.uint16(numpy.uint16(s) + numpy.uint16(w)) return s | 484d69b7885d5f00906e3ba18cc9fbe2eb2951f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/484d69b7885d5f00906e3ba18cc9fbe2eb2951f8/Guest.py |
initrdline = " append initrd=initrd.img ks=cdrom:/ks.cfg method=" | initrdline = " append initrd=initrd.img ks=cdrom:/ks.cfg" | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 57ebceca9f9368a8dadbde08a57b46e2e76d2bf8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/57ebceca9f9368a8dadbde08a57b46e2e76d2bf8/RHEL_6.py |
initrdline += "cdrom:/dev/cdrom\n" | initrdline += "\n" | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 57ebceca9f9368a8dadbde08a57b46e2e76d2bf8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/57ebceca9f9368a8dadbde08a57b46e2e76d2bf8/RHEL_6.py |
if self.haverepo: initrdline += " repo=" else: initrdline += " method=" | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 6952aa087833437094e0e79cc8c39a181e8c9f26 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/6952aa087833437094e0e79cc8c39a181e8c9f26/Fedora.py | |
initrdline += "cdrom:/dev/cdrom\n" | initrdline += "\n" | def modify_iso(self): self.log.debug("Putting the kickstart in place") | 6952aa087833437094e0e79cc8c39a181e8c9f26 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/6952aa087833437094e0e79cc8c39a181e8c9f26/Fedora.py |
packages = cdl.newChild(None, "packages", None) | def output_cdl_xml(self, lines, services): doc = libxml2.newDoc("1.0") cdl = doc.newChild(None, "cdl", None) packages = cdl.newChild(None, "packages", None) | 014e89abab5f0cdac7121e356968182025e9747a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/014e89abab5f0cdac7121e356968182025e9747a/Guest.py | |
packages.newChild(None, "package", None) packages.setProp("name", line) | package = packages.newChild(None, "package", None) package.setProp("name", line) | def output_cdl_xml(self, lines, services): doc = libxml2.newDoc("1.0") cdl = doc.newChild(None, "cdl", None) packages = cdl.newChild(None, "packages", None) | 014e89abab5f0cdac7121e356968182025e9747a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/014e89abab5f0cdac7121e356968182025e9747a/Guest.py |
self.log.debug("Name: %s, UUID: %s, MAC: %s, distro: %s" % (self.name, self.uuid, self.macaddr, self.distro)) | self.log.debug("Name: %s, UUID: %s" % (self.name, self.uuid)) self.log.debug("MAC: %s, distro: %s" % (self.macaddr, self.distro)) | def __init__(self, distro, update, arch, nicmodel, clockoffset, mousetype, diskbus, config): if arch != "i386" and arch != "x86_64": raise Exception, "Unsupported guest arch " + arch self.log = logging.getLogger('%s.%s' % (__name__, self.__class__.__name__)) self.uuid = uuid.uuid4() mac = [0x52, 0x54, 0x00, random.rand... | 446d88e31facb7d96794fdbc733cb97329c67bd6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/446d88e31facb7d96794fdbc733cb97329c67bd6/Guest.py |
"-o", output, inputdir]) | "-o", self.output_iso, self.iso_contents]) | def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | b9c87838b314e44a46f30735d0e6dfea21d22ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/b9c87838b314e44a46f30735d0e6dfea21d22ff6/Ubuntu.py |
"-o", output, inputdir]) | "-o", self.output_iso, self.iso_contents]) | def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | b9c87838b314e44a46f30735d0e6dfea21d22ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/b9c87838b314e44a46f30735d0e6dfea21d22ff6/Ubuntu.py |
"-o", output, inputdir]) | "-o", self.output_iso, self.iso_contents]) | def generate_new_iso(self): self.log.info("Generating new ISO") Guest.subprocess_check_output(["mkisofs", "-r", "-V", "Custom", "-cache-inodes", "-J", "-l", "-b", "isolinux/isolinux.bin", "-c", "isolinux/boot.cat", "-no-emul-boot", "-boot-load-size", "4", "-boot-info-table", "-v", "-v", "-o", output, inputdir]) | b9c87838b314e44a46f30735d0e6dfea21d22ff6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/b9c87838b314e44a46f30735d0e6dfea21d22ff6/Ubuntu.py |
def targetDev(self, doc, type, path, bus): | def targetDev(self, doc, devicetype, path, bus): | def targetDev(self, doc, type, path, bus): installNode = doc.createElement("disk") installNode.setAttribute("type", "file") installNode.setAttribute("device", type) sourceInstallNode = doc.createElement("source") sourceInstallNode.setAttribute("file", path) installNode.appendChild(sourceInstallNode) targetInstallNode =... | 1f0323a18ecdf94f3b3336d1df235fcd65c18c27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/1f0323a18ecdf94f3b3336d1df235fcd65c18c27/Guest.py |
installNode.setAttribute("device", type) | installNode.setAttribute("device", devicetype) | def targetDev(self, doc, type, path, bus): installNode = doc.createElement("disk") installNode.setAttribute("type", "file") installNode.setAttribute("device", type) sourceInstallNode = doc.createElement("source") sourceInstallNode.setAttribute("file", path) installNode.appendChild(sourceInstallNode) targetInstallNode =... | 1f0323a18ecdf94f3b3336d1df235fcd65c18c27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14184/1f0323a18ecdf94f3b3336d1df235fcd65c18c27/Guest.py |
dl.ReplyToThread(game.threadId, ":redhammer: " + (msg % name)) | dl.ReplyToThread(game.threadId, ":redhammer: " + (message % name)) | def PostLynchedMessage(self, game, name): if not game.post_lynches: return | ebcfdbd4bc3f0fbfa20bc46d89494ab738804fb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4484/ebcfdbd4bc3f0fbfa20bc46d89494ab738804fb6/VoteCounter.py |
current_day = models.IntegerField() living_count = models.IntegerField() players_count = models.IntegerField() | current_day = models.IntegerField(default=1) living_count = models.IntegerField(default=0) players_count = models.IntegerField(default=0) | def twitter_in_bg(msg): consumer_key = "r11W5M2m2tdNtcknWSjNKw" consumer_secret = "zSd0vCV2mTcWVyKfAKiIcm6gdzozLEVMjXXpT51XV3c" oauth_token = "166303978-z0Dp7pAoKrgs2ZjN7rCmwVmd9zum4LaUNjH5fzhJ" oauth_token_secret = "YK7cOAF7HcSbvn43EPGBgSXyQ5RWIaruYAfTz3lNpwE" twitter = OAuthApi(consumer_key, consumer_secret, oauth_t... | dcbbb3af41907b7f430ff895f3a336e9fb811d1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4484/dcbbb3af41907b7f430ff895f3a336e9fb811d1d/models.py |
inputs['disablesmilies'] = 'no' | del inputs['disablesmilies'] | def ReplyToThread(self, thread, message): getUrl = "http://forums.somethingawful.com/newreply.php?action=newreply&threadid=%s" % thread postUrl = "http://forums.somethingawful.com/newreply.php?action=newreply" | bb26371a1f352068ac9603e8f5fcd2bb2bd896f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4484/bb26371a1f352068ac9603e8f5fcd2bb2bd896f7/ForumPageDownloader.py |
a.disconnect() a.connect("localhost", 6000, sys.argv[1]) | def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | f417b066878268ec2a67843ba7989753eac7abc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/f417b066878268ec2a67843ba7989753eac7abc8/agent.py | |
def __init__(self, world_model): | def __init__(self, world_model, body_model): | def __init__(self, world_model): self.world_model = world_model | 0a5746747f2505845410e3c0e82f441b81aab1e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/0a5746747f2505845410e3c0e82f441b81aab1e6/handler.py |
msg = "(kick %.10f %.10f)" | msg = "(kick %.10f %.10f)" % (power, relative_direction) | def kick(self, power, relative_direction): """ Accelerates the ball with the given power in the given direction, relative to the current direction of the player's body. """ | 0a5746747f2505845410e3c0e82f441b81aab1e6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/0a5746747f2505845410e3c0e82f441b81aab1e6/handler.py |
setattr(self, item, lambda *args: bork()) | setattr(self, item, lambda *args: destroyed_method()) | def destroyed_method(): """ Raises an error, no matter the arguments given. """ m = ("Agent has been disconnected and no longer supports " "any method calls.") raise NotImplementedError(m) | 04a87a8817b2262987d6932fb6466dcb6f9933ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/04a87a8817b2262987d6932fb6466dcb6f9933ea/agent.py |
super.__init__(self, distance, direction) | GameObject.__init__(self, distance, direction) | def __init__(self, distance, direction, position): """ Field objects have a position in addition to GameObject's members. """ | bee1b1aa333b581e45d525c4630646129d40c777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/bee1b1aa333b581e45d525c4630646129d40c777/game_object.py |
super.__init__(self, distance, direction) | GameObject.__init__(self, distance, direction) | def __init__(self, distance, direction, line_id): self.line_id = line_id super.__init__(self, distance, direction) | bee1b1aa333b581e45d525c4630646129d40c777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/bee1b1aa333b581e45d525c4630646129d40c777/game_object.py |
super.__init__(self, distance, direction, position) | FieldObject.__init__(self, distance, direction, position) | def __init__(self, distance, direction, position, dist_change, dir_change, speed): """ Adds variables for velocity vector deltas. """ | bee1b1aa333b581e45d525c4630646129d40c777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/bee1b1aa333b581e45d525c4630646129d40c777/game_object.py |
super.__init__(self, distance, direction, position) | FieldObject.__init__(self, distance, direction, position) | def __init__(self, distance, direction, position): | bee1b1aa333b581e45d525c4630646129d40c777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/bee1b1aa333b581e45d525c4630646129d40c777/game_object.py |
super.__init__(self, distance, direction, position, dist_change, | MobileObject.__init__(self, distance, direction, position, dist_change, | def __init__(self, distance, direction, position, dist_change, dir_change, speed): super.__init__(self, distance, direction, position, dist_change, dir_change, speed) | bee1b1aa333b581e45d525c4630646129d40c777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/bee1b1aa333b581e45d525c4630646129d40c777/game_object.py |
super.__init__(self, distance, direction, position, dist_change, | MobileObject.__init__(self, distance, direction, position, dist_change, | def __init__(self, distance, direction, position, dist_change, dir_change, speed, team, side, uniform_number, body_direction, face_direction, neck_direction): """ Adds player-specific information to a mobile object. """ | bee1b1aa333b581e45d525c4630646129d40c777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/bee1b1aa333b581e45d525c4630646129d40c777/game_object.py |
super.__init__(self, distance, direction, position) | StationaryObject.__init__(self, distance, direction, position) | def __init__(self, distance, direction, position, marker_id): """ Adds a marker id for this field object. Every marker has a unique id. """ | bee1b1aa333b581e45d525c4630646129d40c777 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/bee1b1aa333b581e45d525c4630646129d40c777/game_object.py |
for agent in xrange(max(11, int(sys.argv[2]))): | for agent in xrange(min(11, int(sys.argv[2]))): | def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | 90fd4f6840a58bd3ad7b2271356e521474cd6541 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/90fd4f6840a58bd3ad7b2271356e521474cd6541/agent.py |
m = "Server returned an error: '%s'" % msg[1:] | m = "Server returned an error: '%s'" % msg[1] | def _handle_error(self, msg): """ Deals with error messages by raising them as exceptions. """ | 71e12d1b5eaf057668ebf4ecc32e9f3ac16d6b17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/71e12d1b5eaf057668ebf4ecc32e9f3ac16d6b17/worldmodel.py |
def __init__(self, host, port, teamname, version=11): """ Gives us a connection to the server as one player on a team. This immediately connects the agent to the server and starts receiving and parsing the information it sends. """ | 24cfef640ebac8f11c64bf93d8e35d395690a310 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/24cfef640ebac8f11c64bf93d8e35d395690a310/agent.py | ||
self.msg_handler = handler.MessageHandler(self.world) | self.msg_handler = handler.MessageHandler(self.world, self.body) | def __init__(self, host, port, teamname, version=11): """ Gives us a connection to the server as one player on a team. This immediately connects the agent to the server and starts receiving and parsing the information it sends. """ | 24cfef640ebac8f11c64bf93d8e35d395690a310 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/24cfef640ebac8f11c64bf93d8e35d395690a310/agent.py |
self.act_handler.move(1000, 1000) | if not self.moved: self.act_handler.move(1000, 1000) self.moved = True if self.world.ball is not None: if self.world.ball.distance <= 1: self.act_handler.kick(100, random.randint(0, 181) - 180) return elif -5 < self.world.ball.direction < 5: self.act_handler.dash(100) return else: self.act_handler.turn(self.world.b... | def think(self): """ Performs a single step of thinking for our agent. Gets called on every iteration of our think loop. """ | 24cfef640ebac8f11c64bf93d8e35d395690a310 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/24cfef640ebac8f11c64bf93d8e35d395690a310/agent.py |
parse_message(line.strip()) | parse(line.strip()) | def stringify(itemlist): """ Takes a list generated by parsing a message and condenses the characters it contains into strings, seperating them by spaces and leaving them alongside the lists therin. """ result = [] s = "" for item in itemlist: if item == " ": if s != "": result.append(s) s = "" elif type(item) is typ... | 8fcaae64233bfd6a299562185d21e2887ea49d6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13574/8fcaae64233bfd6a299562185d21e2887ea49d6c/message_parser.py |
for i, (vertex1_label, vertex2_label, edge ) in enumerate( edges_from_osmdb( osmdb, vertices_namespace, slogs, profiledb ) ): | for i, (vertex1_label, vertex2_label, edge ) in enumerate( edges_from_osmdb( osmdb, vertex_namespace, slogs, profiledb ) ): | def gdb_import_osm(gdb, osmdb, vertex_namespace, slogs, profiledb=None): cursor = gdb.get_cursor() n_edges = osmdb.count_edges() # for each edge in the osmdb for i, (vertex1_label, vertex2_label, edge ) in enumerate( edges_from_osmdb( osmdb, vertices_namespace, slogs, profiledb ) ): if i%(n_edges//100+1)==0: sys.std... | 529ad32d049e1f0bb2e0d949c186a104bc6fdec9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/529ad32d049e1f0bb2e0d949c186a104bc6fdec9/gdb_import_osm.py |
c = gdb.get_cursor() | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 008c6718582ebe64d24072d146e36ffad6265616 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/008c6718582ebe64d24072d146e36ffad6265616/gdb_import_gtfs.py | |
gdb.add_vertex( fromv_label, c ) | gdb.add_vertex( fromv_label, cursor ) | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 008c6718582ebe64d24072d146e36ffad6265616 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/008c6718582ebe64d24072d146e36ffad6265616/gdb_import_gtfs.py |
gdb.add_vertex( tov_label, c ) | gdb.add_vertex( tov_label, cursor ) | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 008c6718582ebe64d24072d146e36ffad6265616 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/008c6718582ebe64d24072d146e36ffad6265616/gdb_import_gtfs.py |
gdb.add_edge( fromv_label, tov_label, edge, c ) gdb.commit() | gdb.add_edge( fromv_label, tov_label, edge, cursor ) | def gdb_load_gtfsdb(gdb, agency_namespace, gtfsdb, cursor, agency_id=None, maxtrips=None, sample_date=None, reporter=sys.stdout): # determine which service periods run on the given day, if a day is given if sample_date is not None: sample_date = datetime.date( *parse_gtfs_date( sample_date ) ) acceptable_service_ids =... | 008c6718582ebe64d24072d146e36ffad6265616 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/008c6718582ebe64d24072d146e36ffad6265616/gdb_import_gtfs.py |
if reporter and i%(n//100)==0: reporter.write( "%d/%d vertices dumped\n"%(i,n) ) | if reporter and i%(nseg//100)==0: reporter.write( "%d/%d vertices dumped\n"%(i,n) ) | def populate(self, graph, reporter=None): c = self.conn.cursor() n = len(graph.vertices) for i, vv in enumerate( graph.vertices ): if reporter and i%(n//100)==0: reporter.write( "%d/%d vertices dumped\n"%(i,n) ) c.execute( "INSERT INTO vertices VALUES (?)", (vv.label,) ) for ee in vv.outgoing: c.execute( "INSERT INTO... | c69cb7e1fdf3fe1a00709681113f6fa12cf70739 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/c69cb7e1fdf3fe1a00709681113f6fa12cf70739/graphdb.py |
id = self.index.nearest( (lon, lat), 1 )[0] | id = list(self.index.nearest( (lon, lat), 1 ))[0] | def nearest_node(self, lat, lon, range=0.005): c = self.get_cursor() if self.index: #print "YOUR'RE USING THE INDEX" id = self.index.nearest( (lon, lat), 1 )[0] #print "THE ID IS %d"%id c.execute( "SELECT id, lat, lon FROM nodes WHERE id = ?", (id,) ) else: c.execute( "SELECT id, lat, lon FROM nodes WHERE endnode_refs... | 131a09d5c6809ca17c5e45a44ef9772320d708e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/131a09d5c6809ca17c5e45a44ef9772320d708e1/osmdb.py |
TestHeadwayAlight, | def glen(gen): return len(list(gen)) | 965d2fdf3748091a8bb749fe0b372388a7986f8d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/965d2fdf3748091a8bb749fe0b372388a7986f8d/unit_test.py | |
if not dryrun: superself.add_way( self.currElem, c ) | if not dryrun and accept(self.currElem.tags): superself.add_way( self.currElem, c ) | def endElement(self,name): if name=='node': if superself.n_nodes%5000==0: print "node %d"%superself.n_nodes superself.n_nodes += 1 if not dryrun: superself.add_node( self.currElem, c ) elif name=='way': if superself.n_ways%5000==0: print "way %d"%superself.n_ways superself.n_ways += 1 if not dryrun: superself.add_way( ... | dc08070bc6e295986633cf510ca46a2f8d451b92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/dc08070bc6e295986633cf510ca46a2f8d451b92/osmdb.py |
log.debug(gtfs_header) | print(gtfs_header) | def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | 5cb3ca89a5d953aecb773f70f7f2f38a1f5a8b85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/5cb3ca89a5d953aecb773f70f7f2f38a1f5a8b85/gtfsdb.py |
log.debug( insert_template ) | print( insert_template ) | def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | 5cb3ca89a5d953aecb773f70f7f2f38a1f5a8b85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/5cb3ca89a5d953aecb773f70f7f2f38a1f5a8b85/gtfsdb.py |
if i%5000==0: log.debug(i) | if i%5000==0: print(i) | def load_gtfs_table_to_sqlite(fp, gtfs_basename, cc, header=None, verbose=False): """header is iterable of (fieldname, fieldtype, processing_function). For example, (("stop_sequence", "INTEGER", int),). "TEXT" is default fieldtype. Default processing_function is lambda x:x""" ur = UTF8TextFile( fp ) rd = csv.reader( u... | 5cb3ca89a5d953aecb773f70f7f2f38a1f5a8b85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10974/5cb3ca89a5d953aecb773f70f7f2f38a1f5a8b85/gtfsdb.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.