This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#License: CC0 Public Domain (2017) Ahmad Retha | |
## | |
# Get range of bases from a fasta file. e.g. chr21:9411239-9411240 | |
# @param refFile The fasta filename e.g. Homo_sapiens.GRCh37.75.dna.chromosome.21.fa | |
# @param begin 1-based index in sequence e.g. 9411239 | |
# @param end 1-based index in sequence up-to-but-not-including e.g. 9411240 | |
# @return string 'G' | |
def getRef(refFile, begin, end): | |
if begin > end: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# License: CC0 2016 Ahmad Retha | |
# | |
# Tree Traversal by order of level | |
# -------------------------------- | |
# | |
# The goal is to get a list of elements in the order of the level they appear in the tree. | |
# Our tree looks like this: | |
# | |
# a Level 1 | |
# / \ |