Skip to content

Commit

Permalink
Update mudations file url and fix docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
awm33 committed Jan 16, 2017
1 parent 1cec5df commit b9b2e4f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/management/commands/acquiredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ def handle(self, *args, **options):

mutation_path = os.path.join(options['path'], 'mutation-matrix.tsv.bz2')
if not os.path.exists(mutation_path):
mutation_url = 'https://ndownloader.figshare.com/files/5864862'
mutation_url = 'https://ndownloader.figshare.com/files/7311953'
urlretrieve(mutation_url, mutation_path)
4 changes: 4 additions & 0 deletions api/management/commands/loaddata.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def add_arguments(self, parser):
def handle(self, *args, **options):
# Diseases
if Disease.objects.count() == 0:
print('Loading diseases table...')
disease_path = os.path.join(options['path'], 'diseases.tsv')
with open(disease_path) as disease_file:
disease_reader = csv.DictReader(disease_file, delimiter='\t')
Expand All @@ -34,6 +35,7 @@ def handle(self, *args, **options):

# Samples
if Sample.objects.count() == 0:
print('Loading samples table...')
sample_path = os.path.join(options['path'], 'samples.tsv')
with open(sample_path) as sample_file:
sample_reader = csv.DictReader(sample_file, delimiter='\t')
Expand All @@ -51,6 +53,7 @@ def handle(self, *args, **options):

# Genes
if Gene.objects.count() == 0:
print('Loading genes table...')
gene_path = os.path.join(options['path'], 'genes.tsv')
with open(gene_path) as gene_file:
gene_reader = csv.DictReader(gene_file, delimiter='\t')
Expand All @@ -70,6 +73,7 @@ def handle(self, *args, **options):

# Mutations
if Mutation.objects.count() == 0:
print('Loading mutations table...')
mutation_path = os.path.join(options['path'], 'mutation-matrix.tsv.bz2')
with bz2.open(mutation_path , 'rt') as mutation_file:
mutation_reader = csv.DictReader(mutation_file, delimiter='\t')
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
image: postgres
core:
build: .
command: bash -c "python manage.py makemigrations genes && python manage.py makemigrations organisms && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
Expand Down

0 comments on commit b9b2e4f

Please # to comment.