Skip to content

Commit

Permalink
Fix annotation processing - closes #93
Browse files Browse the repository at this point in the history
  • Loading branch information
dburkhardt committed Jan 31, 2023
1 parent 8e3c0df commit 4416843
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions notebooks/pbmc_multiome_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1015,12 +1015,12 @@
"import pybiomart as pbm\n",
"dataset = pbm.Dataset(name='hsapiens_gene_ensembl', host='http://www.ensembl.org')\n",
"annot = dataset.query(attributes=['chromosome_name', 'transcription_start_site', 'strand', 'external_gene_name', 'transcript_biotype'])\n",
"annot['Chromosome/scaffold name'] = annot['Chromosome/scaffold name'].to_numpy(dtype = str)\n",
"filter = annot['Chromosome/scaffold name'].str.contains('CHR|GL|JH|MT')\n",
"annot = annot[~filter]\n",
"annot['Chromosome/scaffold name'] = annot['Chromosome/scaffold name'].str.replace(r'(\\b\\S)', r'chr\\1')\n",
"annot.columns=['Chromosome', 'Start', 'Strand', 'Gene', 'Transcript_type']\n",
"annot = annot[annot.Transcript_type == 'protein_coding']\n",
"annot['Chromosome'] = annot['Chromosome'].astype(str)\n",
"mask = ~annot['Chromosome'].str.contains('CHR|GL|JH|MT') & (annot['Transcript_type'] == 'protein_coding')\n",
"annot = annot[mask].reset_index(drop=True)\n",
"annot['Chromosome'] = annot['Chromosome'].apply(lambda x: f\"chr{x}\" if not x.startswith(\"KI\") else x)\n",
"\n",
"from pycisTopic.qc import *\n",
"path_to_regions = {'10x_pbmc':os.path.join(work_dir, 'scATAC/consensus_peak_calling/consensus_regions.bed')}\n",
"\n",
Expand Down

0 comments on commit 4416843

Please sign in to comment.