break return False def main(overlap=10, minNReads=1): for line in sys.stdin: sampN, loc, exn, cnt = line.split('\t') chrom, pos = loc.split(':') strand = exn[0] if int(cnt) < minNReads: continue if (strand == '+' and not exonInclusion(chrom, int(pos), int(pos) + overlap) ) or (strand == '-' and not exonInclusion(chrom, int(pos) - overlap, int(pos))): sys.stdout.write(line) optL, argL = getopt.getopt(sys.argv[1:], 'i:o:s:', []) optH = mybasic.parseParam(optL) exonH = loadExonH() main(10, 1)
for sampN in sampNameL: # if sampN[7:-5] not in ['TCGA-28-5216-01A-01R-1850-01.4']: # continue if pbs: os.system('echo "sort -k1,1 -k2,2n < %s/%s.bed > %s/%s.bed.sorted" | \ qsub -N %s -o %s/%s.sortBed.qlog -j oe' % (inputDirN,sampN, outputDirN,sampN, sampN, outputDirN,sampN)) else: print sampN os.system('(sort -k1,1 -k2,2n < %s/%s.bed > %s/%s.bed.sorted) 2> %s/%s.sortBed.qlog' % \ (inputDirN,sampN, outputDirN,sampN, outputDirN,sampN)) optL, argL = getopt.getopt(sys.argv[1:],'i:o:p',[]) optH = mybasic.parseParam(optL) inputDirN = optH['-i'] if '-o' in optH: outputDirN = optH['-o'] else: outputDirN = inputDirN sortBed_batch(inputDirN,outputDirN,'-p' in optH)