def sample1_se_tiny_fq(tmpdir_factory): """ Single-end FASTQ file with 1010 reads """ d = tmpdir_for_func(tmpdir_factory) fn = 'rnaseq_samples/sample1/sample1.tiny_R1.fastq.gz' return _download_file(fn, d)
def sample1_pe_tiny_fq(tmpdir_factory): pair = [] d = tmpdir_for_func(tmpdir_factory) for fn in [ 'rnaseq_samples/sample1/sample1.tiny_R1.fastq.gz', 'rnaseq_samples/sample1/sample1.tiny_R2.fastq.gz' ]: pair.append(_download_file(fn, d)) return pair
def sample1_se_tiny_bam(tmpdir_factory): d = tmpdir_for_func(tmpdir_factory) fn = 'rnaseq_samples/sample1/sample1.tiny.single.sorted.bam' return _download_file(fn, d)
def sample1_pe_bam(tmpdir_factory): d = tmpdir_for_func(tmpdir_factory) fn = 'rnaseq_samples/sample1/sample1.small.paired.sorted.bam' return _download_file(fn, d)
def annotation_refflat(tmpdir_factory): fn = 'annotation/dm6.small.refflat' d = tmpdir_for_func(tmpdir_factory) return _download_file(fn, d)
def annotation(tmpdir_factory): fn = 'annotation/dm6.small.gtf' d = tmpdir_for_func(tmpdir_factory) return _download_file(fn, d)
def dm6_fa(tmpdir_factory): fn = 'seq/dm6.small.fa' d = tmpdir_for_func(tmpdir_factory) return _download_file(fn, d)
def transcriptome(tmpdir_factory): d = tmpdir_for_func(tmpdir_factory) fn = 'seq/dm6.small.transcriptome.fa' return _download_file(fn, d)
def sample1_se_fq(tmpdir_factory): d = tmpdir_for_func(tmpdir_factory) fn = 'rnaseq_samples/sample1/sample1.small_R1.fastq.gz' return _download_file(fn, d)
def install_cntk(target_dir): logger.info("Begin to install CNTK(BrainScript) ...") if SysInfo.os != TOOLSFORAI_OS_WIN and SysInfo.os != TOOLSFORAI_OS_LINUX: logger.warning( "CNTK(BrainScript) is not supported on your OS, we recommend 64-bit Windows-10 OS or 64-bit Linux OS." ) # fail_install.append("CNTK(BrainScript)") return False if SysInfo.cuda == "8.0": ver = "2.3.1" else: ver = "2.5.1" target_version = 'CNTK-{0}'.format(ver.replace('.', '-')) logger.debug( "In install_cntk(), target_version: {0}".format(target_version)) version = utils._get_cntk_version(target_dir) if target_version == version: logger.info('CNTK(BrainScript)-{0} is already installed.'.format(ver)) return True logger.debug('In install_cntk(), target_dir: {0}'.format(target_dir)) cntk_root = os.path.join(target_dir, 'cntk') if os.path.isdir(cntk_root): try: shutil.rmtree(cntk_root) except: logger.error( 'Fail to install CNTK(BrainScript), the error message: can not remove old version in directory {0}.' 'Please manually remove old version, and run the installer script again.' .format(cntk_root)) # fail_install.append("CNTK(BrainScript)") return False if not os.path.isdir(target_dir): try: os.makedirs(target_dir) except: logger.error( 'Fail to install CNTK(BrainScript), the error message: can not create directory {0}.' 'Please check if there is permission for creating directory.'. format(target_dir)) # fail_install.append("CNTK(BrainScript)") return False cntk_file_name = "{}-{}-64bit-{}.{}".format( target_version, "Windows" if SysInfo.os == TOOLSFORAI_OS_WIN else "Linux", "GPU" if SysInfo.gpu else "CPU-Only", "zip" if SysInfo.os == TOOLSFORAI_OS_WIN else "tar.gz") logger.debug( "In install_cntk(), cntk_file_name: {0}".format(cntk_file_name)) cntk_url = "https://cntk.ai/BinaryDrop/{0}".format(cntk_file_name) logger.debug("In install_cntk(), cntk_url: {0}".format(cntk_url)) cntk_file_path = os.path.join(target_dir, cntk_file_name) logger.debug( "In install_cntk(), cntk_file_path: {0}".format(cntk_file_path)) if SysInfo.os == TOOLSFORAI_OS_WIN: download_dir = cntk_file_path elif SysInfo.os == TOOLSFORAI_OS_LINUX: download_dir = os.path.join(r"/tmp", cntk_file_name) skip_downloading = False if not skip_downloading: if not utils._download_file(cntk_url, download_dir): logger.error( 'Fail to install CNTK(BrainScript), the error message: cannot download {0}.' 'Please check your network.'.format(cntk_url)) # fail_install.append("CNTK(BrainScript)") return False if (not (utils._unzip_file(download_dir, target_dir) if SysInfo.os == TOOLSFORAI_OS_WIN else utils._extract_tar( download_dir, target_dir))): logger.error( 'Fail to install CNTK(BrainScript), the error message: cannot decompress the downloaded package.' ) # fail_install.append("CNTK(BrainScript)") return False if not skip_downloading: if os.path.isfile(download_dir): os.remove(download_dir) if (SysInfo.os == TOOLSFORAI_OS_WIN): suc = install_cntk_win(cntk_root) else: suc = install_cntk_linux(cntk_root) version = utils._get_cntk_version(target_dir) if (suc and (target_version == version)): logger.info("Install CNTK(BrainScript) successfully!") logger.warning( "Please open a new terminal to make the updated Path environment variable effective." ) return True else: logger.error("Fail to install CNTK(BrainScript).") logger.warning( "Please manually install {0} and update PATH environment.".format( target_version)) logger.warning( "You can reference this link based on your OS: https://docs.microsoft.com/en-us/cognitive-toolkit/Setup-CNTK-on-your-machine" ) # fail_install.append("CNTK(BrainScript)") return False return True