Skip to content
Snippets Groups Projects
Commit bd8db1a4 authored by Reto Tschannen's avatar Reto Tschannen
Browse files

chore:try to resolve flake8 errors

parent 6b566324
No related branches found
No related tags found
1 merge request!13feat: add function to calculate mean and variance
Pipeline #13851 failed
...@@ -9,22 +9,24 @@ import matplotlib.pyplot as plt ...@@ -9,22 +9,24 @@ import matplotlib.pyplot as plt
def mean_variance(filepath: str, output_dir: str = os.getcwd()+'/') -> str: def mean_variance(filepath: str, output_dir: str = os.getcwd()+'/') -> str:
"""Given the counts observed for a given gene across all cells, """For observed gene counts calcuclate mean and var.
calculate the mean and variance.
! At the moment the function does not check the import files format, ! At the moment the function does not check the import files format,
be careful, and only add text files in the format geneid number_of_transcipts ! be careful, and only add text files in the format
geneid number_of_transcipts !
Args: Args:
directory with text files of gene expression counts in individual cells. directory with text files of gene expression
counts in individual cells.
Returns: Returns:
1. Path to Csv-formatted table with GeneID, Mean, Variance of the count, and 1. Path to Csv-formatted table with GeneID, Mean, Variance of the
Scatterplot of mean vs variance for all genes. count, and Scatterplot of mean vs variance for all genes.
Raises: Raises:
ValueError: If there are no files in directory ValueError: If there are no files in directory
""" """
# Open each file in the input directory, raises error if no file is found # Open each file in the input directory, raises error if no file is found
files = [file for file in glob(filepath)] files = [file for file in glob(filepath)]
......
"""Parses meanvariancefunction""" """Parses meanvariancefunction."""
import argparse import argparse
from meanvariancefunction import mean_variance as mv from meanvariancefunction import mean_variance as mv
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment