Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ethanagbaker on github.
  • I am ethanagbaker (https://keybase.io/ethanagbaker) on keybase.
  • I have a public key ASCBgKcJXAC4wb3-bC23uuxCxhNCm5NuJ5RxJTMGcrzDlgo

To claim this, I am signing this object:

{
"links": [
{
"source": 0,
"target": 402,
"weight": 1
},
{
"source": 0,
"target": 315,
#!/usr/bin/env python
import copy
def allCombos(scratch, data):
'''
Returns all possible combinations of objects in an array
Args:
----
from Bio import SeqIO
############
pwd = "/Users/Ethan/Desktop/testdir/" #set the present working dir
############
with open(str(pwd) + "namelist.txt") as filenamesFile:
filenames = filenamesFile.readlines()
nameList =[str(e.strip()) for e in filenames]
filenamesFile.close()
@ethanagb
ethanagb / Get_Uniques_Revised.py
Created May 30, 2014 18:01
Pull longest sequence per identifier out of Trinity assembly
from __future__ import print_function
import sys
from Bio import SeqIO
records = dict()
for record in SeqIO.parse('Trinity.fasta',"fasta"):
seq_id = record.id.split('_')[0]
if seq_id not in records: records[seq_id] = list()
records[seq_id].append(record)
#from pprint import pprint
FN ='Trinity.fasta'
def get_data(fn):
with open(fn, mode='r') as fh:
header, fasta = "",""
for line in fh: