Exemple #1
0
def get_contract_parser():
    p = get_base_contract_parser(Constants, default_level="DEBUG")
    tcp = p.tool_contract_parser
    add_fofn_arguments(p.arg_parser.parser,
                       bas_fofn=True,
                       tool_contract_parser=tcp)
    tcp.add_input_file_type(FileTypes.DS_CONTIG,
                            "consensus_fa",
                            name="Consensus isoforms",
                            description="ContigSet of consensus isoforms")
    tcp.add_input_file_type(FileTypes.PICKLE,
                            "cluster_pickle",
                            name="Clusters",
                            description="Cluster pickle file")
    tcp.add_input_file_type(
        FileTypes.PICKLE,
        "map_nofl_pickle",
        name="Pickle file",
        description="Pickle file for non-full-length read mapping")
    tcp.add_input_file_type(FileTypes.JSON,
                            "json_in",
                            name="JSON file",
                            description="Sentinel file from ice_quiver task")
    add_cluster_summary_report_arguments(p)
    add_ice_post_quiver_hq_lq_arguments(p)
    return p
def get_contract_parser():
    """ Return resolved tool contract.
    input files:
        idx 0 - ChunkTasksPickle of ClusterChunkTask objects
        idx 1 - sentinel txt
    output files:
        idx 0 - consensus_isoforms.fa
        idx 1 - summary.json
        idx 2 - cluster_report.csv
        idx 3 - hq_isoforms.contigset.xml
        idx 4 - hq_isoforms.fq
        idx 5 - lq_isoforms.contigset.xml
        idx 6 - lq_isoforms.fq
        idx 7 - hq_lq_prefix_dict.pickle
    """
    p = get_base_contract_parser(Constants, default_level="DEBUG")
    p.add_input_file_type(FileTypes.PICKLE, "cluster_chunks_pickle",
                          "Pickle In", "Cluster chunks pickle file")  # input 0
    p.add_input_file_type(FileTypes.TXT, "cluster_sentinel_in", "Sentinel In",
                          "Setinel file")  # input idx 1

    # output idx 0, consensus_isoforms.contigset,
    p.add_output_file_type(FileTypes.DS_CONTIG,
                           "consensus_isoforms",
                           name="Unpolished Consensus Isoforms",
                           description="Output unpolished consensus isoforms",
                           default_name="consensus_isoforms")

    # output idx 1, summary.json,
    # output idx 2, cluster_report.csv
    add_cluster_summary_report_arguments(p)

    # output idx 3, hq_isoforms_fa, idx 4, hq_isoforms_fq,
    # idx 5 lq_isoforms_fa, idx 6 lq_isoforms_fq
    add_ice_post_quiver_hq_lq_arguments(p)

    # output idx 7, hq_lq_prefix_dict.pickle
    p.add_output_file_type(
        FileTypes.PICKLE,
        "hq_lq_prefix_dict",
        name="HQ LQ Sample Prefix Dict",
        description="Pickle mapping HQ (LQ) sample prefixes to ICE dir",
        default_name="hq_lq_prefix_dict")

    # user specified sample name.
    p.add_str(option_id=Constants.SAMPLE_NAME_ID,
              option_str="sample_name",
              default=Constants.SAMPLE_NAME_DEFAULT,
              name="sample Name",
              description="Sample Name")
    return p
def get_contract_parser():
    """ Return resolved tool contract.
    input files:
        idx 0 - ChunkTasksPickle of ClusterChunkTask objects
        idx 1 - sentinel txt
    output files:
        idx 0 - consensus_isoforms.fa
        idx 1 - summary.json
        idx 2 - cluster_report.csv
        idx 3 - hq_isoforms.contigset.xml
        idx 4 - hq_isoforms.fq
        idx 5 - lq_isoforms.contigset.xml
        idx 6 - lq_isoforms.fq
        idx 7 - hq_lq_prefix_dict.pickle
    """
    p = get_base_contract_parser(Constants, default_level="DEBUG")
    p.add_input_file_type(FileTypes.PICKLE, "cluster_chunks_pickle", "Pickle In",
                          "Cluster chunks pickle file") # input 0
    p.add_input_file_type(FileTypes.TXT, "cluster_sentinel_in", "Sentinel In",
                          "Setinel file") # input idx 1

    # output idx 0, consensus_isoforms.contigset,
    p.add_output_file_type(FileTypes.DS_CONTIG, "consensus_isoforms",
                           name="Unpolished Consensus Isoforms",
                           description="Output unpolished consensus isoforms",
                           default_name="consensus_isoforms")

    # output idx 1, summary.json,
    # output idx 2, cluster_report.csv
    add_cluster_summary_report_arguments(p)

    # output idx 3, hq_isoforms_fa, idx 4, hq_isoforms_fq,
    # idx 5 lq_isoforms_fa, idx 6 lq_isoforms_fq
    add_ice_post_quiver_hq_lq_arguments(p)

    # output idx 7, hq_lq_prefix_dict.pickle
    p.add_output_file_type(FileTypes.PICKLE, "hq_lq_prefix_dict",
                           name="HQ LQ Sample Prefix Dict",
                           description="Pickle mapping HQ (LQ) sample prefixes to ICE dir",
                           default_name="hq_lq_prefix_dict")

    # user specified sample name.
    p.add_str(option_id=Constants.SAMPLE_NAME_ID, option_str="sample_name",
              default=Constants.SAMPLE_NAME_DEFAULT, name="sample Name",
              description="Sample Name")
    return p
Exemple #4
0
def add_ice_polish_arguments(parser):
    """Set up argument parser."""
    parser = add_cluster_root_dir_as_positional_argument(parser)
    parser = add_nfl_fa_argument(parser, positional=True)
    parser = add_fofn_arguments(parser, ccs_fofn=True, bas_fofn=True)
    parser = add_ice_post_quiver_hq_lq_arguments(parser)
    parser = add_sge_arguments(parser, quiver_nproc=True, blasr_nproc=True)
    parser = add_tmp_dir_argument(parser)
    return parser
Exemple #5
0
def add_ice_polish_arguments(parser):
    """Set up argument parser."""
    parser = add_cluster_root_dir_as_positional_argument(parser)
    parser = add_nfl_fa_argument(parser, positional=True)
    parser = add_fofn_arguments(parser, ccs_fofn=True, bas_fofn=True)
    parser = add_ice_post_quiver_hq_lq_arguments(parser)
    parser = add_sge_arguments(parser, quiver_nproc=True, blasr_nproc=True)
    parser = add_tmp_dir_argument(parser)
    return parser
def get_contract_parser():
    p = get_base_contract_parser(Constants, default_level="DEBUG")
    tcp = p.tool_contract_parser
    add_fofn_arguments(p.arg_parser.parser, bas_fofn=True,
                       tool_contract_parser=tcp)
    tcp.add_input_file_type(FileTypes.DS_CONTIG, "consensus_fa",
                            name="Consensus isoforms",
                            description="ContigSet of consensus isoforms")
    tcp.add_input_file_type(FileTypes.PICKLE, "cluster_pickle",
                            name="Clusters",
                            description="Cluster pickle file")
    tcp.add_input_file_type(FileTypes.PICKLE, "map_nofl_pickle",
                            name="Pickle file",
                            description="Pickle file for non-full-length read mapping")
    tcp.add_input_file_type(FileTypes.JSON, "json_in", name="JSON file",
                            description="Sentinel file from ice_quiver task")
    add_cluster_summary_report_arguments(p)
    add_ice_post_quiver_hq_lq_arguments(p)
    return p
Exemple #7
0
def add_ice_quiver_all_arguments(parser):
    """Add arguments for IceQuiverAll, including arguments for IceQuiver and
    IceQuiverPostprocess."""
    arg_parser = parser.arg_parser.parser
    tcp = parser.tool_contract_parser
    arg_parser = add_cluster_root_dir_as_positional_argument(arg_parser)
    arg_parser = add_fofn_arguments(arg_parser, bas_fofn=True,
        tool_contract_parser=parser.tool_contract_parser)
    tcp_parser = add_cluster_summary_report_arguments(_wrap_parser(arg_parser))
    arg_parser = add_ice_post_quiver_hq_lq_arguments(arg_parser)
    arg_parser = add_sge_arguments(arg_parser, quiver_nproc=True,
                                   blasr_nproc=True)
    arg_parser = add_tmp_dir_argument(arg_parser)
    return parser
Exemple #8
0
def add_ice_quiver_all_arguments(parser):
    """Add arguments for IceQuiverAll, including arguments for IceQuiver and
    IceQuiverPostprocess."""
    arg_parser = parser.arg_parser.parser
    tcp = parser.tool_contract_parser
    arg_parser = add_cluster_root_dir_as_positional_argument(arg_parser)
    arg_parser = add_fofn_arguments(
        arg_parser,
        bas_fofn=True,
        tool_contract_parser=parser.tool_contract_parser)
    tcp_parser = add_cluster_summary_report_arguments(_wrap_parser(arg_parser))
    arg_parser = add_ice_post_quiver_hq_lq_arguments(arg_parser)
    arg_parser = add_sge_arguments(arg_parser,
                                   quiver_nproc=True,
                                   blasr_nproc=True)
    arg_parser = add_tmp_dir_argument(arg_parser)
    return parser
def add_ice_quiver_postprocess_arguments(arg_parser):
    """Add arugments for IceQuiverPostprocess ($ICE_QUIVER_PY postprocess)."""
    arg_parser = add_cluster_root_dir_as_positional_argument(arg_parser)
    arg_parser = add_ice_post_quiver_hq_lq_arguments(arg_parser)
    tcp_parser = add_cluster_summary_report_arguments(_wrap_parser(arg_parser))

    arg_parser.add_argument("--use_sge",
                            default=False,
                            dest="use_sge",
                            action="store_true",
                            help="quiver jobs have been submitted to sge."
                             "Check qstat")
    arg_parser.add_argument("--quit_if_not_done",
                            default=False,
                            dest="quit_if_not_done",
                            action="store_true",
                            help="Quit if quiver jobs haven't been completed.")
    return arg_parser
def add_ice_quiver_postprocess_arguments(arg_parser):
    """Add arugments for IceQuiverPostprocess ($ICE_QUIVER_PY postprocess)."""
    arg_parser = add_cluster_root_dir_as_positional_argument(arg_parser)
    arg_parser = add_ice_post_quiver_hq_lq_arguments(arg_parser)
    tcp_parser = add_cluster_summary_report_arguments(_wrap_parser(arg_parser))

    arg_parser.add_argument("--use_sge",
                            default=False,
                            dest="use_sge",
                            action="store_true",
                            help="quiver jobs have been submitted to sge."
                             "Check qstat")
    arg_parser.add_argument("--quit_if_not_done",
                            default=False,
                            dest="quit_if_not_done",
                            action="store_true",
                            help="Quit if quiver jobs haven't been completed.")
    return arg_parser