Skip to content

Conversation

@Rajkumar-D
Copy link
Contributor

@Rajkumar-D Rajkumar-D commented Mar 25, 2024

Created FeatureLocationParser for parsing the CompoundLocation
Added 2 fields in Location object, this is used to write the locations

  private boolean threePrime;
  private boolean fivePrime;

Updated FeatureLocationWriter to write location partiality using Location object
Failing tests are not committed in this branch to keep the PR simple
We can test using FeatureLocationsMatcherTest
Need to update LocationToStringCoverter (Note to self)

Copy link
Contributor

@raskoleinonen raskoleinonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First relatively fast review.


private boolean leftPartial;
private boolean rightPartial;
private boolean fivePrime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to:

  • fivePrimePartial
  • threePrimePartial

private Long beginPosition;
private Long endPosition;

private boolean threePrime;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have the partiality in one place only or they may have conflicting values. If we have getters and setters in both CompoundLocation and Location then CompoundLocation should call the Location getters and setters and not have partiality fields itself. In this case CompoundLocation partiality setting should fail if there are no Locations yet.

if (translationResult.isFixedLeftPartial()) {
if (!cds.getLocations().isComplement()) {
cds.getLocations().setLeftPartial(translator.isLeftPartial());
cds.getLocations().setFivePrime(translator.isLeftPartial());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially unsafe. Best would be to review change Translation left and right partiality as well.

cds.getLocations().setFivePrime(translator.isLeftPartial());
} else {
cds.getLocations().setRightPartial(translator.isLeftPartial());
cds.getLocations().setThreePrime(translator.isLeftPartial());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially unsafe. Best would be to review change Translation left and right partiality as well.

if (translationResult.isFixedRightPartial()) {
if (!cds.getLocations().isComplement()) {
cds.getLocations().setRightPartial(translator.isRightPartial());
cds.getLocations().setThreePrime(translator.isRightPartial());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially unsafe. Best would be to review change Translation left and right partiality as well.

firstContig = false;
}
FeatureLocationWriter.renderLocation(block, contig, false, false);
FeatureLocationWriter.renderLocation(block, contig);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never want to write partiality for CO lines. The old code prevented this completely. Now we will write partiality if the location has it.

firstContig = false;
}
FeatureLocationWriter.renderLocation(block, contig, false, false);
FeatureLocationWriter.renderLocation(block, contig);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never want to write partiality for Contig lines. The old code prevented this completely. Now we will write partiality if the location has it.

assertEquals("complement(467..>468)", test("complement(467..>468)"));
assertEquals("complement(467^>468)", test("complement(467^>468)"));

// Note that 3' prime end (right) partiality is lost.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment not valid.

assertEquals("complement(<467)", test("complement(<>467)"));
assertEquals("complement(<467)", test("complement(<467)"));
// Note that 3' prime end (right) partiality is lost.
assertEquals("complement(<467)", test("complement(<467..>467)"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder where we lost one of the partialities.


location = "complement(join(2182966..2183014,2183124..>2183128))";
assertEquals(location, test(location));
assertTrue(leftPartial(location));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not be using left and right partial terms anymore anywhere.

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.

3 participants