These are chat archives for dereneaton/ipyrad

27th
Apr 2016
Isaac Overcast
@isaacovercast
Apr 27 2016 00:07
step 5, does this look familiar?
ERROR:ipyrad.core.assembly:'ascii' codec can't encode character u'\xb1' in position 23: ordinal not in range(128)
  Caught unknown exception - 'ascii' codec can't encode character u'\xb1' in position 23: ordinal not in range(128)
  Saving Assembly.
Deren Eaton
@dereneaton
Apr 27 2016 00:27
nope
I think I know what it is
I named a variable ord
but ord is a function to convert ascii
Isaac Overcast
@isaacovercast
Apr 27 2016 00:30
It's actually this "\u00B1"
       print(u"""\
  Mean error  [{:.5f} \u00B1 {:.5f}]
  Mean hetero [{:.5f} \u00B1 {:.5f}]"""\
  .format(data.stats.error_est.mean(), data.stats.error_est.std(),
          data.stats.hetero_est.mean(), data.stats.hetero_est.std()))
if i run this print w/o the u in print(u""" it goes fine (obv doesn't parse the unicode), adding the u back it croaks w/ the above error
what' that character supposed to be?
fixed.
Deren Eaton
@dereneaton
Apr 27 2016 00:41
oh
Isaac Overcast
@isaacovercast
Apr 27 2016 00:41
mm. nvm, it just doesn't throw now.
Deren Eaton
@dereneaton
Apr 27 2016 00:41
for me it prints a 'plus-minus' symbol
I guess it's not universal?
Isaac Overcast
@isaacovercast
Apr 27 2016 00:41
on mac it looks like UTF-8 is not the default character encoding for terminal
Deren Eaton
@dereneaton
Apr 27 2016 00:41
good to know
we can get rid of it and just write sd=
Isaac Overcast
@isaacovercast
Apr 27 2016 00:43
yuh, i tested on a newer mac, same issue
i'll change it cuz i'm right there.
Isaac Overcast
@isaacovercast
Apr 27 2016 01:19
found a clue, the vsearch inside ipyrad is 1.10, but the version i was using from the command line is 1.9.5, they must have changed something between those versions in how status writes to the term. still investigating
Deren Eaton
@dereneaton
Apr 27 2016 01:24
it says that 1.10 started printing differently if its not to a terminal
which I thought might be a problem
there are ways to create a pseudo-tty, but it seemed complicated.
Isaac Overcast
@isaacovercast
Apr 27 2016 01:37
Yeah, it somehow knows it's being piped, piping stderr for the new version only writes out the final 100% lines, not the intermediates. weird.
Isaac Overcast
@isaacovercast
Apr 27 2016 03:19
cmd = "/usr/bin/script /tmp/watt /usr/local/opt/anaconda/lib/python2.7/site-packages/ipyrad-0.1.87-py2.7.egg/bin/vsearch-osx-x86_64 --derep_fulllength /tmp/ipyrad-test/ipyrad-test_edits/2G_0_R1_.fastq --output /tmp/wat"
os.system(cmd)
with open("/tmp/watt", 'r') as infile:
    for c in iter(lambda: infile.read(1), ''):
        if c == "%":
            print("".join(acc)+"%")
            acc = []
        else:
            acc.append(c)
jealous of my hax? :hammer: :muscle: :sunglasses:
Isaac Overcast
@isaacovercast
Apr 27 2016 03:28
I tested it and it does work in real time script writes updated output to the file you choose. Now, this is obviously very hackish, and also for a bonus :facepunch: mac and linux script commands differ slightly in syntax (obv, why wouldn't they o_O :rage: )
So, yeah, i'm not saying we should go down this rabbit hole, i just kinda wanted to prove to myself there was a way to do it. Turns out the way kinda sucks. There are def other ways (pseudo-tty) but yeah i looked at them too and they are even more hackish. idk, give it a shot and see what you think, it would be kinda bogus to have to write a switch to handle mac/linux differently just for a progress bar, but it might be the best we can do this route...
Deren Eaton
@dereneaton
Apr 27 2016 16:23
I'm giving a talk at U Ark, so I'll be busy/traveling next few days. I'd love to get a progress bar for clustering since it's a long step, but it sounds annoyingly difficult.
When are you giving that workshop?
Isaac Overcast
@isaacovercast
Apr 27 2016 23:24
If it happens it'll be in may. some circumstances changed that might make it not happen, but it's still on the table.