How to use the toil.job.Job.Runner.getDefaultArgumentParser function in toil

To help you get started, we’ve selected a few toil examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github edraizen / molmimic / generate_data / get_structural_interactome.py View on Github external
job.addChildJobFn(get_inferred_structural_interactome_by_table, dataset_name, table, memory="120000M")

def start_toil(job, dataset_name):
    if not os.path.isdir(get_interfaces_path(dataset_name)):
        os.makedirs(get_interfaces_path(dataset_name))

    obsjob = job.addChildJobFn(start_toil_observed, dataset_name)
    infjob = obsjob.addFollowOnJobFn(start_toil_inferred, dataset_name)
    infmergejob = infjob.addFollowOnJobFn(start_toil_inferred_merge, dataset_name, cores=20, memory="240000M")
    return

if __name__ == "__main__":
    from toil.common import Toil
    from toil.job import Job

    parser = Job.Runner.getDefaultArgumentParser()
    options = parser.parse_args()
    options.logLevel = "DEBUG"
    options.clean = "always"
    dataset_name = options.jobStore.split(":")[-1]

    print "Running"

    job = Job.wrapJobFn(start_toil, dataset_name)
    with Toil(options) as toil:
        toil.start(job)
github edraizen / molmimic / molmimic / generate_data / calculate_bsa.py View on Github external
cjob.addFollowOnJobFn(inferred_bsa, dataset_name, sfam_id, memory=memory)
        elif "/inferred" not in keys:
            cjob = job.addChildJobFn(inferred_bsa, dataset_name, sfam_id, memory=memory)

    job.addFollowOnJobFn(start_toil, dataset_name, iteration=1)

        # cjob = job.addChildJobFn(observed_bsa, dataset_name, sfam_id)
        # if not os.path.isfile(sfam_path+".inferred_interactome"):
        #     continue
        # cjob.addFollowOnJobFn(inferred_bsa, dataset_name, sfam_id)

if __name__ == "__main__":
    from toil.common import Toil
    from toil.job import Job

    parser = Job.Runner.getDefaultArgumentParser()
    options = parser.parse_args()
    options.logLevel = "DEBUG"
    options.clean = "always"
    dataset_name = options.jobStore.split(":")[-1]

    job = Job.wrapJobFn(start_toil, dataset_name)
    with Toil(options) as toil:
        toil.start(job)
github ComparativeGenomicsToolkit / Comparative-Annotation-Toolkit / CAT / base_tasks.py View on Github external
def get_toil_defaults(self):
        """
        Extracts the default toil options as a dictionary, setting jobStore to None
        :return: dict
        """
        parser = Job.Runner.getDefaultArgumentParser()
        namespace = parser.parse_args([''])  # empty jobStore attribute
        namespace.jobStore = None  # jobStore attribute will be updated per-batch
        return namespace
github ComparativeGenomicsToolkit / Comparative-Annotation-Toolkit / cat / __init__.py View on Github external
def get_toil_defaults(self):
        """
        Extracts the default toil options as a dictionary, setting jobStore to None
        :return: dict
        """
        parser = Job.Runner.getDefaultArgumentParser()
        namespace = parser.parse_args([''])  # empty jobStore attribute
        namespace.jobStore = None  # jobStore attribute will be updated per-batch
        return namespace
github edraizen / molmimic / molmimic / generate_data / main.py View on Github external
run_cath_hierarchy(job, cathcode, process_superfamily, cathFileStoreID,
            update_features=update_features, force=force)
    else:
        superfamilies = domains_to_run["cathcode"].drop_duplicates().str.replace(".", "/")
        RealtimeLogger.info("Superfamilies to run: {}".format(len(superfamilies)))
        map_job(job, process_superfamily, superfamilies, cathFileStoreID,
            update_features=update_features, force=force)

    #Build Interactome
    #job.addChildJobFn()

