scripts/export/genomes/genome_fetch.py
def copy_wgs_set_from_ftp(wgs_acc, dest_dir):
    """
    Copy wgs set sequences from physical location on cluster

    wsg_acc: A valid WGS set accession (e.g. AAVU01000000)
    dest_dir: Destination directory where the sequences will be copied to

    return: void
    """

    # build path
    wgs_subdir = os.path.join(gc.ENA_FTP_WGS_PUB, wgs_acc[0:2].lower()) #AA
    wgs_filename = wgs_acc[0:6] + ".fasta.gz"

    # check if wgs sequences are in public dir and copy to destination
    if os.path.exists(os.path.join(wgs_subdir, wgs_filename)):
        shutil.copyfile(os.path.join(wgs_subdir, wgs_filename),
                        os.path.join(dest_dir, wgs_filename))

    # look for wgs set in suppressed sequences
    else:
        wgs_subdir = os.path.join(gc.ENA_FTP_WGS_SUP, wgs_acc[0:2].lower())
        if os.path.exists(os.path.join(wgs_subdir, wgs_filename)):
            shutil.copyfile(os.path.join(wgs_subdir, wgs_filename),
                            os.path.join(dest_dir, wgs_filename))

        else:
            sys.exit("WGS set %s requested does not exist." % wgs_acc)

    Copy wgs set sequences from physical location on cluster

    wsg_acc: A valid WGS set accession (e.g. AAVU01000000)
    dest_dir: Destination directory where the sequences will be copied to

    return: void
    
Copy wgs set sequences from physical location on cluster
wsg_acc: A valid WGS set accession
dest_dir: Destination directory where the sequences will be copied to

void
Copy wgs set sequences from physical location on cluster wsg_acc : A valid WGS set accession dest_dir : Destination directory where the sequences will be copied to void
def copy_wgs_set_from_ftp(wgs_acc, dest_dir):
    wgs_subdir = os.path.join(gc.ENA_FTP_WGS_PUB, wgs_acc[0:2].lower()) 
    wgs_filename = wgs_acc[0:6] + ".fasta.gz"
    if os.path.exists(os.path.join(wgs_subdir, wgs_filename)):
        shutil.copyfile(os.path.join(wgs_subdir, wgs_filename),
                        os.path.join(dest_dir, wgs_filename))
    else:
        wgs_subdir = os.path.join(gc.ENA_FTP_WGS_SUP, wgs_acc[0:2].lower())
        if os.path.exists(os.path.join(wgs_subdir, wgs_filename)):
            shutil.copyfile(os.path.join(wgs_subdir, wgs_filename),
                            os.path.join(dest_dir, wgs_filename))
        else:
            sys.exit("WGS set %s requested does not exist." % wgs_acc)
def copy_wgs_set_from_ftp ( wgs_acc , dest_dir ) : wgs_subdir = os . path . join ( gc . ENA_FTP_WGS_PUB , wgs_acc [ 0 : 2 ] . lower ( ) ) wgs_filename = wgs_acc [ 0 : 6 ] + ".fasta.gz" if os . path . exists ( os . path . join ( wgs_subdir , wgs_filename ) ) : shutil . copyfile ( os . path . join ( wgs_subdir , wgs_filename ) , os . path . join ( dest_dir , wgs_filename ) ) else : wgs_subdir = os . path . join ( gc . ENA_FTP_WGS_SUP , wgs_acc [ 0 : 2 ] . lower ( ) ) if os . path . exists ( os . path . join ( wgs_subdir , wgs_filename ) ) : shutil . copyfile ( os . path . join ( wgs_subdir , wgs_filename ) , os . path . join ( dest_dir , wgs_filename ) ) else : sys . exit ( "WGS set %s requested does not exist." % wgs_acc )
Copy wgs set sequences from physical location on cluster
wsg_acc: A valid WGS set accession (e.g.
Copy wgs set sequences from physical location on cluster wsg_acc : A valid WGS set accession ( e . g .
"""
    Copy wgs set sequences from physical location on cluster

    wsg_acc: A valid WGS set accession (e.g. AAVU01000000)
    dest_dir: Destination directory where the sequences will be copied to

    return: void
    """ # build path #AA # check if wgs sequences are in public dir and copy to destination # look for wgs set in suppressed sequences
wgs_acc
dest_dir