public TagsByTaxa extends Tags
Tags by Taxa is the interface for tracking the distribution of tags across taxa. It can be thought of as a matrix of nTaxa by nTags. Taxa names are also maintained by this interface.
void addReadsToTagTaxon(int tagIndex,
int taxaIndex,
int addValue)
Method for incrementing the read depth for the specified tag and taxon.
tagIndex - taxaIndex - addValue - value to add to the current valueint getIndexOfTaxaName(java.lang.String taxon)
Get the index of a taxon based on its name
taxon - name of the taxon (sample)int getReadCountForTagTaxon(int tagIndex,
int taxaIndex)
Returns the read count for a specified tag and taxon
tagIndex - taxaIndex - kotlin.Array[] getTaxaReadCountsForTag(int tagIndex)
Returns all read counts for a specified tag index.
tagIndex - index of the tagvoid truncateTaxonNames()
TODO: Jeff annotate this
void setMethodByRows(boolean rowSetMethod)
rowSetMethod - OpenBitSet getTaxaReadBitsForTag(int tagIndex)
The presence/absence of the taxa in a bitSet format (1=present, 0=absent)
tagIndex - the index of the tagint getTaxaCount()
Returns the number of taxa (samples)
int getNumberOfTaxaWithTag(int readIndex)
Get the number of taxa with a given tag It is count of the taxa with readCount>0
readIndex - java.lang.String getTaxaName(int taxaIndex)
Returns the name of a taxon
taxaIndex - the index of the taxonjava.lang.String[] getTaxaNames()
Returns an array of taxa names
TaxaList getTaxaList()
Return taxa list of this alignment.
void setReadCountForTagTaxon(int tagIndex,
int taxaIndex,
int value)
Set the read depth for a specific tag and taxon. Overwrite the depth that was previously there.
tagIndex - index of the tagtaxaIndex - index of the taxonvalue - read depthvoid writeDistFile(java.io.File outFile,
net.maizegenetics.dna.tag.TagsByTaxa.FilePacking fileType,
int minCount)
Write the TagsByTaxa object to a file in one of the FilePacking formats. MinCount is useful for excluding the low depth tags (many of these are sequencing errors).
outFile - File for saving this objectfileType - Determine how to output the depthminCount - Only tags greater than minCount are outputvoid initMatrices(int taxaNum,
int tagNum)
Initializes the storage matrices for reading (unclear why in interface)
void addTaxa(java.lang.String[] addTaxaNames)
Add taxa to the TagsByTaxa matrix, they will all be set to distribution value of zero.
addTaxaNames - void getFileReadyForClosing()
In implementations that use a RandomAccessFile for storage, this clears the RAM buffer of any remaining data, writes it to the file on disk, and closes the file.