Overriding run properties in assay transformation script

LabKey Support Forum (Inactive)
Overriding run properties in assay transformation script Andy Straw  2014-06-09 13:00
Status: Closed
 
I have a Java transformation script for an assay. The workflow does NOT involve the user selecting a file, so the default assayId (i.e., name of the run) ends up being something like <AssayDesignName>-<DateTimeStamp>.tmp, which isn't very descriptive. I want my transformation script to set the assayId of the run in a particular way so the user doesn't have to set it. (I want to set the value of assayId based on another run property that the user DOES have to choose, but he/she chooses that from a drop-down list, because that property is a lookup.)

I'm trying to set the assayId by writing to the file whose path is given by the "transformedRunPropertiesFile" property in the runProperties.tsv file. I write a tab-delimited line to that file in the same format as the runProperties.tsv file:

assayId<tab>valueIWant<tab>java.lang.String (where <tab> is actually the tab character)

I also tried simply

assayId<tab>valueIWant

but neither had an affect on the assayId of the resulting run. The file "transformedRunProperties.tsv" is definitely getting written - I see it next to runProperties.tsv - and it has the line above in it.

Is it possible to set the assayId of the run this way? If not, is there another way to do this from a transformation script? I couldn't find any documentation about how to set/override run-level properties from a transformation script.

Thanks.

Andy Straw
University of Rochester
 
 
Greg Taylor responded:  2014-06-10 17:10
Currently, you may override user defined run properties using an assay transformation script but not assayId which is a protected field. However, the fix to support overriding of assayId was simple enough and I have implemented it. I will check the improvement into trunk shortly. The new behavior should be supported by the next release.

Greg
 
Andy Straw responded:  2014-06-11 05:43
Thanks very much.

Andy
 
Will Holtz responded:  2016-04-22 15:51
I just bumped into this exact same problem, so I'm guessing this never was committed.

-Will
 
Jon (LabKey DevOps) responded:  2016-04-22 18:48
Hi Will,

I'm trying to confirm whether this was checked in or not. I'm confident that it was done, but since you saw this exact problem in 16.1, I want to make absolutely sure.

Thank you for your patience.

Regards,

Jon
 
Will Holtz responded:  2016-04-22 21:52
My development machine, where I ran into this, is still on r41716 (between v15.3 and v16.1). But that revision is well after mid-2014. Maybe I'll get everything moved to 16.1 this weekend and can test it again. Unfortunately, I couldn't come up with a fast way to generate a small test case for this.

-Will
 
Will Holtz responded:  2016-04-23 21:27
I upgraded my development machine to v16.1 and tried this again. I am still not able to set the run name via the transformedRunPropertiesFile.tsv. I tried with the field name being 'name', 'assayId', and 'Assay Id' and none of them worked for me.

-Will
 
Jon (LabKey DevOps) responded:  2016-04-27 14:18
Hi Will,

Took a bit to dig through the code, but I found the update that was done.

Revision #32912
Committed by g.taylor 6/11/14, 2:49 PM
Fix for Message 9333: Add support to change assayId as a run property in a transformation script. Request by Rochester.

Checking the files against the local current version that I had pulled down, it doesn't appear that there was anything removed from previous, but I will escalate this for further investigation.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2016-04-27 14:25
 
Will Holtz responded:  2016-04-27 15:29
Hi Jon,

I've also done a bit more digging into this. I attempted to make a small repo of this using the General assay type. With the General assay, I was able to update the assayId field via transformedRunPropertiesFile.tsv. Then I tried modifying trunk/server/customModules/exampleassay by adding the attached transformation script. This is the same transformation script that successfully modified the assayId field of the General assay. The transformation script failed to update the assayId field within exampleassay.

I normally don't assume the path or filename for transformedRunPropertiesFile.tsv, but for the purpose of making a simple repo, I made such an assumption here.

-Will
 
Jon (LabKey DevOps) responded:  2016-04-27 19:02
Thanks for the additional information Will! That will help with the investigation further!

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2016-06-30 12:31
Hi Andy/Will,

Is this still an issue for either of you? We had attempted to reproduce the problem, but found that everything did actually work without fail in 16.1 and in trunk.

Regards,

Jon
 
Andy Straw responded:  2016-06-30 12:53
When you added/fixed this back a while ago, it worked for us, and continues to work. We set the property named "assayId" in the file whose name is given as the value of the "transformedRunPropertiesFile" in the runProperties.tsv file passed to our script.
 
Will Holtz responded:  2016-07-05 16:08
Hi Jon,

I just re-tested the repo that I posted on April 27th on two different machines (my development laptop running 16.1/r42835 that was locally compiled and my staging server running official 16.1 binaries). In both cases, the assayId field was not updated.

I needed to get around this issue, so I basically added an assayIdMutable field to my assay and customized the UI to show this field instead. So this currently isn't blocking for me, but it would be nice to avoid doing all of that in the future.

-Will
 
Jon (LabKey DevOps) responded:  2016-07-08 18:03
Thanks for the additional details Will.

I've reopened the bug for further investigation here.

Regards,

Jon
 
Jon (LabKey DevOps) responded:  2016-10-16 20:08
Hi Will,

We haven't been able to repro this in house on 16.2 or later.

Since this problem is specific to 16.1 and we have 16.3 coming out in mid-November, we are going to encourage users to either upgrade to the current 16.2 build or to 16.3 once that is release.

Regards,

Jon
 
Andy Straw responded:  2016-12-21 09:55
Coming back to this again...

I am writing transformation scripts in Java for assays, and using 16.2. What I have found is the following:
- I can set the AssayId from my transformation script if the user uses the "Paste in a tab-separated set of values" option on the Run Properties wizard page during import.
- If the user first selects a file they have uploaded, and then chooses to import that, my script's attempt to set the assay id seems to be ignored - the name of the selected file is always used as the Assay Id.
- I have not tried the "Upload a data file" option on the Run Properties wizard page - not sure how that will behave.

Andy