seqFilename = GENOME_FILE % options.organism elif options.promoterome: seqFilename = PROMOTEROME_FILE % options.organism else: seqFilename = options.fasta result = ScoreTalesfTask(seqFilename, options.rvdString, options.outputFilepath, options.logFilepath, forwardOnly, options.cupstream, options.cutoff, 4, options.organism if options.genome else "") if(result == 1): raise TaskError() if __name__ == '__main__': # import arguments and options usage = 'usage: %prog [options]' parser = OptParser(usage=usage) # input options parser.add_option('-f', '--fasta', dest='fasta', type='string', default='NA', help='Path to input file if input is not a genome or promoterome') parser.add_option('--ncbi', dest='ncbi', type='string', default='NA', help='NCBI nucleotide sequence ID to search') parser.add_option('-y', '--genome', dest='genome', action = 'store_true', default = False, help='Input is a genome file') parser.add_option('-x', '--promoterome', dest='promoterome', action = 'store_true', default = False, help='Input is a promoterome file') parser.add_option('-o', '--organism', dest='organism', type = 'string', default='NA', help='Name of organism for the genome to be searched.') # program options parser.add_option('-u', '--cupstream', dest='cupstream', type='int', default = 0, help='1 to look for C instead of T, 2 to look for either') parser.add_option('-t', '--cutoff', dest='cutoff', type='float', default = 3.0, help='The threshold score that results must meet') parser.add_option('-c', '--revcomp', dest='revcomp', action = 'store_true', default = False, help='Search the reverse complement of the input FASTA sequences') parser.add_option('-r', '--rvds', dest='rvdString', type = 'string', default='NA', help='RVD sequence seperated by spaces or underscores.') #Drupal options parser.add_option('-p', '--outpath', dest='outputFilepath', type='string', default = 'NA', help='Template file path for output file') parser.add_option('-l', '--logpath', dest='logFilepath', type='string', default = 'NA', help='Process log file path') parser.add_option('-z', '--nodeid', dest='nodeID', type='int', default = '-1', help='Drupal node ID')
if len(binding_sites_unique_plus_minus_pairs.keys()) > 0: for gene in binding_sites_unique_plus_minus_pairs.keys(): for start_site in binding_sites_unique_plus_minus_pairs[gene].keys(): for binding_site in binding_sites_unique_plus_minus_pairs[gene][start_site]: out.write(gene.id + '\t' + str(binding_site.start1) + '\t' + str(binding_site.start2) + '\t' + str(len(binding_site.seq1)) + '\t' + str(len(binding_site.seq2_plus)) + '\t' + str(binding_site.spacer) + '\t' + str(binding_site.start1+len(binding_site.seq1)) + '-' + str(binding_site.start1+len(binding_site.seq1) + binding_site.spacer-1) + '\t' + binding_site.perfectTAL1 + '\t' + binding_site.perfectTAL2 + '\t' + binding_site.upstream.upper() + " " + str(binding_site.seq1) + ' ' + str(binding_site.spacerseq).lower() + ' ' + str(binding_site.seq2_plus) + " " + ("A" if binding_site.upstream == "T" else "G") + '\t' + binding_site.re_sites + '\n') out.close() logger('Finished') if __name__ == '__main__': #signal.signal(signal.SIGUSR2, lambda sig, frame: code.interact()) # import arguments and options usage = 'usage: %prog [options]' parser = OptParser(usage=usage) parser.add_option('-f', '--fasta', dest='fasta', type='string', default='NA', help='FASTA file containing promoter sequence(s).') parser.add_option('-j', '--job', dest='job', type='string', default='output', help='the job name, output files will have the job name as a prefix.') parser.add_option('-m', '--min', dest='min', type='int', default=None, help='the minimum spacer size to try') parser.add_option('-x', '--max', dest='max', type='int', default=None, help='the maximum spacer size to try') parser.add_option('-t', '--t1', dest='t1', action='store_false', default = True, help='Do not enforce rule "No T at position 1."') parser.add_option('-a', '--a2', dest='a2', action='store_false', default = True, help='Do not enforce rule "No A at position 1."') parser.add_option('-n', '--tn', dest='tn', action='store_false', default = True, help='Do not enforce rule "Sites must end in a T."') parser.add_option('-g', '--gn', dest='gn', action='store_false', default = True, help='Do not enforce rule "Sites may not end in G/NN."') parser.add_option('-c', '--comp', dest='comp', action='store_false', default = True, help='Do not enforce base composition rules.') parser.add_option('-d', '--outdir', dest='outdir', type='string', default = 'upload/', help='Directory in which to place output files.') parser.add_option('-o', '--outfile', dest='outfile', type='string', default = '_TALEN_pairs_all.txt', help='Optional filename for output file.') parser.add_option('-r', '--arraymin', dest='arraymin', type='int', default=None, help='the minimum repeat array length to try') parser.add_option('-y', '--arraymax', dest='arraymax', type='int', default=None, help='the maximum repeat array length to try') parser.add_option('-u', '--cupstream', dest='cupstream', type='int', default = 0, help='1 to look for C instead of T, 2 to look for either') #Drupal options
if options.check_offtargets: output_items.append(" ".join(str(binding_site.offtarget_counts[x]) for x in range(5))) out.write("\t".join(output_items) + "\n") out.close() seq_file.close() logger("Finished") if __name__ == "__main__": # import arguments and options usage = "usage: %prog [options]" parser = OptParser(usage=usage) parser.add_option( "--fasta", dest="fasta", type="string", default="NA", help="FASTA file containing promoter sequence(s)." ) parser.add_option("--min", dest="min", type="int", default=None, help="the minimum spacer size to try") parser.add_option("--max", dest="max", type="int", default=None, help="the maximum spacer size to try") parser.add_option( "--arraymin", dest="arraymin", type="int", default=None, help="the minimum repeat array length to try" ) parser.add_option( "--arraymax", dest="arraymax", type="int", default=None, help="the maximum repeat array length to try" ) parser.add_option( "--cupstream", dest="cupstream", type="int",
if binding_site.is_plus: out.write(binding_site.gene_id + '\t' + str(binding_site.start1) + '\t' + str(len(binding_site.seq1)) + '\t' + binding_site.perfectTAL1 + '\t' + 'Plus' + '\t' + binding_site.upstream + " " + str(binding_site.seq1) + '\t' + binding_site.upstream + " " + str(binding_site.seq1) + offtarget_string + '\n') else: out.write(binding_site.gene_id + '\t' + str(binding_site.start1) + '\t' + str(len(binding_site.seq1)) + '\t' + binding_site.perfectTAL1 + '\t' + 'Minus' + '\t' + ("T" if binding_site.upstream == "A" else "C") + " " + str(binding_site.seq1.reverse_complement()) + '\t' + str(binding_site.seq1) + " " + binding_site.upstream + offtarget_string + '\n') out.close() logger('Finished') if __name__ == '__main__': #signal.signal(signal.SIGUSR2, lambda sig, frame: code.interact()) # import arguments and options usage = 'usage: %prog [options]' parser = OptParser(usage=usage) parser.add_option('-f', '--fasta', dest='fasta', type='string', default='NA', help='FASTA file containing promoter sequence(s).') parser.add_option('-j', '--job', dest='job', type='string', default='output', help='the job name, output files will have the job name as a prefix.') parser.add_option('-t', '--t1', dest='t1', action='store_false', default = True, help='Do not enforce rule "No T at position 1."') parser.add_option('-a', '--a2', dest='a2', action='store_false', default = True, help='Do not enforce rule "No A at position 1."') parser.add_option('-n', '--tn', dest='tn', action='store_false', default = True, help='Do not enforce rule "Sites must end in a T."') parser.add_option('-g', '--gn', dest='gn', action='store_false', default = True, help='Do not enforce rule "Sites may not end in G/NN."') parser.add_option('-c', '--comp', dest='comp', action='store_false', default = True, help='Do not enforce base composition rules.') parser.add_option('-r', '--revcomp', dest='revcomp', action = 'store_true', default = False, help='Search the reverse complement of the input FASTA sequences') parser.add_option('-d', '--outdir', dest='outdir', type='string', default = 'upload/', help='Directory in which to place output files.') parser.add_option('-o', '--outfile', dest='outfile', type='string', default = '_TALEN_pairs_all.txt', help='Optional filename for output file.') parser.add_option('-b', '--arraymin', dest='arraymin', type='int', default=None, help='the minimum repeat array length to try') parser.add_option('-y', '--arraymax', dest='arraymax', type='int', default=None, help='the maximum repeat array length to try') parser.add_option('-u', '--cupstream', dest='cupstream', type='int', default = 0, help='1 to look for C instead of T, 2 to look for either') parser.add_option('-s', '--gspec', dest='gspec', action='store_true', default = False, help='If true, use NH instead of NN for G') # Offtarget Options