Skip to content

Commit

Permalink
modify to make it compatible with clonality.py
Browse files Browse the repository at this point in the history
add next(reader) to skip the headline and remove sample_1 or sample_2 from file names to locate the outputs of clonality.py
  • Loading branch information
dormeight authored Oct 7, 2019
1 parent 56b6470 commit 1562db0
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions compare.repertoires.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def file2dict(fileName):
dict={}
file=open(fileName,"r")
reader=csv.reader(file)
next(reader)# skip the headline
for row in reader:
dict[row[0]]=int(row[1])
return dict
Expand Down Expand Up @@ -84,27 +85,27 @@ def file2dict(fileName):

print ("-----")
print (sample_1,sample_2)
# remove "+ sample_1" or "+ sample_2" from the following lines
file_IGH_1=args.dir_1+"/IGH.cdr3.FREQ."+".csv"
file_IGH_2=args.dir_2+"/IGH.cdr3.FREQ."+".csv"

file_IGH_1=args.dir_1+"/IGH.cdr3.FREQ."+sample_1+".csv"
file_IGH_2=args.dir_2+"/IGH.cdr3.FREQ."+sample_2+".csv"
file_IGK_1=args.dir_1+"/IGK.cdr3.FREQ."+".csv"
file_IGK_2=args.dir_2+"/IGK.cdr3.FREQ."+".csv"

file_IGK_1=args.dir_1+"/IGK.cdr3.FREQ."+sample_1+".csv"
file_IGK_2=args.dir_2+"/IGK.cdr3.FREQ."+sample_2+".csv"
file_IGL_1=args.dir_1+"/IGL.cdr3.FREQ."+".csv"
file_IGL_2=args.dir_2+"/IGL.cdr3.FREQ."+".csv"

file_IGL_1=args.dir_1+"/IGL.cdr3.FREQ."+sample_1+".csv"
file_IGL_2=args.dir_2+"/IGL.cdr3.FREQ."+sample_2+".csv"
file_TCRA_1=args.dir_1+"/TCRA.cdr3.FREQ."+".csv"
file_TCRA_2=args.dir_2+"/TCRA.cdr3.FREQ."+".csv"

file_TCRA_1=args.dir_1+"/TCRA.cdr3.FREQ."+sample_1+".csv"
file_TCRA_2=args.dir_2+"/TCRA.cdr3.FREQ."+sample_2+".csv"
file_TCRB_1=args.dir_1+"/TCRB.cdr3.FREQ."+".csv"
file_TCRB_2=args.dir_2+"/TCRB.cdr3.FREQ."+".csv"

file_TCRB_1=args.dir_1+"/TCRB.cdr3.FREQ."+sample_1+".csv"
file_TCRB_2=args.dir_2+"/TCRB.cdr3.FREQ."+sample_2+".csv"
file_TCRD_1=args.dir_1+"/TCRD.cdr3.FREQ."+".csv"
file_TCRD_2=args.dir_2+"/TCRD.cdr3.FREQ."+".csv"

file_TCRD_1=args.dir_1+"/TCRD.cdr3.FREQ."+sample_1+".csv"
file_TCRD_2=args.dir_2+"/TCRD.cdr3.FREQ."+sample_2+".csv"

file_TCRG_1=args.dir_1+"/TCRG.cdr3.FREQ."+sample_1+".csv"
file_TCRG_2=args.dir_2+"/TCRG.cdr3.FREQ."+sample_2+".csv"
file_TCRG_1=args.dir_1+"/TCRG.cdr3.FREQ."+".csv"
file_TCRG_2=args.dir_2+"/TCRG.cdr3.FREQ."+".csv"


dict_IGH_1=file2dict(file_IGH_1)
Expand Down Expand Up @@ -176,27 +177,27 @@ def file2dict(fileName):


#VJ -----------------------------
# also remove "+ sample_1" or "+ sample_2" from the following lines
file_IGH_1=args.dir_1+"/IGH.VJ.FREQ."+".csv"
file_IGH_2=args.dir_2+"/IGH.VJ.FREQ."+".csv"

file_IGH_1=args.dir_1+"/IGH.VJ.FREQ."+sample_1+".csv"
file_IGH_2=args.dir_2+"/IGH.VJ.FREQ."+sample_2+".csv"

file_IGK_1=args.dir_1+"/IGK.VJ.FREQ."+sample_1+".csv"
file_IGK_2=args.dir_2+"/IGK.VJ.FREQ."+sample_2+".csv"
file_IGK_1=args.dir_1+"/IGK.VJ.FREQ."+".csv"
file_IGK_2=args.dir_2+"/IGK.VJ.FREQ."+".csv"

file_IGL_1=args.dir_1+"/IGL.VJ.FREQ."+sample_1+".csv"
file_IGL_2=args.dir_2+"/IGL.VJ.FREQ."+sample_2+".csv"
file_IGL_1=args.dir_1+"/IGL.VJ.FREQ."+".csv"
file_IGL_2=args.dir_2+"/IGL.VJ.FREQ."+".csv"

file_TCRA_1=args.dir_1+"/TCRA.VJ.FREQ."+sample_1+".csv"
file_TCRA_2=args.dir_2+"/TCRA.VJ.FREQ."+sample_2+".csv"
file_TCRA_1=args.dir_1+"/TCRA.VJ.FREQ."+".csv"
file_TCRA_2=args.dir_2+"/TCRA.VJ.FREQ."+".csv"

file_TCRB_1=args.dir_1+"/TCRB.VJ.FREQ."+sample_1+".csv"
file_TCRB_1=args.dir_1+"/TCRB.VJ.FREQ."+".csv"
file_TCRB_2=args.dir_2+"/TCRB.VJ.FREQ."+sample_2+".csv"

file_TCRD_1=args.dir_1+"/TCRD.VJ.FREQ."+sample_1+".csv"
file_TCRD_2=args.dir_2+"/TCRD.VJ.FREQ."+sample_2+".csv"
file_TCRD_1=args.dir_1+"/TCRD.VJ.FREQ."+".csv"
file_TCRD_2=args.dir_2+"/TCRD.VJ.FREQ."+".csv"

file_TCRG_1=args.dir_1+"/TCRG.VJ.FREQ."+sample_1+".csv"
file_TCRG_2=args.dir_2+"/TCRG.VJ.FREQ."+sample_2+".csv"
file_TCRG_1=args.dir_1+"/TCRG.VJ.FREQ."+".csv"
file_TCRG_2=args.dir_2+"/TCRG.VJ.FREQ."+".csv"


dict_IGH_1=file2dict(file_IGH_1)
Expand Down

0 comments on commit 1562db0

Please sign in to comment.