Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/parklab/refinery-platform
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
AntonXue committed Jan 23, 2015
2 parents 6570ccd + 3533ece commit d8b9c8f
Show file tree
Hide file tree
Showing 30 changed files with 3,538 additions and 3,355 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ refinery/ui/node_modules/
media/
static/
isa-tab/
import/
*.conflict
*.sublime-*
.idea/
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ Connect to the initialized VM:
$ workon refinery-platform
$ ./manage.py
Log in to Refinery (http://192.168.50.50:8000/) with the default guest user account (username: guest, password: guest).

Log in to Django admin UI (http://192.168.50.50:8000/admin/) with the default superuser account (username: admin, password: refinery).

Please see `installation notes
<https://refinery-platform.readthedocs.org/en/latest/administrator/setup.html>`_
for more details, including information on how to configure Galaxy for this setup.
Expand Down
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.network :private_network, ip: "192.168.50.50"

config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--memory", "1024"]
v.memory = 1024
v.cpus = 2
end

config.ssh.forward_agent = true # to enable cloning from Github over SSH
Expand Down
16 changes: 14 additions & 2 deletions deployment/manifests/default.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
$project_root = "/vagrant/refinery"
$ui_app_root = "${project_root}/ui"

# to make logs easier to read
file { "/etc/timezone":
content => "US/Eastern",
}

# for better performance
sysctl { 'vm.swappiness': value => '10' }

file { "/home/${appuser}/.ssh/config":
Expand All @@ -27,6 +33,9 @@
}
class { 'postgresql::lib::devel':
}
postgresql::server::role { $appuser:
createdb => true,
}
postgresql::server::db { 'refinery':
user => $appuser,
password => '',
Expand Down Expand Up @@ -67,7 +76,7 @@

package { 'virtualenvwrapper': }
->
file_line {"virtualenvwrapper_config":
file_line { "virtualenvwrapper_config":
path => "/home/${appuser}/.profile",
line => "source /etc/bash_completion.d/virtualenvwrapper",
require => Python::Virtualenv[$virtualenv],
Expand All @@ -82,7 +91,10 @@
group => $appgroup,
}

file { ["/vagrant/media", "/vagrant/static", "/vagrant/isa-tab" ]:
file { ["/vagrant/media",
"/vagrant/static",
"/vagrant/isa-tab",
"/vagrant/import" ]:
ensure => directory,
owner => $appuser,
group => $appgroup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,31 @@ def handle(self, *args, **options):
Description: main program; calls the parsing and insertion functions
"""
required = ['username', 'title', 'file_name', 'source_column_index', 'data_file_column']
required = ['username', 'title', 'file_name', 'source_column_index',
'data_file_column']
for arg in required:
if not options[arg]:
raise CommandError('%s was not provided.' % arg)
raise CommandError('{} was not provided'.format(arg))
source_columns = \
[x.strip() for x in options['source_column_index'].split(",")]
try:
source_columns = [int(x.strip()) for x in options['source_column_index'].split(",")]
except ValueError:
raise CommandError("source_column_index value(s) are invalid")
for column_index in source_columns:
if column_index < 0:
raise CommandError("source_column_index values can not be negative")
integer_values = ['data_file_column', 'auxiliary_file_column',
'genome_build_column', 'annotation_column']
for arg in integer_values:
if options[arg] and options[arg] < 0:
raise CommandError("{} can not be negative".format(arg))
with open(options['file_name']) as metadata_file:
dataset_uuid = process_metadata_table(
options['username'], options['title'], metadata_file,
source_columns, options['data_file_column'],
options['data_file_permanent'], options['base_path'],
options['auxiliary_file_column'], options['species_column'],
options['genome_build_column'], options['annotation_column'],
options['slug'], options['is_public'])
with open(options['file_name']) as metadata_file:
dataset_uuid = process_metadata_table(
username=options['username'], title=options['title'],
metadata_file=metadata_file, source_columns=source_columns,
data_file_column=options['data_file_column'],
auxiliary_file_column=options['auxiliary_file_column'],
base_path=options['base_path'],
data_file_permanent=options['data_file_permanent'],
species_column=options['species_column'],
genome_build_column=options['genome_build_column'],
annotation_column=options['annotation_column'],
slug=options['slug'], is_public=options['is_public'])
except IOError as exc:
raise CommandError(
"Could not open file '{}': {}".format(
options['file_name'], exc))
except ValueError as exc:
raise CommandError(exc)

print("Created dataset with UUID '{}'".format(dataset_uuid))
4 changes: 2 additions & 2 deletions refinery/data_set_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def _is_facet_attribute(attribute,study,assay):

query = settings.REFINERY_SOLR_BASE_URL + "data_set_manager" + "/select?" + "q=django_ct:data_set_manager.node&wt=json&start=0&rows=1&fq=(study_uuid:" + study.uuid + "%20AND%20assay_uuid:" + assay.uuid + "%20AND%20is_annotation:false%20AND%20(type:%22Array%20Data%20File%22%20OR%20type:%22Derived%20Array%20Data%20File%22%20OR%20type:%22Raw%20Data%20File%22%20OR%20type:%20%22Derived%20Data%20File%22))&facet=true&facet.field=" + attribute + "&facet.sort=count&facet.limit=-1"

logger.debug( "Query for initialize_attribute_order: %s" % ( query, ) )
# logger.debug( "Query for initialize_attribute_order: %s" % ( query, ) )

# proper url encoding
query = urllib2.quote(query, safe="%/:=&?~#+!$,;'@()*[]")
Expand Down Expand Up @@ -586,7 +586,7 @@ def initialize_attribute_order( study, assay ):

query = settings.REFINERY_SOLR_BASE_URL + "data_set_manager" + "/select?" + "q=django_ct:data_set_manager.node&wt=json&start=0&rows=1&fq=(study_uuid:" + study.uuid + "%20AND%20assay_uuid:" + assay.uuid + "%20AND%20is_annotation:false%20AND%20(type:%22Array%20Data%20File%22%20OR%20type:%22Derived%20Array%20Data%20File%22%20OR%20type:%22Raw%20Data%20File%22%20OR%20type:%20%22Derived%20Data%20File%22))&facet=true&facet.sort=count&facet.limit=-1"

logger.debug( "Query for initialize_attribute_order: %s" % ( query, ) )
# logger.debug( "Query for initialize_attribute_order: %s" % ( query, ) )

# proper url encoding
query = urllib2.quote(query, safe="%/:=&?~#+!$,;'@()*[]")
Expand Down

0 comments on commit d8b9c8f

Please sign in to comment.