Skip to content
Snippets Groups Projects
Commit 10518502 authored by bow's avatar bow
Browse files

Documentation updates

parent 846acd6c
No related branches found
No related tags found
No related merge requests found
......@@ -19,9 +19,10 @@ import nl.lumc.sasc.biopet.core.ToolCommand
object ExtractAlignedFastq extends ToolCommand {
/** type alias for Fastq input (may or may not be paired) */
type FastqInput = (FastqRecord, Option[FastqRecord])
/** function to get FastqRecord ID */
/** Get the FastqRecord ID */
def fastqId(rec: FastqRecord) = rec.getReadHeader.split(" ")(0)
/**
......@@ -125,6 +126,13 @@ object ExtractAlignedFastq extends ToolCommand {
}
}
/**
* Extracts reads from the given input Fastq file and writes to a new output Fastq file
*
* @param memFunc Predicate for extracting reads. If evaluates to true, the read is extracted.
* @param inputFastq1 Input [[FastqReader]] object.
* @param outputFastq1 Output [[BasicFastqWriter]] object.
*/
def extractReads(memFunc: FastqInput => Boolean,
inputFastq1: FastqReader, outputFastq1: BasicFastqWriter): Unit =
inputFastq1.iterator.asScala
......@@ -132,6 +140,15 @@ object ExtractAlignedFastq extends ToolCommand {
.filter(rec => memFunc(rec._1, rec._2))
.foreach(rec => outputFastq1.write(rec._1))
/**
* Extracts reads from the given input Fastq pairs and writes to new output Fastq pair files
*
* @param memFunc Predicate for extracting reads. If evaluates to true, the read is extracted.
* @param inputFastq1 Input [[FastqReader]] object for pair 1.
* @param outputFastq1 Input [[FastqReader]] object for pair 2.
* @param inputFastq2 Output [[BasicFastqWriter]] object for pair 1.
* @param outputFastq2 Output [[BasicFastqWriter]] object for pair 2.
*/
def extractReads(memFunc: FastqInput => Boolean,
inputFastq1: FastqReader, outputFastq1: BasicFastqWriter,
inputFastq2: FastqReader, outputFastq2: BasicFastqWriter): Unit =
......@@ -143,6 +160,7 @@ object ExtractAlignedFastq extends ToolCommand {
outputFastq2.write(rec._2)
})
/** Default arguments */
case class Args(inputBam: File = new File(""),
intervals: List[String] = List.empty[String],
inputFastq1: File = new File(""),
......@@ -152,6 +170,7 @@ object ExtractAlignedFastq extends ToolCommand {
minMapQ: Int = 0,
commonSuffixLength: Int = 0) extends AbstractArgs
/** Command line argument parser */
class OptParser extends AbstractOptParser {
head(
......@@ -213,6 +232,7 @@ object ExtractAlignedFastq extends ToolCommand {
}
}
/** Parses the command line argument */
def parseArgs(args: Array[String]): Args =
new OptParser()
.parse(args, Args())
......
......@@ -47,12 +47,7 @@ class WipeReads(val root: Configurable) extends BiopetJavaCommandLineFunction {
object WipeReads extends ToolCommand {
/**
* Creates a SamReader object from an input BAM file, ensuring it is indexed
*
* @param inBam input BAM file
* @return
*/
/** Creates a SamReader object from an input BAM file, ensuring it is indexed */
private def prepInBam(inBam: File): SamReader = {
val bam = SamReaderFactory
.make()
......@@ -62,6 +57,7 @@ object WipeReads extends ToolCommand {
bam
}
/** Creates a [[SAMFileWriter]] object for writing, indexed */
private def prepOutBam(outBam: File, templateBam: File,
writeIndex: Boolean = true, async: Boolean = true): SAMFileWriter =
new SAMFileWriterFactory()
......@@ -336,6 +332,7 @@ object WipeReads extends ToolCommand {
}
}
/** Default arguments */
case class Args(inputBam: File = new File(""),
targetRegions: File = new File(""),
outputBam: File = new File(""),
......@@ -348,6 +345,7 @@ object WipeReads extends ToolCommand {
bloomSize: Long = 70000000,
bloomFp: Double = 4e-7) extends AbstractArgs
/** Command line argument parser */
class OptParser extends AbstractOptParser {
head(
......@@ -418,12 +416,7 @@ object WipeReads extends ToolCommand {
}
/**
* Parses the command line argument
*
* @param args Array of arguments
* @return
*/
/** Parses the command line argument */
def parseArgs(args: Array[String]): Args = new OptParser()
.parse(args, Args())
.getOrElse(sys.exit(1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment