flexiprepInputfiles.ssp 2.53 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#import(nl.lumc.sasc.biopet.core.summary.Summary)
#import(nl.lumc.sasc.biopet.core.report.ReportPage)
#import(nl.lumc.sasc.biopet.pipelines.flexiprep.FlexiprepReport)
#import(java.io.File)
<%@ var summary: Summary %>
<%@ var sampleId: Option[String] = None %>
<%@ var libId: Option[String] = None %>
<%@ var rootPath: String %>
<%@ var outputDir: File %>
<%@ var showPlot: Boolean = false %>
<%@ var showTable: Boolean = true %>
#{
    val samples = sampleId match {
14
15
16
17
18
19
20
21
22
        case Some(sample) => List(sample.toString)
        case _ => summary.samples.toList
    }
    val pipelineOutputDir = summary.getValue("meta", "output_dir").getOrElse("").toString
    def removeDir(value: Option[Any]): Option[Any] = {
        value.collect { case a =>
            if (a.toString.startsWith(pipelineOutputDir) && pipelineOutputDir.nonEmpty) "./" + a.toString.stripPrefix(pipelineOutputDir)
            else a
        }
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
    }
}#

<table class="table sortable-theme-bootstrap" data-sortable>

<thead><tr>
    <th data-sorted="true" data-sorted-direction="ascending">Sample</th>
    <th colspan="2">Library</th>
    <th>Path</th>
    <th>MD5</th>
</tr></thead>
<tbody>
    #for (sample <- samples.toList.sorted)
        #{
            val libs = libId match {
            case Some(libId) => List(libId.toString)
            case _ => summary.libraries(sample).toList
            }

            val sampleRowspan = {
            libs.size +
            libs.count(summary.getLibraryValue(sample, _, "flexiprep", "settings", "paired").getOrElse(false) == true)
            }
        }#
        <tr><td rowspan="${sampleRowspan}"><a href="${rootPath}Samples/${sample}/index.html">${sample}</a></td>
        #for (libId <- libs)
            #if (libs.head != libId) <tr> #end
                #{ val paired = summary.getLibraryValue(sample, libId, "flexiprep", "settings", "paired").getOrElse(false) }#
                <td #if (paired == true) rowspan="2" #end><a href="${rootPath}Samples/${sample}/Libraries/${libId}/index.html">${libId}</a></td>
                #{ val reads = if (paired == true) List("R1", "R2") else List("R1") }#
                #for (read <- reads)
                    #if (read == "R2") </tr><tr> #end
                    <td>${read}</td>
56
                    <td>${removeDir(summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "input_" + read, "path"))}</td>
57
58
59
60
61
62
63
                    <td>${summary.getLibraryValue(sample, libId, "flexiprep", "files", "pipeline", "input_" + read, "md5")}</td>
                #end
            </tr>
        #end
    #end
</tbody>
</table>