Skip to content

Commit

Permalink
Add Mutation.isSDRM to GraphQL; release v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
philiptzou committed Jan 19, 2018
1 parent 122798c commit 4791ff5
Show file tree
Hide file tree
Showing 12 changed files with 190,456 additions and 184,934 deletions.
2 changes: 1 addition & 1 deletion Aligner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'edu.stanford.hivdb'
version = '2.2.1-1'
version = '2.2.2'

description = """Aligner"""

Expand Down
2 changes: 1 addition & 1 deletion DrugResistance/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'edu.stanford.hivdb'
version = '2.2.1-1'
version = '2.2.2'

description = """DrugResistance"""

Expand Down
2 changes: 1 addition & 1 deletion TestResources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'edu.stanford.hivdb'
version = '2.2.1-1'
version = '2.2.2'

description = """Test resources"""

Expand Down
2 changes: 1 addition & 1 deletion Utilities/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'edu.stanford.hivdb'
version = '2.2.1-1'
version = '2.2.2'

description = """Utilities"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ public static Mutation parseString(String mutText) {
public boolean hasConsensus () { return aas.split("_", 2)[0].contains(gene.getConsensus(pos));}
public boolean hasStop() { return getAAs().contains("*"); }
public boolean isUnusual() { return UnusualMutations.containsUnusualMut(this); }
public boolean isSDRM() { return Sdrms.isSDRM(this); }
public boolean hasBDHVN() {
// TODO: what if BDHVN doesn't affect the amimo acid?
return triplet.contains("B") || triplet.contains("D") || triplet.contains("H") ||
Expand Down
21 changes: 13 additions & 8 deletions Utilities/src/main/java/edu/stanford/hivdb/mutations/Sdrms.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@
package edu.stanford.hivdb.mutations;

import java.sql.SQLException;
import java.util.Collection;

import edu.stanford.hivdb.utilities.JdbcDatabase;
import edu.stanford.hivdb.utilities.Cachable;

public class Sdrms {
@Cachable.CachableField
private static Collection<Mutation> sdrms;
private static MutationSet sdrms;
private static final JdbcDatabase db;

static {
Expand All @@ -48,16 +47,22 @@ public class Sdrms {
public static MutationSet getSdrms(MutationSet seqMuts) {
return seqMuts.intersectsWith(sdrms);
}

public static boolean isSDRM(Mutation mut) {
return sdrms.hasSharedAAMutation(mut);
}

private static void populateSDRMs() throws SQLException {
final String sqlStatement =
"SELECT Gene, Pos, AAs FROM tblSDRMs ORDER BY Gene, Pos, AAs";

sdrms = db.iterate(sqlStatement, rs -> {
return new Mutation(
Gene.valueOf(rs.getString("Gene")),
rs.getInt("Pos"),
rs.getString("AAs"));
});
sdrms = new MutationSet(
db.iterate(sqlStatement, rs -> {
return new Mutation(
Gene.valueOf(rs.getString("Gene")),
rs.getInt("Pos"),
rs.getString("AAs"));
})
);
}
}
Loading

0 comments on commit 4791ff5

Please sign in to comment.