Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bioinfo_utils
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
bioinfo_utils
Commits
fb1e5043
Commit
fb1e5043
authored
7 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Demultiplex in gzipped format.
parent
d7b5fc52
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fastq-demultiplexing/Python/bin/qaf-demux
+6
-4
6 additions, 4 deletions
fastq-demultiplexing/Python/bin/qaf-demux
with
6 additions
and
4 deletions
fastq-demultiplexing/Python/bin/qaf-demux
+
6
−
4
View file @
fb1e5043
...
...
@@ -12,6 +12,7 @@ import argparse
import
fileinput
import
os
from
itertools
import
islice
from
gzip
import
open
as
gzopen
# from qaf_demux.libqafdemux import parse_fastq
OPD
=
os
.
path
.
dirname
...
...
@@ -70,15 +71,16 @@ def main():
bc_len
=
len
(
barcode
)
else
:
assert
(
len
(
barcode
)
==
bc_len
),
f
"
len(
{
barcode
}
) !=
{
bc_len
}
"
outfiles
[
barcode
]
=
open
(
OPJ
(
out_dir
,
f
"
{
barcode
}
.fastq
"
),
"
w
"
)
outfiles
[
barcode
]
=
gz
open
(
OPJ
(
out_dir
,
f
"
{
barcode
}
.fastq
.gz
"
),
"
w
b
"
)
if
not
outfiles
:
print
(
"
No barcode given.
"
)
exit
(
0
)
outfiles
[
"
undetermined
"
]
=
open
(
OPJ
(
out_dir
,
f
"
undetermined.fastq
"
),
"
w
"
)
outfiles
[
"
undetermined
"
]
=
gz
open
(
OPJ
(
out_dir
,
f
"
undetermined.fastq
.gz
"
),
"
w
b
"
)
bc_start
=
args
.
barcode_start
-
1
def
bc_prob_profile
(
seq
,
qual
):
# if bytes instead of string
# return [(letter, 10 ** ((33 - quality) / 10))
return
[(
letter
,
10
**
((
33
-
ord
(
quality
))
/
10
))
for
letter
,
quality
...
...
@@ -125,7 +127,7 @@ def main():
best_prob
,
best_diff
)
=
(
barcode
,
this_prob
,
this_diff
)
bc_comments
=
f
"
{
best_bc
}
:
{
best_prob
}
:
{
best_diff
}
"
fq_repr
=
f
"
{
name
}
{
bc_comments
}
\n
{
seq
}
\n
+
\n
{
qual
}
\n
"
fq_repr
=
f
"
{
name
}
{
bc_comments
}
\n
{
seq
}
\n
+
\n
{
qual
}
\n
"
.
encode
(
"
utf-8
"
)
if
best_diff
<=
args
.
max_diff
:
outfiles
[
best_bc
].
write
(
fq_repr
)
else
:
...
...
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