Commit d27bbd08 authored by Vermaat's avatar Vermaat
Browse files

Add mm10 (Mouse) transcript mappings

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/branches/mapping-mouse@683 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent 4052e854
#!/bin/bash
# Add mm10 database with mouse mappings.
#
# Usage:
# ./011-db-add-mm10.migration [migrate]
COLOR_INFO='\033[32m'
COLOR_WARNING='\033[33m'
COLOR_ERROR='\033[31m'
COLOR_END='\033[0m'
if echo 'show databases;' | mysql -u mutalyzer | grep -q mm10; then
echo -e "${COLOR_INFO}This migration is not needed.${COLOR_END}"
else
echo -e "${COLOR_WARNING}This migration is needed.${COLOR_END}"
if [ "$1" = 'migrate' ]; then
echo 'Performing migration.'
echo -e "${COLOR_INFO}Creating mm10 database${COLOR_END}"
echo "You will now be asked for the MySQL root password"
# Create databases
cat << EOF | mysql -u root -p
CREATE DATABASE mm10;
GRANT ALL PRIVILEGES ON mm10.* TO mutalyzer@localhost;
FLUSH PRIVILEGES;
EOF
if [ $? -ne 0 ]; then
echo -e "${COLOR_ERROR}Error creating mm10 database, aborting migration.${COLOR_END}"
exit 1
fi
echo -e "${COLOR_INFO}Creating tables in mm10 database${COLOR_END}"
# Create ChrName and Mapping table (mm10)
cat << EOF | mysql -u mutalyzer -D mm10
CREATE TABLE ChrName (
AccNo char(20) NOT NULL,
name char(20) NOT NULL,
organelle_type enum('chromosome','mitochondrion') NOT NULL DEFAULT 'chromosome',
PRIMARY KEY (AccNo)
) ENGINE = MYISAM;
CREATE TABLE Mapping (
gene varchar(255) DEFAULT NULL,
transcript varchar(20) NOT NULL DEFAULT '',
version smallint(6) DEFAULT NULL,
selector varchar(255) DEFAULT NULL,
selector_version smallint(6) DEFAULT NULL,
chromosome varchar(40) DEFAULT NULL,
orientation char(1) DEFAULT NULL,
start int(11) unsigned DEFAULT NULL,
stop int(11) unsigned DEFAULT NULL,
cds_start int(11) unsigned DEFAULT NULL,
cds_stop int(11) unsigned DEFAULT NULL,
exon_starts longblob NOT NULL,
exon_stops longblob NOT NULL,
protein varchar(20) DEFAULT NULL,
source varchar(20) DEFAULT NULL,
INDEX (transcript)
) ENGINE = MYISAM;
INSERT INTO ChrName (AccNo, name, organelle_type) VALUES
('NC_000067.65', 'chr1', 'chromosome'),
('NC_000068.70', 'chr2', 'chromosome'),
('NC_000069.60', 'chr3', 'chromosome'),
('NC_000070.66', 'chr4', 'chromosome'),
('NC_000071.65', 'chr5', 'chromosome'),
('NC_000072.60', 'chr6', 'chromosome'),
('NC_000073.61', 'chr7', 'chromosome'),
('NC_000074.60', 'chr8', 'chromosome'),
('NC_000075.60', 'chr9', 'chromosome'),
('NC_000076.60', 'chr10', 'chromosome'),
('NC_000077.60', 'chr11', 'chromosome'),
('NC_000078.60', 'chr12', 'chromosome'),
('NC_000079.60', 'chr13', 'chromosome'),
('NC_000080.60', 'chr14', 'chromosome'),
('NC_000081.60', 'chr15', 'chromosome'),
('NC_000082.60', 'chr16', 'chromosome'),
('NC_000083.60', 'chr17', 'chromosome'),
('NC_000084.60', 'chr18', 'chromosome'),
('NC_000085.60', 'chr19', 'chromosome'),
('NC_000086.71', 'chrX', 'chromosome'),
('NC_000087.74', 'chrY', 'chromosome'),
('NC_005089.1', 'chrM', 'mitochondrion');
EOF
if [ $? -ne 0 ]; then
echo -e "${COLOR_ERROR}Error creating tables in mm10 database, aborting migration.${COLOR_END}"
exit 1
fi
echo -e "${COLOR_INFO}Populating Mapping table with NCBI data (mm10)${COLOR_END}"
# Populate Mapping table with UCSC data (mm10)
MAPPING=$(mktemp)
wget "ftp://ftp.ncbi.nih.gov/genomes/M_musculus/ARCHIVE/BUILD.38.1/mapview/seq_gene.md.gz" -O - | zcat > $MAPPING
echo -e "${COLOR_INFO}Importing NCBI mapping data, this may take a few minutes (mm10)${COLOR_END}"
BIN_MAPPING_UPDATE=$(which mutalyzer-mapping-update)
$($BIN_MAPPING_UPDATE mm10 $MAPPING 'GRCm38-C57BL/6J')
rm $MAPPING
echo -e "${COLOR_INFO}Separate import of NC_005089.1 (chrM) in mm10 database${COLOR_END}"
BIN_MAPPING_IMPORT=$(which mutalyzer-mapping-import)
$($BIN_MAPPING_IMPORT reference mm10 NC_005089.1)
if [ -e /etc/mutalyzer/config ] && $(grep '^dbNames' /etc/mutalyzer/config | grep -q -v mm10); then
echo -e "${COLOR_INFO}Copying /etc/mutalyzer/config to /etc/mutalyzer/config.backup${COLOR_END}"
cp /etc/mutalyzer/config /etc/mutalyzer/config.backup
sed -i 's/^\(dbNames.*\)$/\1, "mm10"/' /etc/mutalyzer/config
echo -e "${COLOR_INFO}Added mm10 database to /etc/mutalyzer/config${COLOR_END}"
fi
echo 'Performed migration.'
fi
fi
......@@ -30,6 +30,7 @@ PACKAGE_ROOT=$(cd / && python -c 'import mutalyzer; print mutalyzer.package_root
BIN_BATCHD=$(which mutalyzer-batchd)
BIN_CACHE_SYNC=$(which mutalyzer-cache-sync)
BIN_MAPPING_UPDATE=$(which mutalyzer-mapping-update)
BIN_MAPPING_IMPORT=$(which mutalyzer-mapping-import)
BIN_WEBSITE=$(which mutalyzer-website.wsgi)
BIN_SOAP_SERVICE=$(which mutalyzer-soap-service.wsgi)
BIN_JSON_SERVICE=$(which mutalyzer-json-service.wsgi)
......@@ -87,6 +88,8 @@ cp extras/apache/mutalyzer.conf /etc/apache2/conf.d/mutalyzer.conf
sed -i -e "s@<MUTALYZER_BIN_WEBSITE>@${BIN_WEBSITE}@g" -e "s@<MUTALYZER_BIN_SOAP_SERVICE>@${BIN_SOAP_SERVICE}@g" -e "s@<MUTALYZER_BIN_JSON_SERVICE>@${BIN_JSON_SERVICE}@g" -e "s@<MUTALYZER_BIN_BATCHD>@${BIN_BATCHD}@g" /etc/apache2/conf.d/mutalyzer.conf
chmod u=rw,go=r /etc/apache2/conf.d/mutalyzer.conf
echo -e "${COLOR_INFO}Creating databases${COLOR_END}"
echo "You will now be asked for the MySQL root password"
# Create databases
......@@ -95,9 +98,11 @@ cat << EOF | mysql -u root -p
CREATE DATABASE mutalyzer;
CREATE DATABASE hg18;
CREATE DATABASE hg19;
CREATE DATABASE mm10;
GRANT ALL PRIVILEGES ON mutalyzer.* TO mutalyzer@localhost;
GRANT ALL PRIVILEGES ON hg18.* TO mutalyzer@localhost;
GRANT ALL PRIVILEGES ON hg19.* TO mutalyzer@localhost;
GRANT ALL PRIVILEGES ON mm10.* TO mutalyzer@localhost;
FLUSH PRIVILEGES;
EOF
......@@ -168,6 +173,9 @@ echo -e "${COLOR_INFO}Importing NCBI mapping data, this may take a few minutes (
$($BIN_MAPPING_UPDATE hg18 $MAPPING reference)
rm $MAPPING
echo -e "${COLOR_INFO}Separate import of NC_001807.4 (chrM) in hg18 database${COLOR_END}"
$($BIN_MAPPING_IMPORT reference hg18 NC_001807.4)
echo -e "${COLOR_INFO}Creating tables in hg19 database${COLOR_END}"
# Create ChrName and Mapping table (hg19)
......@@ -243,6 +251,74 @@ echo -e "${COLOR_INFO}Importing NCBI mapping data, this may take a few minutes (
$($BIN_MAPPING_UPDATE hg19 $MAPPING 'GRCh37.p2-Primary Assembly')
rm $MAPPING
echo -e "${COLOR_INFO}Separate import of NC_012920.1 (chrM) in hg19 database${COLOR_END}"
$($BIN_MAPPING_IMPORT reference hg19 NC_012920.1)
echo -e "${COLOR_INFO}Creating tables in mm10 database${COLOR_END}"
# Create ChrName and Mapping table (mm10)
cat << EOF | mysql -u mutalyzer -D mm10
CREATE TABLE ChrName (
AccNo char(20) NOT NULL,
name char(20) NOT NULL,
organelle_type enum('chromosome','mitochondrion') NOT NULL DEFAULT 'chromosome',
PRIMARY KEY (AccNo)
) ENGINE = MYISAM;
CREATE TABLE Mapping (
gene varchar(255) DEFAULT NULL,
transcript varchar(20) NOT NULL DEFAULT '',
version smallint(6) DEFAULT NULL,
selector varchar(255) DEFAULT NULL,
selector_version smallint(6) DEFAULT NULL,
chromosome varchar(40) DEFAULT NULL,
orientation char(1) DEFAULT NULL,
start int(11) unsigned DEFAULT NULL,
stop int(11) unsigned DEFAULT NULL,
cds_start int(11) unsigned DEFAULT NULL,
cds_stop int(11) unsigned DEFAULT NULL,
exon_starts longblob NOT NULL,
exon_stops longblob NOT NULL,
protein varchar(20) DEFAULT NULL,
source varchar(20) DEFAULT NULL,
INDEX (transcript)
) ENGINE = MYISAM;
INSERT INTO ChrName (AccNo, name, organelle_type) VALUES
('NC_000067.65', 'chr1', 'chromosome'),
('NC_000068.70', 'chr2', 'chromosome'),
('NC_000069.60', 'chr3', 'chromosome'),
('NC_000070.66', 'chr4', 'chromosome'),
('NC_000071.65', 'chr5', 'chromosome'),
('NC_000072.60', 'chr6', 'chromosome'),
('NC_000073.61', 'chr7', 'chromosome'),
('NC_000074.60', 'chr8', 'chromosome'),
('NC_000075.60', 'chr9', 'chromosome'),
('NC_000076.60', 'chr10', 'chromosome'),
('NC_000077.60', 'chr11', 'chromosome'),
('NC_000078.60', 'chr12', 'chromosome'),
('NC_000079.60', 'chr13', 'chromosome'),
('NC_000080.60', 'chr14', 'chromosome'),
('NC_000081.60', 'chr15', 'chromosome'),
('NC_000082.60', 'chr16', 'chromosome'),
('NC_000083.60', 'chr17', 'chromosome'),
('NC_000084.60', 'chr18', 'chromosome'),
('NC_000085.60', 'chr19', 'chromosome'),
('NC_000086.71', 'chrX', 'chromosome'),
('NC_000087.74', 'chrY', 'chromosome'),
('NC_005089.1', 'chrM', 'mitochondrion');
EOF
echo -e "${COLOR_INFO}Populating Mapping table with NCBI data (mm10)${COLOR_END}"
# Populate Mapping table with UCSC data (mm10)
MAPPING=$(mktemp)
wget "ftp://ftp.ncbi.nih.gov/genomes/M_musculus/ARCHIVE/BUILD.38.1/mapview/seq_gene.md.gz" -O - | zcat > $MAPPING
echo -e "${COLOR_INFO}Importing NCBI mapping data, this may take a few minutes (mm10)${COLOR_END}"
$($BIN_MAPPING_UPDATE mm10 $MAPPING 'GRCm38-C57BL/6J')
rm $MAPPING
echo -e "${COLOR_INFO}Separate import of NC_005089.1 (chrM) in mm10 database${COLOR_END}"
$($BIN_MAPPING_IMPORT reference mm10 NC_005089.1)
echo -e "${COLOR_INFO}Creating tables in mutalyzer database${COLOR_END}"
# Create mutalyzer tables
......
......@@ -36,7 +36,7 @@ from mutalyzer import describe
def _checkBuild(L, build) :
"""
Check if the build is supported (hg18 or hg19).
Check if the build is supported (hg18, hg19, or mm10).
Returns:
- Nothing (but raises an EARG exception).
......@@ -245,7 +245,7 @@ class MutalyzerService(ServiceBase):
- EARG ; The argument was not valid.
- ERANGE ; An invalid range was given.
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg chrom: A chromosome encoded as "chr1", ..., "chrY".
@type chrom: string
......@@ -320,7 +320,7 @@ class MutalyzerService(ServiceBase):
"""
Get all the transcripts that overlap with a range on a chromosome.
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg chrom: A chromosome encoded as "chr1", ..., "chrY".
@type chrom: string
......@@ -366,7 +366,7 @@ class MutalyzerService(ServiceBase):
Get all the transcripts and their info that overlap with a range on a
chromosome.
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg chrom: A chromosome encoded as "chr1", ..., "chrY".
@type chrom: string
......@@ -432,7 +432,7 @@ class MutalyzerService(ServiceBase):
"""
Find the gene name associated with a transcript.
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg accno: The identifier of a transcript.
@type accno: string
......@@ -480,7 +480,7 @@ class MutalyzerService(ServiceBase):
@arg LOVD_ver: The LOVD version.
@type LOVD_ver: string
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg accNo: The NM accession number and version.
@type accNo: string
......@@ -528,7 +528,7 @@ class MutalyzerService(ServiceBase):
@arg LOVD_ver: The LOVD version.
@type LOVD_ver: string
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg accNo: The NM accession number and version.
@type accNo: string
......@@ -559,7 +559,7 @@ class MutalyzerService(ServiceBase):
"""
Get the accession number of a chromosome, given a name.
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg name: The name of a chromosome (e.g. chr1).
@type name: string
......@@ -590,7 +590,7 @@ class MutalyzerService(ServiceBase):
"""
Get the name of a chromosome, given a chromosome accession number.
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg accNo: The accession number of a chromosome (NC_...).
@type accNo: string
......@@ -621,7 +621,7 @@ class MutalyzerService(ServiceBase):
"""
Get the chromosome name, given a transcript identifier (NM number).
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg acc: The NM accession number (version NOT included).
@type acc: string
......@@ -653,7 +653,7 @@ class MutalyzerService(ServiceBase):
"""
Converts I{c.} to I{g.} notation or vice versa
@arg build: The human genome build (hg19 or hg18).
@arg build: The genome build (hg19, hg18, mm10).
@type build: string
@arg variant: The variant in either I{c.} or I{g.} notation, full HGVS
notation, including NM_ or NC_ accession number.
......
......@@ -7,8 +7,8 @@
<center><h3>Position Conversion</h3></center>
<div style="border: 1px solid grey; background-color: aliceblue; padding: 20px;">
Please supply the build which you want to use to convert your
position, available builds at the moment are: hg18 (NCBI 36) and hg19
(GRCh37).<br>
position, available builds at the moment are: hg18 (NCBI36), hg19
(GRCh37) and mm10 (GRCm38).<br>
<br>
Example: NM_003002.2:c.274G&gt;T<br>
or: chr11:g.111959693G&gt;T<br>
......
......@@ -1717,6 +1717,7 @@ def check_variant(description, output):
locations = [pos
for descr, first, last in raw_variants
for pos in (first, last)]
# Todo: This is hard-coded to hg19...
converter = Converter('hg19', output)
chromosomal_positions = converter.chromosomal_positions(
locations, parsed_description.RefSeqAcc, parsed_description.Version)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment