The current GATK version is 3.2-2

#### Howdy, Stranger!

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

Bug Bulletin: The recent 3.2 release fixes many issues. If you run into a problem, please try the latest version before posting a bug report, as your problem may already have been solved.

# 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:

• Broad InstitutePosts: 25Member, Third-party Developer, GSA Collaborator, Broadie, Cancer Tools Developer

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

• Broad InstitutePosts: 25Member, Third-party Developer, GSA Collaborator, Broadie, Cancer Tools Developer

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.

• Posts: 11Member

@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

• Posts: 85Member ✭✭✭

@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._
}

• Posts: 11Member

@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.......

• Posts: 85Member ✭✭✭

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.

• Posts: 11Member
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

Post edited by kevyin on