Question: Text Manipulation > Compute > C1[1:C1.Find("(")] Fails
0
gravatar for Robert Curtis Hendrickson
7.4 years ago by
Folks, I have a column c1 that has entries like "GXP_297346(PVALB/human)". I'm trying to use Text Manipulation > Compute to strip off the "(...)" portion, leaving only the accession (which can vary in length). I have tried a variety of things that work in my python command line, but fail here, for example: c1[1:c1.find("(")] or c1.split('(')[0] This gets mangled: An error occurred running this job: Expression "c1__ob__1:c1.find("(")__cb__" likely invalid. Or An error occurred running this job: Expression "c1.split("(")__ob__0__cb__" likely invalid. Please help. This is driving me crazy. Searching the list, I find only http://gmod.827538.n3.nabble.com/inputs-sanitization- tt2664336.html#a2664911 "Inputs sanitization" which seems to indicate this is a global mapper that can only be disabled with dire security consequences. And http://gmod.827538.n3.nabble.com/substring-sequence-on-coordinate-in- columns-tt3026255.html#a3048100 "substring sequence on coordinate in columns" which doesn't ever answer the question about how to get compute to work. Thanks, Curtis
gmod • 853 views
ADD COMMENTlink modified 7.3 years ago by Russell Bell30 • written 7.4 years ago by Robert Curtis Hendrickson130
0
gravatar for Jennifer Hillman Jackson
7.4 years ago by
United States
Jennifer Hillman Jackson25k wrote:
Hello Robert, This tool does sanitize many of the characters required to build this type of regular expression. Some changes to a few of the Text Manipulation tools have been discussed, but nothing is planned for the near term. For now, the most expedient solution is for you to download the file, edit with a text editor (line command or desktop), then reload. An updated wrapper that successfully adds parenthesis to the to list of chars changed to tabs with "Convert" might be the simplest change. If you make one, please consider adding it to the Tool Shed and send us an email to galaxy-dev@bx.psu.edu to let the development community know about it. Best wishes, Jen Galaxy team -- Jennifer Jackson http://usegalaxy.org/ http://galaxyproject.org/
ADD COMMENTlink written 7.4 years ago by Jennifer Hillman Jackson25k
Hello Curtis, There is some more feedback from our developers. In your own instance, this is the recommended change: Edit -> tools/stats/column_maker.py To add -> __ob__ and __cb__ to the mapped_str dict. Perhaps this will help if you still needed work-around (or others reading this thread). Best! Jen Galaxy team -- Jennifer Jackson http://usegalaxy.org http://galaxyproject.org/Support
ADD REPLYlink written 7.3 years ago by Jennifer Hillman Jackson25k
0
gravatar for Russell Bell
7.3 years ago by
Russell Bell30
Russell Bell30 wrote:
Hi Curtis, To accomplish things like your "split" command I have had success with Compute using c1.split('(').pop(0) HTH - Russell
ADD COMMENTlink written 7.3 years ago by Russell Bell30
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 167 users visited in the last hour