Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fexi_splitter
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
Model registry
Operate
Environments
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
LBMC
RMI2
fexi_splitter
Commits
08198f79
Verified
Commit
08198f79
authored
6 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
rmi_splitter.py: fix parse_ntuple_fastq to work with Reads class
parent
60f2b426
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rmi_splitter/rmi_splitter.py
+25
-12
25 additions, 12 deletions
src/rmi_splitter/rmi_splitter.py
with
25 additions
and
12 deletions
src/rmi_splitter/rmi_splitter.py
+
25
−
12
View file @
08198f79
...
...
@@ -589,15 +589,22 @@ def write_seqs(reads_list, fouts, config, sample, verbose=False):
ntuple
+=
1
def
read_reads
(
fins
,
reads_list
,
ntuple
):
def
read_reads
(
fins
,
reads_list
,
ntuple
,
line_number
):
"""
read a read from handle
params: fin file handle
return: read str()
"""
for
reads
in
ntuple
:
reads_list
[
reads
-
1
].
read
(
fin
=
fins
[
reads
-
1
])
if
line_number
==
0
:
for
reads
in
ntuple
:
reads_list
[
reads
-
1
].
header
=
fins
[
reads
-
1
]
if
line_number
==
1
:
for
reads
in
ntuple
:
reads_list
[
reads
-
1
].
seq
=
fins
[
reads
-
1
]
if
line_number
==
3
:
for
reads
in
ntuple
:
reads_list
[
reads
-
1
].
str2qual
(
fins
[
reads
-
1
])
return
reads_list
...
...
@@ -616,6 +623,7 @@ def parse_ntuples_fastq(ffastqs,
barcode_dictionary
=
create_barcode_dictionaries
(
config
=
config
,
mismatch
=
mismatch
)
sequences_number
=
0
line_number
=
0
reads_list
=
list
()
for
read
in
ntuple
:
reads_list
.
append
(
Reads
())
...
...
@@ -624,16 +632,21 @@ def parse_ntuples_fastq(ffastqs,
fins
=
list_ffastqs
,
ntuple
=
ntuple
,
reads_list
=
reads_list
,
line_number
=
line_number
,
)
sample
=
assign_reads
(
reads_list
=
reads_list
,
config
=
config
,
barcode_dictionary
=
barcode_dictionary
,
verbose
=
verbose
)
write_seqs
(
reads_list
=
reads_list
,
fouts
=
fouts
,
config
=
config
,
sample
=
sample
,
verbose
=
verbose
)
if
line_number
==
3
:
sample
=
assign_reads
(
reads_list
=
reads_list
,
config
=
config
,
barcode_dictionary
=
barcode_dictionary
,
verbose
=
verbose
)
write_seqs
(
reads_list
=
reads_list
,
fouts
=
fouts
,
config
=
config
,
sample
=
sample
,
verbose
=
verbose
)
line_number
=
0
else
:
line_number
+=
1
sequences_number
+=
1
print
(
"
number of processed sequences:
"
+
str
(
sequences_number
-
1
)
+
...
...
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