def loadMatchResults(infile, outfile): ''' load the results of the match analysis into sqlite database ''' temp = P.getTempFile("./match.dir") temp.write("seq_id\tmatrix_id\tposition\tstrand\t" "core_score\tmatrix_score\tsequence\n") for details in PipelineTFM.match_iterator(infile): temp.write("\t".join( map(str, [ details.seq_id, details.matrix_id, details.position, details.strand, details.core_score, details.matrix_score, details.sequence ])) + "\n") temp.close() to_cluster = True job_options = "-l mem_free=64G" inf = temp.name tablename = filenameToTablename(os.path.basename(infile)) statement = ("python %(scriptsdir)s/csv2db.py" " -t %(tablename)s" " --log=%(outfile)s.log" " --index=seq_id" " %(csv2db_options)s" " < %(inf)s > %(outfile)s") P.run() os.unlink(temp.name)
def loadMatchResults(infile, outfile): ''' load the results of the match analysis into sqlite database ''' temp = P.getTempFile() temp.write( "seq_id\tmatrix_id\tposition\tstrand\tcore_score\tmatrix_score\tsequence\n" ) for details in PipelineTransfacMatch.match_iterator(infile): temp.write("\t".join( map(str, [ details.seq_id, details.matrix_id, details.position, details.strand, details.core_score, details.matrix_score, details.sequence ])) + "\n") inf = temp.name tablename = filenameToTablename(os.path.basename(infile)) statement = '''python %(scriptsdir)s/csv2db.py -t %(tablename)s --log=%(outfile)s.log --index=seq_id %(csv2db_options)s < %(inf)s > %(outfile)s''' P.run() os.remove(inf)
def loadMatchResults(infile, outfile): ''' load the results of the match analysis into sqlite database ''' temp = P.getTempFile("./match.dir") temp.write("seq_id\tmatrix_id\tposition\tstrand\t" "core_score\tmatrix_score\tsequence\n") for details in PipelineTFM.match_iterator(infile): temp.write("\t".join(map(str, [details.seq_id, details.matrix_id, details.position, details.strand, details.core_score, details.matrix_score, details.sequence])) + "\n") temp.close() to_cluster = True job_options = "-l mem_free=64G" inf = temp.name tablename = filenameToTablename(os.path.basename(infile)) statement = ("python %(scriptsdir)s/csv2db.py" " -t %(tablename)s" " --log=%(outfile)s.log" " --index=seq_id" " %(csv2db_options)s" " < %(inf)s > %(outfile)s") P.run() os.unlink(temp.name)
def loadMatchResults(infile, outfile): ''' load the results of the match analysis into sqlite database ''' temp = P.getTempFile("./match.dir") temp.write("seq_id\tmatrix_id\tposition\tstrand\t" "core_score\tmatrix_score\tsequence\n") for details in PipelineTFM.match_iterator(infile): temp.write("\t".join( map(str, [ details.seq_id, details.matrix_id, details.position, details.strand, details.core_score, details.matrix_score, details.sequence ])) + "\n") temp.close() P.load(temp.name, outfile, options="--add-index=seq_id") os.unlink(temp.name)
def loadMatchResults(infile, outfile): ''' load the results of the match analysis into sqlite database ''' temp = P.getTempFile() temp.write( "seq_id\tmatrix_id\tposition\tstrand\tcore_score\tmatrix_score\tsequence\n") for details in PipelineTransfacMatch.match_iterator(infile): temp.write("\t".join(map(str, [details.seq_id, details.matrix_id, details.position, details.strand, details.core_score, details.matrix_score, details.sequence])) + "\n") inf = temp.name tablename = filenameToTablename(os.path.basename(infile)) statement = '''python %(scriptsdir)s/csv2db.py -t %(tablename)s --log=%(outfile)s.log --index=seq_id %(csv2db_options)s < %(inf)s > %(outfile)s''' P.run() os.remove(inf)
def loadMatchResults(infile, outfile): ''' load the results of the match analysis into sqlite database ''' temp = P.getTempFile("./match.dir") temp.write("seq_id\tmatrix_id\tposition\tstrand\t" "core_score\tmatrix_score\tsequence\n") for details in PipelineTFM.match_iterator(infile): temp.write("\t".join(map(str, [details.seq_id, details.matrix_id, details.position, details.strand, details.core_score, details.matrix_score, details.sequence])) + "\n") temp.close() P.load(temp.name, outfile, options="--add-index=seq_id") os.unlink(temp.name)