add additional covariates to the mapping file after 08/21/2017 Lab Meeting (output: mapping_more_MrOS.txt)
In [1]:
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
In [2]:
mf = pd.read_csv('../data_uparse/mapping_cleaned_MrOS.txt', sep='\t', dtype=str, index_col='#SampleID')
In [3]:
# add health variable
health = pd.read_csv('../data/MrOS_healthvari.csv', sep=',', dtype=str)
health = health.rename(columns={'ID': '#SampleID'}).set_index('#SampleID')
health['QLCOMP'] = health['QLCOMP'].astype('category')
In [4]:
health.head()
Out[4]:
In [5]:
print(mf.shape)
mf.head()
Out[5]:
In [6]:
df = pd.merge(mf, health, left_index=True, right_index=True)
In [7]:
print(df.shape)
df.head()
Out[7]:
In [8]:
df.to_csv('../data_uparse/mapping_more_MrOS.txt', sep= '\t', index=True)
In [ ]: