-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference.pm
66 lines (56 loc) · 2.62 KB
/
reference.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/perl -w
package reference;
use strict;
use Cwd 'abs_path';
# Check the existence of a user specified reference or set the default.
sub reference {
if (defined $main::reference) {
$main::reference = abs_path($main::reference);
$main::referenceBin = $main::reference;
$main::reference = (split(/\//,$main::reference))[-1];
$main::referenceBin =~ s/\/$main::reference//;
$main::referenceStub = $main::reference;
# Set the default reference to the human reference build 37.
} else {
$main::referenceBin = "/d1/data/references/build_37";
$main::referenceStub = "human_reference_v37";
}
$main::nodeBin = "$main::scratch/$main::userID/references";
$main::reference = "$main::referenceStub.fa";
$main::referenceDictionary = "$main::referenceStub.dict";
# Define the neural net generated files for the mapping quality calculations
# within Mosaik2. Only check that these files exist if Mosaik2 is the
# required aligner.
$main::neuralNetFileSE = "se.100.005.ann";
$main::neuralNetFilePE = "pe.100.01.ann";
if ($main::aligner == "mosaik" && $main::mosaikVersion2 == 1) {
general_tools::checkFileExists("$main::referenceBin/$main::neuralNetFileSE");
general_tools::checkFileExists("$main::referenceBin/$main::neuralNetFilePE");
}
# If the reference file does not exist, throw an exception.
general_tools::checkFileExists("$main::referenceBin/$main::reference");
general_tools::checkFileExists("$main::referenceBin/$main::referenceDictionary");
# If alignments are being produced, check that the necessary files
# exit.
if ($main::aligner ne "none") {
if (!defined $main::dbsnp) {
$main::dbsnpBin = "/d1/data/pipeline_resources/dbSNP";
$main::dbsnp = "ALL.wgs.dbsnp.build135.snps.sites.vcf";
}
general_tools::checkFileExists("$main::dbsnpBin/$main::dbsnp");
}
}
# If Mosaik is the aligner being used, check for the existence of
# the Mosaik specific reference files.
sub mosaikReferenceFiles {
$main::mosaikRef = "$main::referenceStub\.dat";
$main::mosaikCSRef = "$main::referenceStub\_cs.dat";
$main::mosaikJump = "$main::referenceStub\_15";
$main::mosaikJumpCS = "$main::referenceStub\_cs_15";
# Check that the necessary files exist.
general_tools::checkFileExists("$main::referenceBin/$main::mosaikRef");
general_tools::checkFileExists("$main::referenceBin/$main::mosaikJump\_keys.jmp");
general_tools::checkFileExists("$main::referenceBin/$main::mosaikJump\_meta.jmp");
general_tools::checkFileExists("$main::referenceBin/$main::mosaikJump\_positions.jmp");
}
1;