htsworkflow.git
9 years agoactually complain if we get the wrong type
Diane Trout [Tue, 31 Mar 2015 22:37:57 +0000 (15:37 -0700)]
actually complain if we get the wrong type

9 years agoadd a docstring to validate
Diane Trout [Tue, 31 Mar 2015 22:37:11 +0000 (15:37 -0700)]
add a docstring to validate

9 years agoAdd get_accession_name to use collection name to find commonly used spreadsheet acces...
Diane Trout [Tue, 31 Mar 2015 22:35:52 +0000 (15:35 -0700)]
Add get_accession_name to use collection name to find commonly used spreadsheet accesssion column name

9 years agosupport trying to figure out object type based on what collection its going to be...
Diane Trout [Tue, 31 Mar 2015 22:35:19 +0000 (15:35 -0700)]
support trying to figure out object type based on what collection its going to be posted to

9 years agoMerge branch 'django1.7' of mus.cacr.caltech.edu:htsworkflow into django1.7
Diane Trout [Fri, 27 Mar 2015 18:13:50 +0000 (11:13 -0700)]
Merge branch 'django1.7' of mus.cacr.caltech.edu:htsworkflow into django1.7

9 years agoSwitch encode3 submitter to use aws.
Diane Trout [Fri, 27 Mar 2015 18:11:11 +0000 (11:11 -0700)]
Switch encode3 submitter to use aws.

I needed to write a submission class to support submitting to
aws, and of course there's a slightly different set of metadata
they want to know for submission.

9 years agoImport flowcell details into the triple store from a lane
Diane Trout [Fri, 27 Mar 2015 18:07:06 +0000 (11:07 -0700)]
Import flowcell details into the triple store from a lane

9 years agostore flowcell name in the triple store if its known
Diane Trout [Fri, 27 Mar 2015 18:05:05 +0000 (11:05 -0700)]
store flowcell name in the triple store if its known

9 years agorecord file size information for a file in the triple store
Diane Trout [Fri, 27 Mar 2015 18:03:45 +0000 (11:03 -0700)]
record file size information for a file in the triple store

9 years agoAdjust logging overrides and move django.setup to after the override.
Diane Trout [Fri, 27 Mar 2015 18:01:15 +0000 (11:01 -0700)]
Adjust logging overrides and move django.setup to after the override.

