|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--GeneBitSet
The class manipulates lists of 64-bit bit sets for performing Boolean set operations. It implements these operations (union, intersection, difference) efficiently. It is also a required data structure in GeneLists and is the default gene list representation. You may convert a GeneBitSet.bitset to an ordered gene list GeneList.mList[]. The notation talks about adding an "item" which is the mid value corresponding to a Gene. The GeneBitSet userBS[0:nUserBS-1] is the database of all GeneBitSets.
A GeneBitSet has maxSize and is a (unsigned) long bitData[nWords] where: nWords= (maxSize/64)+1. For an endtry eIdx, it is indexed as ((bitData[wIdx] >>> bitIdx) & 01) where: wIdx= eIdx/64 (i.e. eIdx >>> 6), bitIdx= eIdx - (wIdx*64), (i.e. wIdx<<6)
This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.
GeneList
Field Summary | |
private static long |
ALL_BITS
0XFFFFFFFFFFFFFFFF is all 64-bits that is also 1's complement -1 |
(package private) java.lang.String |
assignedBSname
if this was assigned from another bitSet |
(package private) long[] |
bitData
list of nWords bit words allocated [0:maxSize-1] and active [0:highMID-1] |
private int |
bitIdx
index within a bitWord right to left |
private int |
bitWord
64 bit long subset of bits from bitData |
(package private) java.lang.String |
bName
name of bit set |
private int |
bsEnum
enumeration index 0 to length-1 |
(package private) static boolean |
cbsDbug
flag: selective debugging enable |
(package private) int |
count
# of ITEMS used in this GeneBitSet |
(package private) int |
highMID
highest MID in this GeneBitSet |
private static MAExplorer |
mae
link to global MAExplorer instance |
(package private) static int |
MAX_USER_BS
max # user assignable gene bit setst hat can be created |
(package private) int |
maxItems
maximum # ITEMS in bit space allocated |
(package private) static int |
maxUserBS
max # user assignable gene bit sets |
(package private) int |
maxWords
max # 64-bit WORDS alloc'ed in bitData[] |
(package private) GeneList |
ml
Associated Master GeneList if any, else null |
(package private) static int |
nUserBS
# user assignable gene bit sets in use |
private static GeneBitSet |
tempSetBL
temporary bit set used in set operations |
(package private) static GeneBitSet[] |
userBS
[1:maxUserBS] user assignable gene bit sets. |
private int |
wIdx
index of bitWord = bitData[wIdx] |
Constructor Summary | |
(package private) |
GeneBitSet(MAExplorer maE,
int maxItems,
GeneList ml)
GeneBitSet() - constructor to create a GeneBitSet without a name. |
(package private) |
GeneBitSet(MAExplorer maE,
int maxItems,
java.lang.String bName,
GeneList ml)
GeneBitSet() - constructor to create a named GeneBitSet. |
Method Summary | |
(package private) boolean |
addItem(int item)
addItem() - add Item (i.e. |
private void |
allocGeneBitSet(int maxItems,
java.lang.String bName,
GeneList ml)
allocGeneBitSet() - create named GeneBitSet by allocating bit set structures. |
(package private) int |
assignCLtoUserBS(java.lang.String userSetName,
GeneList ml)
assignCLtoUserBS() - assign GeneList ml to new user GeneBitSet userBS[] database. |
(package private) boolean |
assignCSbinOprToUserBS(java.lang.String bsName1,
java.lang.String bsName2,
java.lang.String userSetName,
java.lang.String opr)
assignCSbinOprToUserBS() - assign GeneBitSet binary Boolean opr to new user GeneBitSet. |
(package private) void |
cleanup()
cleanup() - cleanup global static allocated variables in this class. |
(package private) boolean |
clearNull()
clearNull() - clear gene bit set and set entries to null. |
(package private) static boolean |
copyBStoBS(GeneBitSet b1Dst,
GeneBitSet b2Src)
copyBStoBS() - copy GeneBitSet b2Src to GeneBitSet b1Dst. |
(package private) boolean |
copyBStoCL(GeneList c1Dst,
GeneBitSet b2Src)
copyBStoCL() - copy GeneBitSet b2Src to GeneList c1Dst.mList[]. |
(package private) static boolean |
copyCLtoBS(GeneBitSet b1Dst,
GeneList c2Src,
boolean useCopyBitArrayFlag)
copyCLtoBS() - copy GeneList c2Src to GeneBitSet b1Dst. |
(package private) boolean |
cvtBStoCL(GeneList ml)
cvtBStoCL() - convert GeneBitSet ml.bitSet to GeneList c1.mList[] (allocate data structures if needed). |
(package private) boolean |
difference(GeneBitSet b1,
GeneBitSet b2,
GeneBitSet b3)
difference() - difference of GeneBitSets (b2 - b1)==> b3. |
(package private) int |
findCountAndhighMID(GeneList ml)
findCountAndhighMID() - find count and highest MID in gene bit set BitData[]. |
(package private) java.lang.String[] |
getGBSnames()
getGBSnames() - return String array of active Gene Bit Set names. |
(package private) java.lang.String |
getListGeneBitSetsStr()
getListGeneBitSetsStr() - convert list of active GeneBitSets userBS[] to summary print string. |
(package private) boolean |
intersection(GeneBitSet b1,
GeneBitSet b2,
GeneBitSet b3)
intersection() - intersection of GeneBitSets (b1 | b2) ==> b3. |
(package private) boolean |
isItemInGeneBitSet(int item)
isItemInGeneBitSet() - is an item (i.e. |
(package private) void |
listGeneBitSets(java.lang.String optMsg)
listGeneBitSets() - popup a text window to list the user's gene sets. |
(package private) static int |
lookupGeneSetByName(java.lang.String userSetName,
boolean exactFlag)
lookupGeneSetByName() - lookup index of GeneBitSet in userBS[] database. |
(package private) static GeneBitSet |
lookupGeneSetObjByName(java.lang.String userSetName,
boolean exactFlag)
lookupGeneSetObjByName() - lookup GeneBitSet object by name in userBS[] DB. |
(package private) static int |
lookupOrMakeNewGeneBitSet(java.lang.String userSetName,
GeneBitSet bs)
lookupOrMakeNewGeneBitSet() - lookup or create new GeneBitSet in userBS[]. |
(package private) int |
nextMID()
nextMID() - get next mid in enumeration in [0:highMID] of this gene bit set |
(package private) boolean |
removeUserBS(java.lang.String userSetName)
removeUserBS() - remove user GeneBitSet by name from userBS[] database Do NOT remove the gct.nSpecialGC bit sets at the front of the list. |
(package private) void |
resetEnumeration()
resetEnumeration() - reset the gene bit set eumeration count to 0 |
(package private) boolean |
rmvItem(int item)
rmvItem() - remove Item (i.e. |
(package private) boolean |
setItem(int item)
setItem() - set bit in gene bit set corresponding to item (i.e. |
(package private) boolean |
union(GeneBitSet b1,
GeneBitSet b2,
GeneBitSet b3)
union() - compute union of GeneBitSets sets (b1 & b2) ==> b3. |
(package private) void |
updateListGeneBitSets()
updateListGeneBitSets() - update existing "UserGeneSets" popup window |
(package private) boolean |
useGeneSetBS(GeneList mlDest,
java.lang.String gbsName,
java.lang.String userSetNameSrc)
useGeneSetBS() - assign the specified GeneBitSet by name to GeneList ml. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static MAExplorer mae
private static final long ALL_BITS
static final int MAX_USER_BS
private static GeneBitSet tempSetBL
static GeneBitSet[] userBS
static int nUserBS
static int maxUserBS
static boolean cbsDbug
private int bsEnum
private int bitWord
private int wIdx
private int bitIdx
GeneList ml
java.lang.String assignedBSname
java.lang.String bName
long[] bitData
int maxWords
int maxItems
int highMID
int count
Constructor Detail |
GeneBitSet(MAExplorer maE, int maxItems, GeneList ml)
maE
- is instance of MAExplorermaxItems
- is the max size of a bit setml
- is the GeneList instance to associate with the bitsetallocGeneBitSet(int, java.lang.String, GeneList)
GeneBitSet(MAExplorer maE, int maxItems, java.lang.String bName, GeneList ml)
maE
- is instance of MAExplorermaxItems
- is the max size of a bit setbName
- is the bit set nameml
- is the GeneList instance to associate with the bitsetallocGeneBitSet(int, java.lang.String, GeneList)
Method Detail |
private void allocGeneBitSet(int maxItems, java.lang.String bName, GeneList ml)
maxItems
- is the max size of a bit setbName
- is the bit set nameml
- is the GeneList instance to associate with the bitsetboolean setItem(int item)
item
- to be setboolean addItem(int item)
item
- to be addedboolean rmvItem(int item)
item
- to be removedfindCountAndhighMID(GeneList)
boolean isItemInGeneBitSet(int item)
maxItems
- is the max size of a bit setboolean clearNull()
int findCountAndhighMID(GeneList ml)
ml
- is the GeneList instance to associate with the bitsetboolean cvtBStoCL(GeneList ml)
ml
- is the GeneList instance to convert.GeneList.clearMlist()
,
findCountAndhighMID(GeneList)
,
nextMID()
,
resetEnumeration()
boolean copyBStoCL(GeneList c1Dst, GeneBitSet b2Src)
c1Dst
- is the GeneList destination operandb2Src
- is the GeneBitSet source operandcopyBStoBS(GeneBitSet, GeneBitSet)
,
cvtBStoCL(GeneList)
static boolean copyCLtoBS(GeneBitSet b1Dst, GeneList c2Src, boolean useCopyBitArrayFlag)
b1Dst
- is the GeneBitSet destination operandc2Src
- is the GeneList source operanduseCopyBitArrayFlag
- copy bit array dataclearNull()
,
addItem(int)
static boolean copyBStoBS(GeneBitSet b1Dst, GeneBitSet b2Src)
b1Dst
- is the GeneBitSet destination operandb2Src
- is the GeneBitSet source operandvoid resetEnumeration()
int nextMID()
boolean union(GeneBitSet b1, GeneBitSet b2, GeneBitSet b3)
b1
- is the GeneBitSet first source operandb2
- is the GeneBitSet second source operandb3
- is the GeneBitSet destination operandfindCountAndhighMID(GeneList)
boolean intersection(GeneBitSet b1, GeneBitSet b2, GeneBitSet b3)
b1
- is the GeneBitSet first source operandb2
- is the GeneBitSet second source operandb3
- is the GeneBitSet destination operandfindCountAndhighMID(GeneList)
boolean difference(GeneBitSet b1, GeneBitSet b2, GeneBitSet b3)
b1
- is the GeneBitSet first source operandb2
- is the GeneBitSet second source operandb3
- is the GeneBitSet destination operandfindCountAndhighMID(GeneList)
void listGeneBitSets(java.lang.String optMsg)
optMsg
- is optional message to add to front of the report.ShowStringPopup
,
getListGeneBitSetsStr()
void updateListGeneBitSets()
PopupRegistry.lookupShowStringPopupInstance(java.lang.String)
,
ShowStringPopup.updateText(java.lang.String)
,
getListGeneBitSetsStr()
java.lang.String getListGeneBitSetsStr()
java.lang.String[] getGBSnames()
static GeneBitSet lookupGeneSetObjByName(java.lang.String userSetName, boolean exactFlag)
userSetName
- of gene bit setexactFlag
- to do an equal() exact match else use startsWith()static int lookupGeneSetByName(java.lang.String userSetName, boolean exactFlag)
userSetName
- of gene bit setexactFlag
- to do an equal() exact match else use startsWith()static int lookupOrMakeNewGeneBitSet(java.lang.String userSetName, GeneBitSet bs)
userSetName
- is the name of the existing or new gene bit setbs
- is the optional GeneBitSet to copy or useUtil.showMsg(java.lang.String)
,
copyBStoBS(GeneBitSet, GeneBitSet)
,
lookupGeneSetByName(java.lang.String, boolean)
int assignCLtoUserBS(java.lang.String userSetName, GeneList ml)
userSetName
- is the name of the existing or new gene bit setml
- is the optional GeneList to assignUtil.showMsg(java.lang.String)
,
copyBStoBS(GeneBitSet, GeneBitSet)
,
lookupOrMakeNewGeneBitSet(java.lang.String, GeneBitSet)
boolean removeUserBS(java.lang.String userSetName)
userSetName
- is the name of the existing or new gene bit setUtil.showMsg(java.lang.String)
,
lookupGeneSetByName(java.lang.String, boolean)
boolean useGeneSetBS(GeneList mlDest, java.lang.String gbsName, java.lang.String userSetNameSrc)
ml
- is the GeneList destination operandgbsName
- is the print msg of destination bit setuserSetNameSrc
- is the name of the source bit setUtil.showMsg(java.lang.String)
,
copyBStoBS(GeneBitSet, GeneBitSet)
,
lookupGeneSetByName(java.lang.String, boolean)
,
union(GeneBitSet, GeneBitSet, GeneBitSet)
,
intersection(GeneBitSet, GeneBitSet, GeneBitSet)
,
difference(GeneBitSet, GeneBitSet, GeneBitSet)
,
copyBStoCL(GeneList, GeneBitSet)
boolean assignCSbinOprToUserBS(java.lang.String bsName1, java.lang.String bsName2, java.lang.String userSetName, java.lang.String opr)
bsName1
- is the name of the first bit setsource operandbsName2
- is the name of the second bit set source operanduserSetNameSrc
- is the name of the destination bit set operandopr
- is the name of the operator:
"union", "intersection" or "difference"Util.showMsg(java.lang.String)
,
lookupGeneSetByName(java.lang.String, boolean)
,
lookupOrMakeNewGeneBitSet(java.lang.String, GeneBitSet)
void cleanup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |