public class TagsOnPhysicalMap
extends AbstractTagsOnPhysicalMap
Holds tag data compressed in long and a physical position. This can have two variations either include redundant positions or only unique positions. If redundant than tags that map to multiple regions should be placed adjacently Default 40 bytes per position. If we have 10,000,000 million positions then this will be at 400M byte data structure. User: ed
public TagsOnPhysicalMap()
public TagsOnPhysicalMap(java.lang.String inFile,
boolean binary)
public TagsOnPhysicalMap(int rows)
public TagsOnPhysicalMap(int rows,
int tagLengthInLong,
int maxVariants)
public TagsOnPhysicalMap(Tags readList)
public TagsOnPhysicalMap(TagsOnPhysicalMap oldTOPM, boolean filterDuplicates)
public void expandMaxVariants(int newMaxVariants)
public void copyTagMapRow(TagsOnPhysicalMap sourceTOPM, int sourceRow, int destRow, boolean merge)
This helps collapse identical reads from different regions of the genome together.
sourceTOPM - sourceRow - destRow - merge - public long sortTable(boolean byHaplotype)
protected void readBinaryFile(java.io.File currentFile)
public boolean variantsDefined(int tagIndex)
public void readTextFile(java.io.File inFile)
public int getReadIndexForPositionIndex(int posIndex)
public kotlin.Array[] getPositionArray(int index)
public static byte parseCharWMissing(java.lang.String s)
public static byte parseByteWMissing(java.lang.String s)
public static int parseIntWMissing(java.lang.String s)
public byte getMultiMaps(int index)
public int getEndPosition(int index)
public byte getDivergence(int index)
public byte getMapP(int index)
public byte getDcoP(int index)
public void setChromoPosition(int index,
int chromosome,
byte strand,
int positionMin,
int positionMax)
public void setDivergence(int index,
byte divergence)
public void setMapP(int index,
byte mapP)
public void setDcoP(int index,
byte dcoP)
public void setMultimaps(int index,
byte multimaps)
public void setMapP(int index,
double mapP)
public int addVariant(int tagIndex,
byte offset,
byte base)
public void readSAMFile(java.lang.String inputFileName,
int tagLengthInLong)
Reads SAM files output from BWA or bowtie2
public void swap(int index1,
int index2)
public int compare(int index1,
int index2)
public void setVariantDef(int tagIndex,
int variantIndex,
byte def)
public void setVariantPosOff(int tagIndex,
int variantIndex,
byte offset)
public int getMaxNumVariants()
public static TagsOnPhysicalMap merge(java.lang.String[] filenames)
Merges several TOPM files into one, removing duplicate rows. Variants from matching tags are combined in the output file. If there are more variants in the input files than can fit in the output, extra variants are discarded with no particular order.
public void clearVariants()
Sets the variant definition & offset arrays to null for each tag.
public void filter(java.lang.String[] filenames)
Clears variant sites that are not found in the supplied alignments.
public java.util.HashSet<java.lang.Integer> fullTagPositions()
Returns the start positions of tags whose variant arrays are full.
public java.util.HashMap<java.lang.String,java.lang.Integer> uniqueSites()
Maps unique sites (i.e. bestChr and position) to the indices of the tags in which they are found.
public static java.util.HashMap<java.lang.String,java.lang.Integer> hapmapSites(GenotypeTable file)
public kotlin.Array[] mappingDistribution()
Returns an array whose indices are the number of mappings and whose elements are the number of tags with that mapping.