Skip to content

Commit

Permalink
Use centromere position ratio, not raw position, to account for small…
Browse files Browse the repository at this point in the history
… genomes like yeast
  • Loading branch information
eweitz committed Sep 11, 2020
1 parent c14b91e commit 4a59997
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/js/views/chromosome-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,32 +130,33 @@ function deleteExtraneousBands(chr, hasBands) {

function getCentromerePosition(hasBands, bands) {

const hasTelocentricPArm = (
// As with almost all mouse chromosome, chimpanzee chr22
hasBands && bands[0].name[0] === 'p' && bands[1].name[0] === 'q' &&
bands[0].bp.stop - bands[0].bp.start < 2E6
);

let hasTelocentricQArm = false;
if (hasBands) {
// As with Macaca mulatta chromosome Y
const lastBand = bands.slice(-1)[0];
const penultimateBand = bands.slice(-2)[0];
if (hasBands === false) return '';

hasTelocentricQArm = (
hasBands && penultimateBand.name[0] === 'p' && lastBand.name[0] === 'q' &&
lastBand.bp.stop - lastBand.bp.start < 2E6
);
}
// As with Macaca mulatta chromosome Y
const firstBand = bands[0];
const lastBand = bands.slice(-1)[0];
const chrLength = lastBand.bp.stop - firstBand.bp.start;
const smallLength = chrLength/10;

if (hasTelocentricPArm) {
if (
// As with almost all mouse chromosome, chimpanzee chr22
firstBand.name[0] === 'p' && bands[1].name[0] === 'q' &&
firstBand.bp.stop - firstBand.bp.start < smallLength
) {
return 'telocentric-p';
} else if (hasTelocentricQArm) {
}

const penultimateBand = bands.slice(-2)[0];

if (
penultimateBand.name[0] === 'p' && lastBand.name[0] === 'q' &&
lastBand.bp.stop - lastBand.bp.start < smallLength
) {
// As with Macaca mulatta chromosome Y
return 'telocentric-q';
} else {
return '';
}

return '';
}

/**
Expand Down

0 comments on commit 4a59997

Please sign in to comment.