Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
084611b5
Commit
084611b5
authored
Aug 27, 2014
by
bow
Browse files
Update existing gentrap scripts to the new namespace
parent
f28f3f69
Changes
8
Hide whitespace changes
Inline
Side-by-side
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/
pipelines/gentrap/
scripts/aggr_base_count.R
→
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/aggr_base_count.R
View file @
084611b5
File moved
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/
pipelines/gentrap/
scripts/bam_rna.py
→
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/bam_rna.py
View file @
084611b5
File moved
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/
pipelines/gentrap/
scripts/gc_dist.py
→
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/gc_dist.py
View file @
084611b5
File moved
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/hist2count.py
0 → 100755
View file @
084611b5
#!/usr/bin/env python
"""
Convert a histogram generated by coverageBed to counts per region.
A histogram file can be generated with the following command:
coverageBed -split -hist -abam sample.bam -b selection.bed > selection.hist
The output consists of four columns:
- Chromosome name.
- Start position.
- End position.
- Number of nucleotides mapped to this region.
- Normalised expression for this region.
If the -c option is used, additional columns can be added.
"""
import
argparse
import
sys
def
hist2count
(
inputHandle
,
outputHandle
,
copy
):
"""
Split a fasta file on length.
@arg inputHandle: Open readable handle to a histogram file.
@type inputHandle: stream
@arg outputHandle: Open writable handle to the counts file.
@type outputHandle: stream
@arg outputHandle: List of columns to copy to the output file.
@type outputHandle: list[int]
"""
def
__copy
():
copyList
=
""
for
i
in
copy
:
copyList
+=
"
\t
%s"
%
data
[
i
]
return
copyList
#__copy
def
__write
():
outputHandle
.
write
(
"%s
\t
%i
\t
%i
\t
%i
\t
%f%s
\n
"
%
(
chromosome
,
start
,
end
,
count
,
float
(
count
)
/
(
end
-
start
),
copyList
))
chromosome
=
""
start
=
0
end
=
0
count
=
0
for
line
in
inputHandle
.
readlines
():
data
=
line
.
split
()
if
not
data
[
0
]
==
"all"
:
start_temp
=
int
(
data
[
1
])
end_temp
=
int
(
data
[
2
])
if
data
[
0
]
!=
chromosome
or
start_temp
!=
start
or
end_temp
!=
end
:
if
chromosome
:
__write
()
chromosome
=
data
[
0
]
start
=
start_temp
end
=
end_temp
count
=
0
copyList
=
__copy
()
#if
count
+=
int
(
data
[
-
4
])
*
int
(
data
[
-
3
])
#if
#for
__write
()
#hist2count
def
main
():
"""
Main entry point.
"""
usage
=
__doc__
.
split
(
"
\n\n\n
"
)
parser
=
argparse
.
ArgumentParser
(
formatter_class
=
argparse
.
RawDescriptionHelpFormatter
,
description
=
usage
[
0
],
epilog
=
usage
[
1
])
parser
.
add_argument
(
"-i"
,
dest
=
"input"
,
type
=
argparse
.
FileType
(
"r"
),
default
=
sys
.
stdin
,
help
=
"histogram input file (default=<stdin>)"
)
parser
.
add_argument
(
"-o"
,
dest
=
"output"
,
type
=
argparse
.
FileType
(
"w"
),
default
=
sys
.
stdout
,
help
=
"file used as output (default=<stdout>)"
)
parser
.
add_argument
(
"-c"
,
dest
=
"copy"
,
type
=
int
,
nargs
=
"+"
,
default
=
[],
help
=
"copy a column to the output file"
)
args
=
parser
.
parse_args
()
hist2count
(
args
.
input
,
args
.
output
,
args
.
copy
)
#main
if
__name__
==
'__main__'
:
main
()
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/
pipelines/gentrap/
scripts/insert_dist.py
→
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/insert_dist.py
View file @
084611b5
File moved
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/
pipelines/gentrap/
scripts/parse_cuffcmp.py
→
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/parse_cuffcmp.py
View file @
084611b5
File moved
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/
pipelines/gentrap/
scripts/pdf_report.py
→
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/pdf_report.py
View file @
084611b5
File moved
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/
pipelines/gentrap/
scripts/rna_metrics.py
→
biopet-framework/src/main/scripts/nl/lumc/sasc/biopet/scripts/rna_metrics.py
View file @
084611b5
File moved
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment