Skip to content
Snippets Groups Projects
Commit 8d414641 authored by Hanna  JULIENNE's avatar Hanna JULIENNE
Browse files

Structuring preprocessing in a package

parent d646e145
No related branches found
No related tags found
No related merge requests found
import jass_preprocessing.map_gwas.map_gwas
import jass_preprocessing.dna_utils.dna_utils
File added
def dna_complement_base(inputbase):
if (inputbase == 'A'):
return('T')
if (inputbase == 'T'):
return('A')
if (inputbase == 'G'):
return('C')
if (inputbase == 'C'):
return('G')
return('Not ATGC')
def dna_complement(input):
return([dna_complement_base(x) for x in input])
File added
import os
import sys
def walkfs(startdir, findfile):
dircount = 0
filecount = 0
for root, dirs, files in os.walk(startdir):
if findfile in files:
return dircount, filecount + files.index(findfile), os.path.join(root, findfile)
dircount += 1
filecount += len(files)
# nothing found, return None instead of a full path for the file
return dircount, filecount, None
def gwas_internal_link(GWAS_table, GWAS_path):
"""
Walk the GWAS path to find the GWAS tables
"""
Glink = []
for GWAS in range(0, len(GWAS_table)):
GWAS_filename = GWAS_table[GWAS]
Glink.append({'filename': GWAS_filename,
'internalDataLink': walkfs(GWAS_path, GWAS_filename)[2]})
Glink = pd.DataFrame(Glink, columns=('filename', 'internalDataLink'))
return Glink
from setuptools import setup
setup(name='jass_preprocessing',
version='0.1',
description='Preprocess GWAS summary statistic for JASS',
url='http:https://gitlab.pasteur.fr/statistical-genetics/JASS_Pre-processing',
author='Hugues Aschard, Vincent Laville, Hanna Julienne',
author_email='hugues.aschard@pasteur.fr',
license='MIT',
packages=['jass_preprocessing'],
zip_safe=False)
......@@ -2,7 +2,7 @@
Read raw GWAS summary statistics, filter and format
Write clean GWAS
"""
__updated__ = '2017-08-29'
__updated__ = '2018-19-02'
import h5py
import numpy as np
......@@ -14,9 +14,6 @@ import pandas as pd
import matplotlib.pyplot as plt
print('Number of arguments:', len(sys.argv), 'arguments.')
print('Argument List:', str(sys.argv))
perSS = 0.7
netPath = "/mnt/atlas/" # '/home/genstat/ATLAS/'
#netPath = '/pasteur/projets/policy01/'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment