use of uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection in project SeqMonk by s-andrews.
the class PairedDataSet method getExportableReadsForChromosome.
public synchronized HiCHitCollection getExportableReadsForChromosome(Chromosome c) {
if (!isFinalised)
finalise();
HiCHitCollection exportableReads = new HiCHitCollection(c.name());
HiCHitCollection redundantReads = getHiCReadsForChromosome(c);
String[] chrs = redundantReads.getChromosomeNamesWithHits();
for (int i = 0; i < chrs.length; i++) {
// The way we have to do this lookup is ugly, but that's how it is
// We only include data for chromosomes the same or later than our own
Chromosome thisChr = SeqMonkApplication.getInstance().dataCollection().genome().getChromosome(chrs[i]).chromosome();
if (c.compareTo(thisChr) < 0) {
System.err.println("Ignoring " + thisChr + " when exporting " + c);
continue;
}
long[] source = redundantReads.getSourcePositionsForChromosome(chrs[i]);
long[] hits = redundantReads.getHitPositionsForChromosome(chrs[i]);
if (c != thisChr) {
// Put everything from this chromosome into the results
for (int j = 0; j < source.length; j++) {
exportableReads.addHit(chrs[i], source[j], hits[j]);
}
} else {
// Put only the entries where the hit is later than the source in
for (int j = 0; j < source.length; j++) {
if ((source[j] == hits[j] && j % 2 == 0) || SequenceRead.compare(source[j], hits[j]) >= 0) {
exportableReads.addHit(chrs[i], source[j], hits[j]);
}
}
}
}
return exportableReads;
}
use of uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection in project SeqMonk by s-andrews.
the class ReplicateSet method getHiCReadsForChromosome.
public HiCHitCollection getHiCReadsForChromosome(Chromosome c) {
HiCHitCollection collection = new HiCHitCollection(c.name());
for (int i = 0; i < dataStores.length; i++) {
if (dataStores[i] instanceof HiCDataStore) {
HiCHitCollection thisCollection = ((HiCDataStore) dataStores[i]).getHiCReadsForChromosome(c);
collection.addCollection(thisCollection);
}
}
collection.sortCollection();
return collection;
}
use of uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection in project SeqMonk by s-andrews.
the class ReplicateSet method getExportableReadsForChromosome.
public HiCHitCollection getExportableReadsForChromosome(Chromosome c) {
HiCHitCollection collection = new HiCHitCollection(c.name());
for (int i = 0; i < dataStores.length; i++) {
if (dataStores[i] instanceof HiCDataStore) {
HiCHitCollection thisCollection = ((HiCDataStore) dataStores[i]).getExportableReadsForChromosome(c);
collection.addCollection(thisCollection);
}
}
collection.sortCollection();
return collection;
}
use of uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection in project SeqMonk by s-andrews.
the class DataGroup method getHiCReadsForProbe.
public HiCHitCollection getHiCReadsForProbe(Probe p) {
HiCHitCollection collection = new HiCHitCollection(p.chromosome().name());
for (int i = 0; i < dataSets.length; i++) {
if (dataSets[i] instanceof HiCDataStore) {
HiCHitCollection thisCollection = ((HiCDataStore) dataSets[i]).getHiCReadsForProbe(p);
collection.addCollection(thisCollection);
}
}
// TODO: Do an incremental add to this collection so that we don't have
// to re-sort it each time. This is nastily inefficient
collection.sortCollection();
return collection;
}
use of uk.ac.babraham.SeqMonk.DataTypes.Sequence.HiCHitCollection in project SeqMonk by s-andrews.
the class DataGroup method getExportableReadsForChromosome.
public HiCHitCollection getExportableReadsForChromosome(Chromosome c) {
HiCHitCollection collection = new HiCHitCollection(c.name());
for (int i = 0; i < dataSets.length; i++) {
if (dataSets[i] instanceof HiCDataStore) {
HiCHitCollection thisCollection = ((HiCDataStore) dataSets[i]).getExportableReadsForChromosome(c);
collection.addCollection(thisCollection);
}
}
collection.sortCollection();
return collection;
}
Aggregations