public boolean insertItem(BPTreeNodeItem item){ // Quick implementation: assumes all keys are inserted in rank order // todo: verify if need to compare key and insert at rank location leafItems.add((BPTreeLeafNodeItem)item ); // Note: assumes rank order insertions if(leafItems.size() == 1 ){ lowestChromKey = item.getChromKey(); lowestChromID = ((BPTreeLeafNodeItem)item).getChromID(); } else { highestChromKey = item.getChromKey(); highestChromID = ((BPTreeLeafNodeItem)item).getChromID(); } // success return true; }
public void printItems(){ int itemCount = getItemCount(); log.debug("Leaf node " + nodeIndex + "contains " + itemCount + " leaf items:"); for(int item = 0; item < itemCount; ++item){ leafItems.get(item).print(); } }
BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); if(leaf.getChromID() == chromID){ // mChromosome key match chromKey = leaf.getChromKey(); break;
if(leaf.chromKeysMatch(chromKey)){ chromID = leaf.getChromID(); break;
BPTreeLeafNodeItem leafItem = new BPTreeLeafNodeItem(++leafCount, key, chromID, chromSize); thisNode.insertItem(leafItem); } else {
public void findAllChromosomeNames( BPTreeNode thisNode, ArrayList<String> chromosomeList){ // search down the tree recursively starting with the root node if(thisNode.isLeaf()) { // add all leaf names int nLeaves = thisNode.getItemCount(); for(int index = 0; index < nLeaves; ++index){ BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); chromosomeList.add(leaf.getChromKey()); } } else { // get all child nodes int nNodes = thisNode.getItemCount(); for(int index = 0; index < nNodes; ++index){ BPTreeChildNodeItem childItem = (BPTreeChildNodeItem)thisNode.getItem(index); BPTreeNode childNode = childItem.getChildNode(); // keep going until leaf items are extracted findAllChromosomeNames(childNode, chromosomeList); } } }
BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); if(leaf.getChromID() == chromID){ // mChromosome key match chromKey = leaf.getChromKey(); break;
if(leaf.chromKeysMatch(chromKey)){ chromID = leaf.getChromID(); break;
BPTreeLeafNodeItem leafItem = new BPTreeLeafNodeItem(++leafCount, key, chromID, chromSize); thisNode.insertItem(leafItem);
public void findAllChromosomeNames( BPTreeNode thisNode, ArrayList<String> chromosomeList){ // search down the tree recursively starting with the root node if(thisNode.isLeaf()) { // add all leaf names int nLeaves = thisNode.getItemCount(); for(int index = 0; index < nLeaves; ++index){ BPTreeLeafNodeItem leaf = (BPTreeLeafNodeItem)thisNode.getItem(index); chromosomeList.add(leaf.getChromKey()); } } else { // get all child nodes int nNodes = thisNode.getItemCount(); for(int index = 0; index < nNodes; ++index){ BPTreeChildNodeItem childItem = (BPTreeChildNodeItem)thisNode.getItem(index); BPTreeNode childNode = childItem.getChildNode(); // keep going until leaf items are extracted findAllChromosomeNames(childNode, chromosomeList); } } }
chromID = leaf.getChromID(); chromosomeMap.put(chromID, leaf.getChromKey());
public void printItems(){ int itemCount = getItemCount(); log.debug("Leaf node " + nodeIndex + "contains " + itemCount + " leaf items:"); for(int item = 0; item < itemCount; ++item){ leafItems.get(item).print(); } }
public boolean insertItem(BPTreeNodeItem item){ // Quick implementation: assumes all keys are inserted in rank order // todo: verify if need to compare key and insert at rank location leafItems.add((BPTreeLeafNodeItem)item ); // Note: assumes rank order insertions if(leafItems.size() == 1 ){ lowestChromKey = item.getChromKey(); lowestChromID = ((BPTreeLeafNodeItem)item).getChromID(); } else { highestChromKey = item.getChromKey(); highestChromID = ((BPTreeLeafNodeItem)item).getChromID(); } // success return true; }
BPTreeLeafNodeItem leafItem = new BPTreeLeafNodeItem(++leafCount, key, chromID, chromSize); thisNode.insertItem(leafItem);
chromID = leaf.getChromID(); chromosomeMap.put(chromID, leaf.getChromKey());
public void printItems(){ int itemCount = getItemCount(); log.debug("Leaf node " + nodeIndex + "contains " + itemCount + " leaf items:"); for(int item = 0; item < itemCount; ++item){ leafItems.get(item).print(); } }
public boolean insertItem(BPTreeNodeItem item){ // Quick implementation: assumes all keys are inserted in rank order // todo: verify if need to compare key and insert at rank location leafItems.add((BPTreeLeafNodeItem)item ); // Note: assumes rank order insertions if(leafItems.size() == 1 ){ lowestChromKey = item.getChromKey(); lowestChromID = ((BPTreeLeafNodeItem)item).getChromID(); } else { highestChromKey = item.getChromKey(); highestChromID = ((BPTreeLeafNodeItem)item).getChromID(); } // success return true; }