Skip to content

Commit

Permalink
Adding Reporter, changing QC to QualityChecker
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacozzuto committed Jun 6, 2018
1 parent 47099fa commit 582016f
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/QC.groovy → lib/QualityChecker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Luca Cozzuto <lucacozzuto@gmail.com>
*/

class QC {
class QualityChecker {

/*
* Properties definition
Expand Down
104 changes: 104 additions & 0 deletions lib/Reporter.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
* Class for making reports, file descriptors, etc
*
* @authors
* Luca Cozzuto <lucacozzuto@gmail.com>
*/

class Reporter {

/*
* Properties definition
*/

String email = ''
String id = ''
String title = ''
String subtitle = ''
String strand = ''
String extension = ''
String type = ''
String file_name = ''
String PI = ''
String user = ''
String config_file = ''


def public test() {
output = this.dump()
"""
echo '${output}'
"""
}

/*
* Method for writing files needed for an HUB @ UCSC Genome Browser
*/

def public makeGenomeUcscHub() {

"""
echo "genome ${this.id}
trackDb ${this.id}/trackDb.txt" > genomes.txt;
echo "hub ${this.id}
shortLabel ${this.title}
longLabel ${this.subtitle}
genomesFile genomes.txt
email ${this.email}" > hub.txt
"""
}

/*
* Method for writing track DB file needed for HUB @ UCSC Genome Browser
*/
def public makeBigWigTrackDB() {

"""
echo "track ${this.id}
type ${this.type}
compositeTrack on
shortLabel RNAseq profiles (${this.title})
longLabel RNAseq profiles (${this.subtitle})
visibility full
color 0,0,255
autoScale on
maxHeightPixels 128:60:11
" >> trackDb.txt;
for i in *.${this.extension}; \\
do NAME=`echo \$i | sed s/\\.${this.extension}//g`; \\
echo track \$NAME; \\
echo bigDataUrl \$i; \\
echo shortLabel \$NAME; \\
echo longLabel \$NAME; \\
echo "type ${this.type}"; \\
echo "parent ${this.id}"; \\
echo ""; \\
done >> trackDb.txt;
"""
}

/*
* Method for writing multiQC report in a super custom way
*/
def public makeMultiQCreport() {

"""
echo "title: \"${this.title}\"
subtitle: \"${this.subtitle}\"
intro_text: False
report_header_info:
- PI: ${this.PI}
- User: ${this.user}
- Date: `date`
- Contact E-mail: \'${this.email}\'
- Application Type: \'ChIP-seq\'
- Reference Genome: \'${this.id}\'
" > config.yaml;
cat ${this.config_file} >> config.yaml;
multiqc -c config.yaml .
"""
}


}
6 changes: 1 addition & 5 deletions testFunctions.nf
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,12 @@
*/


/*
* Check that helper function `mappingPairsWithSTAR` returns the exepcted result
*/

process testFunction {
echo true

script:
myclass = new NGSaligner2(reads:"luca.fastq", output:"toni.qual")
def myclass = new QC(input:"luca.fastq", output:"toni.qual")
myclass.test()
}

0 comments on commit 582016f

Please sign in to comment.