1{
2 lib,
3 stdenv,
4 fetchzip,
5 jre,
6 perl,
7 makeWrapper,
8 imagemagick,
9 makeDesktopItem,
10 copyDesktopItems,
11 desktopToDarwinBundle,
12 testers,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "fastqc";
17 version = "0.12.1";
18
19 src = fetchzip {
20 url = "https://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v${finalAttrs.version}.zip";
21 hash = "sha256-TenRG2x8ivJ2HM2ZpLaJShp0yI0Qc6K5lW5/NJFAa1I";
22 };
23
24 dontBuild = true;
25
26 nativeBuildInputs = [
27 makeWrapper
28 imagemagick
29 ]
30 ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems # postInstallHook
31 ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle; # fixupOutputHook
32 buildInputs = [
33 jre
34 perl
35 ];
36
37 desktopItem = (
38 makeDesktopItem {
39 name = "FastQC";
40 exec = "fastqc";
41 icon = "fastqc";
42 desktopName = "FastQC";
43 comment = finalAttrs.meta.description;
44 categories = [ "Science" ];
45 }
46 );
47 desktopItems = [ finalAttrs.desktopItem ];
48
49 installPhase = ''
50 runHook preInstall
51
52 mkdir -p $out/{bin,FastQC}
53 cp -r $src/* $out/FastQC
54
55 # Create desktop item
56 mkdir -p $out/share/{applications,icons}
57 # Freedesktop doesn't support windows ICO files. Use imagemagick to convert it to PNG
58 convert $out/FastQC/fastqc_icon.ico $out/share/icons/fastqc.png
59
60 runHook postInstall
61 '';
62
63 preFixup = ''
64 makeWrapper $out/FastQC/fastqc $out/bin/fastqc --prefix PATH : ${jre}/bin
65 '';
66
67 passthru.tests.version = testers.testVersion {
68 package = finalAttrs.finalPackage;
69 version = "v${finalAttrs.version}";
70 };
71
72 meta = {
73 description = "Quality control application for high throughput sequence data";
74 longDescription = ''
75 FastQC aims to provide a simple way to do some quality control checks on raw sequence data coming from high throughput sequencing pipelines. It provides a modular set of analyses which you can use to give a quick impression of whether your data has any problems of which you should be aware before doing any further analysis.
76
77 The main functions of FastQC are
78
79 - Import of data from BAM, SAM or FastQ files (any variant)
80 - Providing a quick overview to tell you in which areas there may be problems
81 - Summary graphs and tables to quickly assess your data
82 - Export of results to an HTML based permanent report
83 - Offline operation to allow automated generation of reports without running the interactive application
84 '';
85 homepage = "https://www.bioinformatics.babraham.ac.uk/projects/fastqc/";
86 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
87 license = with lib.licenses; [
88 gpl3Plus
89 asl20
90 ];
91 maintainers = [ lib.maintainers.dflores ];
92 mainProgram = "fastqc";
93 platforms = lib.platforms.unix;
94 };
95})