saving work with sections reflecting activities
This commit is contained in:
parent
e99c169b35
commit
95a73efdd2
1 changed files with 12 additions and 12 deletions
|
@ -1602,14 +1602,6 @@ gene_LF3.head()
|
|||
gene_LF3['drtype_max'] = gene_LF3.groupby(['mutationinformation'])['drtype_numeric'].max()
|
||||
gene_LF3.head()
|
||||
|
||||
#%% Reset index: original indices
|
||||
#gene_LF3 = gene_LF3.reset_index()
|
||||
gene_LF3.index
|
||||
gene_LF3['mutationinformation'] = gene_LF3.index
|
||||
gene_LF3 = gene_LF3.set_index(['index_orig'])
|
||||
|
||||
gene_LF3[['mutationinformation']]
|
||||
gene_LF3.index
|
||||
#%% Revised counts
|
||||
gene_LF3['dst_mode'].value_counts()
|
||||
gene_LF3[drug].value_counts()
|
||||
|
@ -1688,7 +1680,6 @@ foo2['lineage_corrupt_ucount']
|
|||
foo2.index
|
||||
foo2 = foo2.set_index(['mutationinformation'])
|
||||
|
||||
|
||||
# now merge
|
||||
foo.index
|
||||
foo.index.nunique()
|
||||
|
@ -1699,6 +1690,7 @@ foo_copy['lineage_ucount'] = foo_copy['lineage']
|
|||
foo_copy.loc[foo2.index, 'lineage_ucount'] = foo2['lineage_corrupt_ucount']
|
||||
|
||||
#%%FIXME: do regex for lineage for meta data else the ; messes it up
|
||||
# MOVE THIS TO THE RELEVANT section
|
||||
#--------------------------
|
||||
# lineage multimode mode
|
||||
#--------------------------
|
||||
|
@ -1741,8 +1733,7 @@ c2 = foo2[foo2.loc[:, 'MUT'].isin(['A102P'])]
|
|||
c2['lineage_numeric'].value_counts()
|
||||
|
||||
|
||||
|
||||
#%% Lineage counts (including the ones containing multiple entries)
|
||||
#%% Lineage counts (including the ones containing multiple entries)[[<<< INCOMPLETE, TB finished]]
|
||||
|
||||
# Get information about how many distinct lineages each mutation comes from
|
||||
gene_LF3['lineage'].value_counts()
|
||||
|
@ -1781,4 +1772,13 @@ check1 = gene_LF3[['mutationinformation', 'lineage', 'lineage_ucount']]
|
|||
check2 = check1[check1.loc[:, 'mutationinformation'].isin(['H57D'])]
|
||||
check2.value_counts()
|
||||
|
||||
#%%
|
||||
#%% Reset index: original indices [WAS above section Revised counts]
|
||||
#gene_LF3 = gene_LF3.reset_index()
|
||||
gene_LF3.index
|
||||
gene_LF3['mutationinformation'] = gene_LF3.index
|
||||
gene_LF3 = gene_LF3.set_index(['index_orig'])
|
||||
|
||||
gene_LF3[['mutationinformation']]
|
||||
gene_LF3.index
|
||||
#%% ADD summary results
|
||||
#%% final output file with selected columns
|
Loading…
Add table
Add a link
Reference in a new issue