broadinstitute/fiss

attr_get not working

Closed this issue · 12 comments

attr_get is not working for me.

As seen below, running it with no -t argument yields nothing, with -t participant a one line output, and with pair, pairset, and sample I get an error complaining about having to parse unicode.

I have shared the relevant workspace with Mike.
Any ideas?
Gordon

bash:cga-myc:/cga/fh/fdw/gce 507 $ fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org
bash:cga-myc:/cga/fh/fdw/gce 508 $ fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org -t pair
Traceback (most recent call last):
File "/xchip/tcga/Tools/gdac/bin/fissfc", line 11, in
sys.exit(main())
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/firecloud/fiss.py", line 2074, in main
result = args.func(args)
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/firecloud/fiss.py", line 448, in attr_get
print(u(header))
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/six.py", line 647, in u
return unicode(s.replace(r'\', r'\\'), "unicode_escape")
TypeError: decoding Unicode is not supported
bash:cga-myc:/cga/fh/fdw/gce 509 $ fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org -t pair_set
Traceback (most recent call last):
File "/xchip/tcga/Tools/gdac/bin/fissfc", line 11, in
sys.exit(main())
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/firecloud/fiss.py", line 2074, in main
result = args.func(args)
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/firecloud/fiss.py", line 448, in attr_get
print(u(header))
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/six.py", line 647, in u
return unicode(s.replace(r'\', r'\\'), "unicode_escape")
TypeError: decoding Unicode is not supported
bash:cga-myc:/cga/fh/fdw/gce 510 $ fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org -t participant
participant_id
bash:cga-myc:/cga/fh/fdw/gce 511 $ fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org -t sample
Traceback (most recent call last):
File "/xchip/tcga/Tools/gdac/bin/fissfc", line 11, in
sys.exit(main())
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/firecloud/fiss.py", line 2074, in main
result = args.func(args)
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/firecloud/fiss.py", line 448, in attr_get
print(u(header))
File "/xchip/tcga/Tools/gdac/gdops_1.6.0/lib/python2.7/site-packages/six.py", line 647, in u
return unicode(s.replace(r'\', r'\\'), "unicode_escape")
TypeError: decoding Unicode is not supported
bash:cga-myc:/cga/fh/fdw/gce 512 $

At present I cannot use the workspace, perhaps b/c of lack of permissions to the bucket? See attached error.

screen shot 2017-07-06 at 1 59 39 pm

Similarly, fissfc reports the same:

% fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org
Error 404 (rawls): nci-gsaksena-bi-org/MC3_mutation_validator does not exist

Seems like a permissions issue. It uses protected TCGA data, is your eRA commons credential linked?
Workspace sharing should be pretty instant.

Yup, it does seem that way, but the error could say so more clearly rather than leaving it to be inferred. In the meantime, in a Python venv on your laptop, can you try

pip install firecloud

to get v0.16.1 and then try the same commands?

It looks like I get a different version of fissfc from pip. And, it throws a new error.

Gordon

$ fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org
usage: fissfc [-h] [-u API_URL] [-l] [-v] [-y] [-p PROJECT]
{space_delete,space_list,space_lock,space_new,space_info,space_unlock,space_clone,entity_import,entity_types,entity_list,entity_tsv,participant_list,sample_list,sset_list,entity_delete,participant_delete,sample_delete,sset_delete,space_acl,space_set_acl,flow_new,flow_delete,flow_acl,flow_set_acl,flow_list,config_list,config_acl,attr_get}
...
fissfc: error: unrecognized arguments: -w -p nci-gsaksena-bi-org

$ fissfc -v
0.6.2

I deleted the fissfc project from PyPi: that was the previous name until v0.6.2 (as you just observed). The FISS cli project is now named "firecloud" ... and if you successfully install v0.16.1 you should see the correct behavior: for example

% fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org -t pair -e ACC-OR-A5J1-TP-NB -a mc3_maf
entity:pair_id mc3_maf
ACC-OR-A5J1-TP-NB gs://fc-e5920d62-ed56-47ed-8a61-bf1cac042c69/mc3_controlled_mafs/mc3.v0.2.8.CONTROLLED.ACC-OR-A5J1-TP-NB.maf

Finally, note that you can use a ~/.fissconfig file to simplify your CLI and avoid specifying so many flags.

I can reproduce your fixed behavior via the centrally installed version. Also, having '-e' included in the help is helpful...

Is there a way to get all attributes for the entity? I probably have a workaround if not.

The internal code docs note that the -a merely subsets the attributes that are returned. To return them all, do not specify any -a whatsoever. NOW, doing that for your pair set reveals a problem, in that what FC seems t return for sample_set entities does not match the format of what is returned for pair entities, and possibly others. I'm looking at why ...

That is the problem I noted (in my last post) as being revealed. The format of the payload returned by FC is inconsistent across entity types.

I just pushed v0.16.2 to the repo to address this FC inconsistency. I haven't made a PyPI release, but have done an install on the Broad network:

vgdac1%   fissfc --version
0.16.2
vgdac1%   fissfc attr_get -w MC3_mutation_validator -p nci-gsaksena-bi-org -t pair -e ACC-OR-A5J1-TP-NB
entity:pair_id	mc3_maf	case_sample	participant	control_sample
ACC-OR-A5J1-TP-NB	gs://fc-e5920d62-ed56-47ed-8a61-bf1cac042c69/mc3_controlled_mafs/mc3.v0.2.8.CONTROLLED.ACC-OR-A5J1-TP-NB.maf	ACC-OR-A5J1-TP	ACC-OR-A5J1	ACC-OR-A5J1-NB

Finally, note that there can be inconsistencies between column ordering (e.g. across Python 2 & 3), so be careful about that.