The current GATK version is 3.7-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

GATK 3.7 is here! Be sure to read the Version Highlights and optionally the full Release Notes.
Register now for the upcoming GATK Best Practices workshop, Feb 20-22 in Leuven, Belgium. Open to all comers! More info and signup at http://bit.ly/2i4mGxz

Qscript split into multiple files.

I'm working on a set of related Queue scripts. I would like to have functionality shared between them, ideally in separate scala files which would be imported. Is there a way to specify additional paths for the Queue scala compiler to search or do I have to bake my library into the gatk when I build it?

Tagged:

Thanks for pointing out that post, I hadn't noticed it. I'll let you know how it works.

I got confirmation that there is currently no way to have Queue load multiple script files at runtime. You have to build your libraries into gatk like that post describes.

• Member Posts: 13

@LouisB Hi apologies for the noob question, I'm not very good with java/scala and Walkers

Is it still the case that qscripts can't be split up? What I had in mind is simply importing some traits that extend Qscript so I can add some functions to multiple qscript easily without copy and pasting the code to all the qscripts.

trait MyFunctions extends QScript {
case class bwa() extends CommandLineFunction {
}
}

And from a qscript at the top I do:
class MyQscript extends QScript with MyFunctions {
qscript =>
...
}

Maybe I should start a new thread with this?
thx

• Member Posts: 96 ✭✭✭

@kevyin One what to do what you describe is to create a object (or a class depending on you exact use case) to encapsulate the case classes that you want to use and then import them. That would give you something like this:

object MyAlignmentUtils {
case class bwa() extends CommandLineFunction { }
}

class MyQscript extends QScript { qscript =>

import MyAlignmentUtils._
}

• Member Posts: 13

@Johan_Dahlberg Thanks for the help.
Pardon my ignorance, but do you know of a way to move this object to another file so as to keep my code repo modular?

Would it involve compiling the MyAlignmentUtils separately and adding it to the classpath? I'm thinking aloud here.......

• Member Posts: 96 ✭✭✭

Just put it in a another file named "MyAlignmentUtils.scala" on your build path. Exactly what your build path is depends on the build system you are using, but normally it should be the directory named "src" or something similar. You can have a look at my repository for Piper (a pipelining system for out sequencing facility) here: https://github.com/johandahlberg/piper to get a feeling for how to organize things (note that this uses gatk as a external dependencies which is downloaded of github and build by the setup.sh script)

So yes, it would involve compiling MyAlignmentUtils separately and adding it to the class path.

• Member Posts: 13
edited September 2013

@Johan_Dahlberg said:
Just put it in a another file named "MyAlignmentUtils.scala" on your build path. Exactly what your build path is depends on the build system you are using, but normally it should be the directory named "src" or something similar. You can have a look at my repository for Piper (a pipelining system for out sequencing facility) here: https://github.com/johandahlberg/piper to get a feeling for how to organize things (note that this uses gatk as a external dependencies which is downloaded of github and build by the setup.sh script)

So yes, it would involve compiling MyAlignmentUtils separately and adding it to the class path.

Thanks a million