Sunday, July 27, 2014

Wikipedia (cat)

Here's a silly poem I wrote a few years ago. It comes with its own silly introduction. I think this is pretty much the apex of my poetical achievement, so if you're not a fan of it... well, it just goes downhill from here folks... Also, I'd love to see this turned into a music video, so if anyone with musical or artistic talent would like to collaborate on that, let me know and maybe we can make something really cool.

srj_chembiolib a set of scripts for doing Bioinformaticky type stuff

This post is to announce srj_chembiolib which in an uncreatively named set of scripts I've written to perform various bioinformatics (and hopefully eventually some cheminformatic) tasks that would otherwise be a pain in the rear to accomplish. Most of the scripts work both as libraries that can be imported into other scripts, and as stand alone command line scripts. Some depend on external libraries such as BioPython. Documentation is mostly found in block comments at the top of the script files. Where possible, for example with the scripts that manipulate fasta files, I've tried to make it so that multiple programs can be chained together with pipes on the command line to accomplish more complex tasks. I hope they're useful for someone.

Here's an overview of some (but not all!) of the scripts in the package:

blast_xml_to_outfmt6.py: Converts Blast+ xml output to '-outfmt 6' style output (a tab separated form). Allows for some additional features not available in the standard outfmt 6, such as printing a line for query sequences that had no hits.

subset_fasta.py: Give it a fasta file and a list of strings, and it will give you a fasta file containing only those sequences whose names contain something from the list of strings as a substring.

 extract_massbank.py: A class to read and store data from MassBank format text files, such as those used by MassBank, ReSpect, and Spektraris (my favorite database...).

extract_top_blast_hits.py: Reads a blast xml file and outputs the names of the top hits for each query sequence. There's an option for making a file listing the sequences the queries where the top hit matched in the reverse direction, which is useful, for example with Blastx, to determine whether a nucleotide sequence represents the coding strand, or the non-coding strand.

Monday, July 14, 2014

Head hair as a sensory organ


It's no mystery that hair acts to amplify the sense of touch. Everyone is familiar with the feeling of a bug crawling on their arm, and everyone who has ever gone swimming with a beard knows how much more pleasurable (like a million tiny hands gently pulling at your chin) it is than swimming without a beard. There are also more mystical ideas about long hair granting a kind of sixth sense.

