Example #1
0
import subprocess
import os

PHANTOMPEAKQUALTOOLS_URL = "http://phantompeakqualtools.googlecode.com/files/ccQualityControl.v.1.1.tar.gz"
IDR_URL = "https://sites.google.com/site/anshulkundaje/projects/idr/idrCode.tar.gz"
FIXED_SPP_URL = "https://dl.dropboxusercontent.com/u/2822886/spp/spp_1.10.1.fixed.tar.gz"

if __name__ == "__main__":
    parser = ArgumentParser(
        description='Download and install SPP and IDR scripts for use '
        'with spp-idr')
    parser.add_argument('--tool_path',
                        default="tools",
                        help="path to install tools to")
    args = parser.parse_args()
    idr.safe_makedir(args.tool_path)
    print "Installing tools into %s." % (args.tool_path)
    print "Installing phantompeakqualtools."
    idr.download_to_dir(PHANTOMPEAKQUALTOOLS_URL, args.tool_path)
    print "Installing IDR."
    idr.download_to_dir(IDR_URL, args.tool_path)
    print "Installing fixed SPP."
    spp_file = idr.download_to_dir(FIXED_SPP_URL,
                                   args.tool_path,
                                   extract=False,
                                   remove=False)
    cl = ["R", "CMD", "INSTALL", spp_file]
    cur_dir = os.getcwd()
    os.chdir(args.tool_path)
    subprocess.check_call(cl)
    os.chdir(cur_dir)
Example #2
0
from argparse import ArgumentParser
from spp_idr import idr
import subprocess
import os

PHANTOMPEAKQUALTOOLS_URL = "http://phantompeakqualtools.googlecode.com/files/ccQualityControl.v.1.1.tar.gz"
IDR_URL = "https://sites.google.com/site/anshulkundaje/projects/idr/idrCode.tar.gz"
FIXED_SPP_URL = "https://dl.dropboxusercontent.com/u/2822886/spp/spp_1.10.1.fixed.tar.gz"

if __name__ == "__main__":
    parser = ArgumentParser(description='Download and install SPP and IDR scripts for use '
                            'with spp-idr')
    parser.add_argument('--tool_path', default="tools",
                        help="path to install tools to")
    args = parser.parse_args()
    idr.safe_makedir(args.tool_path)
    print "Installing tools into %s." % (args.tool_path)
    print "Installing phantompeakqualtools."
    idr.download_to_dir(PHANTOMPEAKQUALTOOLS_URL, args.tool_path)
    print "Installing IDR."
    idr.download_to_dir(IDR_URL, args.tool_path)
    print "Installing fixed SPP."
    spp_file = idr.download_to_dir(FIXED_SPP_URL, args.tool_path, extract=False,
                                   remove=False)
    cl = ["R", "CMD", "INSTALL", spp_file]
    cur_dir = os.getcwd()
    os.chdir(args.tool_path)
    subprocess.check_call(cl)
    os.chdir(cur_dir)
    print "Installation of tools complete."
Example #3
0
 def setUp(self):
     idr.safe_makedir(test_dir)
     self.control = _copy_file_to_testdir(control_file)
     self.experimental = _copy_file_to_testdir(exp_file)
Example #4
0
 def setUp(self):
     idr.safe_makedir(test_dir)
     bam_file = os.path.join(data_dir, "control.bam")
     self.bam_file = _copy_file_to_testdir(bam_file)
Example #5
0
def _copy_file_to_testdir(fname, sub_dir=""):
    out_dir = os.path.join(test_dir, sub_dir)
    idr.safe_makedir(out_dir)
    out_file = os.path.join(out_dir, os.path.basename(fname))
    shutil.copyfile(fname, out_file)
    return out_file
Example #6
0
def setUp(self):
    idr.safe_makedir(test_dir)
    if not idr.file_exists(control_file):
        idr.download_to_dir(DATA_URL, os.curdir)