Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = 'cd4'
- j=0
- legend_text=[]
- for pt in pts:
- new_dir = CWD + '\\' + pt
- os.chdir(new_dir)
- #Import alpha and beta chain data
- fileA = 'TRA' + str(x) + '_productive_' + pt + '.txt'
- fileB = 'TRB' + str(x) + '_productive_' + pt + '.txt'
- TRA = pd.read_csv(fileA, sep = '\t')
- TRB = pd.read_csv(fileB, sep = '\t')
- #Get clone size and frequency
- total_TCR = len(TRA) + len(TRB)
- for y in [TRA,TRB]:
- CloneSizes = y['nSeqCDR3'].value_counts()
- freq = CloneSizes.value_counts() / total_TCR
- plt.plot(freq,colors2[j])
- legend_text.append(str(y)+ str(x) + '_' + str(pt))
- j += 1
- os.chdir(CWD)
- #Make the graph look pretty
- plt.xscale('log')
- plt.yscale('log')
- plt.xlabel('Clone Size (log)')
- plt.ylabel('Frequency (log)')
- plt.title(x)
- plt.legend(legend_text, loc = 'center right')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement