def create_analysis(upload_id, type, params): u""" Starts a new analysis for the given file. """ # We need to have an option of whether they want mail # and/or want the call to block until finished, or neither method = '/msa/{0}/{1}'.format(upload_id, type) params["upload_id"] = upload_id json = dm.post(method, params) return Analysis(json)
def upload_file(fn, datatype, gencode, mailaddr=""): u""" Starts a new analysis for the given file. """ # We need to have an option of whether they want mail # and/or want the call to block until finished, or neither method = "/msa" fh = {"files":(fn, open(fn,'rb').read())} params = { "files" : fh, "datatype" : datatype, "gencodeid" : gencode, "mailaddr" : mailaddr } json = dm.post(method, params) return MSA(json)
def start(fn, distance_threshold, min_overlap, ambiguity_handling, mail=''): u""" Starts a new analysis for the given file. """ # We need to have an option of whether they want mail # and/or want the call to block until finished, or neither method = '/hivcluster' fh = {'files' : (fn, open(fn,'rb'))} params = { 'files' : fh, 'distance_threshold' : distance_threshold, 'min_overlap' : min_overlap, 'ambiguity_handling' : ambiguity_handling, 'mail' : mail } json = dm.post(method, params) return HivCluster(json)