use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class FragileSiteAnnotator method loadFragileSitesFile.
public void loadFragileSitesFile(final String filename) {
if (filename.isEmpty())
return;
try {
BufferedReader fileReader = new BufferedReader(new FileReader(filename));
String line;
while ((line = fileReader.readLine()) != null) {
if (line.contains("Chromosome"))
continue;
// parse CSV data
String[] items = line.split(",");
if (items.length < 7)
continue;
final GenomeRegion genomeRegion = GenomeRegionFactory.create(items[0], Long.parseLong(items[1]), Long.parseLong(items[2]));
if (items[6].equals(CSV_FS_TYPE_IDENTIFIED))
mIdentifiedFragileSites.add(genomeRegion);
else
mFragileSites.add(genomeRegion);
// LOGGER.debug("loaded fragile site: chr({}) pos({}-{})",
// genomeRegion.chromosome(), genomeRegion.start(), genomeRegion.end());
}
LOGGER.debug("loaded {} known fragile site records, {} identified", mFragileSites.size(), mIdentifiedFragileSites.size());
} catch (IOException exception) {
LOGGER.error("Failed to read fragile site CSV file({})", filename);
}
}
use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class PCFPositionsSupplier method centromeres.
@NotNull
private static Multimap<String, PCFPosition> centromeres(int windowSize) {
final Window window = new Window(windowSize);
final Multimap<String, PCFPosition> result = ArrayListMultimap.create();
for (final Map.Entry<String, GenomeRegion> entry : Centromeres.grch37().entrySet()) {
final GenomeRegion centromere = entry.getValue();
result.put(entry.getKey(), create(centromere.chromosome(), window.start(centromere.start())));
result.put(entry.getKey(), create(centromere.chromosome(), window.start(centromere.end()) + windowSize));
}
return result;
}
use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class SvUtilities method getChromosomalArmLength.
public long getChromosomalArmLength(final String chromosome, final String armType) {
final GenomeRegion region = CENTROMERES.get(chromosome);
if (region == null)
return 0;
if (armType.equals(CHROMOSOME_ARM_P)) {
return region.start();
}
long chrLength = CHROMOSOME_LENGTHS.get(chromosome);
return chrLength - region.end();
}
use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class CobaltAccumulatorTest method assertTumorCount.
private void assertTumorCount(int expectedCount, long regionStart, long regionEnd, long... ratios) {
final GenomeRegion region = GenomeRegionFactory.create(CHROMOSOME, regionStart, regionEnd);
final ObservedRegionFactory.CobaltAccumulator accumulator = new ObservedRegionFactory.CobaltAccumulator(WINDOW_SIZE, region);
final GenomePositionSelector<CobaltRatio> selector = createSelector(ratios);
selector.select(region, accumulator);
assertEquals(expectedCount, accumulator.tumorCount());
}
use of com.hartwig.hmftools.common.region.GenomeRegion in project hmftools by hartwigmedical.
the class GCAccumulatorTest method testExcludeOverlapFromEnd.
@Test
public void testExcludeOverlapFromEnd() {
final GenomeRegion region = GenomeRegionFactory.create(CHROMOSOME, 1001, 2999);
final GCAccumulator victim = new GCAccumulator(region);
final GenomeRegionSelector<GCProfile> selector = selector(profile(1001, 0.90), profile(2001, 0.91));
selector.select(region, victim);
assertEquals(0.90, victim.averageGCContent(), EPSILON);
}
Aggregations