"""
July 1 2009 added relatedness filter - fo/oo or all
released under the terms of the LGPL
copyright ross lazarus August 2007
for the rgenetics project
Special galaxy tool for the camp2007 data
Allows grabbing genotypes from an arbitrary region
Needs a mongo results file in the location hardwired below or could be passed in as
a library parameter - but this file must have a very specific structure
rs chrom offset float1...floatn
called as
campRGeno2.py $region "$rslist" "$title" $output1 $log_file $userId "$lpedIn" "$lhistIn"
"""
import sys, array, os, string
from rgutils import galhtmlprefix,plinke,readMap
progname = os.path.split(sys.argv[0])[1]
atrandic = {'A':'1','C':'2','G':'3','T':'4','N':'0','-':'0','1':'1','2':'2','3':'3','4':'4','0':'0'}
def doImport(outfile='test',flist=[]):
""" import into one of the new html composite data types for Rgenetics
Dan Blankenberg with mods by Ross Lazarus
October 2007
"""
out = open(outfile,'w')
out.write(galhtmlprefix % progname)
if len(flist) > 0:
out.write('
\n')
for i, data in enumerate( flist ):
out.write('- %s
\n' % (os.path.split(data)[-1],os.path.split(data)[-1]))
out.write('
\n')
else:
out.write('No files found')
out.write("