Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TFSEE
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
GCRB
TFSEE
Commits
202ae5c7
Commit
202ae5c7
authored
8 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Patches
Plain Diff
fix syntax.
parent
ea30a0c5
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
rpkm.py
+2
-2
2 additions, 2 deletions
rpkm.py
rpkm_gro.py
+0
-1
0 additions, 1 deletion
rpkm_gro.py
with
2 additions
and
3 deletions
rpkm.py
+
2
−
2
View file @
202ae5c7
...
...
@@ -47,7 +47,7 @@ def rpkm(peak_file,aln_file,exp_name,columns):
columns
.
append
(
exp_name
)
## RPKM = numReads / (geneLength/1000 * totalNumReads/1,000,000 )
peak_counts
=
peak_file
.
multi_bam_coverage
(
bams
=
[
aln_file
])
total_counts
=
reduce
(
lambda
x
,
y
:
x
+
y
,
[
int
(
l
.
rstrip
(
'
\n
'
).
split
(
'
\t
'
)[
2
])
for
l
in
pysam
.
idxstats
(
aln_file
,
,
split_lines
=
True
)
)
])
total_counts
=
reduce
(
lambda
x
,
y
:
x
+
y
,
[
int
(
l
.
rstrip
(
'
\n
'
).
split
(
'
\t
'
)[
2
])
for
l
in
pysam
.
idxstats
(
aln_file
,
split_lines
=
True
)])
rpkm
=
peak_counts
.
each
(
normalized_to_length
,
3
,
float
(
math
.
pow
(
10
,
9
))
/
total_counts
).
saveas
(
"
test.bed
"
)
rpkm_df
=
rpkm
.
to_dataframe
()
#os.remove('test.bed')
...
...
@@ -61,7 +61,7 @@ def rpkm_strand(peak_file,aln_file,exp_name,columns):
columns
.
append
(
exp_name
)
## RPKM = numReads / (geneLength/1000 * totalNumReads/1,000,000 )
peak_counts
=
peak_file
.
multi_bam_coverage
(
bams
=
[
aln_file
],
s
=
True
)
total_counts
=
reduce
(
lambda
x
,
y
:
x
+
y
,
[
int
(
l
.
rstrip
(
'
\n
'
).
split
(
'
\t
'
)[
2
])
for
l
in
pysam
.
idxstats
(
aln_file
,
,
split_lines
=
True
)
)
])
total_counts
=
reduce
(
lambda
x
,
y
:
x
+
y
,
[
int
(
l
.
rstrip
(
'
\n
'
).
split
(
'
\t
'
)[
2
])
for
l
in
pysam
.
idxstats
(
aln_file
,
split_lines
=
True
)])
rpkm
=
peak_counts
.
each
(
normalized_to_length
,
6
,
float
(
math
.
pow
(
10
,
9
))
/
float
(
total_counts
)).
saveas
(
"
test.bed
"
)
rpkm_df
=
rpkm
.
to_dataframe
()
#os.remove('test.bed')
...
...
This diff is collapsed.
Click to expand it.
rpkm_gro.py
+
0
−
1
View file @
202ae5c7
...
...
@@ -48,7 +48,6 @@ def rpkm(peak_file,aln_file,exp_name,columns):
## RPKM = numReads / (geneLength/1000 * totalNumReads/1,000,000 )
peak_counts
=
peak_file
.
multi_bam_coverage
(
bams
=
[
aln_file
])
total_counts
=
reduce
(
lambda
x
,
y
:
x
+
y
,
[
int
(
l
.
rstrip
(
'
\n
'
).
split
(
'
\t
'
)[
2
])
for
l
in
pysam
.
idxstats
(
aln_file
,
split_lines
=
True
)])
print
total_counts
rpkm
=
peak_counts
.
each
(
normalized_to_length
,
3
,
float
(
math
.
pow
(
10
,
9
))
/
total_counts
).
saveas
(
"
test.bed
"
)
rpkm_df
=
rpkm
.
to_dataframe
()
#os.remove('test.bed')
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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