(Otherwise the extra logging doesn't do much.

9 years agogetitem should only return the key
Diane Trout [Fri, 27 Mar 2015 17:58:35 +0000 (10:58 -0700)]
getitem should only return the key

9 years agoclean up a bit of whitespace
Diane Trout [Fri, 27 Mar 2015 17:53:07 +0000 (10:53 -0700)]
clean up a bit of whitespace

9 years agoconfigure using a local postgres install
Diane Trout [Fri, 20 Mar 2015 23:33:26 +0000 (16:33 -0700)]
configure using a local postgres install

9 years agoConvert reads to an integer, if if it was a float in the xml.
Diane Trout [Fri, 20 Mar 2015 23:31:53 +0000 (16:31 -0700)]
Convert reads to an integer, if if it was a float in the xml.

Some versions of the pipeline include a trailing .0 for read length,
this made python 3s parser unhappy. so convert to a float and then
truncate to work around the type issue.

9 years agoActually comare an integer (length of list) to an integer 0.
Diane Trout [Fri, 20 Mar 2015 23:30:14 +0000 (16:30 -0700)]
Actually comare an integer (length of list) to an integer 0.

Why was list() > 0 ever valid code?

9 years agoThe empty list is now not found
Diane Trout [Fri, 20 Mar 2015 23:29:24 +0000 (16:29 -0700)]
The empty list is now not found

No I don't know why.

9 years agoDrop library id encoding
Diane Trout [Fri, 20 Mar 2015 23:27:19 +0000 (16:27 -0700)]
Drop library id encoding

9 years agoUse regex to make sure scripts end with the right command
Diane Trout [Fri, 20 Mar 2015 23:26:04 +0000 (16:26 -0700)]
Use regex to make sure scripts end with the right command

python 3 doesn't seem to return the path to a .pyc file
like python 2.

9 years agoUse six.moves to find urlencode and urlopen
Diane Trout [Fri, 20 Mar 2015 23:25:20 +0000 (16:25 -0700)]
Use six.moves to find urlencode and urlopen

9 years agofilter out None c.times in list of potential times
Diane Trout [Fri, 20 Mar 2015 23:24:55 +0000 (16:24 -0700)]
filter out None c.times in list of potential times

9 years agouse relative import for submission_test_common
Diane Trout [Fri, 20 Mar 2015 23:23:50 +0000 (16:23 -0700)]
use relative import for submission_test_common

9 years agoTry to detect if an object is a file type on python python 2 & 3.
Diane Trout [Fri, 20 Mar 2015 23:22:06 +0000 (16:22 -0700)]
Try to detect if an object is a file type on python python 2 & 3.

The base type for files changed between the two releases.

9 years agoreplace xrange with enumerate
Diane Trout [Fri, 20 Mar 2015 23:21:35 +0000 (16:21 -0700)]
replace xrange with enumerate

9 years agoUse ''.splitlines() instead of split('\n')
Diane Trout [Fri, 20 Mar 2015 23:19:39 +0000 (16:19 -0700)]
Use ''.splitlines() instead of split('\n')

it seems to handle byte vs text strings a bit better.

9 years agoadapt to python2 returning lists and python3 iterators
Diane Trout [Fri, 20 Mar 2015 23:14:42 +0000 (16:14 -0700)]
adapt to python2 returning lists and python3 iterators

This leads to code like next(iter(obj.values())) instead of
obj.values()[0]. Honestly Im not sure which is less ugly.

Also there's a few places where I have to cast things with list()
to get my tests to pass.

9 years agouse sorted on the iterator instead of an in-place sort
Diane Trout [Fri, 20 Mar 2015 21:46:27 +0000 (14:46 -0700)]
use sorted on the iterator instead of an in-place sort

9 years agoUse max on the iterator to find the last key
Diane Trout [Fri, 20 Mar 2015 21:45:29 +0000 (14:45 -0700)]
Use max on the iterator to find the last key

9 years agoadd more from __future__ import print_function, unicode_literals
Diane Trout [Fri, 20 Mar 2015 21:24:41 +0000 (14:24 -0700)]
add more from __future__ import print_function, unicode_literals

9 years agoCall print(msg) instead of print msg
Diane Trout [Fri, 20 Mar 2015 21:20:27 +0000 (14:20 -0700)]
Call print(msg) instead of print msg

9 years agospecial case unicode handling that differs between python2 & 3
Diane Trout [Fri, 20 Mar 2015 21:19:05 +0000 (14:19 -0700)]
special case unicode handling that differs between python2 & 3

9 years agoReplace some unicode() with str()
Diane Trout [Fri, 20 Mar 2015 21:18:33 +0000 (14:18 -0700)]
Replace some unicode() with str()

9 years agoUse isinstance(object, (types)) pattern instead of type(object) == types.Type
Diane Trout [Fri, 20 Mar 2015 21:13:54 +0000 (14:13 -0700)]
Use isinstance(object, (types)) pattern instead of type(object) == types.Type

9 years agoSpecify text vs binary mode for opening files.
Diane Trout [Fri, 20 Mar 2015 20:47:36 +0000 (13:47 -0700)]
Specify text vs binary mode for opening files.

(And another smart_text cast sliped in)

9 years agoprefer native string types.
Diane Trout [Fri, 20 Mar 2015 20:42:12 +0000 (13:42 -0700)]
prefer native string types.

Things get really messy when trying to pass unicode strings
to redland in python2. I found it simpler to just try and keep
using the native string type.

So this patch is largely replacing unicode() to str() and
changing u'' to ''.

9 years agoupdate more raise exceptions to Exception(message) syntax
Diane Trout [Fri, 20 Mar 2015 20:30:36 +0000 (13:30 -0700)]
update more raise exceptions to Exception(message) syntax

9 years agoUse django.utils.encode smart_text or smart_str for intelligent unicode handling
Diane Trout [Thu, 19 Mar 2015 21:48:46 +0000 (14:48 -0700)]
Use django.utils.encode smart_text or smart_str for intelligent unicode handling

some things like writing files or talking to redland are
quite picky about whether or not they're unicode or ascii strings.

9 years agoimport urljoin from six.moves.urllib.parse
Diane Trout [Wed, 18 Mar 2015 23:52:28 +0000 (16:52 -0700)]
import urljoin from six.moves.urllib.parse

9 years agouse JsonResponse instead of making a json response by hand using HttpResponse
Diane Trout [Wed, 18 Mar 2015 23:50:34 +0000 (16:50 -0700)]
use JsonResponse instead of making a json response by hand using HttpResponse

9 years agodrop support for simplejson. were only caring about python 2.7+ and 3.3+
Diane Trout [Wed, 18 Mar 2015 23:49:31 +0000 (16:49 -0700)]
drop support for simplejson. were only caring about python 2.7+ and 3.3+

9 years agoimport ConfigParser classes from six.moves.configparser
Diane Trout [Wed, 18 Mar 2015 23:46:47 +0000 (16:46 -0700)]
import ConfigParser classes from six.moves.configparser

9 years agouse absolute_import
Diane Trout [Wed, 18 Mar 2015 23:45:08 +0000 (16:45 -0700)]
use absolute_import

9 years agonew json code returns [] when there are no lanes
Diane Trout [Tue, 3 Feb 2015 00:30:31 +0000 (16:30 -0800)]
new json code returns [] when there are no lanes

9 years agoconvert to unicode_literals
Diane Trout [Tue, 3 Feb 2015 00:24:18 +0000 (16:24 -0800)]
convert to unicode_literals

convert all the string handling to unicode.
to make the RDF stuff work I needed to mark those strings
as byte arrays

9 years agotake advantage of absolute_import to simplify import statements
Diane Trout [Mon, 2 Feb 2015 22:54:28 +0000 (14:54 -0800)]
take advantage of absolute_import to simplify import statements

9 years agobase64.encodestring needs a bytearray in python3
Diane Trout [Mon, 2 Feb 2015 22:42:32 +0000 (14:42 -0800)]
base64.encodestring needs a bytearray in python3

I needed to use int2byte to safely replace the char()
I was using in python2.

9 years agoReplace elif list() > int() with else
Diane Trout [Mon, 2 Feb 2015 22:40:47 +0000 (14:40 -0800)]
Replace elif list() > int() with else

the expression was always true under python2 and
is a syntax error in python3. Replacing it with
if len(list()) > 0 caused test case failures
so this seemed like the best idea.

9 years agoproperly call usrlib.parse instead of urlparse
Diane Trout [Fri, 30 Jan 2015 21:48:17 +0000 (13:48 -0800)]
properly call usrlib.parse instead of urlparse

9 years agoConvert alphanum sort from comparitor to key operator
Diane Trout [Fri, 30 Jan 2015 21:47:01 +0000 (13:47 -0800)]
Convert alphanum sort from comparitor to key operator

I found a much shorter algorithm over on stackoverflow.

9 years agoconvert from failUnlessEqual to assertEqual
Diane Trout [Thu, 29 Jan 2015 23:44:06 +0000 (15:44 -0800)]
convert from failUnlessEqual to assertEqual

9 years agoupdate srf2fastq detection code to work with byte arrays
Diane Trout [Thu, 29 Jan 2015 23:43:51 +0000 (15:43 -0800)]
update srf2fastq detection code to work with byte arrays

9 years agoassume we are writing text with gzip
Diane Trout [Thu, 29 Jan 2015 22:14:57 +0000 (14:14 -0800)]
assume we are writing text with gzip

9 years agoreplace iterkeys with python 3 equivalents
Diane Trout [Thu, 29 Jan 2015 22:03:49 +0000 (14:03 -0800)]
replace iterkeys with python 3 equivalents

9 years agoconvert has_key to X in dictionary
Diane Trout [Thu, 29 Jan 2015 21:59:07 +0000 (13:59 -0800)]
convert has_key to X in dictionary

9 years agouse six.moves to work around urllib / urllib2 / urlparse to urllib 2to3 cleanup
Diane Trout [Thu, 29 Jan 2015 21:39:32 +0000 (13:39 -0800)]
use six.moves to work around urllib / urllib2 / urlparse to urllib 2to3 cleanup

9 years agoremove unicode_literals from things going to redland RDF
Diane Trout [Thu, 29 Jan 2015 21:23:39 +0000 (13:23 -0800)]
remove unicode_literals from things going to redland RDF

9 years agoremove some commented out code
Diane Trout [Thu, 29 Jan 2015 19:44:16 +0000 (11:44 -0800)]
remove some commented out code

9 years agoconvert some print statements to logger messages
Diane Trout [Thu, 29 Jan 2015 19:43:59 +0000 (11:43 -0800)]
convert some print statements to logger messages

9 years agoconvert to print_function, and start adding unicode_literals future as well
Diane Trout [Thu, 29 Jan 2015 19:43:18 +0000 (11:43 -0800)]
convert to print_function, and start adding unicode_literals future as well

9 years agoput #!/usr/bin/env python in the right place
Diane Trout [Thu, 29 Jan 2015 19:39:52 +0000 (11:39 -0800)]
put #!/usr/bin/env python in the right place

9 years agoremove ,'s from more except blocks, and now a raise too
Diane Trout [Thu, 29 Jan 2015 19:00:47 +0000 (11:00 -0800)]
remove ,'s from more except blocks, and now a raise too

9 years agomore use six.moves to import StringIO
Diane Trout [Thu, 29 Jan 2015 18:59:48 +0000 (10:59 -0800)]
more use six.moves to import StringIO

9 years agouse six.moves to get to python3-style urllib
Diane Trout [Thu, 29 Jan 2015 18:44:00 +0000 (10:44 -0800)]
use six.moves to get to python3-style urllib

9 years agowhitespace-cleanup
Diane Trout [Thu, 29 Jan 2015 18:42:52 +0000 (10:42 -0800)]
whitespace-cleanup

9 years agoremove some commented out code
Diane Trout [Thu, 29 Jan 2015 18:27:17 +0000 (10:27 -0800)]
remove some commented out code

9 years agoconvert to print_function
Diane Trout [Thu, 29 Jan 2015 18:26:27 +0000 (10:26 -0800)]
convert to print_function

9 years agouse force_text instead of force_unicode for python2/3 compatibility
Diane Trout [Thu, 29 Jan 2015 18:21:04 +0000 (10:21 -0800)]
use force_text instead of force_unicode for python2/3 compatibility

9 years agoimport StringIO from six.moves
Diane Trout [Thu, 29 Jan 2015 18:20:11 +0000 (10:20 -0800)]
import StringIO from six.moves

9 years agouse six to work around rename of configparser
Diane Trout [Thu, 29 Jan 2015 00:08:21 +0000 (16:08 -0800)]
use six to work around rename of configparser

9 years agoConvert old style except blocks to except Exception as variable: blocks
Diane Trout [Thu, 29 Jan 2015 00:00:53 +0000 (16:00 -0800)]
Convert old style except blocks to except Exception as variable: blocks

9 years agomake the search tool more flexible
Diane Trout [Wed, 28 Jan 2015 23:32:02 +0000 (15:32 -0800)]
make the search tool more flexible

9 years agoremove unused code
Diane Trout [Mon, 26 Jan 2015 20:12:21 +0000 (12:12 -0800)]
remove unused code

9 years agoUpdate test_retrieve_config to work with factories
Diane Trout [Wed, 21 Jan 2015 01:17:04 +0000 (17:17 -0800)]
Update test_retrieve_config to work with factories

Along the way I slightly altered how the species factory
worked which required tweaking test_samples.
For some reason test_sequencer changed slightly.

9 years agofix spelling error in module name
Diane Trout [Wed, 14 Jan 2015 19:56:01 +0000 (11:56 -0800)]
fix spelling error in module name

9 years agoDon't pass null authentication information to ENCODED.
Diane Trout [Tue, 13 Jan 2015 19:45:23 +0000 (11:45 -0800)]
Don't pass null authentication information to ENCODED.

the recent build seems unhappy getting auth=(None, None)
and while I was in there, update the domain name.

9 years agouse absolute_import and print_function
Diane Trout [Tue, 13 Jan 2015 19:45:01 +0000 (11:45 -0800)]
use absolute_import and print_function

9 years agoUpdate inventory tests to use factory boy.
Diane Trout [Tue, 13 Jan 2015 00:12:38 +0000 (16:12 -0800)]
Update inventory tests to use factory boy.

also start prefering reverse instead of hardcoding urls.

9 years agomove the file type test cases out into their own module
Diane Trout [Mon, 12 Jan 2015 18:50:28 +0000 (10:50 -0800)]
move the file type test cases out into their own module

9 years agouse migrations for experiments, and use migrations to the file type regexes
Diane Trout [Mon, 12 Jan 2015 18:49:51 +0000 (10:49 -0800)]
use migrations for experiments, and use migrations to  the file type regexes

9 years agoget_schema_url only works on object types now, so change some code to meet the new api
Diane Trout [Sat, 10 Jan 2015 00:40:40 +0000 (16:40 -0800)]
get_schema_url only works on object types now, so change some code to meet the new api

9 years agoat some point I added code that used base64, hashlib, and os, but I never imported...
Diane Trout [Sat, 10 Jan 2015 00:39:11 +0000 (16:39 -0800)]
at some point I added code that used base64, hashlib, and os, but I never imported them

9 years agoForgot to disable loading ClusterStation and Sequencer test cases since I moved them...
Diane Trout [Sat, 10 Jan 2015 00:35:57 +0000 (16:35 -0800)]
Forgot to disable loading ClusterStation and Sequencer test cases since I moved them out.

9 years agoConvert experiments modules to use factories instead of fixtures.
Diane Trout [Sat, 10 Jan 2015 00:28:26 +0000 (16:28 -0800)]
Convert experiments modules to use factories instead of fixtures.

And then propogate those changes throughout the test cases

9 years agoImprove samples_factory generated objects.
Diane Trout [Sat, 10 Jan 2015 00:16:54 +0000 (16:16 -0800)]
Improve samples_factory generated objects.

* Add LibraryType and MultiplexIndex factories.
* Use factoryboy's fuzzy tools to generate more interesting objects,
  especially to avoid problems with Unique=True fields.
* Use django_get_or_create to make it easier to deail with things
  like usernames
* Define field values for is_staff and is_superuser for the user model
* Unsurprisingly this required updating some test cases to
  be compatible with the changes.

9 years agounimportant whitespace changes, at least the lines with text look the same
Diane Trout [Sat, 10 Jan 2015 00:15:03 +0000 (16:15 -0800)]
unimportant whitespace changes, at least the lines with text look the same

9 years agowhitespace changes
Diane Trout [Sat, 10 Jan 2015 00:08:25 +0000 (16:08 -0800)]
whitespace changes

9 years agofix typo -- or at least make it consistent. antigen -> antigene
Diane Trout [Sat, 10 Jan 2015 00:07:41 +0000 (16:07 -0800)]
fix typo -- or at least make it consistent. antigen -> antigene

9 years agomove cluster station and sequencer tests out into their own modules
Diane Trout [Sat, 10 Jan 2015 00:04:36 +0000 (16:04 -0800)]
move cluster station and sequencer tests out into their own modules

9 years agoUse logger instead of trying to print to stdout. especially since print_function...
Diane Trout [Sat, 10 Jan 2015 00:00:34 +0000 (16:00 -0800)]
Use logger instead of trying to print to stdout. especially since print_function has a different syntax for doing that

9 years agoone should only return json objects. so put our arrays inside a minimal object
Diane Trout [Fri, 9 Jan 2015 23:59:15 +0000 (15:59 -0800)]
one should only return json objects. so put our arrays inside a minimal object

9 years agoMerge branch 'django1.7' of mus.cacr.caltech.edu:htsworkflow into django1.7
Diane Trout [Sat, 13 Dec 2014 00:36:36 +0000 (16:36 -0800)]
Merge branch 'django1.7' of mus.cacr.caltech.edu:htsworkflow into django1.7

Conflicts:
htsworkflow/submission/encoded.py

Prefer the multi line
if 'string' in object:
   del object['string']

9 years agoAdd document registration class.
Diane Trout [Sat, 13 Dec 2014 00:34:50 +0000 (16:34 -0800)]
Add document registration class.

9 years agoadd more type checking for parsing object type from an object
Diane Trout [Sat, 13 Dec 2014 00:34:30 +0000 (16:34 -0800)]
add more type checking for parsing object type from an object

9 years agoadd some helpful log messages
Diane Trout [Sat, 13 Dec 2014 00:33:22 +0000 (16:33 -0800)]
add some helpful log messages

9 years agoadd ability to adjust some log level messages
Diane Trout [Mon, 1 Dec 2014 19:20:49 +0000 (11:20 -0800)]
add ability to adjust some log level messages

9 years agocommit script to copy jumpgate sqlite database to felcat postgres
Diane Trout [Mon, 1 Dec 2014 18:57:35 +0000 (10:57 -0800)]
commit script to copy jumpgate sqlite database to felcat postgres

9 years agorequire django 1.7 and factory boy for newer test code
Diane Trout [Mon, 1 Dec 2014 18:56:49 +0000 (10:56 -0800)]
require django 1.7 and factory boy for newer test code

9 years agoAdd some code to help read metadata out of spreadsheets.
Diane Trout [Fri, 7 Nov 2014 23:24:19 +0000 (15:24 -0800)]
Add some code to help read metadata out of spreadsheets.

also make the schema validator in encoded a bit more forgiving.

9 years agoforgot to change one test to use factory
Diane Trout [Mon, 3 Nov 2014 22:02:11 +0000 (14:02 -0800)]
forgot to change one test to use factory

9 years agoThe makemigrations code didn't like how I was setting default selections with class...
Diane Trout [Sat, 1 Nov 2014 00:12:45 +0000 (17:12 -0700)]
The makemigrations code didn't like how I was setting default selections with class methods.

this breaks them out into seperate functions, hopefully less confusing
for the migration code.

9 years agoname get_query_set was deprecated in favor of get_queryset
Diane Trout [Sat, 1 Nov 2014 00:12:34 +0000 (17:12 -0700)]
name get_query_set was deprecated in favor of get_queryset