Skip to content

Commit

Permalink
Compatibility with old name of indexedfasta storeclass (#2068)
Browse files Browse the repository at this point in the history
  • Loading branch information
abretaud authored and nathandunn committed Feb 22, 2019
1 parent 1cbca8e commit f0438cf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions grails-app/services/org/bbop/apollo/SequenceService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.util.zip.CRC32

@Transactional
class SequenceService {

def configWrapperService
def grailsApplication
def featureService
Expand Down Expand Up @@ -84,7 +84,7 @@ class SequenceService {
if(strand==Strand.NEGATIVE){
residueString = SequenceTranslationHandler.reverseComplementSequence(residueString)
}

StringBuilder residues = new StringBuilder(residueString);
List<SequenceAlterationArtifact> sequenceAlterationList = SequenceAlterationArtifact.withCriteria {
createAlias('featureLocations', 'fl', JoinType.INNER_JOIN)
Expand Down Expand Up @@ -248,7 +248,7 @@ class SequenceService {
int startChunkNumber = fmin / sequence.seqChunkSize;
int endChunkNumber = (fmax - 1 ) / sequence.seqChunkSize;


for(int i = startChunkNumber ; i<= endChunkNumber ; i++){
sequenceString.append(loadResidueForSequence(sequence,i))
}
Expand All @@ -274,7 +274,7 @@ class SequenceService {

def loadRefSeqs(Organism organism) {
JSONObject referenceTrackObject = getReferenceTrackObject(organism)
if (referenceTrackObject.storeClass == "JBrowse/Store/Sequence/IndexedFasta") {
if ((referenceTrackObject.storeClass == "JBrowse/Store/SeqFeature/IndexedFasta") || (referenceTrackObject.storeClass == "JBrowse/Store/Sequence/IndexedFasta")) {
loadGenomeFasta(organism, referenceTrackObject)
}
else {
Expand Down Expand Up @@ -401,8 +401,8 @@ class SequenceService {
FeatureLocation featureLocation = deletion.featureLocation
deletion.alterationResidue = getResidueFromFeatureLocation(featureLocation)
}


def getSequenceForFeature(Feature gbolFeature, String type, int flank = 0) {
// Method returns the sequence for a single feature
// Directly called for FASTA Export
Expand Down Expand Up @@ -531,7 +531,7 @@ class SequenceService {
}

def getSequenceForFeatures(JSONObject inputObject, File outputFile=null) {
// Method returns a JSONObject
// Method returns a JSONObject
// Suitable for 'get sequence' operation from AEC
log.debug "input at getSequenceForFeature: ${inputObject}"
JSONArray featuresArray = inputObject.getJSONArray(FeatureStringEnum.FEATURES.value)
Expand All @@ -556,7 +556,7 @@ class SequenceService {
return outFeature
}
}

def getGff3ForFeature(JSONObject inputObject, File outputFile) {
List<Feature> featuresToWrite = new ArrayList<>();
JSONArray features = inputObject.getJSONArray(FeatureStringEnum.FEATURES.value)
Expand Down

0 comments on commit f0438cf

Please sign in to comment.