Skip to content

Commit

Permalink
Merge b007a85 into 9b35abf
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Feb 26, 2019
2 parents 9b35abf + b007a85 commit 8094bcf
Show file tree
Hide file tree
Showing 21 changed files with 1,037 additions and 120 deletions.
4 changes: 0 additions & 4 deletions client/apollo/js/JSONUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,6 @@ JSONUtils.createApolloFeature = function( jfeature, specified_type, useName, spe
afeature.type.name = typename;
}

// if (useName && name) {
// afeature.name = name;
// }

var id = jfeature.get('id');
var name = jfeature.get('name');
if (useName) {
Expand Down
4 changes: 4 additions & 0 deletions client/apollo/js/View/Track/AnnotTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ define([
filteredTrack.type = trackConfig.type;
filteredTrack.category = trackConfig.category;
filteredTrack.urlTemplate = trackConfig.urlTemplate;
filteredTrack.storeClass = trackConfig.storeClass;
filteredTrack.visible = visible;
if(trackConfig.apollo){
filteredTrack.apollo = trackConfig.apollo;
}
filteredTrackList.push(filteredTrack);
}

Expand Down
2 changes: 1 addition & 1 deletion grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ auditLog {
jbrowse {
git {
url = "https://github.com/gmod/jbrowse"
branch = "1.16.2-release"
branch = "1.16.3-release"
// branch = "dev"
// tag = "15dfd2309f2d508d8bed782d0f68b38dd9927bb4"
alwaysPull = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package org.bbop.apollo

import grails.converters.JSON
import grails.transaction.NotTransactional
import liquibase.util.file.FilenameUtils
import org.apache.shiro.SecurityUtils
import org.bbop.apollo.gwt.shared.ClientTokenGenerator
import org.bbop.apollo.gwt.shared.FeatureStringEnum
import org.bbop.apollo.sequence.Range
import org.bbop.apollo.sequence.Range // this line is needed, even if hte import doesn't show it
import org.codehaus.groovy.grails.web.json.JSONArray
import org.codehaus.groovy.grails.web.json.JSONObject

Expand All @@ -16,7 +15,6 @@ import java.text.SimpleDateFormat

import static org.springframework.http.HttpStatus.NOT_FOUND

//@CompileStatic
class JbrowseController {

private static final int DEFAULT_BUFFER_SIZE = 10240; // ..bytes = 10KB.
Expand Down Expand Up @@ -395,7 +393,6 @@ class JbrowseController {
* @param tracksArray
*/
@NotTransactional
def pruneTracks(JSONArray tracksArray){
JSONArray returnArray = new JSONArray()

Expand Down
166 changes: 156 additions & 10 deletions grails-app/controllers/org/bbop/apollo/OrganismController.groovy

Large diffs are not rendered by default.

38 changes: 33 additions & 5 deletions grails-app/services/org/bbop/apollo/FileService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ class FileService {
continue;
}

FileOutputStream fos = new FileOutputStream(outputFile);
IOUtils.copy(tais, fos);
fos.close();
FileOutputStream fos = new FileOutputStream(outputFile)
IOUtils.copy(tais, fos)
fos.close()
}

if (tempDir) {
Expand All @@ -170,6 +170,32 @@ class FileService {
}
}

def storeWithNewName(CommonsMultipartFile file, String path, String directoryName,String newName ) {
File pathFile = new File(path)
if (!pathFile.exists()) {
pathFile.mkdirs()
}
int suffixIndex = newName.indexOf(".")
if(suffixIndex<1){
throw new RuntimeException("Invalid filename, must have a suffix: [" +newName+"]")
}
String suffix = newName.substring(suffixIndex)
String updatedName = directoryName.replaceAll(" ","_") + suffix
// /opt/temporary/apollo/6503-nf_test3/raw || test2 || volvox-sorted.bam
// /opt/temporary/apollo/6503-nf_test3/raw || test2 .bam
String destinationFileName = path + File.separator + updatedName
File destinationFile = new File(destinationFileName)
try {
println "NEW NAME transferring track file to ${destinationFileName}"
file.transferTo(destinationFile)
// destinationFile.renameTo(new File())
println "NEW NAME DONE transferringfile to ${destinationFileName.size()}"

} catch (Exception e) {
println e.message
}
}


def store(CommonsMultipartFile file, String path, String directoryName = null, boolean tempDir = false) {
File pathFile = new File(path)
Expand All @@ -182,10 +208,12 @@ class FileService {

File destinationFile = new File(destinationFileName)
try {
log.debug "transferring track file to ${destinationFileName}"
println "transferring track file to ${destinationFileName}"
file.transferTo(destinationFile)
println "DONE transferringfile to ${destinationFileName.size()}"

} catch (Exception e) {
log.error e.message
println e.message
}
}

Expand Down
20 changes: 20 additions & 0 deletions grails-app/services/org/bbop/apollo/TrackService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,26 @@ class TrackService {
return null
}

/**
*
* @param tracksArray
* @param trackName
* @return
*/
@NotTransactional
def removeTrackFromArray(JSONArray tracksArray, String trackName) {
JSONArray returnArray = new JSONArray()
for (int i = 0; i < tracksArray.size(); i++) {
JSONObject obj = tracksArray.getJSONObject(i)
println "obj ${obj.label} vs ${trackName}"
if (obj.getString("label") != trackName) {
returnArray.add(obj)
}
}

return returnArray
}

/**
* Removes plugins included in annot.json (which is just WebApollo)
* @param pluginsArray
Expand Down
2 changes: 1 addition & 1 deletion install_jbrowse.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

./apollo install-tools
./apollo jbrowse-tools

#done_message () {
# if [ $? == 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion sample-h2-apollo-config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ environments {
//jbrowse {
// git {
// url= "https://github.com/GMOD/jbrowse"
// tag = "1.16.2-release"
// tag = "1.16.3-release"
//// branch = "dev"
//// hash = "09b71099bf73c50d37a0e911baf06b4975e3f6ca"
// alwaysPull = true
Expand Down
2 changes: 1 addition & 1 deletion sample-mysql-apollo-config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ environments {
//jbrowse {
// git {
// url= "https://github.com/GMOD/jbrowse"
// tag = "1.16.2-release"
// tag = "1.16.3-release"
//// branch = "dev"
//// hash = "09b71099bf73c50d37a0e911baf06b4975e3f6ca"
// alwaysPull = true
Expand Down
2 changes: 1 addition & 1 deletion sample-postgres-apollo-config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ environments {
//jbrowse {
// git {
// url= "https://github.com/GMOD/jbrowse"
// tag = "1.16.2-release"
// tag = "1.16.3-release"
//// branch = "dev"
//// hash = "09b71099bf73c50d37a0e911baf06b4975e3f6ca"
// alwaysPull = true
Expand Down
Loading

0 comments on commit 8094bcf

Please sign in to comment.