if __name__ == "__main__":
    from toil.common import Toil
    from toil.job import Job

    parser = Job.Runner.getDefaultArgumentParser()
    parser.add_argument(
        "-c", "--cathcode",
        nargs='+',
        default=None)
    parser.add_argument(
        "--features",
        nargs="+",
        default=None
    )
    parser.add_argument(
        "--force",
        action="store_true",
        default=False)
    options = parser.parse_args()
    options.logLevel = "DEBUG"
    #options.clean = "always"
github ComparativeGenomicsToolkit / Comparative-Annotation-Toolkit / CAT / cat.py View on Github external
def get_toil_defaults(self):
        """
        Extracts the default toil options as a dictionary, setting jobStore to None
        :return: dict
        """
        parser = Job.Runner.getDefaultArgumentParser()
        namespace = parser.parse_args([''])  # empty jobStore attribute
        namespace.jobStore = None  # jobStore attribute will be updated per-batch
        return namespace
github edraizen / molmimic / molmimic / generate_data / calculate_voxels.py View on Github external
# sfams = pd.read_hdf(pdb_file, "Superfamilies", columns=
    #     ["sfam_id"]).drop_duplicates().dropna()["sfam_id"].sort_values()

    sfams = [299845.0]

    map_job(job, calculate_features_for_sfam, sfams)

    #os.remove(pdb_file)

    #job.addChildJobFn(calculate_features, "301320/yc/1YCS_A_sdi225433_d0.pdb")

if __name__ == "__main__":
    from toil.common import Toil
    from toil.job import Job

    parser = Job.Runner.getDefaultArgumentParser()
    options = parser.parse_args()
    options.logLevel = "DEBUG"
    options.clean = "always"
    options.targetTime = 1

    job = Job.wrapJobFn(start_toil)
    with Toil(options) as toil:
        toil.start(job)
github edraizen / molmimic / molmimic / generate_data / get_eppic_interactome.py View on Github external
if split_groups:
        pdb = pdb.assign(group=pdb["pdb"].str[:3])
        pdb_groups = pdb.groupby("group")["pdb"].apply(list)
        map_job(job, process_pdb_group, pdb_groups, cathFileStoreID, further_parallelize)
    else:
        map_job(job, process_pdb, pdb["pdb"], cathFileStoreID)

    #map_job(job, process_pdb, ["4ht5"], cathFileStoreID)

    #job.addFollowOnJobFn(run_cath_hierarchy, merge_cath, None, cathFileStoreID)

if __name__ == "__main__":
    from toil.common import Toil
    from toil.job import Job

    parser = Job.Runner.getDefaultArgumentParser()
    parser.add_argument("--force", default=False, action="store_true")
    options = parser.parse_args()
    options.logLevel = "DEBUG"
    options.clean = "always"
    options.targetTime = 1

    if not os.path.isfile("cath.h5"):
        eppic_interfaces.read_input_file("cath-domain-description-file-small.h5", "cath.h5")

    with Toil(options) as workflow:
        cathFileURL = 'file://' + os.path.abspath("cath.h5")
        cathFileID = workflow.importFile(cathFileURL)
        workflow.start(Job.wrapJobFn(start_toil, cathFileID, options.force))
github edraizen / molmimic / molmimic / generate_data / make_superfamily_autoencoders.py View on Github external
# sfams = pd.read_hdf(pdb_file, "Superfamilies", columns=
    #     ["sfam_id"]).drop_duplicates().dropna()["sfam_id"].sort_values()

    sfams = [299845.0]

    map_job(job, calculate_features_for_sfam, sfams)

    #os.remove(pdb_file)

    #job.addChildJobFn(calculate_features, "301320/yc/1YCS_A_sdi225433_d0.pdb")

if __name__ == "__main__":
    from toil.common import Toil
    from toil.job import Job

    parser = Job.Runner.getDefaultArgumentParser()
    options = parser.parse_args()
    options.logLevel = "DEBUG"
    options.clean = "always"
    options.targetTime = 1

    job = Job.wrapJobFn(start_toil)
    with Toil(options) as toil:
        toil.start(job)