Created
March 6, 2015 00:49
-
-
Save chunxiangzheng/e74e0c2beda0ab5d76a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import synapseclient | |
import os | |
def compare2Files(fname, originFiles, newFiles, syn): | |
df1 = pd.read_csv(syn.get(originFiles[fname]).path, sep="\t") | |
df2 = pd.read_csv(syn.get(newFiles[fname]).path, sep="\t") | |
df1 = df1.ix[sort(df1.index), sort(df1.columns)] | |
df2 = df2.ix[sort(df2.index), sort(df2.columns)] | |
original = "syn2812961" | |
new = "syn3270657" | |
orginalFolder = "original" | |
newFolder = "new" | |
syn=synapseclient.login() | |
originFiles = {x["file.name"]: x["file.id"] for x in syn.chunkedQuery("select name from file where benefactorId=='%s'"%original)} | |
newFiles = {x["file.name"]: x["file.id"] for x in syn.chunkedQuery("select name from file where benefactorId=='%s'"%new)} | |
fname = 'unc.edu_GBM_AgilentG4502A_07_2.geneExp.tsv' | |
df1 = pd.read_csv(syn.get(originFiles[fname]).path, sep="\t", index_col=0) | |
df2 = pd.read_csv(syn.get(newFiles[fname]).path, sep="\t", index_col=0) | |
df1 = df1.ix[sorted(df1.index), sorted(df1.columns)] | |
df2 = df2.ix[sorted(df2.index), sorted(df2.columns)] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment