<commit_before>import os,base64
import scanpy.api as sc
import pandas as pd
import numpy as np
from igf_data.utils.fileutils import get_temp_dir,copy_local_file,remove_dir
from jinja2 import Template,Environment, FileSystemLoader,select_autoescape

class Scanpy_tool:
  '''
  A class for running scanpy tool and generating a html report for the input data
  
  :param project_name: A project name string for the report page
  :param sample_name: A sample name string for the report page
  :param matrix_file: A matrix file from cellranger count output
  :param gene_tsv: A genes.tsv file from cellranger count output
  :param barcode_tsv: A barcodes.tsv file from cellranger count output
  :param output_file: An output file path
  :param html_template_file: A html template for writing the report
  :param species_name: A species name for MT-genes lookup
  :param min_gene_count: Minimum gene count for data filtering, default 200
  :param min_cell_count: Minimum cell count for data filtering, default 3
  :param:<commit_msg>updated docstring<commit_after>import os,base64
import scanpy.api as sc
import pandas as pd
import numpy as np
from igf_data.utils.fileutils import get_temp_dir,copy_local_file,remove_dir
from jinja2 import Template,Environment, FileSystemLoader,select_autoescape

class Scanpy_tool:
  '''
  A class for running scanpy tool and generating a html report for the input data
  
  Reference notebooks
  https://github.com/theislab/scanpy_usage/blob/master/170505_seurat/seurat.ipynb
  https://github.com/theislab/scanpy_usage/blob/master/170503_zheng17/zheng17.ipynb

  :param project_name: A project name string for the report page
  :param sample_name: A sample name string for the report page
  :param matrix_file: A matrix file from cellranger count output
  :param gene_tsv: A genes.tsv file from cellranger count output
  :param barcode_tsv: A barcodes.tsv file from cellranger count output
  :param output_file: An output file path
  :param html_template_file: A html template for writing the report
  :param species_name: A species name for MT-genes lookup
  :param min_gene_count: Minimum gene count for data filtering, default 200
  :param min_cell_count: Minimum cell count for data filtering, default 3
  :param:
{'fraction_non_alphanumeric': 0.04806408544726302, 'fraction_numerical': 0.01335113484646195, 'mean_word_length': 5.125340599455041, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2747257', 'n_tokens_mistral': 693, 'n_tokens_neox': 657, 'n_words': 266}