scripts/release/rfamseq_generator.py
def merge_all_genome_files(project_dir, dest_dir, filename='rfamseq'):
    """
    Simple script to merge all genomes to a single rfamseq file

    project_dir: The path to a genome download project directory
    dest_dir: The directory where to create the new rfamseq file
    filename: A filename for the rfamseq file. Defaults to rfamseq

    return: Void
    """

    err_cases_fp = os.path.join(dest_dir, filename+'_err_cases.txt')

    rfamseq_fp = open(os.path.join(dest_dir, filename + ".fa"), 'w')

    subdirs = [x for x in os.listdir(project_dir)
               if os.path.isdir(os.path.join(project_dir, x))]

    for subdir in subdirs:
        subdir_loc = os.path.join(project_dir, subdir)
        updirs = os.listdir(subdir_loc)

        for upid in updirs:
            updir_loc = os.path.join(subdir_loc, upid)
            up_fasta = os.path.join(updir_loc, upid + ".fa")

            if os.path.exists(up_fasta):
                fasta_fp = open(up_fasta, 'r')
                for seq_line in fasta_fp:
                    #if seq_line[0] == '>':
                    rfamseq_fp.write(seq_line)
                    #else:
                    #    if seq_validator(seq_line):
                    #        rfamseq_fp.write(seq_line)
                    #    else:
                    #        print upid + '\t' + seq_line

                fasta_fp.close()

    rfamseq_fp.close()

    Simple script to merge all genomes to a single rfamseq file

    project_dir: The path to a genome download project directory
    dest_dir: The directory where to create the new rfamseq file
    filename: A filename for the rfamseq file. Defaults to rfamseq

    return: Void
    
Simple script to merge all genomes to a single rfamseq file
project_dir: The path to a genome download project directory
dest_dir: The directory where to create the new rfamseq file
filename: A filename for the rfamseq file. Defaults to rfamseq

Void
Simple script to merge all genomes to a single rfamseq file project_dir : The path to a genome download project directory dest_dir : The directory where to create the new rfamseq file filename : A filename for the rfamseq file . Defaults to rfamseq Void
def merge_all_genome_files(project_dir, dest_dir, filename='rfamseq'):
    err_cases_fp = os.path.join(dest_dir, filename+'_err_cases.txt')
    rfamseq_fp = open(os.path.join(dest_dir, filename + ".fa"), 'w')
    subdirs = [x for x in os.listdir(project_dir)
               if os.path.isdir(os.path.join(project_dir, x))]
    for subdir in subdirs:
        subdir_loc = os.path.join(project_dir, subdir)
        updirs = os.listdir(subdir_loc)
        for upid in updirs:
            updir_loc = os.path.join(subdir_loc, upid)
            up_fasta = os.path.join(updir_loc, upid + ".fa")
            if os.path.exists(up_fasta):
                fasta_fp = open(up_fasta, 'r')
                for seq_line in fasta_fp:
                    rfamseq_fp.write(seq_line)
                fasta_fp.close()
    rfamseq_fp.close()
def merge_all_genome_files ( project_dir , dest_dir , filename = 'rfamseq' ) : err_cases_fp = os . path . join ( dest_dir , filename + '_err_cases.txt' ) rfamseq_fp = open ( os . path . join ( dest_dir , filename + ".fa" ) , 'w' ) subdirs = [ x for x in os . listdir ( project_dir ) if os . path . isdir ( os . path . join ( project_dir , x ) ) ] for subdir in subdirs : subdir_loc = os . path . join ( project_dir , subdir ) updirs = os . listdir ( subdir_loc ) for upid in updirs : updir_loc = os . path . join ( subdir_loc , upid ) up_fasta = os . path . join ( updir_loc , upid + ".fa" ) if os . path . exists ( up_fasta ) : fasta_fp = open ( up_fasta , 'r' ) for seq_line in fasta_fp : rfamseq_fp . write ( seq_line ) fasta_fp . close ( ) rfamseq_fp . close ( )
Simple script to merge all genomes to a single rfamseq file
project_dir: The path to a genome download project directory
dest_dir: The directory where to create the new rfamseq file
filename: A filename for the rfamseq file.
Simple script to merge all genomes to a single rfamseq file project_dir : The path to a genome download project directory dest_dir : The directory where to create the new rfamseq file filename : A filename for the rfamseq file .
"""
    Simple script to merge all genomes to a single rfamseq file

    project_dir: The path to a genome download project directory
    dest_dir: The directory where to create the new rfamseq file
    filename: A filename for the rfamseq file. Defaults to rfamseq

    return: Void
    """ #if seq_line[0] == '>': #else: #    if seq_validator(seq_line): #        rfamseq_fp.write(seq_line) #    else: #        print upid + '\t' + seq_line
project_dir
dest_dir
filename