Skip to content

Commit

Permalink
Fix splice site detection (#1881)
Browse files Browse the repository at this point in the history
* treat splice sites in lowercase when pulling from config

* compare splice sites in lowercase
  • Loading branch information
deepakunni3 authored and nathandunn committed Apr 21, 2018
1 parent 01a7c1c commit 203444e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
12 changes: 10 additions & 2 deletions grails-app/services/org/bbop/apollo/ConfigWrapperService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,19 @@ class ConfigWrapperService {
}

List<String> getSpliceDonorSites(){
return grailsApplication.config.apollo.splice_donor_sites
List<String> sites = new ArrayList<String>()
grailsApplication.config.apollo.splice_donor_sites.each {
sites.add(it.toLowerCase())
}
return sites
}

List<String> getSpliceAcceptorSites(){
return grailsApplication.config.apollo.splice_acceptor_sites
List<String> sites = new ArrayList<String>()
grailsApplication.config.apollo.splice_acceptor_sites.each {
sites.add(it.toLowerCase())
}
return sites
}

int getDefaultMinimumIntronSize() {
Expand Down
8 changes: 4 additions & 4 deletions grails-app/services/org/bbop/apollo/ExonService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class ExonService {
}
String seq = residues.substring(coordinate, coordinate + 2);

if (SequenceTranslationHandler.getSpliceDonorSites().contains(seq)) {
if (SequenceTranslationHandler.getSpliceDonorSites().contains(seq.toLowerCase())) {
if (exon.getFeatureLocation().getStrand() == -1) {
setExonBoundaries(exon,featureService.convertLocalCoordinateToSourceCoordinate(gene,coordinate)+1,exon.getFeatureLocation().getFmax())
} else {
Expand Down Expand Up @@ -292,7 +292,7 @@ class ExonService {
String seq = residues.substring(coordinate, coordinate + 2);

// log.debug "seq ${seq} in ${SequenceTranslationHandler.spliceDonorSites}"
if (SequenceTranslationHandler.getSpliceDonorSites().contains(seq)) {
if (SequenceTranslationHandler.getSpliceDonorSites().contains(seq.toLowerCase())) {
if (exon.getStrand() == -1) {
setExonBoundaries(exon, featureService.convertLocalCoordinateToSourceCoordinate(gene,coordinate) + 1, exon.getFmax());
} else {
Expand Down Expand Up @@ -334,7 +334,7 @@ class ExonService {
throw new AnnotationException("Cannot set to upstream acceptor - will overlap previous exon");
}
String seq = residues.substring(coordinate, coordinate + 2);
if (SequenceTranslationHandler.getSpliceAcceptorSites().contains(seq)) {
if (SequenceTranslationHandler.getSpliceAcceptorSites().contains(seq.toLowerCase())) {
if (exon.getStrand() == -1) {
setExonBoundaries(exon, exon.getFmin(), featureService.convertLocalCoordinateToSourceCoordinate(gene,coordinate) - 1);
} else {
Expand All @@ -360,7 +360,7 @@ class ExonService {
throw new AnnotationException("Cannot set to downstream acceptor - will remove exon");
}
String seq = residues.substring(coordinate, coordinate + 2);
if (SequenceTranslationHandler.getSpliceAcceptorSites().contains(seq)) {
if (SequenceTranslationHandler.getSpliceAcceptorSites().contains(seq.toLowerCase())) {
if (exon.getStrand() == -1) {
setExonBoundaries(exon, exon.getFmin(), featureService.convertLocalCoordinateToSourceCoordinate(gene,coordinate) - 1);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class NonCanonicalSplitSiteService {
String acceptorSpliceSiteSequence = residues.substring(local1,local2)
acceptorSpliceSiteSequence=transcript.getStrand()==-1?acceptorSpliceSiteSequence.reverse():acceptorSpliceSiteSequence
log.debug "acceptor ${local1} ${local2} ${acceptorSpliceSiteSequence} ${acceptor}"
if(acceptorSpliceSiteSequence==acceptor)
if(acceptorSpliceSiteSequence.toLowerCase() == acceptor)
validThreePrimeSplice=true
else
threePrimeSpliceSitePosition = exon.getStrand() == -1 ? local1 : local2;
Expand All @@ -135,7 +135,7 @@ class NonCanonicalSplitSiteService {
String donorSpliceSiteSequence = residues.substring(local3,local4)
donorSpliceSiteSequence=transcript.getStrand()==-1?donorSpliceSiteSequence.reverse():donorSpliceSiteSequence
log.debug "donor ${local3} ${local4} ${donorSpliceSiteSequence} ${donor}"
if(donorSpliceSiteSequence==donor)
if(donorSpliceSiteSequence.toLowerCase() == donor)
validFivePrimeSplice=true
else
fivePrimeSpliceSitePosition = exon.getStrand() == -1 ? local3 : local4;
Expand Down

0 comments on commit 203444e

Please sign in to comment.