Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OBITools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
28
Issues
28
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools
Commits
6bfec50f
Commit
6bfec50f
authored
Mar 21, 2015
by
Eric Coissac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debug the reading of gziped files, change the doc of obipr2 and obisilva
parent
28dad843
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
64 deletions
+32
-64
distutils.ext/obidistutils/serenity/checkpip.py
distutils.ext/obidistutils/serenity/checkpip.py
+2
-30
sample/CAA64141.fasta
sample/CAA64141.fasta
+0
-8
setup.py
setup.py
+1
-1
src/obipr2.py
src/obipr2.py
+3
-3
src/obisilva.py
src/obisilva.py
+2
-2
src/obitools/options/__init__.py
src/obitools/options/__init__.py
+7
-6
src/obitools/options/_options.pyx
src/obitools/options/_options.pyx
+1
-1
src/obitools/utils/__init__.py
src/obitools/utils/__init__.py
+14
-11
src/obitools/utils/_utils.pyx
src/obitools/utils/_utils.pyx
+1
-1
src/obitools/version.py
src/obitools/version.py
+1
-1
No files found.
distutils.ext/obidistutils/serenity/checkpip.py
View file @
6bfec50f
...
...
@@ -56,41 +56,13 @@ def get_a_pip_module(minversion=PIP_MINVERSION):
tmpdir
=
get_serenity_dir
()
if
not
local_pip
:
# if not is_pip_installed(minversion):
# try:
# if 'http_proxy' in os.environ and 'https_proxy' not in os.environ:
# os.environ['https_proxy']=os.environ['http_proxy']
# pipinstallscript = urllib2.urlopen('https://bootstrap.pypa.io/get-pip.py')
# except:
# raise DistutilsError,"Pip (>=%s) is not install on your system and I cannot install it" % PIP_MINVERSION
#
# script = pipinstallscript.read()
# getpip_py = os.path.join(tmpdir, "get-pip.py")
# with open(getpip_py, "wb") as fp:
# log.info("Downloading temporary pip...")
# fp.write(script)
# log.info(" done.")
#
# getpip = imp.load_source("getpip",getpip_py)
# ZIPFILE=getpip.ZIPFILE
#
# pip_zip = os.path.join(tmpdir, "pip.zip")
# with open(pip_zip, "wb") as fp:
# log.info("Installing temporary pip...")
# fp.write(base64.decodestring(ZIPFILE))
# log.info(" done.")
#
# # Add the zipfile to sys.path so that we can import it
# sys.path.insert(0,pip_zip)
# zi = zipimport.zipimporter(pip_zip)
# pip = zi.load_module("pip")
# pip = importlib.import_module('obidistutils.serenity.pip')
# else:
serenity
=
importlib
.
import_module
(
'obidistutils.serenity'
)
sys
.
path
.
insert
(
0
,
os
.
path
.
dirname
(
serenity
.
__file__
))
pip
=
importlib
.
import_module
(
'pip'
)
local_pip
.
append
(
pip
)
else
:
pip
=
local_pip
[
-
1
]
# Prepare the CERT certificat for https download
...
...
sample/CAA64141.fasta
deleted
100644 → 0
View file @
28dad843
>CAA64141 taxid=4932; unnamed protein product [Saccharomyces cerevisiae]
MGVSANLFVKQRGSTTALKQPKEIGFYSRTKDEEYLISDDTNLNYYYLPDAELDRKLDLS
SGFQKFKDYYKDFEDRCSLRGLLETIESSERHKGKKINADIITFRGIARKLISCAFDSPS
FNTVDLRIVSFNGQLFIKEVPEAVNAAKASSATEAGRNINQDLNVFTGYKFETLATLSNP
LQYTPREVIEKRTKRIVSHGDEYISVVRTGVGNCKLILGAEVDCIFDFKENGRDNLKHYA
ELKCTQQVANISDTHKFERKLFRTWLQCFLVGIPRIIYGFKDDHYVLKTVEEFSTEEVPV
LLKNNNPQVGSACLEAIKWYGLLTEWLLKMIPRDEDPHSQIRAFKLVFENNHLRLSEIEE
SDEEYSGLIDGEHILSNGFKEWRKSLK
setup.py
View file @
6bfec50f
...
...
@@ -19,7 +19,7 @@ from os import path
PACKAGE
=
"OBITools"
VERSION
=
"1.1.
4
"
VERSION
=
"1.1.
5
"
AUTHOR
=
'Eric Coissac'
EMAIL
=
'eric@coissac.eu'
URL
=
'metabarcoding.org/obitools'
...
...
src/obipr2.py
View file @
6bfec50f
#!/usr/local/bin/python
'''
:py:mod:`obipr2`:
manages taxonomic databases
==================================================
:py:mod:`obipr2`:
converts silva database into an ecoPCR database
==================================================
===============
:py:mod:`obipr2`: converts and optionally download the `PR2 database <http://ssu-rrna.org/pr2/>`_
into an ecoPCR database. The formated database include the taxonomy as defined by the PR2 authors.
.. warning::
Take care that the numeric taxids associated to the sequences are
internal
Take care that the numeric taxids associated to the sequences are
specific
to this **PR2** database and not compatible with the NCBI taxids.
The taxids present in a version of the **PR2** database are are just valid for
this version of the database and not compatible with the taxids used in another version
...
...
src/obisilva.py
View file @
6bfec50f
...
...
@@ -7,7 +7,7 @@
into an ecoPCR database. The formated database include the taxonomy as defined by the Silva authors.
.. warning::
Take care that the numeric taxids associated to the sequences are
internal
Take care that the numeric taxids associated to the sequences are
specific
to this Silva database and not compatible with the NCBI taxids.
The taxids present in a version of the Silva database (*i.e* ssu, lsu, parc, ref...)
are are just valid for this version of the database and not compatible
...
...
@@ -140,6 +140,7 @@ def getHyperlink(url):
return
links
def
silvaURLS
(
options
):
global
siteurl
if
options
.
local
is
not
None
:
archive
=
dict
((
f
,
f
)
for
f
in
listdir
(
options
.
local
)
if
isfile
(
join
(
options
.
local
,
f
)))
...
...
@@ -192,7 +193,6 @@ def silvaURLS(options):
{
True
:
"nr_"
,
False
:
""
}[
options
.
nr
],
{
True
:
"trunc"
,
False
:
"full"
}[
options
.
trunc
]
)
return
"%s/%s"
%
(
siteurl
,
sequrl
),
"%s/%s"
%
(
siteurl
,
taxurl
),
output
...
...
src/obitools/options/__init__.py
View file @
6bfec50f
...
...
@@ -17,12 +17,13 @@ from obitools.format.options import addInputFormatOption, addInOutputOption,\
autoEntriesIterator
import
time
from
_options
import
fileWithProgressBar
,
\
currentInputFileName
,
\
currentInputFile
,
\
currentFileSize
,
\
currentFileTell
,
\
allEntryIterator
from
_options
import
fileWithProgressBar
# @UnresolvedImport
from
_options
import
currentInputFileName
# @UnresolvedImport
from
_options
import
currentInputFile
# @UnresolvedImport
from
_options
import
currentFileSize
# @UnresolvedImport
from
_options
import
currentFileTell
# @UnresolvedImport
from
_options
import
allEntryIterator
# @UnresolvedImport
from
obitools.ecopcr.sequence
import
EcoPCRDBSequenceIterator
class
ObiHelpFormatter
(
IndentedHelpFormatter
):
...
...
src/obitools/options/_options.pyx
View file @
6bfec50f
...
...
@@ -84,7 +84,7 @@ def allEntryIterator(files,entryIterator,with_progress=False,histo_step=102,opti
cfs
.
currentFileSize
=
fileSize
(
cfs
.
currentFile
)
debug
(
f
)
if
with_progress
:
if
with_progress
and
cfs
.
currentFileSize
>
0
:
f
=
fileWithProgressBar
(
f
,
step
=
histo_step
)
if
entryIterator
is
None
:
...
...
src/obitools/utils/__init__.py
View file @
6bfec50f
...
...
@@ -12,8 +12,8 @@ from obitools.gzip import GzipFile
from
obitools.zipfile
import
ZipFile
import
os.path
from
_utils
import
FakeFile
from
_utils
import
progressBar
from
_utils
import
FakeFile
# @UnresolvedImport
from
_utils
import
progressBar
# @UnresolvedImport
import
zlib
try
:
...
...
@@ -97,9 +97,11 @@ def universalTell(file):
@return: position in the file
@rtype: C{int}
'''
if
isinstance
(
file
,
GzipFile
):
file
=
file
.
myfileobj
return
file
.
tell
()
if
hasattr
(
file
,
"tell"
):
return
file
.
tell
()
else
:
return
None
def
fileSize
(
file
):
'''
...
...
@@ -112,12 +114,13 @@ def fileSize(file):
@return: the size of the file
@rtype: C{int}
'''
if
isinstance
(
file
,
GzipFile
):
file
=
file
.
myfileobj
pos
=
file
.
tell
()
file
.
seek
(
0
,
2
)
length
=
file
.
tell
()
file
.
seek
(
pos
,
0
)
if
hasattr
(
file
,
"tell"
):
pos
=
file
.
tell
()
file
.
seek
(
0
,
2
)
length
=
file
.
tell
()
file
.
seek
(
pos
,
0
)
else
:
length
=
0
return
length
...
...
src/obitools/utils/_utils.pyx
View file @
6bfec50f
...
...
@@ -40,7 +40,7 @@ cdef class FakeFile:
cpdef
str
readline
(
self
):
cdef
str
line
cdef
str
line
# @DuplicatedSignature
try
:
if
self
.
__buffer
:
...
...
src/obitools/version.py
View file @
6bfec50f
major
=
1
minor
=
1
serial
=
'
4
'
serial
=
'
5
'
version
=
"%2d.%02d %s"
%
(
major
,
minor
,
serial
)
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