Skip to content

Commit

Permalink
Fixed ftp download issue for R wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbergstrom authored and erikbergstrom committed Jul 31, 2019
1 parent ffb6dd7 commit bbea258
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 24 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion SigProfilerMatrixGenerator.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: SigProfilerMatrixGenerator
Version: 1.0.14
Version: 1.0.15
Summary: SigProfiler matrix generator tool
Home-page: UNKNOWN
Author: Erik Bergstrom
Expand Down
Binary file modified SigProfilerMatrixGenerator/.DS_Store
Binary file not shown.
49 changes: 29 additions & 20 deletions SigProfilerMatrixGenerator/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,25 @@ def benchmark (genome, ref_dir):


def install (genome, custom=False, rsync=False, bash=True, ftp=True):
first_path= os.getcwd()
ref_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(ref_dir)
if os.path.exists("install.log"):
os.remove("install.log")

#ref_dir += "/references/"
chrom_string_dir = ref_dir + "/references/chromosomes/chrom_string/"
chrom_fasta_dir = ref_dir + "/references/chromosomes/fasta/"
chrom_tsb_dir = ref_dir + "/references/chromosomes/tsb/"
matrix_dir = ref_dir + "/references/matrix/"
vcf_dir = ref_dir + "/references/vcf_files/"
bed_dir = ref_dir + "/references/vcf_files/BED/"
log_dir = "logs/"
new_dirs = [ref_dir, chrom_string_dir, chrom_fasta_dir, chrom_tsb_dir, matrix_dir, vcf_dir, bed_dir, log_dir]

for dirs in new_dirs:
if not os.path.exists(dirs):
os.makedirs(dirs)

if ftp:
check_sum = {'GRCh37':
Expand Down Expand Up @@ -407,8 +424,6 @@ def install (genome, custom=False, rsync=False, bash=True, ftp=True):
else:
print("Beginning installation. This may take up to 20 minutes to complete.")
first_path = os.getcwd()
# current_dir = os.path.realpath(__file__)
# ref_dir = re.sub('\/install.py$', '', current_dir)
ref_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(ref_dir)

Expand All @@ -417,34 +432,30 @@ def install (genome, custom=False, rsync=False, bash=True, ftp=True):
genomes = [genome]

if os.path.exists("install.log"):
# os.system("rm install.log")
os.remove("install.log")

ref_dir += "/references/"
chrom_string_dir = ref_dir + "chromosomes/chrom_string/"
chrom_fasta_dir = ref_dir + "chromosomes/fasta/"
chrom_tsb_dir = ref_dir + "chromosomes/tsb/"
matrix_dir = ref_dir + "matrix/"
vcf_dir = ref_dir + "vcf_files/"
bed_dir = ref_dir + "vcf_files/BED/"
log_dir = "logs/"
new_dirs = [ref_dir, chrom_string_dir, chrom_fasta_dir, chrom_tsb_dir, matrix_dir, vcf_dir, bed_dir, log_dir]
# ref_dir += "/references/"
# chrom_string_dir = ref_dir + "chromosomes/chrom_string/"
# chrom_fasta_dir = ref_dir + "chromosomes/fasta/"
# chrom_tsb_dir = ref_dir + "chromosomes/tsb/"
# matrix_dir = ref_dir + "matrix/"
# vcf_dir = ref_dir + "vcf_files/"
# bed_dir = ref_dir + "vcf_files/BED/"
# log_dir = "logs/"
# new_dirs = [ref_dir, chrom_string_dir, chrom_fasta_dir, chrom_tsb_dir, matrix_dir, vcf_dir, bed_dir, log_dir]

for dirs in new_dirs:
if not os.path.exists(dirs):
os.makedirs(dirs)
# for dirs in new_dirs:
# if not os.path.exists(dirs):
# os.makedirs(dirs)

install_chromosomes(genomes, ref_dir, custom, rsync, bash)
install_chromosomes_tsb (genomes, ref_dir, custom)

if os.path.exists("BRCA_example/"):
#os.system("mv BRCA_example/ references/vcf_files/")
shutil.copy("BRCA_example/", "references/vcf_files/")
if os.path.exists("example_test"):
#os.system("mv example_test/ references/vcf_files/")
shutil.copy("example_test/", "references/vcf_files/")
if os.path.exists("context_distributions/"):
#os.system("mv context_distributions/ references/chromosomes/")
shutil.copy("context_distributions/", "references/chromosomes/")

print("All reference files have been created.")
Expand All @@ -453,8 +464,6 @@ def install (genome, custom=False, rsync=False, bash=True, ftp=True):
benchmark(genome, ref_dir)

print ("To proceed with matrix_generation, please provide the path to your vcf files and an appropriate output path.")
# os.system("rm -r " + chrom_string_dir)
# os.remove(chrom_string_dir)
shutil.rmtree(chrom_string_dir)
print("Installation complete.")
os.chdir(first_path)
Expand Down
4 changes: 2 additions & 2 deletions SigProfilerMatrixGenerator/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# THIS FILE IS GENERATED FROM SIGPROFILEMATRIXGENERATOR SETUP.PY
short_version = '1.0.14'
version = '1.0.14'
short_version = '1.0.15'
version = '1.0.15'


Binary file not shown.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def readme():
with open('README.rst') as f:
return(f.read())

VERSION = '1.0.14'
VERSION = '1.0.15'

def write_version_py(filename='SigProfilerMatrixGenerator/version.py'):
# Copied from numpy setup.py
Expand Down

0 comments on commit bbea258

Please sign in to comment.