-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsnps.php
More file actions
136 lines (128 loc) · 5.81 KB
/
snps.php
File metadata and controls
136 lines (128 loc) · 5.81 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
require 'config.php';
require $config['root_dir'].'includes/bootstrap.inc';
$mysqli = connecti();
require_once $config['root_dir'].'theme/normal_header.php';
if (isset($_SESSION['geno_exps'])) {
$geno_exps = $_SESSION['geno_exps'];
$count = $_SESSION['geno_exps_cnt'];
$exp_uid = $geno_exps[0];
$sql = "select trial_code from experiments where experiment_uid = ?";
if ($stmt = mysqli_prepare($mysqli, $sql)) {
mysqli_stmt_bind_param($stmt, "i", $exp_uid);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $trial_code);
if (mysqli_stmt_fetch($stmt)) {
echo "<h2>Marker Alleles and Sequences for $trial_code</h2>";
}
mysqli_stmt_close($stmt);
}
} elseif (isset($_SESSION['clicked_buttons'])) {
$markers = $_SESSION['clicked_buttons'];
$count = count($markers);
$markers_str = implode(",", $markers);
echo "<h2>Marker Alleles and Sequences for selected markers</h2>";
} else {
$geno_exps = "";
$markers_str = "";
echo "<h2>Marker Alleles and Sequences</h2>";
}
?>
<font size =-1>
Genotyping results are submitted to T3, and can be
<a href="downloads/downloads.php">downloaded</a> from T3, in a variety
of formats. To allow this flexibility, all types of markers are
represented internally in a common format. In this format each marker
has two allele states (plus "missing data"), referred to as <i>A-allele</i> and
<i>B-allele</i>. Below are the mapping rules used to convert from each
submission format to T3 format. Following that are the nucleotide calls
corresponding to the A- and B-allele for each marker. In each <i>Sequence</i>,
the SNP is given in square brackets as "[A-allele/B-allele]".
<h4>Illumina SNPs</h4>
Genotyping results from Illumina GoldenGate and Infinium assays are
submitted to T3 in Illumina's A/B format, and stored as A-allele = A and
B-allele = B. The actual nucleotide calls corresponding to A and B are
taken from the Illumina manifest files
(<a href="docs/GS0007511-OPA.opa">example</a>), interpreted according to
the documentation in Illumina's Technical
Note <a href="docs/TopBot_TechNote.pdf">"TOP/BOT" Strand and "A/B"
Allele</a>. In short:<ul>
<li>For [A/C] and [A/G] SNPs, Allele A is A.
<li>For [T/C] and [T/G] SNPs, Allele A is T and the sequence is
designated BOT.
<li>For [A/T] SNPs, when the Illumina Strand
is TOP then Allele A = A and Allele B = T. When the
Strand is BOT, then Allele A = T and Allele B = A.
<li>For [C/G] SNPs, when the Illumina Strand is
TOP then Allele A = C and Allele B = G. When the Strand
is BOT then Allele A = G and Allele B = C.
</ul>
The Sequence shown in T3 is the reverse-complement of the the manifest's
<i>TopGenomicSeq</i> when the Illumina strand (manifest field "<i>Ilmn Strand</i>")
was BOT, so the the bracketed SNP nucleotides
in the Sequence are the same as the A-allele and B-allele nucleotides;
however they aren't necessarily given in the same order.
<h4>GBS SNPs</h4>
<p>For SNPs assayed by shotgun sequencing downstream from a restriction
site, the Sequence is oriented with the common restriction site at the
5-prime, left end. The alternative nucleotides for this strand are
shown in square brackets in alphabetical order, A < C < G < T. The first
nucleotide alphabetically is stored as A-allele, and the second is
B-allele. Genotyping data are provided to T3 with a single-letter score,
the nucleotide, when homozygous; heterozygotes are indicated with "H", and
missing data with "N".
<h4>DArTs</h4>
<p>For DArT markers, Allele A is 1 (present) and Allele B is 0 (absent).
</font>
<?php
if (($trial_code == "") and ($markers_str == "")) {
echo "<br><br><font color=red>Please select a <a href=downloads/select_genotype.php>genotype experiment</a> or";
echo " <a href=genotyping/marker_selection.php>markers</a>.";
echo "</div>";
include_once $config['root_dir'].'theme/footer.php';
die();
}
if ($count > 1000) {
print "<br><br><a href=genotyping/display_markers.php>Download selected markers</a><br>\n";
echo "</div>";
include_once $config['root_dir'].'theme/footer.php';
die();
}
print "<br><br><a href=genotyping/display_markers.php?function=download>Download marker information</a><br>\n";
echo "<br><table><tr><th>Marker<th>Type<th>A_allele<th>B_allele<th>Sequence";
if ($geno_exps != "") {
$sql = "select marker_name, marker_type_name, A_allele, B_allele, sequence
from markers, marker_types, allele_frequencies
where markers.marker_type_uid = marker_types.marker_type_uid
and markers.marker_uid = allele_frequencies.marker_uid
and A_allele is not null
and experiment_uid = ?
order by marker_name";
if ($stmt = mysqli_prepare($mysqli, $sql)) {
mysqli_stmt_bind_param($stmt, "i", $exp_uid);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $marker_name, $marker_type_name, $A_allele, $B_allele, $sequence);
while (mysqli_stmt_fetch($stmt)) {
echo "<tr><td>$marker_name<td>$marker_type_name<td>$A_allele<td>$B_allele<td>$sequence\n";
}
mysqli_stmt_close($stmt);
}
echo "</table>";
} elseif ($markers_str != "") {
$sql = "select marker_name, marker_type_name, A_allele, B_allele, sequence
from markers, marker_types
where markers.marker_type_uid = marker_types.marker_type_uid
and marker_uid IN ($markers_str)
order by marker_name";
if ($stmt = mysqli_prepare($mysqli, $sql)) {
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $marker_name, $marker_type_name, $A_allele, $B_allele, $sequence);
while (mysqli_stmt_fetch($stmt)) {
echo "<tr><td>$marker_name<td>$marker_type_name<td>$A_allele<td>$B_allele<td>$sequence\n";
}
mysqli_stmt_close($stmt);
}
print "</table>";
} else {
echo "Error: bad selection\n";
}