Skip to content

Instantly share code, notes, and snippets.

View psomdeb25's full-sized avatar

Somdeb Paul psomdeb25

  • The University of British Columbia
View GitHub Profile
var DNA_NUCLEOTIDES = ['A', 'T', 'C', 'G'];
var ALL_NUCLEOTIDES = DNA_NUCLEOTIDES.concat('U');
function initialCounts() {
return DNA_NUCLEOTIDES.reduce(function(counts, nucleotide) {
counts[nucleotide] = 0;
return counts;
}, {});
}
@lambdaman2
lambdaman2 / Snipplr-53250.py
Created October 1, 2012 12:48
Python: Ways to Move up and Down the dir structure in Python
#Moving up/down dir structure
print os.listdir('.') # current level
print os.listdir('..') # one level up
print os.listdir('../..') # two levels up
# more complex example:
# This will walk the file system beginning in the directory the script is run from. It
# deletes the empty directories at each level