Exemple #1
0
def get_parser():
    """Returns arg parser."""
    parser = argparse.ArgumentParser(prog='tofu_wrap')

    helpstr = "Input full-length non-chimeric reads in FASTA or ContigSet format " + \
              "(e.g., isoseq_flnc.fasta|contigset.xml)"
    parser.add_argument("flnc_fa", type=str, help=helpstr)
    helpstr = "Output collapsed filtered isoforms in FASTA/FASTQ format (e.g., tofu_out.fastq)"
    parser.add_argument("collapsed_filtered_fn", type=str, help=helpstr)

    parser = add_nfl_fa_argument(parser, positional=False, required=True)
    parser.add_argument("--nfl_reads_per_split", type=int,
                        dest="nfl_reads_per_split", default=60000,
                        help="Number of nFL reads per split file (default: 60000)")
    parser = add_fofn_arguments(parser, ccs_fofn=True, bas_fofn=True, fasta_fofn=True)

    # tofu output arguments
    parser = add_tofu_output_arguments(parser)

    parser = add_ice_arguments(parser) # Add Ice options, including --quiver
    parser = add_sge_arguments(parser, blasr_nproc=True, quiver_nproc=True, gcon_nproc=True) # Sge
    parser = add_ice_post_quiver_hq_lq_qv_arguments(parser) # IceQuiver HQ/LQ QV options.

    parser = add_separate_flnc_arguments(parser) # separate_flnc options
    parser = add_gmap_arguments(parser) # map to gmap reference options
    parser = add_post_mapping_to_genome_arguments(parser) # post mapping to genome options

    misc_group = parser.add_argument_group("Misc arguments")
    misc_group.add_argument("--mem_debug", default=False, action="store_true",
                            help=argparse.SUPPRESS)
    misc_group.add_argument("--keep_tmp_files", default=False, action="store_true",
                            help="False: delete tmp files; True: keep tmp files (default: False).")
    misc_group.add_argument("--version", action='version', version='%(prog)s ' + str(get_version()))
    return parser
def add_ice_all_partials_arguments(parser):
    """Add IceAllPartials argument parser."""
    parser.add_argument("fasta_filenames",
                        type=str,
                        help="comma delimited fasta files of " +
                             "splitted non-full-length reads")
    parser.add_argument("ref_fasta",
                        type=str,
                        help="Reference fasta file, most likely " +
                             "ref_consensus.fasta from ICE output")
    parser.add_argument("out_pickle",
                        type=str,
                        help="Output pickle file.")
    parser.add_argument("--root_dir",
                        dest="root_dir",
                        default="",
                        help="A directory for saving intermediate files.")

    parser = add_sge_arguments(parser, blasr_nproc=True)
    parser = add_fofn_arguments(parser, ccs_fofn=True)

    parser.add_argument("--done", dest="done_filename", type=str,
                        help="An empty file generated to indicate that " +
                             "out_pickle is done.")

    parser = add_tmp_dir_argument(parser)
    return parser
Exemple #3
0
def add_ice_daligner_arguments(parser):
    """Set up argument parser."""
    helpstr = "Query reads fasta file"
    parser.add_argument("query_fasta", type=str, help=helpstr)

    helpstr = "Target reads fasta file"
    parser.add_argument("target_fasta", type=str, help=helpstr)

    helpstr = "Output directory to store daligner and LA4Ice outputs"
    parser.add_argument("output_dir", type=str, help=helpstr)

    helpstr = "Query reads are Full-Length isoforms."
    parser.add_argument("--is_FL",
                        default=False,
                        action="store_true",
                        help=helpstr)

    helpstr = "Query and target reads are of the same strand"
    parser.add_argument("--same_strand_only",
                        default=False,
                        action="store_true",
                        help=helpstr)

    parser = add_sge_arguments(parser, blasr_nproc=True)
    return parser
Exemple #4
0
def add_ice_all_partials_arguments(parser):
    """Add IceAllPartials argument parser."""
    parser.add_argument("fasta_filenames",
                        type=str,
                        help="comma delimited fasta files of " +
                             "splitted non-full-length reads")
    parser.add_argument("ref_fasta",
                        type=str,
                        help="Reference fasta file, most likely " +
                             "ref_consensus.fasta from ICE output")
    parser.add_argument("out_pickle",
                        type=str,
                        help="Output pickle file.")
    parser.add_argument("--root_dir",
                        dest="root_dir",
                        default="",
                        help="A directory for saving intermediate files.")

    parser = add_sge_arguments(parser, blasr_nproc=True)
    parser = add_fofn_arguments(parser, ccs_fofn=True)

    parser.add_argument("--done", dest="done_filename", type=str,
                        help="An empty file generated to indicate that " +
                             "out_pickle is done.")

    parser = add_tmp_dir_argument(parser)
    return parser
Exemple #5
0
def get_parser():
    """Returns arg parser."""
    parser = argparse.ArgumentParser(prog='tofu_wrap')

    helpstr = "Input full-length non-chimeric reads in FASTA or ContigSet format " + \
              "(e.g., isoseq_flnc.fasta|contigset.xml)"
    parser.add_argument("flnc_fa", type=str, help=helpstr)
    helpstr = "Output collapsed filtered isoforms in FASTA/FASTQ format (e.g., tofu_out.fastq)"
    parser.add_argument("collapsed_filtered_fn", type=str, help=helpstr)

    parser = add_nfl_fa_argument(parser, positional=False, required=True)
    parser.add_argument("--nfl_reads_per_split", type=int,
                        dest="nfl_reads_per_split", default=60000,
                        help="Number of nFL reads per split file (default: 60000)")
    parser = add_fofn_arguments(parser, ccs_fofn=True, bas_fofn=True, fasta_fofn=True)

    # tofu output arguments
    parser = add_tofu_output_arguments(parser)

    parser = add_ice_arguments(parser) # Add Ice options, including --quiver
    parser = add_sge_arguments(parser, blasr_nproc=True, quiver_nproc=True, gcon_nproc=True) # Sge
    parser = add_ice_post_quiver_hq_lq_qv_arguments(parser) # IceQuiver HQ/LQ QV options.

    parser = add_separate_flnc_arguments(parser) # separate_flnc options
    parser = add_gmap_arguments(parser) # map to gmap reference options
    parser = add_post_mapping_to_genome_arguments(parser) # post mapping to genome options

    misc_group = parser.add_argument_group("Misc arguments")
    misc_group.add_argument("--mem_debug", default=False, action="store_true",
                            help=argparse.SUPPRESS)
    misc_group.add_argument("--keep_tmp_files", default=False, action="store_true",
                            help="False: delete tmp files; True: keep tmp files (default: False).")
    misc_group.add_argument("--version", action='version', version='%(prog)s ' + str(get_version()))
    return parser
Exemple #6
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 #7
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 #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
Exemple #9
0
def add_ice_quiver_i_arguments(parser):
    """Add IceQuiverI (ice_quiver.py i) arguments."""
    parser = add_cluster_root_dir_as_positional_argument(parser)

    helpstr = "Divide clusters into N chunks."
    parser.add_argument("N", help=helpstr, type=int)

    helpstr = "Call quiver to polish clusters in the (i / N)-th chunk."
    parser.add_argument("i", nargs="+", help=helpstr, type=int)

    parser = add_fofn_arguments(parser, bas_fofn=True)
    parser = add_sge_arguments(parser, quiver_nproc=True, blasr_nproc=True)
    parser = add_tmp_dir_argument(parser)

    return parser
Exemple #10
0
def add_ice_quiver_i_arguments(parser):
    """Add IceQuiverI (ice_quiver.py i) arguments."""
    parser = add_cluster_root_dir_as_positional_argument(parser)

    helpstr = "Divide clusters into N chunks."
    parser.add_argument("N", help=helpstr, type=int)

    helpstr = "Call quiver to polish clusters in the (i / N)-th chunk."
    parser.add_argument("i", nargs="+", help=helpstr, type=int)

    parser = add_fofn_arguments(parser, bas_fofn=True)
    parser = add_sge_arguments(parser, quiver_nproc=True, blasr_nproc=True)
    parser = add_tmp_dir_argument(parser)

    return parser
Exemple #11
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_daligner_arguments(parser):
    """Set up argument parser."""
    helpstr = "Query reads fasta file"
    parser.add_argument("query_fasta", type=str, help=helpstr)

    helpstr = "Target reads fasta file"
    parser.add_argument("target_fasta", type=str, help=helpstr)

    helpstr = "Output directory to store daligner and LA4Ice outputs"
    parser.add_argument("output_dir", type=str, help=helpstr)

    helpstr = "Query reads are Full-Length isoforms."
    parser.add_argument("--is_FL", default=False, action="store_true", help=helpstr)

    helpstr = "Query and target reads are of the same strand"
    parser.add_argument("--same_strand_only", default=False, action="store_true", help=helpstr)

    parser = add_sge_arguments(parser, blasr_nproc=True)
    return parser
Exemple #13
0
def add_ice_quiver_arguments(parser):
    """Add arguments for IceQuiver, not including IceQuiverPostprocess."""
    parser = add_cluster_root_dir_as_positional_argument(parser)
    parser = add_fofn_arguments(parser, bas_fofn=True)
    parser = add_sge_arguments(parser, quiver_nproc=True, blasr_nproc=True)
    return parser
Exemple #14
0
def add_ice_quiver_arguments(parser):
    """Add arguments for IceQuiver, not including IceQuiverPostprocess."""
    parser = add_cluster_root_dir_as_positional_argument(parser)
    parser = add_fofn_arguments(parser, bas_fofn=True)
    parser = add_sge_arguments(parser, quiver_nproc=True, blasr_nproc=True)
    return parser