Search in sources :

Example 21 with HiCHitCollection

use of uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection in project SeqMonk by s-andrews.

the class HeatmapMatrix method getTotalCounts.

private void getTotalCounts(int[] cisCounts, int[] transCounts) {
    for (int p = 0; p < probes.length; p++) {
        if (p % 100 == 0) {
            Enumeration<ProgressListener> en = listeners.elements();
            while (en.hasMoreElements()) {
                en.nextElement().progressUpdated("Getting probe total counts", p, probes.length);
            }
            if (cancel) {
                return;
            }
        }
        HiCHitCollection hits = dataSet.getHiCReadsForProbe(probes[p].probe);
        String[] names = hits.getChromosomeNamesWithHits();
        for (int c = 0; c < names.length; c++) {
            if (names[c].equals(probes[p].probe.chromosome().name())) {
                cisCounts[p] = hits.getSourcePositionsForChromosome(names[c]).length;
            } else {
                transCounts[p] += hits.getSourcePositionsForChromosome(names[c]).length;
            }
        }
    }
}
Also used : HiCHitCollection(uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection) ProgressListener(uk.ac.babraham.SeqMonk.DataTypes.ProgressListener)

Aggregations

HiCHitCollection (uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection)21 Chromosome (uk.ac.babraham.SeqMonk.DataTypes.Genome.Chromosome)7 HiCDataStore (uk.ac.babraham.SeqMonk.DataTypes.HiCDataStore)6 Probe (uk.ac.babraham.SeqMonk.DataTypes.Probes.Probe)6 SeqMonkException (uk.ac.babraham.SeqMonk.SeqMonkException)5 DataStore (uk.ac.babraham.SeqMonk.DataTypes.DataStore)3 ProgressListener (uk.ac.babraham.SeqMonk.DataTypes.ProgressListener)3 Vector (java.util.Vector)2 BufferedInputStream (java.io.BufferedInputStream)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 ObjectInputStream (java.io.ObjectInputStream)1 Hashtable (java.util.Hashtable)1 DataSet (uk.ac.babraham.SeqMonk.DataTypes.DataSet)1 Feature (uk.ac.babraham.SeqMonk.DataTypes.Genome.Feature)1 HiCInteractionStrengthCalculator (uk.ac.babraham.SeqMonk.DataTypes.Interaction.HiCInteractionStrengthCalculator)1 PairedDataSet (uk.ac.babraham.SeqMonk.DataTypes.PairedDataSet)1 ProbeList (uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList)1