Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scRNA-seq-simulation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zavolan_group
pipelines
scRNA-seq-simulation
Commits
aa8c35fb
Commit
aa8c35fb
authored
3 years ago
by
Reto Tschannen
Browse files
Options
Downloads
Patches
Plain Diff
chore:try5 fixing flake8 errors
parent
572d0491
No related branches found
No related tags found
1 merge request
!13
feat: add function to calculate mean and variance
Pipeline
#13858
failed
3 years ago
Stage: qc
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/meanvariancefunction.py
+4
-3
4 additions, 3 deletions
src/meanvariancefunction.py
with
4 additions
and
3 deletions
src/meanvariancefunction.py
+
4
−
3
View file @
aa8c35fb
...
...
@@ -11,13 +11,14 @@ import matplotlib.pyplot as plt
def
mean_variance
(
filepath
:
str
,
output_dir
:
str
=
os
.
getcwd
()
+
'
/
'
)
->
str
:
"""
For observed gene counts calcuclate mean and var.
!
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
!
geneid number_of_transcipts
.
Args:
directory with text files of gene expression
counts in individual cells.
Returns:
1. Path to Csv-formatted table with GeneID, Mean, Variance of the
count, and Scatterplot of mean vs variance for all genes.
...
...
@@ -26,8 +27,8 @@ def mean_variance(filepath: str, output_dir: str = os.getcwd()+'/') -> str:
ValueError: If there are no files in directory
"""
files
=
[
file
for
file
in
glob
(
filepath
)]
# Open each file in the input directory, raises error if no file is found
files
=
[
file
for
file
in
glob
(
filepath
)]
if
len
(
files
)
==
0
:
raise
ValueError
(
'
No files in directory:
'
,
filepath
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment