Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OBITools3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
20
Issues
20
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
7dcbc340
Commit
7dcbc340
authored
Jul 30, 2020
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import: fixed entry count estimation when importing fastq files
parent
db2202c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
utils.pxd
python/obitools3/utils.pxd
+1
-1
utils.pyx
python/obitools3/utils.pyx
+4
-4
No files found.
python/obitools3/utils.pxd
View file @
7dcbc340
...
...
@@ -2,7 +2,7 @@
from obitools3.dms.capi.obitypes cimport obitype_t, index_t
cpdef bytes format_
separator
(bytes format)
cpdef bytes format_
uniq_pattern
(bytes format)
cpdef int count_entries(file, bytes format)
cdef obi_errno_to_exception(index_t line_nb=*, object elt_id=*, str error_message=*)
...
...
python/obitools3/utils.pyx
View file @
7dcbc340
...
...
@@ -24,11 +24,11 @@ import glob
import gzip
cpdef bytes format_
separator
(bytes format):
cpdef bytes format_
uniq_pattern
(bytes format):
if format == b"fasta":
return b"\n>"
elif format == b"fastq":
return b"\n
@
"
return b"\n
\+\n
"
elif format == b"ngsfilter" or format == b"tabular":
return b"\n"
elif format == b"genbank" or format == b"embl":
...
...
@@ -42,7 +42,7 @@ cpdef bytes format_separator(bytes format):
cpdef int count_entries(file, bytes format):
try:
sep = format_
separator
(format)
sep = format_
uniq_pattern
(format)
if sep is None:
return -1
sep = re.compile(sep)
...
...
@@ -72,7 +72,7 @@ cpdef int count_entries(file, bytes format):
return -1
mmapped_file = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
total_count += len(re.findall(sep, mmapped_file))
if format != b"ngsfilter" and format != b"tabular" and format != b"embl" and format != b"genbank":
if format != b"ngsfilter" and format != b"tabular" and format != b"embl" and format != b"genbank"
and format != b"fastq"
:
total_count += 1 # adding +1 for 1st entry because separators include \n (ngsfilter and tabular already count one more because of last \n)
except:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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