Skip to content

Commit

Permalink
fix(datamanager): remove populationFrequency from named allele (never…
Browse files Browse the repository at this point in the history
… used)
  • Loading branch information
markwoon committed Apr 28, 2024
1 parent 80ad6ba commit 5ecaa74
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.regex.Pattern;
import com.google.common.base.Objects;
Expand Down Expand Up @@ -39,9 +38,6 @@ public class NamedAllele implements Comparable<NamedAllele> {
@SerializedName("cpicAlleles")
private final String[] m_cpicAlleles;
@Expose
@SerializedName("populationFrequency")
private Map<String, String> m_popFreqMap;
@Expose
@SerializedName(value = "reference", alternate = {"matchesreferencesequence"})
private final boolean m_isReference;
//-- variables after this point are used by NamedAlleleMatcher --//
Expand Down Expand Up @@ -296,18 +292,6 @@ public SortedSet<VariantLocus> getMissingPositions() {
}


/**
* A mapping of population name to allele frequency
*/
public Map<String, String> getPopFreqMap() {
return m_popFreqMap;
}

public void setPopFreqMap(Map<String, String> popFreqMap) {
m_popFreqMap = popFreqMap;
}


@Override
public String toString() {
return m_name + " [" + m_id + "]";
Expand Down Expand Up @@ -338,13 +322,12 @@ public boolean equals(Object o) {
}
return Objects.equal(m_name, that.getName()) &&
Objects.equal(m_id, that.getId()) &&
Arrays.equals(m_alleles, that.getAlleles()) &&
Objects.equal(m_popFreqMap, that.getPopFreqMap());
Arrays.equals(m_alleles, that.getAlleles());
}

@Override
public int hashCode() {
return Objects.hashCode(m_name, m_id, m_alleles, m_popFreqMap);
return Objects.hashCode(m_name, m_id, m_alleles);
}


Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/pharmgkb/pharmcat/haplotype/MatchData.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ void marshallHaplotypes(String gene, SortedSet<NamedAllele> allHaplotypes, boole

NamedAllele newHap = new NamedAllele(hap.getId(), hap.getName(), availableAlleles, cpicAlleles,
missingPositions, hap.isReference());
newHap.setPopFreqMap(hap.getPopFreqMap());
newHap.initialize(m_positions);
if (newHap.getScore() > 0) {
m_haplotypes.add(newHap);
Expand Down Expand Up @@ -211,7 +210,6 @@ void defaultMissingAllelesToReference() {

NamedAllele fixedHap = new NamedAllele(hap.getId(), hap.getName(), newAlleles, cpicAlleles,
hap.getMissingPositions(), hap.isReference());
fixedHap.setPopFreqMap(hap.getPopFreqMap());
fixedHap.initialize(m_positions, hap.getScore());
updatedHaplotypes.add(fixedHap);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,12 @@ public void finalizeCombinationHaplotype(MatchData matchData, boolean findPartia

NamedAllele partialHap = new NamedAllele(hap.getId(), builder.toString(), hap.getAlleles(),
hap.getCpicAlleles(), hap.getMissingPositions(), false, hap.getNumCombinations(), partials.size());
partialHap.setPopFreqMap(hap.getPopFreqMap());
partialHap.initialize(refVariants);
m_haplotype = partialHap;

} else {
NamedAllele newHap = new NamedAllele(hap.getId(), hap.getName(), hap.getAlleles(),
hap.getCpicAlleles(), hap.getMissingPositions(), hap.isReference(), hap.getNumCombinations(), 0);
newHap.setPopFreqMap(hap.getPopFreqMap());
newHap.initialize(refVariants);
m_haplotype = newHap;
}
Expand Down

0 comments on commit 5ecaa74

Please sign in to comment.