I recently gave myself a buzz cut after letting my hair grow for about 2 years. My hair is moderately curly, so when it's long it poofs out an inch or two from my scalp. From my experience, I don't think long hair grants any kind of mysterious powers (nor do I think it has any effect on personality or intelligence, although people with certain personality traits may be more likely to choose to grow their hair long), but I was surprised to find that scalp hair does seem to contribute to spatial awareness. My evidence for this (which is admittedly circumstantial and has a low sample size, but this would be a very hard thing to test in a controlled environment, you can't very well have a "double blind" haircut) is that in the 24 hours after I cut my hair, I bonked my head into the wall twice. Once I was leaning over to put something in the trash can, and hit my head on the corner of the doorway that the can is next to. The other time I was in the shower and leaning around the too-hot stream of water to adjust the knobs. So I think scalp hair can function for people kind of like how whiskers function for cats.

I think that when I had poofy hair, I subconsciously used it to provide spatial information about the environment immediately around my head. Lacking that information, but not yet having had a chance to compensate by other means, my lack of hair temporarily increased my propensity to bonk into things.

Tuesday, June 24, 2014

maximum blastx tblastn translation length?


Blastx the sequence below against SwissProt. It has an orf that's 493 amino acids long, but the best hsp it turns up (from a protein that is completely identical to the orf) is 453 a.a. long. The same is true when you do tblastn the other way. However, when you first translate the orf (for instance here) and Blastp against SwissProt, you get an hsp covering the whole orf. What's going on here? Does Blast have a maximum length it stores translations at? Hopefully someday I'll have time to investigate this further, or maybe some knowledgeable stranger will pass by this blog and let me know. (edit: This seems to be a freak occurrence with this particular sequence. I have since noticed other Blastx searches to find longer hsps than this one. There is a truncated version of this protein in the NCBI Protein database so maybe that has something to do with it)
GCTGAAAAAAAGTGTAACGTCTCTAGCGGGACGGAGGTAGTATTTATTAAGTTCTGGCGT
GAGAAATAGGAATAAATCTGGACCACCGATCTTAGTTAGATCTATGGTTGATATTTATTT
AAGCATAGTTACAAGATACAATATGCATGATTTTATTTAAGCATTGATTTTACATTAAAA
AGCACAATCGTATAATAAGCATAATATAATGCGTATTTAAGCATGACTTTGTATAGTTTT
AAACATTATTCAAATTTTCTCACGTGAAGATTTATTTACACACGAACCCTTCCCTTCCGT
GTGTATATGTATATAAATATTTAATCAAGATTGACGTGGAGTAGCAAGCACAAGCAAAGG
AGACTTCTTATGGACTACAAATCCAGGAGCTTCAGTCATGTCCAAATCCTCCGCTCTATC
TCCATTACCCAATCTGAAATCGAACTCGTTTACCAGCTTGGATAGTGCAAGCTCGTATAA
AGCCATCGCAAACGTGGATCCGGGGCACCCTCTTCGACCCGACCCGAACGGAAGCATCTC
AAAATGCAACCCTTTATAGTCTATGCTCGTCTCGAGGAACCTTTCTGGACGAAATTCTTC
GGGATTTTCCCACAACGAGGGGTCTCTCGATATGGCCCAGTTGTTGACCAACACGACCGT
GCCACGTGGGATGTCGTAGCCGAGCATATTGGCGTCTTGAGTCAATTCTCGAGGGAGCAG
AATTGCGAAAGGTGGATGTAGGCGTAGAATCTCCTTGGATACTGCTTTCAGATATGGCAT
CTTGTCCACGTCATCCTCGGTAATCCCACCTTTGTTTCTAGAAACTTCTCGCACCTCGTT
CTGCAAAGTTTTTAGGGTACGCGGGTTTTTTATGAGCTCCGCCATCGTCCACTCTAGAGC
CGCGAAAGTCGTATCGGTTCCGGCAGAAACCATGTCGAAGATTAGAGCTTTGATTACGTC
ATCCTCGACGGGGTCAGTATCTTTACTCTCTCTCTGAAACTGAAGCAATGTGTCTACGAA
ATTCGTTTCATCATCACCCACCTTCTTCCTTCTATATTTTCGAAGAATACCCTCCATTGA
TCCATCCAACTTTGTACCGACTTTTTCCACTTCTGCATCGACGCCATTTATCCGGTTGAT
CCAAGACAGCCATGGAACGTAATCCCCCACGTTGAAACTTCCCAAGAGCTTGATAACCTT
GATCAGAATCCGATTAAAATCATCTCCGCCGTCGCCCTTCCTCCCTAACACCGCCCTGTG
AATTACGCCGTTCGTCAGCGCCATGAACATCTCGCTCAAGTTCACGACCGTCGTCGGCTT
CGATCGCCTGATCTTCTCAATCATAGCCGACGTTTCCTCTTCTCGAATCCCGCCGAACGA
CTGGACCCTCTTAGCGCTGAGCAGCTGCAGCATGCACATGCTCCGCGCGTTGCGCCAGTG
CTCGCCGTAGGGGGCGAAGGCCACGCCCTTGCCGCTGTACATCAGCCTGTCGAAGATGCT
CAGCCTCGGCCTGCTCGCGAAGATCACGTCTTGGTTCTTCATGATCTCACGCGCCGCCGC
CGCTGAGGAGGCCACTAGGACAGGAGCGCTGCCGAAATGGAGTAGCATCACCTCGCCGTA
GCGCTTGGATAAGGAGGTGAAGGAGCGGTGGGAGAGGGCTCCGATCAGGTGGAAATGGCC
GATCACCGGAAGCCTTAATGGAGACGGCGGCGGCCTCTTTCTTGAGGAAAGACTGGACTT
TCGTTTATGGAAAAGGACCGCCAGTAAGATTAAAGAGACAGAGAAAAATACTAGAAGAGC
GGCCATTTTCTCTTCAGTTGAATATAATGATGGACAAGTTCTTGGAGAAGG

Friday, May 30, 2014

Milling lupins with a pasta maker machine

In an earlier post, I hypothesized that soaked lupin beans could be effectively dehulled with a pasta maker. Turns out, one of my co-workers has a pasta machine, so I finally got the chance to test this hypothesis. And it does in fact work, particularly after the beans have sprouted a little bit.

As is, the pasta machine is an improvement over hand de-hulling, but I think it could be improved. Set to maximum, the gap on this pasta machine is 2.5 mm, I'd like to try one with a 5 mm gap because this one kind of crushed the beans (although, I still think they'd make decent tempe in this state). The rollers are not grippy enough, (this would be less of a problem with wider spacing), you have to apply gentle pressure to the beans to get them to go through. The pasta machine lacks a hopper so beans have to be fed through fairly slowly and can't be piled up very high on the machine, if there were a hopper, the pressure of beans on other beans might be enough to make extra grip on the rollers unnecessary.

I don't think I'll actually end up using this method, because I suspect that dicing with a food processor will turn out to be cheaper and more effective, but it's certainly a viable strategy, and much preferable to hand hulling.




Thursday, May 29, 2014

Exporting diagrams from Dia into Microsoft Word or Powerpoint

Short answer: on Windows, export to "emf" format, then add the image to the document like you would any other image.


Tuesday, May 27, 2014

Lupin tempe and fried lupin hulls

Lupin tempe is highly touted, and apparently one of the most promising possibilities for expanding the presence of lupins in the human food supply. Tempe (or "tempeh", if you prefer the crude anglicization) is made by growing fungus, usually Rhizopus oligosporus (sometimes also with Rhizopus orzae and other minor components) on beans (usually soy beans, but a wide range of substrates are possible). Tempe is a traditional food in Indonesia and is recently becoming popular in Europe and North America. I've made soybean tempe several times and it's turned out well, so I was excited to try to make lupin tempe. Differences between soy and lupin that may make the process different are that lupins are tougher (more fiber, less oil) than soy beans and have a much thicker hull.