Skip to content

Commit

Permalink
run pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnaChristina committed Oct 5, 2023
1 parent 0041e41 commit aefddec
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 43 deletions.
2 changes: 1 addition & 1 deletion jupyter-book/surface_protein/annotation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"source": [
"adata = sc.read(\n",
" \"cite_preprocessed.h5ad\",\n",
" backup_url='https://figshare.com/ndownloader/files/42569866'\n",
" backup_url=\"https://figshare.com/ndownloader/files/42569866\",\n",
")"
]
},
Expand Down
10 changes: 6 additions & 4 deletions jupyter-book/surface_protein/batch_correction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
"source": [
"cite_xdbt = pooch.retrieve(\n",
" url=\"https://figshare.com/ndownloader/files/41452434\",\n",
" fname='cite_doublet_removal_xdbt.h5mu', path='.',\n",
" known_hash=None, progressbar=True, \n",
" fname=\"cite_doublet_removal_xdbt.h5mu\",\n",
" path=\".\",\n",
" known_hash=None,\n",
" progressbar=True,\n",
")"
]
},
Expand All @@ -88,7 +90,7 @@
"metadata": {},
"outputs": [],
"source": [
"mdata = mu.read('cite_doublet_removal_xdbt.h5mu')"
"mdata = mu.read(\"cite_doublet_removal_xdbt.h5mu\")"
]
},
{
Expand Down Expand Up @@ -390,7 +392,7 @@
"metadata": {},
"outputs": [],
"source": [
"mdata.write('cite_batch_correction.h5mu')"
"mdata.write(\"cite_batch_correction.h5mu\")"
]
},
{
Expand Down
16 changes: 7 additions & 9 deletions jupyter-book/surface_protein/dimensionality_reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@
"source": [
"cite_xdbt = pooch.retrieve(\n",
" url=\"https://figshare.com/ndownloader/files/41452434\",\n",
" fname='cite_doublet_removal_xdbt.h5mu', path='.',\n",
" known_hash=None, progressbar=True, \n",
" fname=\"cite_doublet_removal_xdbt.h5mu\",\n",
" path=\".\",\n",
" known_hash=None,\n",
" progressbar=True,\n",
")"
]
},
Expand All @@ -102,7 +104,7 @@
},
"outputs": [],
"source": [
"mdata = mu.read('cite_doublet_removal_xdbt.h5mu')"
"mdata = mu.read(\"cite_doublet_removal_xdbt.h5mu\")"
]
},
{
Expand Down Expand Up @@ -178,11 +180,7 @@
}
],
"source": [
"temp = (\n",
" mdata[\"prot\"]\n",
" .var.loc[~mdata[\"prot\"].var.index.isin(isotype_controls), :]\n",
" .index\n",
")\n",
"temp = mdata[\"prot\"].var.loc[~mdata[\"prot\"].var.index.isin(isotype_controls), :].index\n",
"temp"
]
},
Expand Down Expand Up @@ -467,7 +465,7 @@
"metadata": {},
"outputs": [],
"source": [
"mdata.write('cite_dimensionality_reduction.h5mu')"
"mdata.write(\"cite_dimensionality_reduction.h5mu\")"
]
},
{
Expand Down
10 changes: 6 additions & 4 deletions jupyter-book/surface_protein/doublet_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@
"source": [
"cite_filtered = pooch.retrieve(\n",
" url=\"https://figshare.com/ndownloader/files/41452443\",\n",
" fname='cite_normalization.h5mu', path='.',\n",
" known_hash=None, progressbar=True, \n",
" fname=\"cite_normalization.h5mu\",\n",
" path=\".\",\n",
" known_hash=None,\n",
" progressbar=True,\n",
")"
]
},
Expand All @@ -82,7 +84,7 @@
"metadata": {},
"outputs": [],
"source": [
"mdata = mu.read('cite_normalization.h5mu')"
"mdata = mu.read(\"cite_normalization.h5mu\")"
]
},
{
Expand Down Expand Up @@ -378,7 +380,7 @@
"metadata": {},
"outputs": [],
"source": [
"mdata.write('cite_doublet_removal_xdbt.h5mu')"
"mdata.write(\"cite_doublet_removal_xdbt.h5mu\")"
]
},
{
Expand Down
15 changes: 9 additions & 6 deletions jupyter-book/surface_protein/normalization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
"import scanpy as sc\n",
"\n",
"import warnings\n",
"warnings.filterwarnings('ignore')\n",
"\n",
"warnings.filterwarnings(\"ignore\")\n",
"\n",
"sc.settings.verbosity = 0\n",
"sc.settings.set_figure_params(\n",
Expand All @@ -79,8 +80,10 @@
"source": [
"cite_quality_control = pooch.retrieve(\n",
" url=\"https://figshare.com/ndownloader/files/41452449\",\n",
" fname='cite_quality_control.h5mu', path='.',\n",
" known_hash=None, progressbar=True, \n",
" fname=\"cite_quality_control.h5mu\",\n",
" path=\".\",\n",
" known_hash=None,\n",
" progressbar=True,\n",
")"
]
},
Expand Down Expand Up @@ -131,7 +134,7 @@
}
],
"source": [
"mdata = mu.read('cite_quality_control.h5mu')\n",
"mdata = mu.read(\"cite_quality_control.h5mu\")\n",
"mdata"
]
},
Expand Down Expand Up @@ -172,7 +175,7 @@
}
],
"source": [
"mdata_raw = mu.read('cite_raw.h5mu')\n",
"mdata_raw = mu.read(\"cite_raw.h5mu\")\n",
"mdata_raw"
]
},
Expand Down Expand Up @@ -394,7 +397,7 @@
"metadata": {},
"outputs": [],
"source": [
"mdata.write('cite_normalization.h5mu')"
"mdata.write(\"cite_normalization.h5mu\")"
]
},
{
Expand Down
42 changes: 23 additions & 19 deletions jupyter-book/surface_protein/quality_control.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@
"source": [
"# ToDo adjust this\n",
"rna = sc.read_10x_h5(\n",
" filename=\"rna_filtered_feature_bc_matrix.h5\", \n",
" backup_url='https://figshare.com/ndownloader/files/39546196'\n",
" filename=\"rna_filtered_feature_bc_matrix.h5\",\n",
" backup_url=\"https://figshare.com/ndownloader/files/39546196\",\n",
")\n",
"prot = sc.read_10x_h5(\n",
" filename=\"prot_filtered_feature_bc_matrix.h5\", \n",
" backup_url='https://figshare.com/ndownloader/files/42569008'\n",
" filename=\"prot_filtered_feature_bc_matrix.h5\",\n",
" backup_url=\"https://figshare.com/ndownloader/files/42569008\",\n",
")"
]
},
Expand Down Expand Up @@ -198,12 +198,12 @@
"source": [
"# ToDo adjust this\n",
"rna_raw = sc.read_10x_h5(\n",
" filename=\"rna_raw_feature_bc_matrix.h5\", \n",
" backup_url='https://figshare.com/ndownloader/files/39546217'\n",
" filename=\"rna_raw_feature_bc_matrix.h5\",\n",
" backup_url=\"https://figshare.com/ndownloader/files/39546217\",\n",
")\n",
"prot_raw = sc.read_10x_h5(\n",
" filename=\"prot_raw_feature_bc_matrix.h5\", \n",
" backup_url='https://figshare.com/ndownloader/files/42569026'\n",
" filename=\"prot_raw_feature_bc_matrix.h5\",\n",
" backup_url=\"https://figshare.com/ndownloader/files/42569026\",\n",
")\n",
"mdata_raw = mu.MuData({\"rna\": rna_raw, \"prot\": prot_raw})\n",
"mdata_raw"
Expand All @@ -228,8 +228,10 @@
"source": [
"cite_filtered = pooch.retrieve(\n",
" url=\"https://figshare.com/ndownloader/files/41452287\",\n",
" fname='cite_filtered.h5mu', path='.',\n",
" known_hash=None, progressbar=True, \n",
" fname=\"cite_filtered.h5mu\",\n",
" path=\".\",\n",
" known_hash=None,\n",
" progressbar=True,\n",
")"
]
},
Expand All @@ -242,8 +244,10 @@
"source": [
"cite_raw = pooch.retrieve(\n",
" url=\"https://figshare.com/ndownloader/files/41452308\",\n",
" fname='cite_raw.h5mu', path='.',\n",
" known_hash=None, progressbar=True, \n",
" fname=\"cite_raw.h5mu\",\n",
" path=\".\",\n",
" known_hash=None,\n",
" progressbar=True,\n",
")"
]
},
Expand Down Expand Up @@ -284,7 +288,7 @@
}
],
"source": [
"mdata = md.read_h5mu('cite_filtered.h5mu')\n",
"mdata = md.read_h5mu(\"cite_filtered.h5mu\")\n",
"mdata"
]
},
Expand Down Expand Up @@ -325,7 +329,7 @@
}
],
"source": [
"mdata_raw = md.read_h5mu('cite_raw.h5mu')\n",
"mdata_raw = md.read_h5mu(\"cite_raw.h5mu\")\n",
"mdata_raw"
]
},
Expand Down Expand Up @@ -570,9 +574,7 @@
],
"source": [
"sns.displot(\n",
" mdata[\"prot\"]\n",
" .obs.query(\"total_counts>20000 and total_counts<100000\")\n",
" .total_counts\n",
" mdata[\"prot\"].obs.query(\"total_counts>20000 and total_counts<100000\").total_counts\n",
")"
]
},
Expand Down Expand Up @@ -620,7 +622,9 @@
],
"source": [
"sns.displot(\n",
" mdata_raw[\"rna\"].obs.sample(frac=0.01).query(\"total_counts<100000 and total_counts>10\"),\n",
" mdata_raw[\"rna\"]\n",
" .obs.sample(frac=0.01)\n",
" .query(\"total_counts<100000 and total_counts>10\"),\n",
" x=\"total_counts\",\n",
" log_scale=True,\n",
" hue=\"donor\",\n",
Expand Down Expand Up @@ -1139,7 +1143,7 @@
"metadata": {},
"outputs": [],
"source": [
"mdata.write('cite_quality_control.h5mu')"
"mdata.write(\"cite_quality_control.h5mu\")"
]
},
{
Expand Down

0 comments on commit aefddec

Please sign in to comment.