Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 91 #92

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Issue 91 #92

wants to merge 4 commits into from

Conversation

manulera
Copy link
Contributor

Hi @tnrich, working on this for #91. First 2 commits include:

  • Fix to getStructuredBases to handle origin-spanning primers
  • Some docs on how to run the OVE unit tests.
  • The possibility to log in tests using cy.task('log', 'message'). I can revert this if you want, I used it for debugging the test.

CONTRIBUTING.md Outdated Show resolved Hide resolved
cypress.config.ts Outdated Show resolved Hide resolved
packages/ove/cypress/e2e/unit/getStructuredBases.spec.js Outdated Show resolved Hide resolved
@manulera
Copy link
Contributor Author

Hi @tnrich see my comments regarding the logs and running test locally in the command line. If you think the use-case is not relevant I can remove them from the PR.

Regarding getStructuredBases I think passing annotationRange could be omitted. I think in all calls to getStructuredBases in the repo, the function is called with identical values in start and annotationRange.start, and same for end.

In this case clearly yes

// in helperComponents/AddOrEditPrimerDialog/index.js
const { allBasesWithMetaData } = getStructuredBases({
    annotationRange: { start: start - 1, end: end - 1 },
    forward,
    bases: basesToUse,
    start: start - 1,
    end: end - 1,
    fullSequence: sequenceData.sequence,
    primerBindsOn,
    sequenceLength
  });

In this second one, is there a case where annotation.start and annotationRange.start are different and what would it mean in a primer?

// RowItem/StackedAnnotations/primerBases.js
export function getBasesToShow({
  hidePrimerBases,
  annotation,
  annotationRange,
  charWidth,
  bpsPerRow,
  fullSequence,
  iTree,
  sequenceLength
}) {
  if (hidePrimerBases) return {};
  const basesToShow = {};
  if (annotation && annotation.bases) {
    const fudge = charWidth - realCharWidth;
    const { forward, primerBindsOn } = annotation;

    const { basesNoInsertsWithMetaData, inserts, aRange } = getStructuredBases({
      ...annotation,
      fullSequence,
      annotationRange,
      sequenceLength
    });

@manulera
Copy link
Contributor Author

Hi @tnrich I reverted those changes, let me know what you think about the change, and if you have some advice for the displaying as mentioned in #91

@tnrich
Copy link
Collaborator

tnrich commented Jul 16, 2024

@manulera annotationRange is used when an annotation spans multiple rows. Try changing to this:

      name: "Right tail primer - reverse",
      start: 40,
      end: 83,
      type: "primer_bind",
      forward: false,
      color: "red",
      primerBindsOn: "5prime",
      bases: "tgcaccggggccagcccgagcgagttccgtgccggttgtgaaga"
    }

And you'll see how your changes aren't quite rendering correctly across rows:
image

I think you'll need to try a slightly different tweaking of the code there that preserves at least some of the annotationRange logic.

@tnrich
Copy link
Collaborator

tnrich commented Aug 5, 2024

@manulera any luck updating the code based off my comment ?

@manulera
Copy link
Contributor Author

Hi @tnrich I was hoping to get this done before the holidays, but I did not manage to slot it in. Will get back to you eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants