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
Holland Computing Center
chipathlon
Commits
c59ee118
Commit
c59ee118
authored
Feb 23, 2016
by
aknecht2
Browse files
Updated import script, fixed progress utility.
parent
b2f7f01d
Changes
2
Hide whitespace changes
Inline
Side-by-side
chipathlon/utils.py
View file @
c59ee118
...
...
@@ -5,5 +5,4 @@ def progress(current, end):
hashes
=
"#"
*
int
(
round
(
percent
*
20
))
spaces
=
" "
*
(
20
-
len
(
hashes
))
sys
.
stdout
.
write
(
"
\r
Processed %s / %s entries. [%s] %s%%"
%
(
current
,
end
,
hashes
+
spaces
,
int
(
round
(
percent
*
100
))))
sys
.
stdout
.
flush
()
meta/import.py
View file @
c59ee118
...
...
@@ -11,7 +11,7 @@ parser.add_argument("--host", dest="host", default="hcc-anvil-241-41.unl.edu", r
parser
.
add_argument
(
"--drop"
,
dest
=
"drop"
,
default
=
False
,
action
=
"store_true"
,
help
=
"Drop data if it exists."
)
args
=
parser
.
parse_args
()
# Everything in a db named chipseq
# Everything in a db named chipseq
# Set up connection and authenticate
client
=
MongoClient
(
args
.
host
)
...
...
@@ -35,9 +35,9 @@ organism = {
# Loop through experiments to create samples
cursor
=
db
.
experiments
.
find
({
"target"
:
{
"$exists"
:
True
},
"revoked_files.0"
:
{
"$exists"
:
False
},
"assembly.0"
:
{
"$exists"
:
True
},
"target"
:
{
"$exists"
:
True
},
"revoked_files.0"
:
{
"$exists"
:
False
},
"assembly.0"
:
{
"$exists"
:
True
},
"assembly.1"
:
{
"$exists"
:
False
}
})
...
...
@@ -52,6 +52,8 @@ for i,document in enumerate(cursor):
if
"/targets/H"
in
document
[
"target"
]:
doc
[
"histone_modification"
]
=
document
[
"target"
].
split
(
"/"
)[
2
][:
2
]
doc
[
"transcription_factor"
]
=
document
[
"target"
].
split
(
"/"
)[
2
][
2
:].
split
(
"-"
)[
0
]
elif
document
[
"target"
].
split
(
"/"
)[
2
].
split
(
"-"
)[
0
].
lower
()
==
"control"
:
doc
[
"control"
]
=
True
else
:
doc
[
"transcription_factor"
]
=
document
[
"target"
].
split
(
"/"
)[
2
].
split
(
"-"
)[
0
]
doc
[
"cell_type"
]
=
document
[
"biosample_term_name"
]
...
...
@@ -61,4 +63,3 @@ for i,document in enumerate(cursor):
progress
(
total
,
total
)
print
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