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
bd8db1a4
Commit
bd8db1a4
authored
3 years ago
by
Reto Tschannen
Browse files
Options
Downloads
Patches
Plain Diff
chore:try to resolve flake8 errors
parent
6b566324
No related branches found
No related tags found
1 merge request
!13
feat: add function to calculate mean and variance
Pipeline
#13851
failed
3 years ago
Stage: qc
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/meanvariancefunction.py
+8
-6
8 additions, 6 deletions
src/meanvariancefunction.py
src/parser_meanvar.py
+1
-1
1 addition, 1 deletion
src/parser_meanvar.py
with
9 additions
and
7 deletions
src/meanvariancefunction.py
+
8
−
6
View file @
bd8db1a4
...
@@ -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
)]
...
...
This diff is collapsed.
Click to expand it.
src/parser_meanvar.py
+
1
−
1
View file @
bd8db1a4
"""
Parses meanvariancefunction
"""
"""
Parses meanvariancefunction
.
"""
import
argparse
import
argparse
from
meanvariancefunction
import
mean_variance
as
mv
from
meanvariancefunction
import
mean_variance
as
mv
...
...
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