From 3e4c187e00b7eaafca2d3c215777cdc3b4101a33 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 24 Jan 2014 15:31:18 -0600 Subject: Committer: root On branch master --- .../dataset/special/correlation/about.txt | 3 ++ .../dataset/special/correlation/conf.ini | 2 + .../dataset/special/correlation/correlations.py | 47 ++++++++++++++++++++++ .../maintenance/dataset/special/correlation/run.sh | 1 + 4 files changed, 53 insertions(+) create mode 100644 wqflask/maintenance/dataset/special/correlation/about.txt create mode 100644 wqflask/maintenance/dataset/special/correlation/conf.ini create mode 100644 wqflask/maintenance/dataset/special/correlation/correlations.py create mode 100644 wqflask/maintenance/dataset/special/correlation/run.sh (limited to 'wqflask/maintenance/dataset/special') diff --git a/wqflask/maintenance/dataset/special/correlation/about.txt b/wqflask/maintenance/dataset/special/correlation/about.txt new file mode 100644 index 00000000..a12f8c47 --- /dev/null +++ b/wqflask/maintenance/dataset/special/correlation/about.txt @@ -0,0 +1,3 @@ +BXD +genotype, phenotype, mRNA expression +correlation \ No newline at end of file diff --git a/wqflask/maintenance/dataset/special/correlation/conf.ini b/wqflask/maintenance/dataset/special/correlation/conf.ini new file mode 100644 index 00000000..9c23bb45 --- /dev/null +++ b/wqflask/maintenance/dataset/special/correlation/conf.ini @@ -0,0 +1,2 @@ +[configuration] +genofile = /home/leiyan/gn/web/genotypes/BXD.geno diff --git a/wqflask/maintenance/dataset/special/correlation/correlations.py b/wqflask/maintenance/dataset/special/correlation/correlations.py new file mode 100644 index 00000000..b089e446 --- /dev/null +++ b/wqflask/maintenance/dataset/special/correlation/correlations.py @@ -0,0 +1,47 @@ +# Author: Lei Yan +# Create Date: 2014-01-21 +# Last Update Date: 2014-01-24 + +# import +import sys +import os +import re +import MySQLdb +import ConfigParser + +def main(argv): + + # load configuration from configuration file + config = ConfigParser.ConfigParser() + config.read(argv[1]) + genofile = config.get('configuration', 'genofile') + + # parse genofile + genotypes = [] + file_geno = open(genofile, 'r') + for line in file_geno: + line = line.strip() + if line.startswith('#'): + continue + if line.startswith('@'): + continue + cells = line.split() + if line.startswith("Chr"): + strains = cells[4:] + continue + genotype = {} + genotype['chr'] = cells[0] + genotype['locus'] = cells[1] + genotype['cm'] = cells[2] + genotype['mb'] = cells[3] + genotype['values'] = cells[4:] + genotypes.append(genotype) + print "get %d strains:\t%s" % (len(strains), strains) + print "load %d genotypes" % len(genotypes) + + # phenotypes + +# main +if __name__ == "__main__": + main(sys.argv) + print "exit successfully" diff --git a/wqflask/maintenance/dataset/special/correlation/run.sh b/wqflask/maintenance/dataset/special/correlation/run.sh new file mode 100644 index 00000000..eccfa507 --- /dev/null +++ b/wqflask/maintenance/dataset/special/correlation/run.sh @@ -0,0 +1 @@ +/usr/bin/python correlations.py conf.ini \ No newline at end of file -- cgit v1.2.3