Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify to make it compatible with clonality.py #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you didn't take out the sample_2 in this line?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh,my god. I forgot to remove these ones. all sample_1 or sample_2 should be removed

Copy link

@aaronkarlsberg aaronkarlsberg Oct 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! @mandricigor could you modify the script to amend these two lines as well and create a new pull request?
@smangul1 I don't have authorization to merge a pull request with the master branch. Can you approve it and/or add me as a contributor?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged these changes with the Mangul USC lab fork.
@mandricigor, I recommend merging this patch into your fork.
@dormeight made a good fix.


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