scripts/support/rfamseq2genseq.py
def generate_genseq_files_from_common_directory(rfamseq_input, dest_dir=None):
    """
    Simple function to generate .genseq files from within the same directory

    rfamseq_input: The path to a directory containing multiple .rfamseq files
    or a single .rfamseq file
    dest_dir: The path to destination directory

    return:
    """
    # work on the destination directory
    if dest_dir is None:
        if os.path.isdir(rfamseq_input):
            dest_dir = rfamseq_input
        else:
            dest_dir = os.path.split(rfamseq_input)[0]

    if os.path.isdir(rfamseq_input):
        rfamseq_files = [x for x in os.listdir(rfamseq_input) if x.endswith('.rfamseq')]
        dest_dir = os.path.join(rfamseq_input, "genseq")

        if not os.path.exists(dest_dir):
            os.mkdir(dest_dir)

        for rfamseq_file in rfamseq_files:
            rfamseq_loc = os.path.join(rfamseq_input, rfamseq_file)
            convert_rfamseq_to_genseq(rfamseq_loc, dest_dir=dest_dir)

    elif os.path.isfile(rfamseq_input):
        convert_rfamseq_to_genseq(rfamseq_input, dest_dir=dest_dir)

    else:
        sys.exit("\nWrong input! Please provide an rfamseq file or dir.")

    Simple function to generate .genseq files from within the same directory

    rfamseq_input: The path to a directory containing multiple .rfamseq files
    or a single .rfamseq file
    dest_dir: The path to destination directory

    return:
    
Simple function to generate .genseq files from within the same directory
rfamseq_input: The path to a directory containing multiple .rfamseq files
or a single .rfamseq file
dest_dir: The path to destination directory


Simple function to generate . genseq files from within the same directory rfamseq_input : The path to a directory containing multiple . rfamseq files or a single . rfamseq file dest_dir : The path to destination directory
def generate_genseq_files_from_common_directory(rfamseq_input, dest_dir=None):
    if dest_dir is None:
        if os.path.isdir(rfamseq_input):
            dest_dir = rfamseq_input
        else:
            dest_dir = os.path.split(rfamseq_input)[0]
    if os.path.isdir(rfamseq_input):
        rfamseq_files = [x for x in os.listdir(rfamseq_input) if x.endswith('.rfamseq')]
        dest_dir = os.path.join(rfamseq_input, "genseq")
        if not os.path.exists(dest_dir):
            os.mkdir(dest_dir)
        for rfamseq_file in rfamseq_files:
            rfamseq_loc = os.path.join(rfamseq_input, rfamseq_file)
            convert_rfamseq_to_genseq(rfamseq_loc, dest_dir=dest_dir)
    elif os.path.isfile(rfamseq_input):
        convert_rfamseq_to_genseq(rfamseq_input, dest_dir=dest_dir)
    else:
        sys.exit("\nWrong input! Please provide an rfamseq file or dir.")
def generate_genseq_files_from_common_directory ( rfamseq_input , dest_dir = None ) : if dest_dir is None : if os . path . isdir ( rfamseq_input ) : dest_dir = rfamseq_input else : dest_dir = os . path . split ( rfamseq_input ) [ 0 ] if os . path . isdir ( rfamseq_input ) : rfamseq_files = [ x for x in os . listdir ( rfamseq_input ) if x . endswith ( '.rfamseq' ) ] dest_dir = os . path . join ( rfamseq_input , "genseq" ) if not os . path . exists ( dest_dir ) : os . mkdir ( dest_dir ) for rfamseq_file in rfamseq_files : rfamseq_loc = os . path . join ( rfamseq_input , rfamseq_file ) convert_rfamseq_to_genseq ( rfamseq_loc , dest_dir = dest_dir ) elif os . path . isfile ( rfamseq_input ) : convert_rfamseq_to_genseq ( rfamseq_input , dest_dir = dest_dir ) else : sys . exit ( "\nWrong input! Please provide an rfamseq file or dir." )
Simple function to generate .genseq files from within the same directory
rfamseq_input: The path to a directory containing multiple .rfamseq files
or a single .rfamseq file
dest_dir: The path to destination directory
Simple function to generate . genseq files from within the same directory rfamseq_input : The path to a directory containing multiple . rfamseq files or a single . rfamseq file dest_dir : The path to destination directory
"""
    Simple function to generate .genseq files from within the same directory

    rfamseq_input: The path to a directory containing multiple .rfamseq files
    or a single .rfamseq file
    dest_dir: The path to destination directory

    return:
    """ # work on the destination directory
rfamseq_input
dest_dir